feat: APK distribution pipeline — server hosting + Pi auto-update + /app routes

This commit is contained in:
Mathieu Moran
2026-08-15 20:52:38 -04:00
parent 5039b90bc6
commit 5a5df2b323
11 changed files with 320 additions and 16 deletions
+18
View File
@@ -48,6 +48,24 @@ def settings():
def status_page():
return render_template('status.html', account=account, car=car)
# ── Android app download (served on the car hotspot) ─────────────────────
# The APK is mirrored here from the remote server by deploy/yaris_app_updater.py
# so the phone can install/update over WiFi without leaving the hotspot.
APP_APK_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static', 'app', 'yaris-obd.apk')
@app.route('/app')
def app_download_page():
apk_exists = os.path.isfile(APP_APK_PATH)
apk_size = os.path.getsize(APP_APK_PATH) if apk_exists else 0
return render_template('app.html', apk_exists=apk_exists, apk_size=apk_size)
@app.route('/app/yaris-obd.apk')
def app_download_apk():
if not os.path.isfile(APP_APK_PATH):
return "APK not downloaded yet — try again once the Pi has internet.", 404
return send_file(APP_APK_PATH, as_attachment=True, download_name='yaris-obd.apk',
mimetype='application/vnd.android.package-archive')
@app.route('/api/settings', methods=['GET', 'POST'])
def api_settings():
if request.method == 'GET':