You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In `init/initializeService.ts`, set the default SMTP state alongside any internal-only secrets the service needs. The admin password is set by the `setAdminPassword` action when the user runs its critical task (see [Prompt User to Create Admin Credentials](./recipe-admin-credentials.md)):
393
+
In `init/seedFiles.ts`, set the default SMTP state alongside any internal-only secrets the service needs. The admin password is set by the `setAdminPassword` action when the user runs its critical task (see [Prompt User to Create Admin Credentials](./recipe-admin-credentials.md)):
Copy file name to clipboardExpand all lines: packaging/src/init.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
For one-time setup that generates new state. Internal-only secrets (DB password, JWT secret, etc.) **are** generated here, because no user interaction is involved:
If the upstream service needs the password applied via CLI or API rather than just read from the store at startup, wrap the work in `sdk.SubContainer.withTemp()` inside the action handler — see the [Reset a Password](recipe-reset-password.md) recipe.
150
150
151
-
## Registering initializeService
151
+
## Registering a custom init function
152
152
153
153
Add your custom init function to `init/index.ts`:
154
154
@@ -159,15 +159,15 @@ import { setInterfaces } from '../interfaces'
Copy file name to clipboardExpand all lines: packaging/src/main.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ Oneshots are tasks that run on every startup before daemons. Use them for idempo
177
177
```
178
178
179
179
> [!WARNING]
180
-
> Do NOT put one-time setup tasks (like `createsuperuser`) in `main.ts` oneshots -- they run on every startup and will fail on subsequent runs. Use `init/initializeService.ts` instead. See [Initialization Patterns](./init.md) for details.
180
+
> Do NOT put one-time setup tasks (like `createsuperuser`) in `main.ts` oneshots -- they run on every startup and will fail on subsequent runs. Use a custom init file (e.g. `init/seedFiles.ts`) instead. See [Initialization Patterns](./init.md) for details.
181
181
182
182
## Exec Command
183
183
@@ -468,7 +468,7 @@ The `user` option is optional. If omitted, commands run as the default user defi
468
468
**Use `execFail()` when:**
469
469
470
470
- The command must succeed for the service to work correctly
471
-
- You are in `initializeService.ts` and want installation to fail if setup fails
471
+
- You are in a custom init file (e.g. `seedFiles.ts`) and want installation to fail if setup fails
0 commit comments