Commit eacc173
committed
feat(forge): chain mios-forge admin creation through build-mios.ps1 + install.env + firstboot service
End-to-end chain so the user identity defined in mios-bootstrap.git/
mios.toml propagates all the way to the Forgejo admin account on the
deployed image:
mios-bootstrap/mios.toml
|
v
build-mios.ps1 (Windows orchestrator) interactive prompts
build-mios.sh (bootstrap Linux installer) interactive prompts
| Read-Timed / prompt_default with 3-min auto-accept
| defaulting to MIOS_LINUX_USER and <user>@<host>.local
v
/etc/mios/install.env (mode 0640 in the imported WSL2 distro)
| written by tools/lib/install-env.ps1 (Windows side) and
| by build-mios.sh's PROFILE_FILE writer (Linux side); both
| emit MIOS_FORGE_ADMIN_USER, MIOS_FORGE_ADMIN_EMAIL, and
| MIOS_FORGE_ADMIN_PASSWORD= (empty -> generated below)
v
mios-forge.service starts at boot
v
mios-forge-firstboot.service (oneshot, RemainAfterExit=yes)
| After=mios-forge.service; runs once per fresh deployment;
| ConditionPathExists guards on install.env presence and on
| absence of the .firstboot-done sentinel.
v
/usr/libexec/mios/forge-firstboot.sh
| - waits up to 300s for Forgejo's /api/v1/version probe
| - if MIOS_FORGE_ADMIN_PASSWORD empty, generates a 24-byte
| URL-safe random pwd, writes /etc/mios/forge/admin-password
| (root-owned, mode 0600); operator reads via 'sudo cat'
| - 'podman exec mios-forge forgejo admin user create
| --admin --must-change-password=true' against the values
| from install.env
| - drops a sentinel at /var/lib/mios/forge/.firstboot-done
| so re-boots are no-ops
v
Operator runs:
git remote add origin http://localhost:3000/<user>/<repo>.git
git push origin main
NEW FILES (mios.git)
usr/libexec/mios/forge-firstboot.sh (executable; bash -n clean)
usr/lib/systemd/system/mios-forge-firstboot.service
(oneshot; ProtectSystem=
strict; ReadWritePaths
scoped to forge dirs only)
UPDATED FILES (mios.git)
tools/lib/install-env.ps1
Write-MiosInstallEnv signature gains -ForgeAdminUser and
-ForgeAdminEmail (both default to the linux identity if
omitted). Three new lines emitted into install.env:
MIOS_FORGE_ADMIN_USER, MIOS_FORGE_ADMIN_EMAIL,
MIOS_FORGE_ADMIN_PASSWORD= (empty -> firstboot generates).
build-mios.ps1
- Phase-0 custom workflow now prompts for forge admin user +
email via Read-Timed (3-min auto-accept, defaulting to the
linux $U and $U@$HostIn.local).
- Non-custom workflow takes the same defaults silently.
- WSL2 deployment branch passes $ForgeAdmin / $ForgeEmail
through Write-MiosInstallEnv.
- Phase-5 build summary prints the forge URL, admin user/email,
how to read the generated password, and a 'git remote add'
one-liner so the operator has the locally-hosted .git=./
flow at their fingertips.
UPDATED FILES (mios-bootstrap.git, sibling commit)
build-mios.sh
- Phase-0 gather_user_choices() prompts for FORGE_ADMIN_USER
and FORGE_ADMIN_EMAIL with the same 3-minute timeout
(defaulting to LINUX_USER and LINUX_USER@HOSTNAME_VAL.local).
- install.env writer emits the three MIOS_FORGE_ADMIN_*
lines; password stays empty so firstboot can generate.
POSTCHECK COVERAGE
No new failures introduced. The new oneshot service ships in
/usr/lib/systemd/system/, where systemd-analyze verify already runs
in postcheck #10. ConditionVirtualization=!container keeps it from
trying to exec into a non-existent Quadlet inside nested containers.1 parent 7bb042c commit eacc173
4 files changed
Lines changed: 186 additions & 4 deletions
File tree
- tools/lib
- usr
- libexec/mios
- lib/systemd/system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
349 | 357 | | |
350 | 358 | | |
351 | 359 | | |
| |||
359 | 367 | | |
360 | 368 | | |
361 | 369 | | |
| 370 | + | |
| 371 | + | |
362 | 372 | | |
363 | 373 | | |
364 | 374 | | |
| |||
912 | 922 | | |
913 | 923 | | |
914 | 924 | | |
915 | | - | |
| 925 | + | |
916 | 926 | | |
917 | 927 | | |
918 | 928 | | |
| |||
1023 | 1033 | | |
1024 | 1034 | | |
1025 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1026 | 1052 | | |
1027 | 1053 | | |
1028 | 1054 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
35 | | - | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
0 commit comments