Fix proxy headers and help sync boot
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-13 21:31:46 +01:00
parent 9cf6e9d94d
commit d9568be579
3 changed files with 46 additions and 0 deletions

View File

@@ -53,6 +53,23 @@ refresh_config_cache() {
php artisan view:clear >/dev/null 2>&1 || true php artisan view:clear >/dev/null 2>&1 || true
} }
ensure_help_cache() {
cd "$APP_TARGET"
if [[ "${HELP_SYNC_ON_BOOT:-auto}" == "0" ]]; then
return
fi
if [[ "${HELP_SYNC_ON_BOOT:-auto}" == "1" ]]; then
php artisan help:sync >/dev/null 2>&1 || true
return
fi
if ! compgen -G "$APP_TARGET/storage/app/help/*/*/articles.json" > /dev/null; then
php artisan help:sync >/dev/null 2>&1 || true
fi
}
wait_for_service() { wait_for_service() {
local name="$1" host="$2" port="$3" timeout="$4" local name="$1" host="$2" port="$3" timeout="$4"
local start local start
@@ -120,6 +137,7 @@ ensure_helper_scripts
prepare_storage prepare_storage
refresh_config_cache refresh_config_cache
wait_for_dependencies wait_for_dependencies
ensure_help_cache
cd "$APP_TARGET" cd "$APP_TARGET"
exec "$@" exec "$@"

View File

@@ -20,6 +20,10 @@ server {
fastcgi_pass app:9000; fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
fastcgi_param HTTP_X_FORWARDED_HOST $http_x_forwarded_host;
fastcgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
fastcgi_param HTTPS $http_x_forwarded_proto;
fastcgi_buffer_size 32k; fastcgi_buffer_size 32k;
fastcgi_buffers 8 16k; fastcgi_buffers 8 16k;
} }

View File

@@ -0,0 +1,24 @@
<?php
namespace Tests\Feature\Help;
use App\Services\Help\HelpSyncService;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class HelpSyncServiceTest extends TestCase
{
public function test_help_sync_writes_compiled_articles(): void
{
Storage::fake('local');
Config::set('help.disk', 'local');
$service = $this->app->make(HelpSyncService::class);
$result = $service->sync();
$this->assertNotEmpty($result);
Storage::disk('local')->assertExists('help/guest/en/articles.json');
Storage::disk('local')->assertExists('help/guest/de/articles.json');
}
}