mirror of
git://f0xx.org/ac/ac-platform-edge
synced 2026-07-29 03:19:03 +03:00
initial
This commit is contained in:
17
fragments/crash_reporter/nginx.apps-builder.frag
Normal file
17
fragments/crash_reporter/nginx.apps-builder.frag
Normal 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;
|
||||
}
|
||||
134
fragments/crash_reporter/nginx.apps-port80.fragment
Normal file
134
fragments/crash_reporter/nginx.apps-port80.fragment
Normal file
@@ -0,0 +1,134 @@
|
||||
# Full androidcast vhost for Alpine BE — listen 80 only.
|
||||
# FE (apps.f0xx.org) proxies here: proxy_pass http://artc0.intra.raptor.org:80;
|
||||
# Port 8089 is a different service (e.g. Janus) — not this vhost.
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
# OTA v0 static tree — devices fetch https://apps.f0xx.org/v0/ota/channel/stable.json
|
||||
# Populate: builder auto_deploy, or rsync out/ota/v0/ → .../ota-artifacts/v0/
|
||||
location ^~ /v0/ota/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/ota-artifacts/v0/ota/;
|
||||
add_header Cache-Control "public, max-age=60";
|
||||
}
|
||||
|
||||
location = /app/androidcast_project {
|
||||
return 301 /app/androidcast_project/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/index.php {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass unix:/run/php-fpm.socket;
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/index.php;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/ {
|
||||
rewrite ^ /app/androidcast_project/index.php last;
|
||||
}
|
||||
|
||||
location /app/androidcast_project/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/;
|
||||
index index.php index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/issues {
|
||||
return 301 /app/androidcast_project/issues/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes {
|
||||
return 301 /app/androidcast_project/issues/;
|
||||
}
|
||||
|
||||
location ~ ^/app/androidcast_project/crashes(/.*)?$ {
|
||||
return 301 /app/androidcast_project/issues$1;
|
||||
}
|
||||
|
||||
location ~ ^/app/androidcast_project/(login|logout|register|two-factor|verify-email)(/|$) {
|
||||
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/crash_reporter/backend/public/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/index.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/issues/assets/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/issues/api/upload.php {
|
||||
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/crash_reporter/backend/public/api/upload.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/api/upload.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/issues/ {
|
||||
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/crash_reporter/backend/public/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/index.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/graphs {
|
||||
return 301 /app/androidcast_project/graphs/;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/graphs/assets/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/graphs/api/graphs.php {
|
||||
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/crash_reporter/backend/public/api/graphs.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graphs.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/graphs/api/graph_upload.php {
|
||||
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/crash_reporter/backend/public/api/graph_upload.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graph_upload.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/graphs/ {
|
||||
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/crash_reporter/backend/public/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/index.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
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;
|
||||
}
|
||||
}
|
||||
117
fragments/crash_reporter/nginx.apps.conf.fragment
Normal file
117
fragments/crash_reporter/nginx.apps.conf.fragment
Normal file
@@ -0,0 +1,117 @@
|
||||
# Paste into the listen 443 (and 80) server {} in /etc/nginx/conf.d/apps.conf
|
||||
# Replaces old per-URL blocks + any backend symlink paths.
|
||||
|
||||
location ^~ /v0/ota/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/ota-artifacts/v0/ota/;
|
||||
add_header Cache-Control "public, max-age=60";
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes {
|
||||
return 301 /app/androidcast_project/crashes/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/graphs {
|
||||
return 301 /app/androidcast_project/graphs/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project {
|
||||
return 301 /app/androidcast_project/;
|
||||
}
|
||||
|
||||
# Hub — see nginx.apps-port80.fragment (index.php + shared footer).
|
||||
location = /app/androidcast_project/index.php {
|
||||
include fastcgi_params;
|
||||
fastcgi_pass unix:/run/php-fpm.socket;
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/index.php;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/ {
|
||||
rewrite ^ /app/androidcast_project/index.php last;
|
||||
}
|
||||
|
||||
location /app/androidcast_project/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/;
|
||||
index index.php index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/crashes/assets/ {
|
||||
alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes/api/upload.php {
|
||||
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/crash_reporter/backend/public/api/upload.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/upload.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes/api/diag.php {
|
||||
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/crash_reporter/backend/public/api/diag.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/diag.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes/api/reports.php {
|
||||
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/crash_reporter/backend/public/api/reports.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/reports.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes/api/report_viewed.php {
|
||||
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/crash_reporter/backend/public/api/report_viewed.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/report_viewed.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/crashes/api/report_tags.php {
|
||||
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/crash_reporter/backend/public/api/report_tags.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/report_tags.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/crashes/ {
|
||||
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/crash_reporter/backend/public/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/index.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/graphs/api/graphs.php {
|
||||
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/crash_reporter/backend/public/api/graphs.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graphs.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
}
|
||||
|
||||
location = /app/androidcast_project/graphs/api/graph_upload.php {
|
||||
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/crash_reporter/backend/public/api/graph_upload.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graph_upload.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
|
||||
location ^~ /app/androidcast_project/graphs/ {
|
||||
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/crash_reporter/backend/public/index.php;
|
||||
fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/index.php;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
client_max_body_size 4m;
|
||||
}
|
||||
3
fragments/crash_reporter/nginx.fe-apps.conf.fragment
Normal file
3
fragments/crash_reporter/nginx.fe-apps.conf.fragment
Normal file
@@ -0,0 +1,3 @@
|
||||
# DEPRECATED — use nginx/fe/apps.conf (full apps.f0xx.org vhost).
|
||||
# nginx.conf should contain only: include /etc/nginx/apps.conf;
|
||||
# See patches/fe-nginx-APPLY.md and scripts/generate-fe-nginx-patch.sh
|
||||
30
fragments/crash_reporter/nginx.fe-apps.f0xx.org.snippet
Normal file
30
fragments/crash_reporter/nginx.fe-apps.f0xx.org.snippet
Normal file
@@ -0,0 +1,30 @@
|
||||
# FE apps.f0xx.org — replace hub/crashes upstream blocks (use BE port 80, preserve URI).
|
||||
# OTA at /v0/ota/ must proxy to BE :80 even when hub uses :443 — see nginx.fe-ota.snippet
|
||||
# and scripts/install-fe-ota-nginx.sh (public URL 400 until this is applied on FE).
|
||||
#
|
||||
# File: tmp/FE_gentoo/etc/nginx/nginx.conf (inside server { listen 443; server_name apps.f0xx.org; })
|
||||
#
|
||||
# WRONG (causes browser to download index.php as application/octet-stream):
|
||||
# proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/;
|
||||
# BE :443 serves static files; hub must hit BE :80 (PHP-FPM) like location / already does.
|
||||
|
||||
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)
|
||||
13
fragments/crash_reporter/nginx.fe-build-inline.snippet
Normal file
13
fragments/crash_reporter/nginx.fe-build-inline.snippet
Normal file
@@ -0,0 +1,13 @@
|
||||
# Paste into Gentoo FE /etc/nginx/nginx.conf inside server { listen 443; server_name apps.f0xx.org; }
|
||||
# Place immediately AFTER the crashes location block (same style as hub + crashes).
|
||||
|
||||
location /app/androidcast_project/build/ {
|
||||
proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/build/;
|
||||
}
|
||||
|
||||
# Then REMOVE or comment out the build location in /etc/nginx/apps.conf (avoid duplicate/conflict).
|
||||
# Reload: nginx -t && rc-service nginx reload
|
||||
|
||||
# Verify from FE:
|
||||
# curl -sSI -H 'Host: apps.f0xx.org' http://127.0.0.1/app/androidcast_project/build/ | head -5
|
||||
# Expect 302 + x-powered-by: PHP (after BE fragment is fixed too).
|
||||
13
fragments/crash_reporter/nginx.fe-ota.snippet
Normal file
13
fragments/crash_reporter/nginx.fe-ota.snippet
Normal file
@@ -0,0 +1,13 @@
|
||||
# FE apps.f0xx.org — OTA channel at site root (/v0/ota/…).
|
||||
# BE serves files on listen 80; hub/crashes may use :443 upstream — OTA must hit :80.
|
||||
#
|
||||
# Paste inside server { listen 443 ssl; server_name apps.f0xx.org; } before androidcast blocks.
|
||||
|
||||
location /v0/ota/ {
|
||||
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;
|
||||
}
|
||||
20
fragments/crash_reporter/rssh-bastion-stream.conf.example
Normal file
20
fragments/crash_reporter/rssh-bastion-stream.conf.example
Normal file
@@ -0,0 +1,20 @@
|
||||
# FE nginx stream — TCP proxy to BE sshd for RSSH bastion (ra.apps.f0xx.org:443).
|
||||
# Install on FE (Gentoo); BE runs openssh with Match User ra-* (see sshd_config.d/ra.conf).
|
||||
#
|
||||
# *** DO NOT install under BE /etc/nginx/stream.d/ ***
|
||||
# BE already uses listen 443 ssl in conf.d/apps.conf (http). Stream listen 443 here
|
||||
# causes: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address in use)
|
||||
#
|
||||
# Include from nginx.conf:
|
||||
# include /etc/nginx/stream.d/rssh-bastion.conf;
|
||||
|
||||
upstream rssh_bastion_be {
|
||||
server 10.7.16.128:22; # artc0 / alpine-be — adjust for cluster/lab
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
proxy_pass rssh_bastion_be;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_timeout 24h;
|
||||
}
|
||||
Reference in New Issue
Block a user