feat: Add API endpoints and UI for managing application settings, deploy servers, and Git servers.
This commit is contained in:
parent
7a1d90f96d
commit
deadc684c7
@ -6,10 +6,10 @@ TELEGRAM_BOT_TOKEN=your-telegram-bot-token
|
||||
TELEGRAM_CHAT_ID=your-chat-id
|
||||
|
||||
# ─── OpenClaw ──────────────────────────────────────────────
|
||||
# Path on the HOST (where openclaw workspace is stored)
|
||||
OPENCLAW_WORKSPACE=/home/openclaw/.openclaw/workspace
|
||||
# Path in the CONTAINER (keep as is)
|
||||
FOXY_WORKSPACE=/home/foxy/.openclaw/workspace
|
||||
# Root path on the HOST (contains agents/, workspace/, config.json)
|
||||
OPENCLAW_HOME=/home/openclaw/.openclaw
|
||||
# Root path in the CONTAINER (keep as is)
|
||||
FOXY_HOME=/home/foxy/.openclaw
|
||||
|
||||
# ─── Gitea ─────────────────────────────────────────────────
|
||||
GITEA_SERVER=https://gitea.your.server
|
||||
|
||||
@ -16,6 +16,7 @@ class Settings(BaseSettings):
|
||||
TELEGRAM_CHAT_ID: str = ""
|
||||
|
||||
# OpenClaw
|
||||
FOXY_HOME: str = "/home/foxy/.openclaw"
|
||||
FOXY_WORKSPACE: str = "/home/foxy/.openclaw/workspace"
|
||||
|
||||
# Gitea
|
||||
|
||||
@ -27,6 +27,7 @@ router = APIRouter(prefix="/api/config", tags=["config"])
|
||||
async def get_config():
|
||||
"""Get current configuration (secrets masked)."""
|
||||
return ConfigResponse(
|
||||
FOXY_HOME=settings.FOXY_HOME,
|
||||
FOXY_WORKSPACE=settings.FOXY_WORKSPACE,
|
||||
GITEA_SERVER=settings.GITEA_SERVER,
|
||||
DEPLOYMENT_SERVER=settings.DEPLOYMENT_SERVER,
|
||||
|
||||
@ -218,6 +218,7 @@ class AgentStatus(BaseModel):
|
||||
|
||||
|
||||
class ConfigResponse(BaseModel):
|
||||
FOXY_HOME: str
|
||||
FOXY_WORKSPACE: str
|
||||
GITEA_SERVER: str
|
||||
DEPLOYMENT_SERVER: str
|
||||
@ -231,6 +232,7 @@ class ConfigResponse(BaseModel):
|
||||
|
||||
|
||||
class ConfigUpdate(BaseModel):
|
||||
FOXY_HOME: Optional[str] = None
|
||||
FOXY_WORKSPACE: Optional[str] = None
|
||||
GITEA_SERVER: Optional[str] = None
|
||||
DEPLOYMENT_SERVER: Optional[str] = None
|
||||
|
||||
@ -24,7 +24,7 @@ services:
|
||||
- backend/.env
|
||||
volumes:
|
||||
- foxy-data:/app/data
|
||||
- "${OPENCLAW_WORKSPACE:-/home/openclaw/.openclaw/workspace}:${FOXY_WORKSPACE:-/home/foxy/.openclaw/workspace}"
|
||||
- "${OPENCLAW_HOME:-/home/openclaw/.openclaw}:${FOXY_HOME:-/home/foxy/.openclaw}"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:7000/api/health"]
|
||||
interval: 30s
|
||||
|
||||
@ -136,6 +136,7 @@ export interface GitServer {
|
||||
}
|
||||
|
||||
export interface AppConfig {
|
||||
FOXY_HOME: string;
|
||||
FOXY_WORKSPACE: string;
|
||||
GITEA_SERVER: string;
|
||||
DEPLOYMENT_SERVER: string;
|
||||
|
||||
@ -19,6 +19,7 @@ export default function SettingsPage() {
|
||||
setMessage('');
|
||||
try {
|
||||
await api.updateConfig({
|
||||
FOXY_HOME: config.FOXY_HOME,
|
||||
FOXY_WORKSPACE: config.FOXY_WORKSPACE,
|
||||
GITEA_SERVER: config.GITEA_SERVER,
|
||||
DEPLOYMENT_SERVER: config.DEPLOYMENT_SERVER,
|
||||
@ -37,6 +38,7 @@ export default function SettingsPage() {
|
||||
}
|
||||
|
||||
const fields: { key: keyof AppConfig; label: string; icon: string; editable: boolean; secret?: boolean }[] = [
|
||||
{ key: 'FOXY_HOME', label: 'Home OpenClaw (Conteneur)', icon: '🏠', editable: true },
|
||||
{ key: 'FOXY_WORKSPACE', label: 'Workspace Foxy (Conteneur)', icon: '📁', editable: true },
|
||||
{ key: 'GITEA_SERVER', label: 'Serveur Gitea', icon: '🌐', editable: true },
|
||||
{ key: 'GITEA_OPENCLAW_TOKEN', label: 'Token Gitea', icon: '🔑', editable: false, secret: true },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user