Initial commit: Premier Gunner tracker + StartOS 0.4.0 s9pk package

This commit is contained in:
Keysat
2026-05-31 21:04:48 -05:00
commit 0265699504
67 changed files with 4578 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
import { store } from './fileModels/store'
import { i18n } from './i18n'
import { sdk } from './sdk'
import { uiPort } from './utils'
export const main = sdk.setupMain(async ({ effects }) => {
console.info(i18n('Starting Premier Gunner!'))
// The login password lives in store.json. Reading it with `.const` makes the
// daemon restart whenever it changes (e.g. via the "Set Login Password" action),
// so PG_PASSWORD stays authoritative on every boot.
const password = await store.read((s) => s.password).const(effects)
return sdk.Daemons.of(effects).addDaemon('primary', {
subcontainer: await sdk.SubContainer.of(
effects,
{ imageId: 'premier-gunner' },
sdk.Mounts.of().mountVolume({
volumeId: 'main',
subpath: null,
mountpoint: '/data',
readonly: false,
}),
'premier-gunner-sub',
),
exec: {
command: ['node', 'src/server.js'],
cwd: '/app',
env: {
NODE_ENV: 'production',
PG_HOST: '0.0.0.0',
PG_PORT: String(uiPort),
PG_DATA_DIR: '/data',
...(password ? { PG_PASSWORD: password } : {}),
},
},
ready: {
display: i18n('Web Interface'),
fn: () =>
sdk.healthCheck.checkPortListening(effects, uiPort, {
successMessage: i18n('The web interface is ready'),
errorMessage: i18n('The web interface is not ready'),
}),
},
requires: [],
})
})