native-update 3.1.1 → 3.1.3

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.
Files changed (203) hide show
  1. package/AI-INTEGRATION-GUIDE.md +98 -63
  2. package/Readme.md +89 -120
  3. package/android/src/main/java/com/aoneahsan/nativeupdate/LiveUpdatePlugin.kt +88 -12
  4. package/android/src/main/java/com/aoneahsan/nativeupdate/NativeUpdatePlugin.kt +45 -18
  5. package/cli/package.json +2 -2
  6. package/dist/esm/definitions.d.ts +8 -0
  7. package/dist/esm/plugin.js +16 -2
  8. package/dist/plugin.cjs.js +1 -1
  9. package/dist/plugin.esm.js +1 -1
  10. package/dist/plugin.js +2 -2
  11. package/docs/CHANGELOG.md +108 -0
  12. package/docs/KNOWN_LIMITATIONS.md +2 -2
  13. package/docs/MIGRATION.md +1 -1
  14. package/ios/Plugin/LiveUpdate/LiveUpdatePlugin.swift +64 -8
  15. package/ios/Plugin/NativeUpdatePlugin.swift +39 -13
  16. package/package.json +8 -3
  17. package/docs/AGENTS.md +0 -47
  18. package/docs/APP_REVIEW_GUIDE.md +0 -768
  19. package/docs/BUNDLE_SIGNING.md +0 -277
  20. package/docs/CLAUDE.md +0 -110
  21. package/docs/COMPREHENSIVE_AUDIT_REPORT.md +0 -526
  22. package/docs/DEPLOY_NOTES.md +0 -117
  23. package/docs/EXAMPLE_APPS_SIMPLIFICATION_PLAN.md +0 -384
  24. package/docs/EXAMPLE_APPS_SIMPLIFICATION_TRACKER.md +0 -390
  25. package/docs/LIVE_UPDATES_GUIDE.md +0 -675
  26. package/docs/MANUAL-TASKS.md +0 -30
  27. package/docs/MARKETING_WEBSITE_TRACKER.md +0 -677
  28. package/docs/NATIVE_UPDATES_GUIDE.md +0 -695
  29. package/docs/PACKAGES.md +0 -167
  30. package/docs/PERFORMANCE.md +0 -110
  31. package/docs/PROJECT_COMPLETION_TRACKER.md +0 -411
  32. package/docs/QUICK_START.md +0 -595
  33. package/docs/README.md +0 -130
  34. package/docs/REMAINING_FEATURES.md +0 -192
  35. package/docs/ROADMAP.md +0 -295
  36. package/docs/SECURITY-IF-REPO-PUBLIC.md +0 -232
  37. package/docs/SECURITY.md +0 -356
  38. package/docs/TESTING_REQUIREMENTS.md +0 -201
  39. package/docs/ai-knowledge-base/00-project-profile.md +0 -38
  40. package/docs/ai-knowledge-base/01-features.md +0 -46
  41. package/docs/ai-knowledge-base/02-routes.md +0 -72
  42. package/docs/ai-knowledge-base/03-tech-stack.md +0 -57
  43. package/docs/ai-knowledge-base/README.md +0 -23
  44. package/docs/analytics-tracking.md +0 -37
  45. package/docs/api/API.md +0 -558
  46. package/docs/api/FEATURES.md +0 -414
  47. package/docs/api/app-review-api.md +0 -239
  48. package/docs/api/app-update-api.md +0 -154
  49. package/docs/api/background-update-api.md +0 -170
  50. package/docs/api/events-api.md +0 -323
  51. package/docs/api/live-update-api.md +0 -258
  52. package/docs/archive/MARKETING_WEBSITE_PLAN.md +0 -659
  53. package/docs/background-updates.md +0 -392
  54. package/docs/capacitor-official-plugins.md +0 -46
  55. package/docs/capawesome-plugins.md +0 -29
  56. package/docs/cli-reference.md +0 -321
  57. package/docs/deployment/HOSTINGER_DEPLOY.md +0 -370
  58. package/docs/deployment/PRODUCTION-DEPLOY-CHECKLIST.md +0 -184
  59. package/docs/docs-site/plan.md +0 -201
  60. package/docs/docs-site/scope.md +0 -127
  61. package/docs/docs-site/tracker.json +0 -235
  62. package/docs/error-handling-tracking.md +0 -37
  63. package/docs/examples/advanced-scenarios.md +0 -394
  64. package/docs/examples/android-manifest-example.xml +0 -77
  65. package/docs/examples/basic-usage.md +0 -206
  66. package/docs/examples/node-express-backend-example.md +0 -28
  67. package/docs/examples/react-capacitor-example.md +0 -29
  68. package/docs/features/app-reviews.md +0 -975
  69. package/docs/features/app-updates.md +0 -785
  70. package/docs/features/e2e-full-verification/00-overview.md +0 -99
  71. package/docs/features/e2e-full-verification/00-tracker.json +0 -284
  72. package/docs/features/e2e-full-verification/phase01-backend-schema-fixes.md +0 -183
  73. package/docs/features/e2e-full-verification/phase02-test-auth.md +0 -176
  74. package/docs/features/e2e-full-verification/phase03-api-test-coverage.md +0 -63
  75. package/docs/features/e2e-full-verification/phase04-frontend-package-contract-audit.md +0 -73
  76. package/docs/features/e2e-full-verification/phase05-browser-e2e-matrix.md +0 -69
  77. package/docs/features/e2e-full-verification/phase06-deploy-prod-smoke.md +0 -51
  78. package/docs/features/e2e-full-verification/results/phase01-drift-report.md +0 -50
  79. package/docs/features/e2e-full-verification/results/phase03-coverage-matrix.md +0 -215
  80. package/docs/features/e2e-full-verification/results/phase04-frontend-contract.md +0 -139
  81. package/docs/features/e2e-full-verification/results/phase05-e2e-results.md +0 -99
  82. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-01-dashboard.png +0 -0
  83. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-02-signup.png +0 -0
  84. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-03-settings-persisted.png +0 -0
  85. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04a-app-created.png +0 -0
  86. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-04b-duplicate-bundle-422.png +0 -0
  87. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-05-plan-limit-403.png +0 -0
  88. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08a-upload-graceful-fail.png +0 -0
  89. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-08b-builds-list.png +0 -0
  90. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-10-rollout-25pct.png +0 -0
  91. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-11-analytics.png +0 -0
  92. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-12-drive-disconnected.png +0 -0
  93. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-13-pricing.png +0 -0
  94. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-14-isolation-403.png +0 -0
  95. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15a-admin-overview.png +0 -0
  96. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-15b-regular-user-admin-redirect.png +0 -0
  97. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-16a-delete-dialog.png +0 -0
  98. package/docs/features/e2e-full-verification/results/phase05-evidence/e2e-17-mobile-375.png +0 -0
  99. package/docs/features/e2e-full-verification/results/route-list.json +0 -1
  100. package/docs/features/laravel-nova-backend/ASSESSMENT-SUMMARY.md +0 -96
  101. package/docs/features/laravel-nova-backend/IMPLEMENTATION-PLAN.md +0 -504
  102. package/docs/features/laravel-nova-backend/progress-tracker.json +0 -184
  103. package/docs/features/live-updates.md +0 -642
  104. package/docs/features/queues-and-emails/00-overview.md +0 -41
  105. package/docs/features/queues-and-emails/00-tracker.json +0 -99
  106. package/docs/features/queues-and-emails/phase01-foundation.md +0 -15
  107. package/docs/features/queues-and-emails/phase02-queued-jobs.md +0 -19
  108. package/docs/features/queues-and-emails/phase03-transactional-emails.md +0 -16
  109. package/docs/features/queues-and-emails/phase04-quota-ops.md +0 -17
  110. package/docs/features/queues-and-emails/phase05-async-build-processing-DECISION.md +0 -16
  111. package/docs/features/queues-and-emails/phase06-verify-deploy.md +0 -17
  112. package/docs/getting-started/configuration.md +0 -469
  113. package/docs/getting-started/installation.md +0 -300
  114. package/docs/getting-started/quick-start.md +0 -430
  115. package/docs/guides/BACKEND_TEMPLATES_GUIDE.md +0 -183
  116. package/docs/guides/admin-panel.md +0 -268
  117. package/docs/guides/channel-management.md +0 -343
  118. package/docs/guides/dashboard-guide.md +0 -365
  119. package/docs/guides/deployment-guide.md +0 -335
  120. package/docs/guides/end-to-end-workflow.md +0 -491
  121. package/docs/guides/key-management.md +0 -284
  122. package/docs/guides/migration-from-codepush.md +0 -145
  123. package/docs/guides/security-best-practices.md +0 -1057
  124. package/docs/guides/testing-guide.md +0 -346
  125. package/docs/guides/troubleshooting.md +0 -482
  126. package/docs/package-audit.md +0 -41
  127. package/docs/plans/PLANNING_COMPLETE_SUMMARY.md +0 -361
  128. package/docs/plans/TASK_1_ANDROID_EXAMPLE_APP.md +0 -401
  129. package/docs/plans/TASK_2_API_ENDPOINTS.md +0 -856
  130. package/docs/plans/TASK_2_DASHBOARD_UI_UX.md +0 -820
  131. package/docs/plans/TASK_2_DATABASE_SCHEMA.md +0 -704
  132. package/docs/plans/TASK_2_GOOGLE_DRIVE_INTEGRATION.md +0 -646
  133. package/docs/plans/TASK_2_SAAS_ARCHITECTURE.md +0 -587
  134. package/docs/plans/TASK_2_USER_AUTHENTICATION.md +0 -600
  135. package/docs/play-store/ASO-METADATA.md +0 -5
  136. package/docs/play-store/DATA-SAFETY.md +0 -5
  137. package/docs/play-store/DECLARATIONS.md +0 -5
  138. package/docs/play-store/README.md +0 -27
  139. package/docs/play-store/RELEASE-NOTES.md +0 -99
  140. package/docs/play-store/RELEASE-STEPS.md +0 -6
  141. package/docs/play-store/STORE-LISTING.md +0 -7
  142. package/docs/play-store/SUBMISSION-CHECKLIST.md +0 -5
  143. package/docs/production-readiness.md +0 -475
  144. package/docs/project-audit/2026-05-16/00-FINALIZATION-PLAN.md +0 -123
  145. package/docs/project-audit/2026-05-16/01-BATCH-PLAN.md +0 -227
  146. package/docs/project-audit/2026-05-16/02-AUDIT-FINDINGS.md +0 -144
  147. package/docs/project-audit/2026-05-16/sessions/batch-01.md +0 -42
  148. package/docs/project-audit/2026-05-16/sessions/batch-02.md +0 -74
  149. package/docs/project-audit/2026-05-16/sessions/batch-03.md +0 -71
  150. package/docs/project-audit/2026-05-16/sessions/batch-04.md +0 -88
  151. package/docs/project-audit/2026-05-16/sessions/batch-05.md +0 -63
  152. package/docs/project-audit/2026-05-16/sessions/batch-06.md +0 -103
  153. package/docs/project-audit/2026-05-16/sessions/batch-07.md +0 -61
  154. package/docs/project-audit/2026-05-16/sessions/batch-08.md +0 -101
  155. package/docs/project-audit/2026-05-16/sessions/batch-09.md +0 -105
  156. package/docs/project-audit/2026-05-16/sessions/batch-10.md +0 -102
  157. package/docs/project-audit/AUDIT-HISTORY.md +0 -74
  158. package/docs/project-audit/BATCH-PLAN.md +0 -168
  159. package/docs/project-audit/MARKETING-WEBSITE-FINDINGS-2026-05-11.md +0 -73
  160. package/docs/project-audit/PRODUCTION-READINESS-AUDIT-2026-05-08.md +0 -275
  161. package/docs/project-finalization/00-tracker.json +0 -60
  162. package/docs/project-knowledge-base/01-system-overview.md +0 -227
  163. package/docs/project-knowledge-base/02-routes-pages-forms-users.md +0 -352
  164. package/docs/project-knowledge-base/03-tech-stack-modules-services.md +0 -379
  165. package/docs/project-knowledge-base/04-data-models-integrations.md +0 -244
  166. package/docs/project-knowledge-base/05-docs-corpus-inventory.md +0 -256
  167. package/docs/project-knowledge-base/06-operations-testing-legal-content.md +0 -208
  168. package/docs/project-knowledge-base/README.md +0 -103
  169. package/docs/project-profiles/native-update-capacitor-update-platform-project-profile-last-updated-2026-05-19.md +0 -81
  170. package/docs/reports/AUDIT_SUMMARY_2025-12-26.md +0 -203
  171. package/docs/reports/CLAUDE-CODE-COMPLETION-PROMPT.md +0 -403
  172. package/docs/reports/CLAUDE_CODE_PROMPT.md +0 -29
  173. package/docs/reports/CODEBASE_STATUS_REPORT.md +0 -272
  174. package/docs/reports/COMPLETE_VERIFICATION.md +0 -106
  175. package/docs/reports/COMPREHENSIVE-PROJECT-AUDIT-2026-02-24.md +0 -747
  176. package/docs/reports/EVENT_FLOW_VERIFICATION.md +0 -80
  177. package/docs/reports/EXAMPLE_APPS_SIMPLIFICATION_COMPLETE.md +0 -369
  178. package/docs/reports/FINAL_STATUS.md +0 -122
  179. package/docs/reports/FINAL_VERIFICATION_CHECKLIST.md +0 -425
  180. package/docs/reports/MARKETING_WEBSITE_COMPLETE.md +0 -466
  181. package/docs/reports/PACKAGE_COMPLETENESS_REPORT.md +0 -130
  182. package/docs/reports/PRODUCTION_STATUS.md +0 -115
  183. package/docs/reports/PROJECT_RESTRUCTURE_2025-12-27.md +0 -287
  184. package/docs/reports/PROJECT_RESTRUCTURE_FINAL_SUMMARY.md +0 -464
  185. package/docs/reports/PUBLISHING_VERIFICATION.md +0 -144
  186. package/docs/reports/RELEASE_READY_SUMMARY.md +0 -99
  187. package/docs/reports/claude-completion.json +0 -241
  188. package/docs/rules-tracker.md +0 -102
  189. package/docs/security/PRE-LAUNCH-PENTEST-CHECKLIST.md +0 -116
  190. package/docs/security/certificate-pinning.md +0 -122
  191. package/docs/seo-aeo-rules.json +0 -3043
  192. package/docs/social-media-marketing/README.md +0 -81
  193. package/docs/social-media-marketing/posts-batch-01.md +0 -613
  194. package/docs/social-media-marketing/posts-batch-02.md +0 -528
  195. package/docs/social-media-marketing/whatsapp-messages-batch-01.md +0 -458
  196. package/docs/social-media-marketing/whatsapp-status-batch-01.md +0 -355
  197. package/docs/tracking/IMPLEMENTATION_TRACKER.md +0 -303
  198. package/docs/tracking/capacitor-rollout-note-2026-03-01.md +0 -21
  199. package/docs/tracking/completion-tracker-2026-02-24.json +0 -174
  200. package/docs/tracking/finalization-2026-05-16-tracker.json +0 -346
  201. package/docs/tracking/full-audit-tracker.json +0 -121
  202. package/docs/tracking/production-readiness-audit-tracker.json +0 -429
  203. package/docs/tracking/seo-checklist-tracker.json +0 -333
