Files
doormile_backend/.env
Suriyakumarvijayanayagam b0f733ae38 feat: miler POD upload — presigned Spaces PUT (/miler/uploads/sign)
Rider proof-of-delivery / signature photos need a way to reach storage.
The legacy (jupiter) rider app shipped the DigitalOcean Spaces access/secret
key inside the Flutter build and PUT to the bucket directly. This moves the
key server-side and hands the app a short-lived presigned PUT URL instead.

- internal/storage/spaces.go: self-contained AWS SigV4 query presigner for
  Spaces (S3 API) — no aws-sdk-go-v2 dependency for a single presign op.
  Verified live end-to-end (presign -> PUT 200 -> CDN GET matches).
- controllers/uploadController.go: POST /miler/uploads/sign returns
  { uploadurl, url, method, headers, key, expiresin }. Same bucket/folders/
  CDN (images.nearle.app) as jupiter so images share one store.
- Reads DO_SPACES_* from .env via godotenv; returns 503 UPLOAD_NOT_CONFIGURED
  when unset rather than handing out URLs that 403.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRaFH5hMRqmUQvVPQsyjZD
2026-08-24 18:18:52 +05:30

32 lines
918 B
Bash

# App Config
APP_PORT=8081
ENV=development
JWT_SECRET_KEY=DoormileSuperSecretJWTKey2026!
INTERNAL_API_KEY=doormile-internal-2024
# PostgreSQL Database Configuration
DB_HOST=31.97.228.132
DB_PORT=5433
DB_NAME=logistics
DB_USER=admin
DB_PASSWORD=Package@321#
# Redis Configuration
REDIS_HOST=31.97.228.132
REDIS_PORT=6379
REDIS_USER=admin
REDIS_PASSWORD=Package@321#
# AI Decision Engine
AI_LAYER_BASE_URL=https://routemate.workolik.com
# DigitalOcean Spaces — rider proof-of-delivery / signature uploads.
# Same bucket/region/CDN as the legacy (jupiter) rider app so images share one
# store. Consumed by internal/storage for presigned PUT URLs (/miler/uploads/sign).
DO_SPACES_REGION=sgp1
DO_SPACES_ENDPOINT=sgp1.digitaloceanspaces.com
DO_SPACES_BUCKET=nearle
DO_SPACES_ACCESS_KEY=DO00NQER7N2FRYZAB2HR
DO_SPACES_SECRET_KEY=nMDewX25IBEu1FM5dakK+v28/WbW3TzBAwq913+dxP0
DO_SPACES_CDN_BASE=https://images.nearle.app