Add an Android uploader app
Native single-photo uploader for POST /upload. Lives in android/ with its own flake, so the root flake stays Go-only and NixOS consumers of nixosModules.default do not pull the Android SDK into their lock. The server is untouched, so the app closes every gap client side: - The slug is the enqueue-time timestamp, persisted in the work input. server.go derives the stored slug from the uploaded filename, so reusing that filename across WorkManager retries overwrites the same post rather than creating a duplicate. That stands in for an idempotency key. - EXIF is stripped before upload. The gallery publishes the uploaded file verbatim as its full-size download, and phone photos carry GPS. JPEG and PNG drop metadata at marker and chunk level with the compressed pixels untouched; HEIC is decoded to JPEG because the extension check rejects it. - Photos flagged for rotation are rotated into the pixels instead of relying on the orientation tag, which cannot survive the strip and which the thumbnailer ignores regardless. - Anything over 18 MiB steps quality, then resolution, to stay inside nginx's client_max_body_size 20M. - Credentials are sealed with an AES-GCM key in the Android Keystore. The key deliberately does not require user authentication, or background retries could not read it. Basic auth is attached by an interceptor rather than an Authenticator, which reacts to a 401 by replaying a multipart body that is not reliably replayable. - The connection test uses GET /upload. /health is unreachable from outside because the nginx vhost only proxies location /upload. WorkManager's SystemForegroundService needs foregroundServiceType declared on the service entry, not just as a permission, or setForeground throws on Android 14+. Only lintVitalRelease catches that, never a debug build. Also anchors the .gitignore patterns. Unanchored, "photogallery" matched the Kotlin package directory ws/inflo/photogallery/ and silently swallowed every source file on git add.
This commit is contained in:
+18
-5
@@ -1,8 +1,21 @@
|
||||
content/
|
||||
public/
|
||||
photogallery
|
||||
result
|
||||
result-*
|
||||
/content/
|
||||
/public/
|
||||
# Anchored: unanchored these would also match the Kotlin package directory
|
||||
# android/app/src/main/java/ws/inflo/photogallery/ and any nested "result".
|
||||
/photogallery
|
||||
/result
|
||||
/result-*
|
||||
*.tar.gz
|
||||
.envrc
|
||||
.direnv/
|
||||
|
||||
# Android app
|
||||
android/.gradle/
|
||||
android/build/
|
||||
android/app/build/
|
||||
android/local.properties
|
||||
android/.idea/
|
||||
android/.kotlin/
|
||||
android/keystore.properties
|
||||
*.jks
|
||||
*.keystore
|
||||
|
||||
Reference in New Issue
Block a user