Merge upstream start-sdk 3.0.3 and the corrected logging docs

This commit is contained in:
Unheard0840 committed 2026-10-10 13:19:31 +02:00
commit 9a4ab4af96
22 files changed
+1207 -973

No files matched your search

+8 -3
View File
@@ -3,15 +3,20 @@ name: Build
on:
workflow_dispatch:
pull_request:
paths-ignore: ['*.md']
types: [opened, synchronize, reopened, ready_for_review]
branches: ['main']
paths-ignore: ['*.md']
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
group: package-build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
if: github.event.pull_request.draft == false
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
permissions:
contents: read
uses: Start9Labs/start-technologies/.github/workflows/build.yml@master
# No DEV_KEY — a PR build doesn't publish, so it doesn't need the signing key.
+18
View File
@@ -0,0 +1,18 @@
name: Retarget Build
on:
pull_request:
types: [edited]
permissions: {}
concurrency:
group: package-build-${{ github.event.changes.base && github.event.pull_request.number || format('metadata-{0}', github.event.pull_request.number) }}
cancel-in-progress: true
jobs:
build:
if: github.event.changes.base && github.event.pull_request.draft == false
permissions:
contents: read
uses: Start9Labs/start-technologies/.github/workflows/build.yml@master
+8
View File
@@ -3,6 +3,14 @@ name: Sync next
# Carries every change that lands on the base branch onto the paired `next`
# iteration branch, so `next` never drifts behind what has already shipped.
# `next` is created on the first run if the repo does not have one yet.
#
# List every base branch this package maintains. Most packages have one; the
# multi-branch packages list each major line or flavor (e.g. 28.x, 29.x). A
# package whose default branch is `main` must say `main` here — a workflow
# pointed at a branch the repo does not use never runs.
#
# No paths-ignore: a docs-only commit on the base still has to reach `next`,
# or the next merge back re-introduces the stale copy.
on:
push:
branches: ['main']
+1
View File
@@ -0,0 +1 @@
"@start9labs/start-sdk/prettier.config.json"
+14 -8
View File
@@ -18,17 +18,23 @@ Freshly scaffolded? Work the
guide page, not a file in this repo — read it, don't copy it in.
Keep `README.md` (technical reference for an AI support or administering agent) and
`instructions.md` (end-user docs) in sync with your changes.
`instructions.md` (end-user docs) in sync with your changes. This file restates neither:
whoever changes the package has both, so it carries only what they don't — repo mechanics,
a change that looks right and is not, where the next thing gets added, a naming trap, a
build or test invocation particular to this repo.
**Fix a defect you spot rather than reporting it** — you have the package open and the
context to be sure. File **a GitHub issue on this repo** only when the call isn't yours to
make: you can't pin the cause down, two defensible fixes exist, or it's too large to ride on
the work in hand. An open issue is a report, not a queue — implement one when you're asked
to or when it's labelled `Approved`, then close it with `Closes #<n>`.
**Bugs and feature requests are GitHub issues on this repo** — file them as you find them.
Don't record work in the repo instead: no `TODO.md`, no `NOTES.md`, no `PLAN.md`. What you
verified, tried, and decided belongs in the commit message and the PR body.
## This repo
- **`config.json`'s shape must stay exactly upstream's.** The proxy rewrites the whole file when a key is saved on the Status Page, so anything the package adds there is destroyed. Package-owned settings go in `store.json` at the volume root — **outside** the `proxy/` subpath that is mounted — where the container cannot see or clobber them.
- **Don't set `PPQ_API_KEY`.** Leaving it unset makes the proxy's own key store the single owner, so the action and the Status Page write the same key rather than competing.
- **The task is `important`, not `critical`, on purpose.** A `critical` task suspends the ordinary controls, which would stop the user starting the service — and the Status Page is the other place a key can be saved. Blocking startup would block half the ways to complete the task.
- **The key pattern is validated in the action** because upstream only validates on the Status Page — a malformed key written straight to `config.json` surfaces later as a 401 on the first request.
- **A blank key field preserves the existing key**, so the action doubles as the way to toggle logging. Don't "fix" it to clear on empty.
- **Default branch is `main`, not `master`.** Its CI workflows reference `main`; leave them.
- **Put package-owned settings in `store.json`, never in `config.json`** — the proxy rewrites `config.json` whole when a key is saved on the Status Page.
- **Don't set `PPQ_API_KEY`** — the proxy's own key store must stay the key's only owner, so the action and the Status Page write the same key.
- **A blank key field keeps the saved key; don't "fix" it to clear on empty** — it is how the action toggles logging without re-entering the key.
- **Default branch is `main`, not `master`.** Keep `main` in every workflow when resyncing them from the template.
+3 -1
View File
@@ -86,7 +86,9 @@ reachable from your browser — that is what the LAN `https://` address is for.
Either surface works, and both write the same place: **Replace key** on the
Status Page, or the **Configure PPQ API Key** action. The action is also where
you turn Verbose Logging on and off; leaving its key field blank keeps the key
you already saved.
you already saved. Verbose Logging adds model information for accepted chat
requests and logs OpenAI stream errors. Error messages may include sensitive
content, even when Verbose Logging is off; review logs before sharing them.
## Limitations
+1111 -894
View File
File diff suppressed because it is too large. Load diff
+1 -18
View File
@@ -1,26 +1,9 @@
{
"name": "ppq-private-mode-startos",
"scripts": {
"build": "rm -rf ./javascript && ncc build startos/index.ts -o ./javascript",
"prettier": "prettier --write startos",
"check": "tsc --noEmit"
},
"dependencies": {
"@start9labs/start-sdk": "2.0.9"
"@start9labs/start-sdk": "3.0.3"
},
"overrides": {
"@start9labs/start-sdk": "$@start9labs/start-sdk"
},
"devDependencies": {
"@types/node": "^22.19.0",
"@vercel/ncc": "^0.38.4",
"prettier": "^3.6.2",
"typescript": "^6.0.3"
},
"prettier": {
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
}
+2 -2
View File
@@ -27,7 +27,7 @@ const inputSpec = InputSpec.of({
debug: Value.toggle({
name: i18n('Verbose Logging'),
description: i18n(
'Log every request the proxy handles. Useful for troubleshooting.',
'Logs the model for accepted chat requests and OpenAI stream errors. Error messages may include sensitive content, even when Verbose Logging is off.',
),
default: false,
}),
@@ -71,4 +71,4 @@ export const configureApiKey = sdk.Action.withInput(
}
}
},
)
)
+2 -3
View File
@@ -2,7 +2,6 @@ import { sdk } from '../sdk'
import { configureApiKey } from './configureApiKey'
import { showServiceUrl } from './showServiceUrl'
export const actions = sdk
.Actions.of()
export const actions = sdk.Actions.of()
.addAction(configureApiKey)
.addAction(showServiceUrl)
.addAction(showServiceUrl)
+1 -1
View File
@@ -62,4 +62,4 @@ export const showServiceUrl = sdk.Action.withoutInput(
},
}
},
)
)
+1 -3
View File
@@ -1,5 +1,3 @@
import { sdk } from './sdk'
export const setDependencies = sdk.setupDependencies(
async ({ effects }) => ({}),
)
export const dependencies = sdk.Dependencies.of()
+1 -1
View File
@@ -5,7 +5,7 @@ import { sdk } from '../sdk'
// loads the key from here at startup and rewrites the whole file when one is
// saved from the status page, so this shape must stay exactly upstream's and
// nothing else may live in it — see fileModels/store.json.ts.
const shape = z.object({
const shape = z.looseObject({
apiKey: z.string().optional().catch(undefined),
})
+1 -1
View File
@@ -3,7 +3,7 @@ import { sdk } from '../sdk'
// Package-owned settings, kept outside the mounted PPQ_DATA_DIR subtree so the
// proxy neither sees them nor overwrites them.
const shape = z.object({
const shape = z.looseObject({
debug: z.boolean().catch(false),
})
+2 -2
View File
@@ -16,7 +16,7 @@ const dict = {
'Your API key from ppq.ai (Settings → API Keys). Leave blank to keep the key already saved, or to set one later from the Status Page.': 9,
'A PPQ.AI key starts with "sk-".': 10,
'Verbose Logging': 11,
'Log every request the proxy handles. Useful for troubleshooting.': 12,
'Logs the model for accepted chat requests and OpenAI stream errors. Error messages may include sensitive content, even when Verbose Logging is off.': 12,
'Configure PPQ API Key': 13,
'Set the PPQ.AI API key the proxy uses to authenticate. Requests are billed to this key.': 14,
// init/taskConfigureApiKey.ts
@@ -34,4 +34,4 @@ const dict = {
*/
export type I18nKey = keyof typeof dict
export type LangDict = Record<(typeof dict)[I18nKey], string>
export default dict
export default dict
+5 -5
View File
@@ -14,7 +14,7 @@ export default {
9: 'Tu clave API de ppq.ai (Ajustes → Claves API). Déjalo en blanco para conservar la clave ya guardada, o para configurar una más tarde desde la Página de estado.',
10: 'Una clave de PPQ.AI empieza por «sk-».',
11: 'Registro detallado',
12: 'Registra cada solicitud que maneja el proxy. Útil para diagnosticar problemas.',
12: 'Registra el modelo de las solicitudes de chat aceptadas y los errores de streaming de OpenAI. Los mensajes de error pueden incluir contenido sensible, incluso cuando el Registro detallado está desactivado.',
13: 'Configurar clave API de PPQ',
14: 'Establece la clave API de PPQ.AI que el proxy usa para autenticarse. Las solicitudes se facturan a esta clave.',
15: 'Añade aquí tu clave API de PPQ.AI, o inicia el servicio y guárdala en la Página de estado',
@@ -37,7 +37,7 @@ export default {
9: 'Dein API-Schlüssel von ppq.ai (Einstellungen → API-Schlüssel). Leer lassen, um den bereits gespeicherten Schlüssel zu behalten oder später auf der Statusseite einen festzulegen.',
10: 'Ein PPQ.AI-Schlüssel beginnt mit „sk-“.',
11: 'Ausführliche Protokollierung',
12: 'Protokolliert jede Anfrage, die der Proxy verarbeitet. Nützlich zur Fehlersuche.',
12: 'Protokolliert das Modell akzeptierter Chat-Anfragen und OpenAI-Streamingfehler. Fehlermeldungen können sensible Inhalte enthalten, auch wenn die Ausführliche Protokollierung deaktiviert ist.',
13: 'PPQ-API-Schlüssel konfigurieren',
14: 'Lege den PPQ.AI-API-Schlüssel fest, mit dem sich der Proxy authentifiziert. Anfragen werden diesem Schlüssel in Rechnung gestellt.',
15: 'Füge deinen PPQ.AI-API-Schlüssel hier hinzu, oder starte den Dienst und speichere ihn auf der Statusseite',
@@ -60,7 +60,7 @@ export default {
9: 'Twój klucz API z ppq.ai (Ustawienia → Klucze API). Pozostaw puste, aby zachować już zapisany klucz lub ustawić go później na Stronie stanu.',
10: 'Klucz PPQ.AI zaczyna się od „sk-”.',
11: 'Szczegółowe logowanie',
12: 'Rejestruje każde żądanie obsługiwane przez proxy. Przydatne przy rozwiązywaniu problemów.',
12: 'Rejestruje model zaakceptowanych żądań czatu i błędy strumieniowania OpenAI. Komunikaty błędów mogą zawierać poufne treści, nawet gdy Szczegółowe logowanie jest wyłączone.',
13: 'Skonfiguruj klucz API PPQ',
14: 'Ustaw klucz API PPQ.AI, którym proxy się uwierzytelnia. Żądania są rozliczane na ten klucz.',
15: 'Dodaj tutaj swój klucz API PPQ.AI albo uruchom usługę i zapisz go na Stronie stanu',
@@ -83,7 +83,7 @@ export default {
9: "Votre clé API de ppq.ai (Paramètres → Clés API). Laissez vide pour conserver la clé déjà enregistrée, ou pour en définir une plus tard depuis la Page d'état.",
10: 'Une clé PPQ.AI commence par « sk- ».',
11: 'Journalisation détaillée',
12: 'Journalise chaque requête traitée par le proxy. Utile pour le dépannage.',
12: "Journalise le modèle des requêtes de chat acceptées et les erreurs de streaming OpenAI. Les messages d'erreur peuvent inclure du contenu sensible, même lorsque la Journalisation détaillée est désactivée.",
13: 'Configurer la clé API PPQ',
14: "Définissez la clé API PPQ.AI avec laquelle le proxy s'authentifie. Les requêtes sont facturées sur cette clé.",
15: "Ajoutez ici votre clé API PPQ.AI, ou démarrez le service et enregistrez-la sur la Page d'état",
@@ -93,4 +93,4 @@ export default {
19: "Collez cette URL dans Open WebUI (Admin → Connections → OpenAI API, champ URL), enregistrez, puis ajoutez les identifiants de modèles private/ affichés sur la Page d'état. Cette adresse ne fonctionne que depuis des services sur ce même serveur — elle n'est pas accessible depuis votre navigateur.",
20: "Impossible de résoudre l'adresse de service à service de ce package.",
},
} satisfies Record<string, LangDict>
} satisfies Record<string, LangDict>
+2 -1
View File
@@ -8,4 +8,5 @@ export { actions } from './actions'
import { buildManifest } from '@start9labs/start-sdk'
import { manifest as sdkManifest } from './manifest'
import { versionGraph } from './versions'
export const manifest = buildManifest(versionGraph, sdkManifest)
import { dependencies } from './dependencies'
export const manifest = buildManifest(versionGraph, sdkManifest, dependencies)
+2 -2
View File
@@ -1,5 +1,5 @@
import { sdk } from '../sdk'
import { setDependencies } from '../dependencies'
import { dependencies } from '../dependencies'
import { setInterfaces } from '../interfaces'
import { versionGraph } from '../versions'
import { actions } from '../actions'
@@ -10,8 +10,8 @@ export const init = sdk.setupInit(
restoreInit,
versionGraph,
setInterfaces,
setDependencies,
actions,
dependencies,
taskConfigureApiKey,
)
+16 -19
View File
@@ -32,24 +32,21 @@ export const main = sdk.setupMain(async ({ effects }) => {
// dials). Resolved reactively so an address added later is picked up on the
// next restart.
const servedHosts = await sdk.host
.getOwn(
effects,
apiHostId,
(host) =>
host
? utils
.filledAddress(host, {
hostId: apiHostId,
internalPort: apiPort,
username: null,
scheme: null,
sslScheme: null,
suffix: '',
})
.matchesAny([{ visibility: 'private' }, { visibility: 'public' }])
.filter({ exclude: { kind: ['localhost', 'link-local'] } })
.hostnames.map((h) => h.hostname)
: [],
.getOwn(effects, apiHostId, (host) =>
host
? utils
.filledAddress(host, {
hostId: apiHostId,
internalPort: apiPort,
username: null,
scheme: null,
sslScheme: null,
suffix: '',
})
.matchesAny([{ visibility: 'private' }, { visibility: 'public' }])
.filter({ exclude: { kind: ['localhost', 'link-local'] } })
.hostnames.map((h) => h.hostname)
: [],
)
.const()
@@ -115,4 +112,4 @@ export const main = sdk.setupMain(async ({ effects }) => {
},
requires: ['chown'],
})
})
})
-1
View File
@@ -22,5 +22,4 @@ export const manifest = setupManifest({
arch: ['x86_64', 'aarch64'],
},
},
dependencies: {},
})
+1 -1
View File
@@ -10,4 +10,4 @@ export const apiHostId = 'main'
// Upstream's PPQ_DATA_DIR inside the container: where it persists the API key
// saved from the status page.
export const dataDir = '/data'
export const dataDir = '/data'
+7 -7
View File
@@ -2,21 +2,21 @@ import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'
export const current = VersionInfo.of({
// Tracks upstream ppq-private-mode-proxy (package.json version).
version: '0.6.0:4',
version: '0.6.0:5',
releaseNotes: {
en_US:
'DNS-rebinding hardening: PPQ_ALLOWED_HOSTS is now set automatically from the actual hostnames StartOS serves this API on (addresses, .local, domains, plus bridge and loopback), so a hostile page can no longer reach the proxy as same-origin or overwrite the stored key. Configure PPQ API Key now only writes the API key when it actually changed (no unnecessary restart).',
'Rebased onto upstream start-sdk 3.0.3. The Verbose Logging description now states that error messages may include sensitive content, even when verbose logging is off.',
es_ES:
'Refuerzo contra DNS-rebinding: PPQ_ALLOWED_HOSTS ahora se establece automáticamente a partir de los hostnames reales que StartOS sirve en esta API (direcciones, .local, dominios, más bridge y loopback), de modo que una página hostil ya no puede llegar al proxy como mismo-origen ni sobrescribir la clave guardada. Configure PPQ API Key ahora solo escribe la clave API cuando realmente cambia (sin reinicio innecesario).',
'Actualizado a start-sdk 3.0.3. La descripción de Registro detallado ahora indica que los mensajes de error pueden incluir contenido sensible, incluso con el registro desactivado.',
de_DE:
'DNS-Rebinding-Härtung: PPQ_ALLOWED_HOSTS wird jetzt automatisch aus den tatsächlichen Hostnamen gesetzt, die StartOS für diese API bedient (Adressen, .local, Domains sowie Bridge und Loopback), sodass eine bösartige Seite den Proxy nicht mehr als Same-Origin erreichen oder den gespeicherten Schlüssel überschreiben kann. „Configure PPQ API Key“ schreibt den API-Schlüssel jetzt nur noch, wenn er sich tatsächlich geändert hat (kein unnötiger Neustart).',
'Auf start-sdk 3.0.3 umgestellt. Die Beschreibung von „Ausführliche Protokollierung“ weist nun darauf hin, dass Fehlermeldungen sensiblen Inhalt enthalten können, auch wenn die Protokollierung aus ist.',
pl_PL:
'Wzmocnienie przed atakiem DNS-rebinding: PPQ_ALLOWED_HOSTS jest teraz ustawiane automatycznie na podstawie rzeczywistych nazw hostów, które StartOS serwuje dla tego API (adresy, .local, domeny oraz most i loopback), dzięki czemu wroga strona nie może już dotrzeć do proxy jako same-origin ani nadpisać zapisanego klucza. Akcja Configure PPQ API Key zapisuje teraz klucz API tylko wtedy, gdy faktycznie się zmienił (bez zbędnego restartu).',
'Przejście na start-sdk 3.0.3. Opis opcji Szczegółowe logowanie informuje teraz, że komunikaty błędów mogą zawierać poufne treści, nawet gdy logowanie jest wyłączone.',
fr_FR:
"Durcissement anti DNS-rebinding : PPQ_ALLOWED_HOSTS est désormais défini automatiquement à partir des noms d'hôte réels servis par StartOS pour cette API (adresses, .local, domaines, pont et loopback), de sorte qu'une page hostile ne peut plus atteindre le proxy en same-origin ni écraser la clé enregistrée. L'action Configure PPQ API Key n'écrit la clé API que lorsqu'elle change réellement (pas de redémarrage inutile).",
"Passage à start-sdk 3.0.3. La description de la Journalisation détaillée indique désormais que les messages d'erreur peuvent contenir du contenu sensible, même lorsque la journalisation est désactivée.",
},
migrations: {
up: async ({ effects }) => {},
down: IMPOSSIBLE,
},
})
})