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
|
TELEGRAM_CHAT_ID=your-chat-id
|
||||||
|
|
||||||
# ─── OpenClaw ──────────────────────────────────────────────
|
# ─── OpenClaw ──────────────────────────────────────────────
|
||||||
# Path on the HOST (where openclaw workspace is stored)
|
# Root path on the HOST (contains agents/, workspace/, config.json)
|
||||||
OPENCLAW_WORKSPACE=/home/openclaw/.openclaw/workspace
|
OPENCLAW_HOME=/home/openclaw/.openclaw
|
||||||
# Path in the CONTAINER (keep as is)
|
# Root path in the CONTAINER (keep as is)
|
||||||
FOXY_WORKSPACE=/home/foxy/.openclaw/workspace
|
FOXY_HOME=/home/foxy/.openclaw
|
||||||
|
|
||||||
# ─── Gitea ─────────────────────────────────────────────────
|
# ─── Gitea ─────────────────────────────────────────────────
|
||||||
GITEA_SERVER=https://gitea.your.server
|
GITEA_SERVER=https://gitea.your.server
|
||||||
|
|||||||
@ -16,6 +16,7 @@ class Settings(BaseSettings):
|
|||||||
TELEGRAM_CHAT_ID: str = ""
|
TELEGRAM_CHAT_ID: str = ""
|
||||||
|
|
||||||
# OpenClaw
|
# OpenClaw
|
||||||
|
FOXY_HOME: str = "/home/foxy/.openclaw"
|
||||||
FOXY_WORKSPACE: str = "/home/foxy/.openclaw/workspace"
|
FOXY_WORKSPACE: str = "/home/foxy/.openclaw/workspace"
|
||||||
|
|
||||||
# Gitea
|
# Gitea
|
||||||
|
|||||||
@ -27,6 +27,7 @@ router = APIRouter(prefix="/api/config", tags=["config"])
|
|||||||
async def get_config():
|
async def get_config():
|
||||||
"""Get current configuration (secrets masked)."""
|
"""Get current configuration (secrets masked)."""
|
||||||
return ConfigResponse(
|
return ConfigResponse(
|
||||||
|
FOXY_HOME=settings.FOXY_HOME,
|
||||||
FOXY_WORKSPACE=settings.FOXY_WORKSPACE,
|
FOXY_WORKSPACE=settings.FOXY_WORKSPACE,
|
||||||
GITEA_SERVER=settings.GITEA_SERVER,
|
GITEA_SERVER=settings.GITEA_SERVER,
|
||||||
DEPLOYMENT_SERVER=settings.DEPLOYMENT_SERVER,
|
DEPLOYMENT_SERVER=settings.DEPLOYMENT_SERVER,
|
||||||
|
|||||||
@ -218,6 +218,7 @@ class AgentStatus(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class ConfigResponse(BaseModel):
|
class ConfigResponse(BaseModel):
|
||||||
|
FOXY_HOME: str
|
||||||
FOXY_WORKSPACE: str
|
FOXY_WORKSPACE: str
|
||||||
GITEA_SERVER: str
|
GITEA_SERVER: str
|
||||||
DEPLOYMENT_SERVER: str
|
DEPLOYMENT_SERVER: str
|
||||||
@ -231,6 +232,7 @@ class ConfigResponse(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class ConfigUpdate(BaseModel):
|
class ConfigUpdate(BaseModel):
|
||||||
|
FOXY_HOME: Optional[str] = None
|
||||||
FOXY_WORKSPACE: Optional[str] = None
|
FOXY_WORKSPACE: Optional[str] = None
|
||||||
GITEA_SERVER: Optional[str] = None
|
GITEA_SERVER: Optional[str] = None
|
||||||
DEPLOYMENT_SERVER: Optional[str] = None
|
DEPLOYMENT_SERVER: Optional[str] = None
|
||||||
|
|||||||
@ -24,7 +24,7 @@ services:
|
|||||||
- backend/.env
|
- backend/.env
|
||||||
volumes:
|
volumes:
|
||||||
- foxy-data:/app/data
|
- 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:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:7000/api/health"]
|
test: ["CMD", "curl", "-f", "http://localhost:7000/api/health"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
@ -136,6 +136,7 @@ export interface GitServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AppConfig {
|
export interface AppConfig {
|
||||||
|
FOXY_HOME: string;
|
||||||
FOXY_WORKSPACE: string;
|
FOXY_WORKSPACE: string;
|
||||||
GITEA_SERVER: string;
|
GITEA_SERVER: string;
|
||||||
DEPLOYMENT_SERVER: string;
|
DEPLOYMENT_SERVER: string;
|
||||||
|
|||||||
@ -19,6 +19,7 @@ export default function SettingsPage() {
|
|||||||
setMessage('');
|
setMessage('');
|
||||||
try {
|
try {
|
||||||
await api.updateConfig({
|
await api.updateConfig({
|
||||||
|
FOXY_HOME: config.FOXY_HOME,
|
||||||
FOXY_WORKSPACE: config.FOXY_WORKSPACE,
|
FOXY_WORKSPACE: config.FOXY_WORKSPACE,
|
||||||
GITEA_SERVER: config.GITEA_SERVER,
|
GITEA_SERVER: config.GITEA_SERVER,
|
||||||
DEPLOYMENT_SERVER: config.DEPLOYMENT_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 }[] = [
|
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: 'FOXY_WORKSPACE', label: 'Workspace Foxy (Conteneur)', icon: '📁', editable: true },
|
||||||
{ key: 'GITEA_SERVER', label: 'Serveur Gitea', icon: '🌐', editable: true },
|
{ key: 'GITEA_SERVER', label: 'Serveur Gitea', icon: '🌐', editable: true },
|
||||||
{ key: 'GITEA_OPENCLAW_TOKEN', label: 'Token Gitea', icon: '🔑', editable: false, secret: true },
|
{ key: 'GITEA_OPENCLAW_TOKEN', label: 'Token Gitea', icon: '🔑', editable: false, secret: true },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user