1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 04:38:53 +03:00
This commit is contained in:
Anton Afanasyeu
2026-06-10 11:54:09 +02:00
parent b4f972b4e0
commit db230a6a77
8 changed files with 64 additions and 4 deletions

View File

@@ -5,6 +5,13 @@
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/;
}

View File

@@ -1,6 +1,11 @@
# 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/;
}

View File

@@ -1,4 +1,16 @@
# 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; })
#
# WRONG (causes browser to download index.php as application/octet-stream):

View File

@@ -18,6 +18,11 @@ server {
access_log /var/log/nginx/apps.intra.raptor.org.access_log main;
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 {
return 301 /app/androidcast_project/crashes/;
}

View 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}/"

View File

@@ -1,7 +1,8 @@
{
"ota": {
"base_url": "https://foxx.org/v0/ota/channel/stable.json",
"base_url": "https://apps.f0xx.org/v0/ota/channel/stable.json",
"base_urls": [
"https://apps.f0xx.org/v0/ota/channel/stable.json",
"https://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"