@@ -1,321 +0,0 @@
1
- # CLI Reference
2
-
3
- The Native Update CLI provides comprehensive tools for managing your update workflow.
4
-
5
- ## Installation
6
-
7
- The CLI is included with the native-update package. You can use it via npx without any additional installation:
8
-
9
- ```bash
10
- # Use directly with npx (recommended)
11
- npx native-update <command>
12
-
13
- # Or install globally
14
- yarn global add native-update
15
-
16
- # Or use locally in your project
17
- yarn add native-update
18
- npx native-update <command>
19
- ```
20
-
21
- ## Commands
22
-
23
- ### Bundle Management
24
-
25
- #### `bundle create <webDir>`
26
-
27
- Creates an update bundle from your web build directory.
28
-
29
- ```bash
30
- npx native-update bundle create ./www
31
-
32
- # Options:
33
- # -o, --output <path> Output directory (default: ./update-bundles)
34
- # -v, --version <version> Bundle version (default: from package.json)
35
- # -c, --channel <channel> Release channel (default: production)
36
- # -m, --metadata <json> Additional metadata as JSON string
37
- ```
38
-
39
- **Example:**
40
- ```bash
41
- npx native-update bundle create ./dist \
42
- --version 1.2.0 \
43
- --channel staging \
44
- --metadata '{"releaseNotes":"Bug fixes"}'
45
- ```
46
-
47
- #### `bundle sign <bundlePath>`
48
-
49
- Signs a bundle with your private key for security verification.
50
-
51
- ```bash
52
- npx native-update bundle sign ./bundle.zip --key ./keys/private.pem
53
-
54
- # Options:
55
- # -k, --key <path> Path to private key file (required)
56
- # -o, --output <path> Output path for signed bundle
57
- ```
58
-
59
- #### `bundle verify <bundlePath>`
60
-
61
- Verifies a signed bundle with the public key.
62
-
63
- ```bash
64
- npx native-update bundle verify ./bundle.zip --key ./keys/public.pem
65
-
66
- # Options:
67
- # -k, --key <path> Path to public key file (required)
68
- ```
69
-
70
- ### Key Management
71
-
72
- #### `keys generate`
73
-
74
- Generates a new cryptographic key pair for bundle signing. This is the recommended way to create keys for the Native Update plugin.
75
-
76
- ```bash
77
- npx native-update keys generate
78
-
79
- # Options:
80
- # -o, --output <dir> Output directory (default: ./keys)
81
- # -t, --type <type> Key type: rsa or ec (default: rsa)
82
- # -s, --size <size> Key size - RSA: 2048/4096, EC: 256/384 (default: 2048)
83
- ```
84
-
85
- **What it creates:**
86
- - `private-{timestamp}.pem` - Private key for signing (keep SECRET on server)
87
- - `public-{timestamp}.pem` - Public key for verification (include in app)
88
- - Sets proper file permissions (600) on private key
89
- - Timestamps prevent accidental overwriting
90
-
91
- **Example:**
92
- ```bash
93
- # Generate strong RSA keys for production (recommended)
94
- npx native-update keys generate --type rsa --size 4096
95
-
96
- # Generate EC keys for smaller signature size
97
- npx native-update keys generate --type ec --size 256
98
-
99
- # Generate in custom directory
100
- npx native-update keys generate --output ./my-keys --type rsa --size 4096
101
- ```
102
-
103
- **Security Notes:**
104
- - NEVER commit private keys to version control
105
- - Store private keys in secure locations with restricted access
106
- - Use environment variables or key management services in production
107
- - See [Key Management Guide](https://nativeupdate.aoneahsan.com/docs/guides/key-management) for best practices
108
-
109
- ### Backend Templates
110
-
111
- #### `backend create <type>`
112
-
113
- Creates a backend server template for hosting updates.
114
-
115
- ```bash
116
- npx native-update backend create express
117
-
118
- # Types available:
119
- # express - Node.js Express server
120
- # firebase - Firebase Functions
121
- # vercel - Vercel serverless functions
122
-
123
- # Options:
124
- # -o, --output <dir> Output directory (default: ./native-update-backend)
125
- # --with-monitoring Include monitoring setup
126
- # --with-admin Include admin dashboard
127
- ```
128
-
129
- **Examples:**
130
- ```bash
131
- # Express server with admin dashboard
132
- npx native-update backend create express --with-admin
133
-
134
- # Firebase Functions with monitoring
135
- npx native-update backend create firebase --with-monitoring
136
-
137
- # Vercel deployment ready backend
138
- npx native-update backend create vercel
139
- ```
140
-
141
- ### Development Tools
142
-
143
- #### `server start`
144
-
145
- Starts a local update server for development and testing.
146
-
147
- ```bash
148
- npx native-update server start
149
-
150
- # Options:
151
- # -p, --port <port> Server port (default: 3000)
152
- # -d, --dir <dir> Directory containing bundles (default: ./update-bundles)
153
- # --cors Enable CORS (default: true)
154
- ```
155
-
156
- #### `init`
157
-
158
- Initializes Native Update configuration in your project.
159
-
160
- ```bash
161
- npx native-update init
162
-
163
- # Options:
164
- # --example Include example code
165
- # --backend <type> Backend type: firebase, express, custom (default: custom)
166
- ```
167
-
168
- ### Monitoring
169
-
170
- #### `monitor`
171
-
172
- Monitors update deployment statistics in real-time.
173
-
174
- ```bash
175
- npx native-update monitor --server https://your-update-server.com
176
-
177
- # Options:
178
- # -s, --server <url> Backend server URL (required)
179
- # -k, --key <key> API key for authentication
180
- ```
181
-
182
- ### Configuration
183
-
184
- #### `config check`
185
-
186
- Validates your Native Update configuration.
187
-
188
- ```bash
189
- npx native-update config check
190
- ```
191
-
192
- ### Migration
193
-
194
- #### `migrate`
195
-
196
- Helps migrate from other OTA solutions.
197
-
198
- ```bash
199
- npx native-update migrate --from codepush
200
-
201
- # Options:
202
- # --from <solution> Source solution: codepush, appflow (default: codepush)
203
- ```
204
-
205
- ## Complete Workflow Example
206
-
207
- Here's a typical workflow using the CLI:
208
-
209
- ```bash
210
- # 1. Initialize in your project
211
- npx native-update init --example
212
-
213
- # 2. Generate signing keys
214
- npx native-update keys generate --type rsa --size 4096
215
-
216
- # 3. Create a backend
217
- npx native-update backend create express --with-admin
218
-
219
- # 4. Start the backend (in another terminal)
220
- cd native-update-backend
221
- yarn install
222
- yarn dev
223
-
224
- # 5. Build your app
225
- yarn build
226
-
227
- # 6. Create and sign a bundle
228
- npx native-update bundle create ./www --version 1.0.1
229
- npx native-update bundle sign ./update-bundles/bundle-*.zip --key ./keys/private-*.pem
230
-
231
- # 7. Upload to your server (use the admin dashboard or API)
232
-
233
- # 8. Monitor deployments
234
- npx native-update monitor --server http://localhost:3000
235
- ```
236
-
237
- ## CI/CD Integration
238
-
239
- ### GitHub Actions
240
-
241
- ```yaml
242
- - name: Create Update Bundle
243
- run: |
244
- npx native-update bundle create ./dist \
245
- --version ${{ github.event.release.tag_name }}
246
- --channel production
247
-
248
- - name: Sign Bundle
249
- run: |
250
- npx native-update bundle sign ./update-bundles/*.zip \
251
- --key ${{ secrets.PRIVATE_KEY }}
252
- ```
253
-
254
- ### Jenkins
255
-
256
- ```groovy
257
- stage('Create Update') {
258
- steps {
259
- sh 'npx native-update bundle create ./www --version ${BUILD_NUMBER}'
260
- sh 'npx native-update bundle sign ./update-bundles/*.zip --key ${PRIVATE_KEY_PATH}'
261
- }
262
- }
263
- ```
264
-
265
- ## Environment Variables
266
-
267
- The CLI respects these environment variables:
268
-
269
- - `NATIVE_UPDATE_SERVER` - Default server URL for commands
270
- - `NATIVE_UPDATE_API_KEY` - Default API key for authentication
271
- - `NATIVE_UPDATE_CHANNEL` - Default release channel
272
- - `NO_COLOR` - Disable colored output
273
-
274
- ## Troubleshooting
275
-
276
- ### "Command not found"
277
-
278
- Make sure you're using `npx` or have installed the package:
279
- ```bash
280
- npx native-update <command>
281
- ```
282
-
283
- ### "EACCES: permission denied"
284
-
285
- Key files need proper permissions:
286
- ```bash
287
- chmod 600 ./keys/private-*.pem
288
- ```
289
-
290
- ### Bundle creation fails
291
-
292
- Ensure your web directory contains built files:
293
- ```bash
294
- # Build first
295
- yarn build
296
-
297
- # Then create bundle
298
- npx native-update bundle create ./www
299
- ```
300
-
301
- ## Best Practices
302
-
303
- 1. **Security**
304
- - Keep private keys secure and never commit them
305
- - Use strong RSA 4096 keys for production
306
- - Always sign bundles before deployment
307
-
308
- 2. **Versioning**
309
- - Use semantic versioning (1.0.0, 1.0.1, etc.)
310
- - Increment versions for each update
311
- - Use channels for staged rollouts
312
-
313
- 3. **Testing**
314
- - Test updates locally first using `server start`
315
- - Verify bundles before deployment
316
- - Use staging channel before production
317
-
318
- 4. **Monitoring**
319
- - Always monitor deployments
320
- - Set up alerts for failed updates
321
- - Track adoption rates
@@ -1,370 +0,0 @@
1
- # Hostinger Deployment Guide
2
-
3
- Step-by-step deploy of the Laravel + Nova backend to Hostinger Business
4
- (shared hosting, SSH-enabled). Target URL:
5
- **https://nativeupdatebe.aoneahsan.com**.
6
-
7
- Tested against Hostinger hPanel, shared Business plan, PHP 8.2, MySQL.
8
-
9
- ---
10
-
11
- ## 0. What you need before starting
12
-
13
- | Item | Where to get it |
14
- |---|---|
15
- | Hostinger SSH access | hPanel → Advanced → SSH Access → "Enable" |
16
- | MySQL database | hPanel → Databases → MySQL Databases → Create |
17
- | Nova license key | nova.laravel.com (account → licenses) |
18
- | PayPal Live credentials | developer.paypal.com → My Apps & Credentials → Live |
19
- | PayPal subscription plans | PayPal Dashboard → Subscriptions → Plans (create Pro + Enterprise, copy the `P-...` IDs) |
20
- | PayPal webhook ID | Set up in step 4, skip for now |
21
- | FilesHub API key | fileshub.zaions.com admin |
22
- | Google OAuth client | console.cloud.google.com → APIs & Services → Credentials (used for both dashboard sign-in and Google Drive) |
23
-
24
- ---
25
-
26
- ## 1. Build the production zip (local machine)
27
-
28
- Already built by the maintainer. Current artifact lives at:
29
-
30
- ```
31
- production-deploy/nu-backend-YYYYMMDD-HHMMSS.zip
32
- ```
33
-
34
- If you need to rebuild:
35
-
36
- ```bash
37
- cd /home/ahsan/Documents/01-code/projects/native-update/backend
38
-
39
- # Ensure Nova + PayPal deps resolve
40
- composer install
41
- composer update --no-interaction
42
-
43
- # Production-only deps + Vite build
44
- php artisan optimize:clear
45
- composer install --no-dev --optimize-autoloader --classmap-authoritative
46
- npm run build
47
-
48
- # Produce the zip
49
- mkdir -p ../production-deploy
50
- zip -qr "../production-deploy/nu-backend-$(date +%Y%m%d-%H%M%S).zip" . \
51
- -x "node_modules/*" ".git/*" "tests/*" ".env" ".env.*" \
52
- "storage/logs/*.log" "storage/framework/cache/data/*" \
53
- "storage/framework/sessions/*" "storage/framework/views/*.php" \
54
- "*.sqlite" ".phpunit.result.cache" "*.DS_Store"
55
-
56
- # Restore dev deps locally
57
- composer install
58
- ```
59
-
60
- The zip is ~67 MB. Upload it to Hostinger via SFTP to `~/uploads/`.
61
-
62
- ---
63
-
64
- ## 2. Hostinger hPanel one-time setup
65
-
66
- 1. **Subdomain**. hPanel → Domains → Subdomains → Create:
67
- - Subdomain: `nativeupdatebe`
68
- - Domain: `aoneahsan.com`
69
- - Document root: leave as Hostinger's default for now; we'll symlink
70
- it to Laravel's `public/` in step 3.
71
-
72
- 2. **Database**. hPanel → Databases → MySQL Databases → Create:
73
- - DB name: `nativeupdate_backend` (Hostinger will prefix with your user)
74
- - User: `nativeupdate_user`
75
- - Password: generate a strong one; save it.
76
-
77
- 3. **SSH**. hPanel → Advanced → SSH Access → Enable (if not already).
78
- Note the port (usually 65002) and username.
79
-
80
- 4. **Upload the deploy zip** via hPanel File Manager (or SFTP) to
81
- `~/uploads/`. (No Firebase credentials file is needed — auth is Google
82
- Socialite + Sanctum, configured entirely via `.env`.)
83
-
84
- ---
85
-
86
- ## 3. SSH deploy (first time)
87
-
88
- SSH in:
89
-
90
- ```bash
91
- ssh -p 65002 <USER>@<HOST>
92
- ```
93
-
94
- Create the app directory one level above `public_html` and extract:
95
-
96
- ```bash
97
- cd ~/domains/nativeupdatebe.aoneahsan.com
98
- mkdir -p app && cd app
99
- unzip -q ~/uploads/nu-backend-*.zip -d .
100
- ```
101
-
102
- Point `public_html` at Laravel's `public/`:
103
-
104
- ```bash
105
- cd ~/domains/nativeupdatebe.aoneahsan.com
106
- rm -rf public_html
107
- ln -s app/public public_html
108
- ```
109
-
110
- Configure the environment:
111
-
112
- ```bash
113
- cd ~/domains/nativeupdatebe.aoneahsan.com/app
114
- cp .env.example .env
115
- nano .env
116
- ```
117
-
118
- Fill in the following (paste real values for each `_________` placeholder):
119
-
120
- ```dotenv
121
- APP_NAME="Native Update"
122
- APP_ENV=production
123
- APP_KEY= # php artisan key:generate runs next
124
- APP_DEBUG=false
125
- APP_TIMEZONE=UTC
126
- APP_URL=https://nativeupdatebe.aoneahsan.com
127
-
128
- LOG_CHANNEL=daily
129
- LOG_LEVEL=warning
130
-
131
- # MySQL from step 2
132
- DB_CONNECTION=mysql
133
- DB_HOST=127.0.0.1
134
- DB_PORT=3306
135
- DB_DATABASE=_________
136
- DB_USERNAME=_________
137
- DB_PASSWORD=_________
138
-
139
- # FilesHub
140
- FILESHUB_BASE_URL=https://fileshub.zaions.com
141
- FILESHUB_API_KEY=_________
142
- FILESHUB_APP_ID=native-update
143
-
144
- # Sanctum (OAuth-issued bearer tokens)
145
- SANCTUM_TOKEN_EXPIRATION=10080 # minutes (7 days)
146
-
147
- # Frontend (for OAuth redirect back to the dashboard SPA)
148
- FRONTEND_URL=https://nativeupdate.aoneahsan.com
149
-
150
- # Google OAuth — sign-in (Socialite) AND Google Drive integration
151
- GOOGLE_CLIENT_ID=_________
152
- GOOGLE_CLIENT_SECRET=_________
153
- GOOGLE_REDIRECT_URI=${APP_URL}/api/auth/google/callback
154
- GOOGLE_DRIVE_REDIRECT_URI=${APP_URL}/api/dashboard/google-drive/callback
155
-
156
- # PayPal (live)
157
- PAYPAL_MODE=live
158
- PAYPAL_LIVE_CLIENT_ID=_________
159
- PAYPAL_LIVE_CLIENT_SECRET=_________
160
- PAYPAL_PLAN_PRO=P-_________
161
- PAYPAL_PLAN_ENTERPRISE=P-_________
162
- PAYPAL_WEBHOOK_ID= # fill in step 4
163
-
164
- # Nova
165
- NOVA_LICENSE_KEY=_________
166
-
167
- # Admin
168
- ADMIN_EMAILS=aoneahsan@gmail.com
169
- ```
170
-
171
- Generate APP_KEY and lock down permissions:
172
-
173
- ```bash
174
- php artisan key:generate --force
175
-
176
- find . -type d -exec chmod 755 {} \;
177
- find . -type f -exec chmod 644 {} \;
178
- chmod -R 775 storage bootstrap/cache
179
- chmod 600 .env
180
- ```
181
-
182
- > The full, authoritative env contract (every `[REQUIRED]`/`[OPTIONAL]` key with its purpose)
183
- > is `backend/.env.example`. Populate the server `.env` from it — an incomplete `.env` (missing
184
- > a required key) is a common cause of a booting-but-500 backend.
185
-
186
- Run migrations and cache config for production:
187
-
188
- ```bash
189
- php artisan migrate --force
190
- php artisan storage:link
191
- php artisan config:cache
192
- php artisan route:cache
193
- php artisan view:cache
194
- php artisan nova:publish
195
- ```
196
-
197
- Smoke-test:
198
-
199
- ```bash
200
- curl -sS https://nativeupdatebe.aoneahsan.com/api/health
201
- # Expected: {"status":"ok","app":"Native Update","env":"production","time":"..."}
202
- ```
203
-
204
- Log in to Nova at `https://nativeupdatebe.aoneahsan.com/nova` with an
205
- email listed in `ADMIN_EMAILS` (sign in via Google — Socialite issues the
206
- Sanctum session; the first sign-in by an `ADMIN_EMAILS` address is granted
207
- the `super-admin` role) and verify the Apps / Builds / ApiKeys /
208
- SigningKeys / Subscriptions resources render.
209
-
210
- ---
211
-
212
- ## 4. Register the PayPal webhook
213
-
214
- In PayPal Dashboard → Webhooks → Add Webhook:
215
-
216
- - URL: `https://nativeupdatebe.aoneahsan.com/api/webhooks/paypal`
217
- - Events (minimum):
218
- - `BILLING.SUBSCRIPTION.ACTIVATED`
219
- - `BILLING.SUBSCRIPTION.CANCELLED`
220
- - `BILLING.SUBSCRIPTION.SUSPENDED`
221
- - `BILLING.SUBSCRIPTION.EXPIRED`
222
- - `BILLING.SUBSCRIPTION.PAYMENT.FAILED`
223
- - `PAYMENT.SALE.COMPLETED`
224
-
225
- Copy the webhook ID PayPal assigns (starts with `WH-`). SSH back in:
226
-
227
- ```bash
228
- cd ~/domains/nativeupdatebe.aoneahsan.com/app
229
- sed -i 's|^PAYPAL_WEBHOOK_ID=.*|PAYPAL_WEBHOOK_ID=WH-xxxxxxxxxxxx|' .env
230
- php artisan config:cache
231
- ```
232
-
233
- Run PayPal's Webhook Simulator from the dashboard to fire a
234
- `BILLING.SUBSCRIPTION.ACTIVATED` event. Expected response: `200 ok`.
235
- Check the logs:
236
-
237
- ```bash
238
- tail -n 100 ~/domains/nativeupdatebe.aoneahsan.com/app/storage/logs/laravel-*.log
239
- ```
240
-
241
- Should contain `PayPal webhook received` or `PayPal subscription activated`.
242
-
243
- ---
244
-
245
- ## 5. Cron for scheduled tasks (REQUIRED as of v3.1.0)
246
-
247
- The backend now runs a scheduled job: `analytics:cleanup` (defined in
248
- `routes/console.php`) prunes old `device_activities` **and**
249
- `analytics_events` rows monthly. Without the scheduler cron below those
250
- tables grow unbounded, so this cron is now required, not optional.
251
-
252
- hPanel → Advanced → Cron Jobs → Add (runs every minute; Laravel's
253
- scheduler decides internally when each job is actually due):
254
-
255
- ```
256
- * * * * * cd ~/domains/nativeupdatebe.aoneahsan.com/app && php artisan schedule:run >/dev/null 2>&1
257
- ```
258
-
259
- ---
260
-
261
- ## 6. Re-deploys
262
-
263
- For each subsequent release:
264
-
265
- 1. Rebuild the zip locally (see step 1).
266
- 2. SFTP it to `~/uploads/nu-backend-NEW.zip`.
267
- 3. SSH in and atomic-swap:
268
-
269
- ```bash
270
- cd ~/domains/nativeupdatebe.aoneahsan.com
271
- mv app app.old
272
- mkdir app && cd app
273
- unzip -q ~/uploads/nu-backend-NEW.zip -d .
274
-
275
- # Carry over secrets + stored files
276
- cp ../app.old/.env .env
277
- cp -a ../app.old/storage/app storage/ 2>/dev/null || true
278
-
279
- # Fix perms
280
- find . -type d -exec chmod 755 {} \;
281
- find . -type f -exec chmod 644 {} \;
282
- chmod -R 775 storage bootstrap/cache
283
- chmod 600 .env
284
-
285
- # Rebuild caches + apply migrations
286
- php artisan migrate --force
287
- php artisan config:cache
288
- php artisan route:cache
289
- php artisan view:cache
290
-
291
- # Re-point public_html (only needed if symlink was lost)
292
- cd ..
293
- rm -rf public_html && ln -s app/public public_html
294
-
295
- # Smoke-test then clean up old release
296
- curl -sS https://nativeupdatebe.aoneahsan.com/api/health
297
- rm -rf app.old
298
- ```
299
-
300
- ---
301
-
302
- ## 7. Rollback
303
-
304
- If a deploy breaks things and you didn't delete `app.old` yet:
305
-
306
- ```bash
307
- cd ~/domains/nativeupdatebe.aoneahsan.com
308
- rm -rf app
309
- mv app.old app
310
- rm -rf public_html && ln -s app/public public_html
311
- php artisan config:cache
312
- curl -sS https://nativeupdatebe.aoneahsan.com/api/health
313
- ```
314
-
315
- Migrations that were applied on the new release may need a manual
316
- `php artisan migrate:rollback --step=N` depending on what they changed.
317
-
318
- ---
319
-
320
- ## 8. Known Hostinger constraints
321
-
322
- - **No persistent queue workers needed.** The backend uses
323
- `QUEUE_CONNECTION=database`, but the only async work — the update-check
324
- device-activity + analytics writes — is dispatched with
325
- `dispatch(...)->afterResponse()`, which runs **in-process** during the
326
- request's terminating phase (no `queue:work` daemon required). If a
327
- future feature dispatches a real queued job, add a 1-minute cron running
328
- `php artisan queue:work --stop-when-empty`.
329
- - **No Redis.** Cache + sessions use the MySQL `CACHE_STORE=database`
330
- driver. The v3.1.0 latest-build cache (`App::getLatestBuildForChannel`,
331
- 45s TTL) works with any driver, including `database` and `file`.
332
- - **PHP 8.3+ is required** (Laravel 13 / `composer.json` `php: ^8.3`).
333
- Select PHP 8.3 or newer in hPanel → Advanced → PHP Configuration before
334
- deploying; PHP 8.2 will fail to boot the framework.
335
- - **Node/npm are not available via SSH on all plans.** The Vite build step
336
- runs locally; the zip ships pre-built `public/build/` assets.
337
- - **Nova admin assets** are served from `public/vendor/nova/...` after
338
- `php artisan nova:publish` — re-run after every deploy.
339
-
340
- ---
341
-
342
- ## 9. v3.1.0 deploy notes
343
-
344
- This release adds one migration and shifts two hot-path writes; nothing in
345
- the standard deploy flow above changes, but confirm each of these:
346
-
347
- 1. **Run the new migration.** `php artisan migrate --force` applies
348
- `2026_07_02_000001_extend_builds_channel_index` (adds a covering index
349
- `builds_channel_lookup_idx` on `builds(app_id, channel, status,
350
- created_at)`). Purely additive — no data change, safe to run live.
351
- 2. **Re-cache config/routes/views** after the swap (already in the deploy
352
- steps): `php artisan config:cache && php artisan route:cache &&
353
- php artisan view:cache`.
354
- 3. **Confirm the scheduler cron** from section 5 exists — `analytics:cleanup`
355
- now also prunes `analytics_events`, so the monthly run matters.
356
- 4. **No queue worker required** — see section 8 (the update-check writes run
357
- via `afterResponse()`).
358
-
359
- ### Large bundle downloads (optional)
360
-
361
- `BundleController@download` streams bundle files through PHP (a
362
- `StreamedResponse`). This is deliberate: it keeps the signed-URL / auth
363
- check as the single chokepoint in front of every download. On a server with
364
- `mod_xsendfile` (Apache) or `X-Accel-Redirect` (nginx), that streaming can
365
- be offloaded to the web server after the auth check by returning an
366
- `X-Sendfile` / `X-Accel-Redirect` header instead of the file body — freeing
367
- the PHP-FPM worker for the duration of the transfer. This is a documented
368
- option only; it is **not implemented** (Hostinger shared hosting does not
369
- expose the needed web-server config, and the current streaming approach is
370
- correct and safe as-is).