diff --git a/CUSTOM_REDEEM_SUBSCRIPTION.md b/CUSTOM_REDEEM_SUBSCRIPTION.md new file mode 100644 index 00000000..a2971297 --- /dev/null +++ b/CUSTOM_REDEEM_SUBSCRIPTION.md @@ -0,0 +1,22 @@ +# Customization: subscription-capable redemption codes + +Base upstream commit: 677d02f2 +Local branch: codex/redeem-subscription +Deployment dir: /root/docker/newapi + +What changed +- Redemption codes support two modes: quota and subscription. +- Subscription redemption creates user_subscriptions with source=redeem. +- Admin redemption UI supports selecting a subscription plan. +- User redemption response distinguishes quota vs subscription. + +Suggested future upgrade flow +1. Pull latest upstream source into a clean clone. +2. Re-apply the patch file in this folder. +3. Resolve any merge conflicts in redemption/subscription files. +4. Rebuild with: docker compose up -d --build new-api +5. Verify with: curl http://127.0.0.1:3000/api/status + +Current compose note +- This server is currently using source build mode instead of the official image. +- Original compose backup: docker-compose.yml.bak-20260406094555 diff --git a/custom-redeem-subscription.patch b/custom-redeem-subscription.patch new file mode 100644 index 00000000..7cba7179 Binary files /dev/null and b/custom-redeem-subscription.patch differ diff --git a/docker-compose.remote-test.yml b/docker-compose.remote-test.yml new file mode 100644 index 00000000..264310bb --- /dev/null +++ b/docker-compose.remote-test.yml @@ -0,0 +1,34 @@ +services: + new-api: + build: + context: . + dockerfile: Dockerfile + image: new-api-local:test + container_name: new-api + restart: always + command: --log-dir /app/logs + env_file: + - .env + ports: + - "${NEWAPI_PORT}:3000" + volumes: + - /root/docker/newapi/data:/data + - /root/docker/newapi/logs:/app/logs + environment: + - SQL_DSN=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} + - REDIS_CONN_STRING=${REDIS_CONN_STRING} + - TZ=${TZ} + - ERROR_LOG_ENABLED=${ERROR_LOG_ENABLED} + - BATCH_UPDATE_ENABLED=${BATCH_UPDATE_ENABLED} + depends_on: + - redis + healthcheck: + test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + + redis: + image: redis:latest + container_name: redis + restart: always