create-expo-updates-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +19 -0
- package/bin/create-expo-updates-server.mjs +5 -0
- package/dist/template/.env.docker.example +15 -0
- package/dist/template/.env.example +35 -0
- package/dist/template/Dockerfile +42 -0
- package/dist/template/LICENSE +21 -0
- package/dist/template/README.md +665 -0
- package/dist/template/app/api/admin/access-tokens/[id]/route.ts +25 -0
- package/dist/template/app/api/admin/access-tokens/route.test.ts +73 -0
- package/dist/template/app/api/admin/access-tokens/route.ts +90 -0
- package/dist/template/app/api/admin/embedded-updates/[embeddedUpdateId]/route.ts +25 -0
- package/dist/template/app/api/admin/embedded-updates/route.test.ts +102 -0
- package/dist/template/app/api/admin/embedded-updates/route.ts +47 -0
- package/dist/template/app/api/admin/emergency-redirects/[id]/route.ts +62 -0
- package/dist/template/app/api/admin/emergency-redirects/route.test.ts +84 -0
- package/dist/template/app/api/admin/emergency-redirects/route.ts +56 -0
- package/dist/template/app/api/admin/login/route.test.ts +55 -0
- package/dist/template/app/api/admin/login/route.ts +52 -0
- package/dist/template/app/api/admin/logout/route.ts +20 -0
- package/dist/template/app/api/admin/session/route.ts +15 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/deactivate/route.ts +33 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/promote/route.ts +29 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/rollback/route.ts +29 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/route.ts +96 -0
- package/dist/template/app/api/admin/updates/route.test.ts +142 -0
- package/dist/template/app/api/admin/updates/route.ts +32 -0
- package/dist/template/app/api/assets/route.ts +6 -0
- package/dist/template/app/api/health/route.test.ts +26 -0
- package/dist/template/app/api/health/route.ts +42 -0
- package/dist/template/app/api/manifest/route.ts +6 -0
- package/dist/template/app/api/update-complete/route.ts +6 -0
- package/dist/template/app/favicon.ico +0 -0
- package/dist/template/app/globals.css +26 -0
- package/dist/template/app/layout.tsx +34 -0
- package/dist/template/app/login/page.tsx +77 -0
- package/dist/template/app/page.tsx +12 -0
- package/dist/template/app/updates/[encodedKey]/page.tsx +482 -0
- package/dist/template/app/updates/embedded/page.tsx +164 -0
- package/dist/template/app/updates/emergency-redirects/page.tsx +430 -0
- package/dist/template/app/updates/layout.tsx +14 -0
- package/dist/template/app/updates/page.tsx +281 -0
- package/dist/template/docker-compose.yml +100 -0
- package/dist/template/docs/expo-app-setup.md +497 -0
- package/dist/template/docs/getting-started.md +502 -0
- package/dist/template/docs/getting-started.ru.md +623 -0
- package/dist/template/docs/index.md +57 -0
- package/dist/template/docs/migrations/schema.sql +363 -0
- package/dist/template/docs/npm-installer.md +83 -0
- package/dist/template/docs/operations-guide.md +270 -0
- package/dist/template/docs/ota-emergency-recovery.md +109 -0
- package/dist/template/docs/supabase-setup.md +133 -0
- package/dist/template/eslint.config.mjs +30 -0
- package/dist/template/gitignore.template +58 -0
- package/dist/template/next.config.ts +7 -0
- package/dist/template/package-lock.json +12156 -0
- package/dist/template/package.json +50 -0
- package/dist/template/postcss.config.mjs +7 -0
- package/dist/template/public/file.svg +1 -0
- package/dist/template/public/globe.svg +1 -0
- package/dist/template/public/next.svg +1 -0
- package/dist/template/public/vercel.svg +1 -0
- package/dist/template/public/window.svg +1 -0
- package/dist/template/scripts/configure-expo-app.mjs +145 -0
- package/dist/template/scripts/create-access-token.mjs +135 -0
- package/dist/template/scripts/create-admin.mjs +169 -0
- package/dist/template/scripts/import-emergency-redirects.mjs +126 -0
- package/dist/template/scripts/lib/embedded-update-registrar.test.ts +64 -0
- package/dist/template/scripts/lib/expo-app-configurator.mjs +666 -0
- package/dist/template/scripts/lib/expo-app-configurator.test.ts +463 -0
- package/dist/template/scripts/lib/expo-app-prompts.mjs +139 -0
- package/dist/template/scripts/lib/expo-app-prompts.test.ts +97 -0
- package/dist/template/scripts/lib/expo-export-command.test.ts +31 -0
- package/dist/template/scripts/lib/ota-publish-retry.test.ts +33 -0
- package/dist/template/scripts/manage-emergency-redirect.mjs +483 -0
- package/dist/template/scripts/sync-docker-database-password.sh +16 -0
- package/dist/template/src/client/admin-api.ts +174 -0
- package/dist/template/src/client/admin-types.ts +93 -0
- package/dist/template/src/client/logout-button.tsx +31 -0
- package/dist/template/src/server/controllers/assets.ts +216 -0
- package/dist/template/src/server/controllers/manifest.test.ts +403 -0
- package/dist/template/src/server/controllers/manifest.ts +626 -0
- package/dist/template/src/server/controllers/update-complete.ts +36 -0
- package/dist/template/src/server/lib/admin-access-tokens.ts +169 -0
- package/dist/template/src/server/lib/admin-api.ts +101 -0
- package/dist/template/src/server/lib/admin-auth.ts +208 -0
- package/dist/template/src/server/lib/admin-embedded-updates.ts +150 -0
- package/dist/template/src/server/lib/admin-updates.ts +1282 -0
- package/dist/template/src/server/lib/common.js +24 -0
- package/dist/template/src/server/lib/emergency-channel-redirects.ts +310 -0
- package/dist/template/src/server/lib/env.js +8 -0
- package/dist/template/src/server/lib/manifest-helpers.js +91 -0
- package/dist/template/src/server/lib/response.js +11 -0
- package/dist/template/src/server/lib/signing.js +55 -0
- package/dist/template/src/server/lib/supabase.js +763 -0
- package/dist/template/src/server/manifest/manifest-repository.ts +269 -0
- package/dist/template/src/server/manifest/manifest-request.ts +21 -0
- package/dist/template/src/server/manifest/manifest-response.ts +235 -0
- package/dist/template/src/server/manifest/manifest-values.ts +62 -0
- package/dist/template/templates/expo-app/.env.ota.example +18 -0
- package/dist/template/templates/expo-app/ci_scripts/ci_post_xcodebuild.sh +6 -0
- package/dist/template/templates/expo-app/ci_scripts/register-embedded-update.sh +36 -0
- package/dist/template/templates/expo-app/plugins/with-ota-embedded-registration.js +33 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/api/database-client.mjs +87 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/api/storage-client.mjs +57 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/index.mjs +182 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/lib/common.mjs +84 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/lib/expo-export-command.mjs +24 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/lib/retry.mjs +25 -0
- package/dist/template/templates/expo-app/scripts/ota-publish/shared/config.mjs +48 -0
- package/dist/template/templates/expo-app/scripts/ota-register-embedded/android-register-embedded-update.sh +18 -0
- package/dist/template/templates/expo-app/scripts/ota-register-embedded/index.mjs +275 -0
- package/dist/template/tsconfig.json +36 -0
- package/dist/template/vitest.config.mts +20 -0
- package/dist/template-manifest.json +564 -0
- package/lib/cli.mjs +549 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Expo Update Custom Server contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# create-expo-updates-server
|
|
2
|
+
|
|
3
|
+
Create a standalone, self-hosted Expo Updates Server project from the
|
|
4
|
+
versioned template bundled in this npm package.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx create-expo-updates-server@latest my-server
|
|
8
|
+
cd my-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The initializer performs no network requests, dependency installation, Git
|
|
12
|
+
initialization, or secret generation while scaffolding. The target path must
|
|
13
|
+
remain absent while the command runs; the initializer never merges with an
|
|
14
|
+
existing path. If scaffolding fails after staging starts, the error reports the
|
|
15
|
+
private staging directory left for manual inspection or removal.
|
|
16
|
+
|
|
17
|
+
See the
|
|
18
|
+
[installer documentation](https://github.com/tonichiga/expo-updates-server/blob/main/docs/npm-installer.md)
|
|
19
|
+
for Docker and npm setup instructions.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
POSTGRES_DB=expo_updates
|
|
2
|
+
POSTGRES_USER=expo_updates
|
|
3
|
+
POSTGRES_PASSWORD=replace-with-a-strong-storage-password
|
|
4
|
+
POSTGRES_PORT=5432
|
|
5
|
+
|
|
6
|
+
MINIO_ROOT_USER=expo_updates
|
|
7
|
+
MINIO_ROOT_PASSWORD=replace-with-a-strong-storage-password
|
|
8
|
+
MINIO_API_PORT=9000
|
|
9
|
+
MINIO_CONSOLE_PORT=9001
|
|
10
|
+
OTA_STORAGE_BUCKET=expo-updates
|
|
11
|
+
|
|
12
|
+
OTA_HTTP_PORT=3000
|
|
13
|
+
OTA_PUBLIC_BASE_URL=http://localhost:3000
|
|
14
|
+
OTA_CDN_BASE_URL=
|
|
15
|
+
CODE_SIGNING_PRIVATE_KEY=
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# OTA signing (optional)
|
|
2
|
+
CODE_SIGNING_PRIVATE_KEY=""
|
|
3
|
+
|
|
4
|
+
# Feature flags (optional)
|
|
5
|
+
FLAGS=""
|
|
6
|
+
FLAGS_SECRET=""
|
|
7
|
+
|
|
8
|
+
# Database
|
|
9
|
+
DATABASE_PROVIDER="pg"
|
|
10
|
+
DATABASE_URL="postgresql://user:password@host:5432/database"
|
|
11
|
+
DATABASE_SSL="false"
|
|
12
|
+
|
|
13
|
+
# Cloudflare R2 or another S3-compatible storage
|
|
14
|
+
R2_ENDPOINT="https://<account-id>.r2.cloudflarestorage.com"
|
|
15
|
+
R2_ACCESS_KEY_ID="<access-key-id>"
|
|
16
|
+
R2_SECRET_ACCESS_KEY="<secret-access-key>"
|
|
17
|
+
R2_BUCKET="expo-updates"
|
|
18
|
+
R2_REGION="auto"
|
|
19
|
+
|
|
20
|
+
# OTA storage
|
|
21
|
+
OTA_STORAGE_BUCKET="expo-updates"
|
|
22
|
+
OTA_SIGNED_URL_TTL="3600"
|
|
23
|
+
OTA_PUBLIC_BASE_URL="https://updates.example.com"
|
|
24
|
+
OTA_CDN_BASE_URL=""
|
|
25
|
+
|
|
26
|
+
# Supabase provider
|
|
27
|
+
SUPABASE_PROJECT_URL="https://<project-ref>.supabase.co"
|
|
28
|
+
SUPABASE_PUBLISHED_KEY=""
|
|
29
|
+
SUPABASE_SERVICE_ROLE_KEY="<service-role-key>"
|
|
30
|
+
SUPABASE_SIGNED_URL_TTL="3600"
|
|
31
|
+
SUPABASE_UPDATES_BUCKET="expo-updates"
|
|
32
|
+
|
|
33
|
+
# Optional Cloudflare/Vercel integration
|
|
34
|
+
CF_API_TOKEN=""
|
|
35
|
+
VERCEL_OIDC_TOKEN=""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
FROM node:24-alpine AS dependencies
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
COPY package.json package-lock.json ./
|
|
5
|
+
RUN npm ci
|
|
6
|
+
|
|
7
|
+
FROM node:24-alpine AS production-dependencies
|
|
8
|
+
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
COPY package.json package-lock.json ./
|
|
11
|
+
RUN npm ci --omit=dev
|
|
12
|
+
|
|
13
|
+
FROM node:24-alpine AS builder
|
|
14
|
+
|
|
15
|
+
WORKDIR /app
|
|
16
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
17
|
+
COPY --from=dependencies /app/node_modules ./node_modules
|
|
18
|
+
COPY . .
|
|
19
|
+
RUN npm run build
|
|
20
|
+
|
|
21
|
+
FROM node:24-alpine AS runner
|
|
22
|
+
|
|
23
|
+
WORKDIR /app
|
|
24
|
+
ENV NODE_ENV=production
|
|
25
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
26
|
+
ENV PORT=3000
|
|
27
|
+
ENV HOSTNAME=0.0.0.0
|
|
28
|
+
|
|
29
|
+
RUN addgroup --system --gid 1001 nodejs \
|
|
30
|
+
&& adduser --system --uid 1001 nextjs
|
|
31
|
+
|
|
32
|
+
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
|
33
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
34
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
35
|
+
COPY --from=production-dependencies --chown=nextjs:nodejs /app/node_modules ./node_modules
|
|
36
|
+
COPY --from=builder --chown=nextjs:nodejs /app/scripts ./scripts
|
|
37
|
+
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
|
38
|
+
|
|
39
|
+
USER nextjs
|
|
40
|
+
EXPOSE 3000
|
|
41
|
+
|
|
42
|
+
CMD ["node", "server.js"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tonichiga
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|