Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## How the upstream version is pulled
- dockerTag in `startos/manifest/index.ts`: `ghcr.io/opensecretcloud/maple-proxy:<version>`

> Fork of islandbitcoin/maple-proxy-startos.
68 changes: 55 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,22 @@ Configuration is stored in `store.json` on the `main` volume and read by the map

## Actions (StartOS UI)

| Action | Description | Allowed States |
| ---------------- | ------------------------------- | -------------- |
| Configure | Set API key and backend URL | Any |
| Proxy Properties | Display API and UI port numbers | Any |
### Configure

| Property | Value |
|----------|-------|
| ID | `configure` |
| Availability | Any status |
| Visibility | Enabled |

**Inputs:**

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| Backend URL | Text | Yes | `https://enclave.trymaple.ai` | Maple/OpenSecret backend URL |
| API Key | Text (masked) | No | _(empty)_ | Your Maple API key; if empty, clients must provide their own via Authorization header |

**Output:** None (service restarts to apply new configuration)

---

Expand All @@ -122,20 +134,18 @@ The `main` volume is included in backups, preserving your `store.json` configura

## Health Checks

| Check | Daemon | Method | Grace Period |
| ------------- | --------- | --------------------- | ------------ |
| API Interface | `primary` | Port listening (8080) | 10s |
| Web Interface | `ui` | Port listening (80) | — |
| Check | Daemon | Method | Display |
| ------------ | -------------- | --------------------- | -------------- |
| Proxy Server | `maple-proxy` | Port listening (8080) | Proxy Server |
| Web UI | `ui` | Port listening (80) | Web UI |

---

## Limitations and Differences

| Area | Upstream | StartOS |
| ------------- | --------------------- | --------------------------------- |
| Configuration | Environment variables | `store.json` via Configure action |
| Web UI | Not included | Bundled nginx chat interface |
| Networking | Direct port binding | StartOS multi-host interfaces |
1. **Configuration via action only** — upstream uses environment variables directly; on StartOS, all configuration is managed through `store.json` via the Configure action
2. **Bundled web UI** — StartOS adds a custom nginx chat interface not included in the upstream project
3. **StartOS networking** — uses StartOS multi-host interfaces instead of direct port binding

---

Expand All @@ -161,3 +171,35 @@ make x86 # x86_64 only
```

Requires [start-cli](https://github.com/Start9Labs/start-os) v0.4.0+ and Docker.

---

## Quick Reference for AI Consumers

```yaml
package_id: maple-proxy
images:
maple-proxy: ghcr.io/opensecretcloud/maple-proxy (upstream, unmodified)
maple-ui: custom nginx build (assets/ui/)
architectures: [x86_64, aarch64]
volumes:
main: /data
ports:
api: 8080
ui: 80
dependencies: none
startos_managed_env_vars:
- MAPLE_HOST
- MAPLE_PORT
- MAPLE_ENABLE_CORS
- RUST_LOG
- MAPLE_BACKEND_URL (user-configurable via action)
- MAPLE_API_KEY (user-configurable via action)
actions:
- configure
health_checks:
- port_listening: 8080 (maple-proxy)
- port_listening: 80 (maple-ui)
backup_volumes:
- main
```
77 changes: 70 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"check": "tsc --noEmit"
},
"dependencies": {
"@start9labs/start-sdk": "^0.4.0-beta.58"
"@start9labs/start-sdk": "1.0.0"
},
"devDependencies": {
"@types/node": "^22.19.0",
Expand Down
2 changes: 1 addition & 1 deletion startos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export { init, uninit } from './init'
export { actions } from './actions'
import { buildManifest } from '@start9labs/start-sdk'
import { manifest as sdkManifest } from './manifest'
import { versionGraph } from './install/versionGraph'
import { versionGraph } from './versions'
export const manifest = buildManifest(versionGraph, sdkManifest)
14 changes: 8 additions & 6 deletions startos/init/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { sdk } from '../sdk'
import { setDependencies } from '../dependencies'
import { setInterfaces } from '../interfaces'
import { versionGraph } from '../install/versionGraph'
import { actions } from '../actions'
import { restoreInit } from '../backups'
import { initializeService } from './initializeService'
import { setDependencies } from '../dependencies'
import { setInterfaces } from '../interfaces'
import { sdk } from '../sdk'
import { versionGraph } from '../versions'
import { seedFiles } from './seedFiles'
import { taskConfigure } from './taskConfigure'

export const init = sdk.setupInit(
initializeService,
restoreInit,
versionGraph,
seedFiles,
setInterfaces,
setDependencies,
actions,
taskConfigure,
)

export const uninit = sdk.setupUninit(versionGraph)
16 changes: 0 additions & 16 deletions startos/init/initializeService.ts

This file was deleted.

6 changes: 6 additions & 0 deletions startos/init/seedFiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { storeJson } from '../fileModels/store.json'
import { sdk } from '../sdk'

export const seedFiles = sdk.setupOnInit(async (effects) => {
await storeJson.merge(effects, {})
})
11 changes: 11 additions & 0 deletions startos/init/taskConfigure.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configure } from '../actions/configure'
import { i18n } from '../i18n'
import { sdk } from '../sdk'

export const taskConfigure = sdk.setupOnInit(async (effects, kind) => {
if (kind === 'install') {
await sdk.action.createOwnTask(effects, configure, 'important', {
reason: i18n('Set your Maple API key'),
})
}
})
2 changes: 0 additions & 2 deletions startos/install/versions/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions startos/install/versions/v_0_1_7_0_4_b0.ts

This file was deleted.

2 changes: 1 addition & 1 deletion startos/manifest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const manifest = setupManifest({
title: 'Maple Proxy',
license: 'MIT',
packageRepo:
'https://github.com/islandbitcoin/maple-proxy-startos/tree/update/040',
'https://github.com/islandbitcoin/maple-proxy-startos',
upstreamRepo: 'https://github.com/OpenSecretCloud/maple-proxy',
marketingUrl: 'https://trymaple.ai/',
donationUrl: null,
Expand Down
6 changes: 3 additions & 3 deletions startos/install/versionGraph.ts → startos/versions/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { VersionGraph } from '@start9labs/start-sdk'
import { current, other } from './versions'
import { v_0_1_7_4 } from './v0.1.7.4'

export const versionGraph = VersionGraph.of({
current,
other,
current: v_0_1_7_4,
other: [],
})
16 changes: 16 additions & 0 deletions startos/versions/v0.1.7.4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { VersionInfo } from '@start9labs/start-sdk'

export const v_0_1_7_4 = VersionInfo.of({
version: '0.1.7:4',
releaseNotes: {
en_US: 'Update to upstream v0.1.7 (security patches, streaming fix)',
es_ES: 'Actualización a upstream v0.1.7 (parches de seguridad, corrección de streaming)',
de_DE: 'Update auf Upstream v0.1.7 (Sicherheitspatches, Streaming-Fix)',
pl_PL: 'Aktualizacja do upstream v0.1.7 (łatki bezpieczeństwa, naprawa streamingu)',
fr_FR: 'Mise à jour vers upstream v0.1.7 (correctifs de sécurité, correction du streaming)',
},
migrations: {
up: async ({ effects }) => {},
down: async ({ effects }) => {},
},
})
Loading