mirror of
git://f0xx.org/android_cast
synced 2026-07-29 07:39:15 +03:00
sync
This commit is contained in:
@@ -86,12 +86,16 @@ Direct debug ports: crashes `:8082`, builder `:8083`.
|
|||||||
|-----|------------------|
|
|-----|------------------|
|
||||||
| `build.repo_root` | `/var/www/.../androidcast_project/android_cast` (git tree) |
|
| `build.repo_root` | `/var/www/.../androidcast_project/android_cast` (git tree) |
|
||||||
| `build.artifacts_root` | `/var/www/.../androidcast_project/out/builds` — **must exist**, writable by PHP-FPM (`nginx`) |
|
| `build.artifacts_root` | `/var/www/.../androidcast_project/out/builds` — **must exist**, writable by PHP-FPM (`nginx`) |
|
||||||
|
| `build.ota_mount` | `/var/www/.../androidcast_project/ota-artifacts` — nginx serves `…/v0/ota/` at `/v0/ota/` |
|
||||||
| `build.runner_script` | full path to `scripts/docker-build-runner.sh` (no `...` placeholders) |
|
| `build.runner_script` | full path to `scripts/docker-build-runner.sh` (no `...` placeholders) |
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir -p .../out/builds .../ota-artifacts
|
sudo examples/crash_reporter/backend/scripts/prepare-be-ota-mount.sh
|
||||||
chown -R nginx:nginx .../out
|
mkdir -p .../out/builds
|
||||||
chmod -R 775 .../out
|
chown -R nginx:nginx .../out .../ota-artifacts
|
||||||
|
chmod -R 775 .../out .../ota-artifacts
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Apply nginx OTA block: `nginx.apps-port80.fragment` (`location ^~ /v0/ota/`), then `nginx -t && rc-service nginx reload` on BE.
|
||||||
|
|
||||||
If **Start build** shows *Network error*, check BE `php-fpm81` log: often `mkdir(): Permission denied` on `out/builds` (HTTP 500, not a browser network fault).
|
If **Start build** shows *Network error*, check BE `php-fpm81` log: often `mkdir(): Permission denied` on `out/builds` (HTTP 500, not a browser network fault).
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ Web root prefix:
|
|||||||
|------------|------|
|
|------------|------|
|
||||||
| `.../androidcast_project/android_cast/` | Full git tree (crash backend, app sources) |
|
| `.../androidcast_project/android_cast/` | Full git tree (crash backend, app sources) |
|
||||||
| `.../androidcast_project/index.html` | `examples/app_hub/index.html` (copy or symlink) |
|
| `.../androidcast_project/index.html` | `examples/app_hub/index.html` (copy or symlink) |
|
||||||
|
| `.../androidcast_project/ota-artifacts/v0/` | OTA publish tree (`/v0/ota/` on public URL) |
|
||||||
| `.../android_cast/examples/crash_reporter/backend/public/` | PHP document root for crashes |
|
| `.../android_cast/examples/crash_reporter/backend/public/` | PHP document root for crashes |
|
||||||
|
|
||||||
`config.php` **`base_path`** must be exactly:
|
`config.php` **`base_path`** must be exactly:
|
||||||
|
|||||||
@@ -5,6 +5,13 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
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 {
|
location = /app/androidcast_project {
|
||||||
return 301 /app/androidcast_project/;
|
return 301 /app/androidcast_project/;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
# Paste into the listen 443 (and 80) server {} in /etc/nginx/conf.d/apps.conf
|
# Paste into the listen 443 (and 80) server {} in /etc/nginx/conf.d/apps.conf
|
||||||
# Replaces old per-URL blocks + any backend symlink paths.
|
# 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 {
|
location = /app/androidcast_project/crashes {
|
||||||
return 301 /app/androidcast_project/crashes/;
|
return 301 /app/androidcast_project/crashes/;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,16 @@
|
|||||||
# FE apps.f0xx.org — replace hub/crashes upstream blocks (use BE port 80, preserve URI).
|
# FE apps.f0xx.org — replace hub/crashes upstream blocks (use BE port 80, preserve URI).
|
||||||
|
# If location / already proxy_passes to artc0:80, /v0/ota/ needs no extra block once BE serves it.
|
||||||
|
# Optional explicit block (same upstream as /):
|
||||||
|
#
|
||||||
|
# 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;
|
||||||
|
# }
|
||||||
|
#
|
||||||
# File: tmp/FE_gentoo/etc/nginx/nginx.conf (inside server { listen 443; server_name apps.f0xx.org; })
|
# 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):
|
# WRONG (causes browser to download index.php as application/octet-stream):
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ server {
|
|||||||
access_log /var/log/nginx/apps.intra.raptor.org.access_log main;
|
access_log /var/log/nginx/apps.intra.raptor.org.access_log main;
|
||||||
error_log /var/log/nginx/apps.intra.raptor.org.error_log warn;
|
error_log /var/log/nginx/apps.intra.raptor.org.error_log warn;
|
||||||
|
|
||||||
|
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 {
|
location = /app/androidcast_project/crashes {
|
||||||
return 301 /app/androidcast_project/crashes/;
|
return 301 /app/androidcast_project/crashes/;
|
||||||
}
|
}
|
||||||
|
|||||||
25
examples/crash_reporter/backend/scripts/prepare-be-ota-mount.sh
Executable file
25
examples/crash_reporter/backend/scripts/prepare-be-ota-mount.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Create BE OTA artifact directory for nginx location /v0/ota/ (run on alpine-be).
|
||||||
|
#
|
||||||
|
# Usage (on BE as root):
|
||||||
|
# sudo ./prepare-be-ota-mount.sh
|
||||||
|
# sudo ./prepare-be-ota-mount.sh /custom/path/to/ota-artifacts
|
||||||
|
#
|
||||||
|
# After mkdir, publish artifacts:
|
||||||
|
# rsync -av ./out/ota/v0/ /var/www/.../ota-artifacts/v0/
|
||||||
|
# Or enable builder config build.ota_mount + auto_deploy.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
OTA_ROOT="${1:-/var/www/localhost/htdocs/apps/app/androidcast_project/ota-artifacts}"
|
||||||
|
V0="${OTA_ROOT}/v0"
|
||||||
|
|
||||||
|
mkdir -p "${V0}/ota/channel"
|
||||||
|
chown -R nginx:nginx "${OTA_ROOT}"
|
||||||
|
chmod -R 775 "${OTA_ROOT}"
|
||||||
|
|
||||||
|
echo "OTA mount ready: ${OTA_ROOT}"
|
||||||
|
echo "nginx alias target: ${V0}/ota/"
|
||||||
|
echo "Channel URL: https://apps.f0xx.org/v0/ota/channel/stable.json"
|
||||||
|
echo
|
||||||
|
echo "Publish example:"
|
||||||
|
echo " rsync -av out/ota/v0/ ${V0}/"
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"ota": {
|
"ota": {
|
||||||
"base_url": "https://foxx.org/v0/ota/channel/stable.json",
|
"base_url": "https://apps.f0xx.org/v0/ota/channel/stable.json",
|
||||||
"base_urls": [
|
"base_urls": [
|
||||||
|
"https://apps.f0xx.org/v0/ota/channel/stable.json",
|
||||||
"https://foxx.org/v0/ota/channel/stable.json",
|
"https://foxx.org/v0/ota/channel/stable.json",
|
||||||
"https://mirror.foxx.org/v0/ota/channel/stable.json",
|
"https://mirror.foxx.org/v0/ota/channel/stable.json",
|
||||||
"mqtt://foxx.org:8443/ota/v0/channel/stable.json"
|
"mqtt://foxx.org:8443/ota/v0/channel/stable.json"
|
||||||
|
|||||||
Reference in New Issue
Block a user