1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 05:58:14 +03:00
This commit is contained in:
Anton Afanasyeu
2026-05-30 20:47:12 +02:00
parent c80d646f09
commit 350f8343ad
9 changed files with 106 additions and 6 deletions

View File

@@ -0,0 +1,17 @@
location = /app/androidcast_project/build {
return 301 /app/androidcast_project/build/;
}
location ^~ /app/androidcast_project/build/assets/ {
alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/assets/;
}
location ^~ /app/androidcast_project/build/ {
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm.socket;
fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/index.php;
fastcgi_param SCRIPT_NAME /app/androidcast_project/build/index.php;
fastcgi_param REQUEST_URI $request_uri;
client_max_body_size 512m;
fastcgi_read_timeout 1800s;
}

View File

@@ -40,6 +40,24 @@ server {
client_max_body_size 4m;
}
location = /app/androidcast_project/build {
return 301 /app/androidcast_project/build/;
}
location ^~ /app/androidcast_project/build/assets/ {
alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/assets/;
}
location ^~ /app/androidcast_project/build/ {
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm.socket;
fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/index.php;
fastcgi_param SCRIPT_NAME /app/androidcast_project/build/index.php;
fastcgi_param REQUEST_URI $request_uri;
client_max_body_size 512m;
fastcgi_read_timeout 1800s;
}
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/run/php-fpm.socket;

View File

@@ -0,0 +1,23 @@
# FE apps.f0xx.org — replace hub/crashes upstream blocks (use BE port 80, preserve URI).
# File: tmp/FE_gentoo/etc/nginx/nginx.conf (inside server { listen 443; server_name apps.f0xx.org; })
location /app/androidcast_project/ {
proxy_pass http://artc0.intra.raptor.org:80;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /app/androidcast_project/crashes/ {
proxy_pass http://artc0.intra.raptor.org:80;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# apps.conf build block must stay:
# proxy_pass http://artc0.intra.raptor.org:80; (no trailing slash)

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Replace BE apps.conf listen-80 block from repo fragment (run on machine with BE mount write access).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
REPO_ROOT="$(cd "$ROOT/../.." && pwd)"
FRAG="$ROOT/crash_reporter/backend/nginx.apps-port80.fragment"
APPS_CONF="${1:-$REPO_ROOT/tmp/BE_alpine/etc/nginx/conf.d/apps.conf}"
if [[ ! -f "$FRAG" || ! -f "$APPS_CONF" ]]; then
echo "Usage: $0 [path/to/apps.conf]" >&2
exit 1
fi
python3 - "$FRAG" "$APPS_CONF" << 'PY'
import sys
from pathlib import Path
frag, apps_path = map(Path, sys.argv[1:3])
text = apps_path.read_text()
start = text.index("server {\n\tlisten 80;")
end = text.index("\n}\n\n\nserver {\n\tlisten 443")
apps_path.write_text(text[:start] + frag.read_text().strip() + text[end:])
print(f"Updated listen 80 in {apps_path}")
PY

View File

@@ -3,6 +3,8 @@
# Usage: ./scripts/deploy-to-be-mount.sh [DEST]
set -euo pipefail
SRC="$(cd "$(dirname "$0")/.." && pwd)"
REPO_EXAMPLES="$(cd "$SRC/../.." && pwd)"
BE_ROOT="${BE_ROOT:-$(cd "$REPO_EXAMPLES/../../tmp/BE_alpine/var/www/localhost/htdocs/apps/app/androidcast_project/android_cast" 2>/dev/null && pwd || true)}"
DEST="${1:-$(cd "$SRC/../../../tmp/BE_alpine/var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend" 2>/dev/null && pwd || true)}"
if [[ -z "$DEST" || ! -d "$DEST" ]]; then
echo "DEST not found. Pass BE mount path as first argument." >&2
@@ -11,4 +13,9 @@ fi
rsync -a --no-group --no-owner \
--exclude 'data/' --exclude 'config/config.php' \
"$SRC/" "$DEST/"
if [[ -n "$BE_ROOT" && -d "$BE_ROOT" ]]; then
rsync -a --no-group --no-owner \
"$REPO_EXAMPLES/platform/" "$BE_ROOT/examples/platform/"
echo "Synced platform/ to $BE_ROOT/examples/platform/"
fi
echo "Synced to $DEST (config.php and data/ untouched)."

View File

@@ -12,7 +12,7 @@
*/
declare(strict_types=1);
require_once dirname(__DIR__, 2) . '/platform/shared_session.php';
require_once dirname(__DIR__, 3) . '/platform/shared_session.php';
if (!function_exists('session_start')) {
http_response_code(500);