Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ SERVER_SECRET_KEY=your_server_private_key_here
# OPTIONAL CONFIGURATION
# =============================================================================

# =============================================================================
# CONFIG MANAGER AUTHENTICATION
# =============================================================================

# Credentials for the web-based config manager (port 3000)
# If not set, a random password will be generated on startup and printed to the console
# MANAGER_USER=admin
# MANAGER_PASSWORD=your_secure_password_here

# Default perspective pubkey for trust calculations (hex format)
# Default: Gigi's pubkey (6e468422dfb74a5738702a8823b9b28168abab8655faacb6853cd0ee15deee93)
DEFAULT_SOURCE_PUBKEY=6e468422dfb74a5738702a8823b9b28168abab8655faacb6853cd0ee15deee93
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ services:
- ./plugins:/usr/src/app/plugins

ports:
- 3000:3000
# Bind to localhost by default to prevent accidental public exposure
- 127.0.0.1:3000:3000

# Restart policy for production reliability
restart: unless-stopped
Expand Down
14 changes: 14 additions & 0 deletions manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/** Entry point for the config and process manager */
import { startServer } from "process-pastry";
import { parseArgs } from "util";
import { randomBytes } from "crypto";

import configApp from "./config-ui/index.html";

Expand All @@ -22,13 +23,26 @@ const { values } = parseArgs({
allowPositionals: true,
});

const managerUser = process.env.MANAGER_USER || "admin";
let managerPassword = process.env.MANAGER_PASSWORD;

if (!managerPassword) {
managerPassword = randomBytes(16).toString("hex");
console.log(`\n⚠️ WARNING: No MANAGER_PASSWORD set in environment.`);
console.log(`🔒 Generated temporary password for config manager:`);
console.log(` User: ${managerUser}`);
console.log(` Password: ${managerPassword}\n`);
}

// Start process-pastry server with the bundled HTML
startServer({
port: 3000,
envPath: values.env || ".env",
command: values.command
? values.command.split(" ")
: ["bun", "run", "src/mcp/server.ts"],
authUser: managerUser,
authPassword: managerPassword,
// Expose existing environment variables to the config UI
expose: [
"SERVER_SECRET_KEY",
Expand Down
Loading