### Full Configuration Example (config.example.yaml) Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/configuration.mdx This example displays all available configuration options for DiscoPanel in YAML format. Ensure your configuration file is placed in one of the recognized locations or specified via the -config flag. ```yaml listen_address: "0.0.0.0" port: 8080 log_level: "info" log_format: "text" # Database configuration database: type: "sqlite" connection_string: "data/discopanel.db" # Authentication configuration auth: method: "jwt" jwt_secret: "super-secret-key" jwt_expiry: "1h" # API configuration api: rate_limit: 100 rate_limit_window: "1m" # UI configuration ui: theme: "dark" logo_url: "/logo.png" # Other settings feature_flags: new_dashboard: true experimental_feature: false # Server-specific configuration (example) server: name: "My Minecraft Server" motd: "Welcome to my server!" max_players: 20 jvm_flags: - "-Xmx4G" - "-Xms2G" ``` -------------------------------- ### Run Documentation Locally Source: https://github.com/nickheyer/discopanel/blob/main/README.md Start the development server to view documentation changes at http://localhost:4321. ```bash make dev-docs ``` -------------------------------- ### DiscoPanel Core Configuration Example Source: https://context7.com/nickheyer/discopanel/llms.txt This is an example of the core DiscoPanel configuration file in YAML format. It includes settings for the web server, Docker connection, storage paths, authentication, proxy, modules, and default Minecraft server properties. ```yaml # config.yaml - Core DiscoPanel configuration # Web server settings server: port: "8080" host: "0.0.0.0" read_timeout: 15 write_timeout: 15 # Docker connection docker: host: "unix:///var/run/docker.sock" network_name: "discopanel-network" sync_interval: 5 # Data storage paths storage: data_dir: "./data" backup_dir: "./backups" temp_dir: "./tmp" max_upload_size: 524288000 # 500MB # Authentication auth: session_timeout: 86400 # 24 hours anonymous_access: false local: enabled: true allow_registration: false oidc: enabled: false issuer_uri: "https://auth.example.com" client_id: "discopanel" client_secret: "your-secret" redirect_url: "http://localhost:8080/api/v1/auth/oidc/callback" scopes: ["openid", "profile", "email"] role_claim: "groups" # Minecraft proxy - CRITICAL for hostname routing proxy: enabled: true base_url: "mc.example.com" listen_port: 25565 port_range_min: 25565 port_range_max: 25665 # Module system module: enabled: true port_range_min: 8100 port_range_max: 8199 # Default Minecraft server settings minecraft: global_config: memory: "4G" enableRcon: true useAikarFlags: true maxPlayers: 20 difficulty: "normal" mode: "survival" onlineMode: true ``` -------------------------------- ### Run Development Server Source: https://github.com/nickheyer/discopanel/blob/main/web/discopanel/README.md Start the development server to preview changes, optionally opening the browser automatically. ```sh npm run dev # or start the server and open the app in a new browser tab npm run dev -- --open ``` -------------------------------- ### Run the DiscoPanel Binary Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/build-from-source.mdx Starts the application using either the default configuration or a specified file path. ```bash # Using default config (./config.yaml if it exists, otherwise defaults) ./discopanel # Or point to a specific config file ./discopanel -config /path/to/config.yaml ``` -------------------------------- ### Install DiscoPanel on Proxmox Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/proxmox.mdx Execute this command in the Proxmox host shell to launch the interactive installation wizard. ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/discopanel.sh)" ``` -------------------------------- ### Start Authelia Stack Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/guides/oidc/authelia.mdx Commands to navigate to the Authelia directory and launch the Docker Compose stack. ```bash cd oidc/authelia docker compose up -d ``` -------------------------------- ### Configure Storage Directory Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/build-from-source.mdx Example YAML configuration for setting the data storage directory. ```yaml storage: data_dir: /your/path # Default: ./data (relative to working directory) ``` -------------------------------- ### Start Service Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/docker-compose.mdx Command to initialize and run the service in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Start Docker Compose Stack Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/guides/oidc/discord.mdx Navigate to the Discord OIDC directory and start the Docker Compose stack in detached mode. ```bash cd oidc/discord docker compose up -d ``` -------------------------------- ### Development Workflow for DiscoPanel Source: https://github.com/nickheyer/discopanel/blob/main/README.md For development, install `make` and use `make gen` followed by `make dev` after cloning the repository to streamline the build and run process. ```bash make gen && make dev ``` -------------------------------- ### Start Keycloak Docker stack Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/guides/oidc/keycloak.mdx Commands to navigate to the OIDC directory and initialize the Keycloak container stack. ```bash cd oidc/keycloak docker compose up -d ``` -------------------------------- ### Manage Server Lifecycle Source: https://context7.com/nickheyer/discopanel/llms.txt Control server container states including starting, stopping, restarting, and recreating instances. ```bash # Start a stopped server curl -X POST http://localhost:8080/discopanel.v1.ServerService/StartServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "srv_abc123"}' # Stop a running server curl -X POST http://localhost:8080/discopanel.v1.ServerService/StopServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "srv_abc123"}' # Restart (stop + start) a server curl -X POST http://localhost:8080/discopanel.v1.ServerService/RestartServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "srv_abc123"}' # Recreate container from scratch (destroys and rebuilds) curl -X POST http://localhost:8080/discopanel.v1.ServerService/RecreateServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "srv_abc123"}' ``` -------------------------------- ### Environment Variable Configuration Example Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/configuration.mdx Demonstrates how nested YAML configuration options translate to environment variables. Use DISCOPANEL_ prefix for environment variables, with underscores separating nested keys. ```yaml server: port: "8080" ``` ```bash DISCOPANEL_SERVER_PORT="8080" ``` -------------------------------- ### Start DiscoPanel with Google OIDC Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/guides/oidc/google.mdx Run the Docker Compose stack after pasting your Google OAuth Client ID and Client Secret into the compose file. Ensure you are in the correct directory before executing. ```bash cd oidc/google docker compose up -d ``` -------------------------------- ### Server Lifecycle Management Source: https://context7.com/nickheyer/discopanel/llms.txt Manage the lifecycle of a server instance, including starting, stopping, restarting, and recreating the server container. ```APIDOC ## Server Lifecycle Management ### Description Control server container lifecycle with start, stop, restart, and recreate operations. ### Method POST ### Endpoint /discopanel.v1.ServerService/StartServer ### Parameters #### Request Body - **id** (string) - Required - The ID of the server to start. ### Request Example ```json { "id": "srv_abc123" } ``` --- ### Method POST ### Endpoint /discopanel.v1.ServerService/StopServer ### Parameters #### Request Body - **id** (string) - Required - The ID of the server to stop. ### Request Example ```json { "id": "srv_abc123" } ``` --- ### Method POST ### Endpoint /discopanel.v1.ServerService/RestartServer ### Parameters #### Request Body - **id** (string) - Required - The ID of the server to restart. ### Request Example ```json { "id": "srv_abc123" } ``` --- ### Method POST ### Endpoint /discopanel.v1.ServerService/RecreateServer ### Description Recreates the server container from scratch, which involves destroying and rebuilding it. ### Parameters #### Request Body - **id** (string) - Required - The ID of the server to recreate. ### Request Example ```json { "id": "srv_abc123" } ``` ``` -------------------------------- ### Initialize Chunked File Upload Source: https://context7.com/nickheyer/discopanel/llms.txt Starts a new upload session for large files. Provides essential metadata like filename, total size, and desired chunk size. The response includes a session ID and the total number of chunks. ```bash curl -X POST http://localhost:8080/discopanel.v1.UploadService/InitUpload \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "filename": "modpack.zip", "totalSize": 524288000, "chunkSize": 5242880 }' ``` -------------------------------- ### Build and Preview Production Source: https://github.com/nickheyer/discopanel/blob/main/web/discopanel/README.md Generate a production-ready build and preview the application locally. ```sh npm run build ``` ```sh npm run preview ``` -------------------------------- ### Get Modpack Versions Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieves a list of available versions for a specific modpack. ```bash curl -X POST http://localhost:8080/discopanel.v1.ModpackService/GetModpackVersions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "id": "mp_123", "gameVersion": "1.20.1", "modLoader": "forge" }' # Response: # { # "versions": [ # { # "id": "5247274", # "displayName": "ATM9-1.2.0", # "releaseType": "release", # "fileDate": "2024-01-15T00:00:00Z", # "versionNumber": "1.2.0" # } # ] # } ``` -------------------------------- ### Get Proxy Status Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieve the current status and configuration of the proxy service. ```bash curl -X POST http://localhost:8080/discopanel.v1.ProxyService/GetProxyStatus \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{}' # Response: # { # "enabled": true, # "baseUrl": "mc.example.com", # "listenPorts": [25565], # "listeners": [ # { # "id": "listener_default", # "name": "Default", # "port": 25565, # "enabled": true, # "isDefault": true # } # ], # "listenPort": 25565, # "running": true, # "activeRoutes": 3 # } ``` -------------------------------- ### Build DiscoPanel from Source Source: https://github.com/nickheyer/discopanel/blob/main/README.md Follow these steps to clone the repository, generate RPC code, build the frontend, and compile the backend. Requires Go and NodeJs. ```bash git clone https://github.com/nickheyer/discopanel cd discopanel docker run --rm -v "$(pwd):/workspace" -w /workspace -u "$(id -u):$(id -g)" bufbuild/buf:latest generate cd web/discopanel && npm install && npm run build && cd ../.. go build -o discopanel cmd/discopanel/main.go ./disopanel ``` -------------------------------- ### List Module Templates Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieve available templates for creating module instances. ```bash curl -X POST http://localhost:8080/discopanel.v1.ModuleService/ListModuleTemplates \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "category": "maps" }' # Response: # { # "templates": [ # { # "id": "tpl_bluemap", # "name": "BlueMap", # "description": "3D web-based map viewer", # "type": "MODULE_TEMPLATE_TYPE_BUILTIN", # "dockerImage": "bluemap/bluemap:latest", # "category": "maps", # "icon": "map", # "supportsProxy": true, # "ports": [ # { # "name": "Web UI", # "containerPort": 8100, # "hostPort": 0, # "protocol": "tcp", # "proxyEnabled": true # } # ] # } # ] # } ``` -------------------------------- ### Create Module Instance Source: https://context7.com/nickheyer/discopanel/llms.txt Registers a new module on a server with specific resource limits, port mappings, and environment overrides. ```bash curl -X POST http://localhost:8080/discopanel.v1.ModuleService/CreateModule \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "BlueMap for Survival", "serverId": "srv_abc123", "templateId": "tpl_bluemap", "memory": 512, "autoStart": true, "followServerLifecycle": true, "startImmediately": true, "ports": [ { "name": "Web UI", "containerPort": 8100, "hostPort": 8100, "protocol": "tcp", "proxyEnabled": true } ], "envOverrides": "{\"BLUEMAP_UPDATE_INTERVAL\":\"30\"}", "eventHooks": [ { "event": "MODULE_EVENT_TYPE_SERVER_START", "action": "MODULE_EVENT_ACTION_START", "delaySeconds": 60 } ] }' ``` -------------------------------- ### Create Minecraft Servers Source: https://context7.com/nickheyer/discopanel/llms.txt Create new server instances with specific mod loaders and configurations. ```bash curl -X POST http://localhost:8080/discopanel.v1.ServerService/CreateServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "Creative", "description": "Creative building server", "modLoader": "MOD_LOADER_PAPER", "mcVersion": "1.21.4", "port": 25567, "maxPlayers": 50, "memory": 4096, "autoStart": true, "startImmediately": true, "proxyHostname": "creative", "proxyListenerId": "listener_default", "useBaseUrl": true, "additionalPorts": [ { "name": "Dynmap", "containerPort": 8123, "hostPort": 8123, "protocol": "tcp" } ], "dockerOverrides": { "environment": { "ENABLE_AUTOPAUSE": "true", "AUTOPAUSE_TIMEOUT_EST": "3600" } } }' ``` ```bash curl -X POST http://localhost:8080/discopanel.v1.ServerService/CreateServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "ATM9", "description": "All The Mods 9 server", "modLoader": "MOD_LOADER_AUTO_CURSEFORGE", "mcVersion": "1.20.1", "port": 25568, "maxPlayers": 10, "memory": 8192, "modpackId": "715572", "modpackVersionId": "5247274", "startImmediately": false }' ``` -------------------------------- ### Build DiscoPanel from Source Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/build-from-source.mdx Executes the full build pipeline including protobuf generation, frontend compilation, and Go binary creation. ```bash # Clone the repo git clone https://github.com/nickheyer/discopanel.git cd discopanel # Generate protobuf code (Go + TypeScript) via Docker buf make gen # Install frontend dependencies and build cd web/discopanel && npm install && npm run build && cd ../.. # Build the Go binary with embedded frontend go build -o discopanel cmd/discopanel/main.go ``` -------------------------------- ### Get Server Logs Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieve the logs generated by a server container, with an option to limit the number of log lines returned. ```APIDOC ## POST /discopanel.v1.ServerService/GetServerLogs ### Description Retrieve container logs for a server with optional tail limit. ### Method POST ### Endpoint /discopanel.v1.ServerService/GetServerLogs ### Parameters #### Request Body - **id** (string) - Required - The ID of the server. - **tail** (integer) - Optional - The number of log lines to retrieve from the end of the logs. ### Request Example ```json { "id": "srv_abc123", "tail": 100 } ``` ### Response #### Success Response (200) - **logs** (array) - An array of log entries. - **timestamp** (string) - The timestamp of the log entry. - **message** (string) - The log message content. - **level** (string) - The log level (e.g., "INFO", "ERROR"). - **source** (string) - The source of the log message (e.g., "minecraft"). - **isCommand** (boolean) - Whether the log entry originated from a command. - **isError** (boolean) - Whether the log entry indicates an error. - **total** (integer) - The total number of log lines available (or the limit specified by tail). ### Response Example ```json { "logs": [ { "timestamp": "2024-01-01T12:00:00Z", "message": "[Server] Player joined the game", "level": "INFO", "source": "minecraft", "isCommand": false, "isError": false } ], "total": 100 } ``` ``` -------------------------------- ### Get Permission Matrix Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieves the permission matrix, which can optionally include associated objects. Useful for auditing or understanding effective permissions. ```bash curl -X POST http://localhost:8080/discopanel.v1.RoleService/GetPermissionMatrix \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"includeObjects": true}' ``` -------------------------------- ### Create a Svelte Project Source: https://github.com/nickheyer/discopanel/blob/main/web/discopanel/README.md Initialize a new Svelte project in the current directory or a specified folder. ```sh # create a new project in the current directory npx sv create # create a new project in my-app npx sv create my-app ``` -------------------------------- ### Generate Support Bundle Source: https://context7.com/nickheyer/discopanel/llms.txt Creates a diagnostic archive containing logs, configurations, and system information for specified servers. The response includes a bundle ID and filename for the generated archive. ```bash curl -X POST http://localhost:8080/discopanel.v1.SupportService/GenerateSupportBundle \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "includeLogs": true, "includeConfigs": true, "includeSystemInfo": true, "serverIds": ["srv_abc123"] }' ``` -------------------------------- ### Google Workspace Role Mapping Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/guides/oidc/google.mdx Configure role mapping for Google Workspace organizations by setting the `DISCOPANEL_AUTH_OIDC_ROLE_CLAIM` to `hd` and specifying a mapping where the domain is assigned a role. This example assigns the `admin` role to users from `yourdomain.com`. ```yaml - DISCOPANEL_AUTH_OIDC_ROLE_CLAIM=hd - DISCOPANEL_AUTH_OIDC_ROLE_MAPPING={"yourdomain.com":"admin"} ``` -------------------------------- ### Configure Discopanel with config.yaml Source: https://github.com/nickheyer/discopanel/blob/main/README.md Define storage paths and proxy settings for the Discopanel instance. ```yaml storage: data_dir: "./data/servers" backup_dir: "./data/backups" proxy: enabled: true base_url: "minecraft.example.com" listen_ports: [25565] ``` -------------------------------- ### Run DiscoPanel Binary Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/prebuilt-binaries.mdx Execute the DiscoPanel binary. You can use the default configuration or specify a custom config file path. Environment variables with the DISCOPANEL_ prefix can also override config file settings. ```bash ./discopanel ``` ```bash ./discopanel -config /path/to/config.yaml ``` -------------------------------- ### Create Server Source: https://context7.com/nickheyer/discopanel/llms.txt Create a new Minecraft server instance. Supports vanilla, Paper, and Forge modded servers with CurseForge modpacks. ```APIDOC ## POST /discopanel.v1.ServerService/CreateServer ### Description Creates a new Minecraft server instance. This endpoint supports various configurations including mod loaders (Paper, Forge with CurseForge modpacks), specific Minecraft versions, port assignments, memory allocation, and Docker environment overrides. ### Method POST ### Endpoint /discopanel.v1.ServerService/CreateServer ### Parameters #### Request Body - **name** (string) - Required - The name of the server. - **description** (string) - Optional - A description for the server. - **modLoader** (string) - Required - The mod loader to use (e.g., "MOD_LOADER_PAPER", "MOD_LOADER_AUTO_CURSEFORGE"). - **mcVersion** (string) - Required - The Minecraft version for the server. - **port** (integer) - Required - The primary port for the server. - **maxPlayers** (integer) - Optional - The maximum number of players allowed. - **memory** (integer) - Optional - The amount of memory allocated to the server in MB. - **autoStart** (boolean) - Optional - Whether the server should automatically start on creation. - **startImmediately** (boolean) - Optional - Whether to start the server immediately after creation. - **proxyHostname** (string) - Optional - Hostname for proxy routing. - **proxyListenerId** (string) - Optional - The ID of the proxy listener to use. - **useBaseUrl** (boolean) - Optional - Whether to use the base URL for proxying. - **modpackId** (string) - Optional - The ID of the CurseForge modpack. - **modpackVersionId** (string) - Optional - The ID of the CurseForge modpack version. - **additionalPorts** (array) - Optional - A list of additional ports for the server. - **name** (string) - Required - Name of the additional port. - **containerPort** (integer) - Required - Port inside the container. - **hostPort** (integer) - Required - Port on the host machine. - **protocol** (string) - Required - Protocol (e.g., "tcp"). - **dockerOverrides** (object) - Optional - Docker specific overrides. - **environment** (object) - Optional - Environment variables for the Docker container. - **ENABLE_AUTOPAUSE** (string) - Optional - Enable autopause. - **AUTOPAUSE_TIMEOUT_EST** (string) - Optional - Autopause timeout in seconds. ### Request Example ```json { "name": "Creative", "description": "Creative building server", "modLoader": "MOD_LOADER_PAPER", "mcVersion": "1.21.4", "port": 25567, "maxPlayers": 50, "memory": 4096, "autoStart": true, "startImmediately": true, "proxyHostname": "creative", "proxyListenerId": "listener_default", "useBaseUrl": true, "additionalPorts": [ { "name": "Dynmap", "containerPort": 8123, "hostPort": 8123, "protocol": "tcp" } ], "dockerOverrides": { "environment": { "ENABLE_AUTOPAUSE": "true", "AUTOPAUSE_TIMEOUT_EST": "3600" } } } ``` ### Request Example (Forge Modpack) ```json { "name": "ATM9", "description": "All The Mods 9 server", "modLoader": "MOD_LOADER_AUTO_CURSEFORGE", "mcVersion": "1.20.1", "port": 25568, "maxPlayers": 10, "memory": 8192, "modpackId": "715572", "modpackVersionId": "5247274", "startImmediately": false } ``` ``` -------------------------------- ### Manage Server Configuration Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieves and updates environment variables and settings for a specific server. ```bash curl -X POST http://localhost:8080/discopanel.v1.ConfigService/GetServerConfig \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"serverId": "srv_abc123"}' # Response: # { # "categories": [ # { # "name": "JVM Configuration", # "properties": [ # { # "key": "memory", # "label": "Memory", # "value": "4G", # "defaultValue": "1G", # "type": "text", # "description": "JVM heap memory allocation", # "envVar": "MEMORY" # }, # { # "key": "useAikarFlags", # "label": "Use Aikar's Flags", # "value": "true", # "type": "checkbox", # "envVar": "USE_AIKAR_FLAGS" # } # ] # } # ] # } ``` ```bash curl -X POST http://localhost:8080/discopanel.v1.ConfigService/UpdateServerConfig \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "serverId": "srv_abc123", "updates": { "memory": "6G", "useAikarFlags": "true", "viewDistance": "12", "maxPlayers": "50" } }' ``` -------------------------------- ### POST /discopanel.v1.FileService/CreateArchive Source: https://context7.com/nickheyer/discopanel/llms.txt Creates a zip archive from specified paths on a server. ```APIDOC ## POST /discopanel.v1.FileService/CreateArchive ### Description Creates a zip archive from selected paths. ### Method POST ### Endpoint http://localhost:8080/discopanel.v1.FileService/CreateArchive ### Request Body - **serverId** (string) - Required - ID of the server - **paths** (array) - Required - List of paths to archive - **destinationPath** (string) - Required - Path where the archive will be saved - **archiveName** (string) - Required - Name of the resulting zip file ### Request Example { "serverId": "srv_abc123", "paths": ["/world", "/server.properties"], "destinationPath": "/backups", "archiveName": "backup-2024-01-01.zip" } ``` -------------------------------- ### Control Module Lifecycle Source: https://context7.com/nickheyer/discopanel/llms.txt Performs state transitions on existing module containers using their unique identifiers. ```bash # Start module curl -X POST http://localhost:8080/discopanel.v1.ModuleService/StartModule \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "mod_xyz"}' # Stop module curl -X POST http://localhost:8080/discopanel.v1.ModuleService/StopModule \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "mod_xyz"}' # Restart module curl -X POST http://localhost:8080/discopanel.v1.ModuleService/RestartModule \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "mod_xyz"}' # Recreate with fresh container curl -X POST http://localhost:8080/discopanel.v1.ModuleService/RecreateModule \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"id": "mod_xyz"}' ``` -------------------------------- ### List Server Files Source: https://context7.com/nickheyer/discopanel/llms.txt Browses the file system within a server's data directory. ```bash curl -X POST http://localhost:8080/discopanel.v1.FileService/ListFiles \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "serverId": "srv_abc123", "path": "/", "tree": false }' # Response: # { # "files": [ # { # "name": "server.properties", # "path": "/server.properties", # "isDir": false, # "size": 1024, # "modified": 1704067200, # "isEditable": true # }, # { # "name": "world", # "path": "/world", # "isDir": true, # "size": 0, # "modified": 1704067200 # } # ] # } ``` -------------------------------- ### Sync Modpacks from Source Source: https://context7.com/nickheyer/discopanel/llms.txt Fetches and indexes modpacks from external sources like CurseForge or Modrinth. ```bash curl -X POST http://localhost:8080/discopanel.v1.ModpackService/SyncModpacks \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "query": "skyblock", "gameVersion": "1.20.1", "modLoader": "fabric", "indexer": "modrinth" }' # Response: # { # "syncedCount": 25, # "message": "Successfully synced 25 modpacks from modrinth" # } ``` -------------------------------- ### Download Support Bundle using cURL Source: https://context7.com/nickheyer/discopanel/llms.txt Use this cURL command to download a support bundle from the DiscoPanel API. Ensure you have a valid authentication token. ```bash curl -X POST http://localhost:8080/discopanel.v1.SupportService/DownloadSupportBundle \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"bundleId": "bundle_xyz"}' \ --output support-bundle.zip ``` -------------------------------- ### Connect and Subscribe to Server Logs via WebSocket Source: https://context7.com/nickheyer/discopanel/llms.txt Establishes a WebSocket connection for real-time log streaming and command execution. Authenticate first, then subscribe to specific server logs. Handles different message types including authentication, logs, and command results. ```javascript const ws = new WebSocket('ws://localhost:8080/ws'); // Authenticate ws.onopen = () => { ws.send(JSON.stringify({ type: 'WS_MESSAGE_TYPE_AUTH', auth: { token: 'your-jwt-token' } })); }; // Handle messages ws.onmessage = (event) => { const msg = JSON.parse(event.data); switch (msg.type) { case 'WS_MESSAGE_TYPE_AUTH_OK': // Subscribe to server logs after authentication ws.send(JSON.stringify({ type: 'WS_MESSAGE_TYPE_SUBSCRIBE', subscribe: { serverId: 'srv_abc123', tail: 100 } })); break; case 'WS_MESSAGE_TYPE_LOGS': // Initial batch of logs console.log('Historical logs:', msg.logs.logs); break; case 'WS_MESSAGE_TYPE_LOG': // Real-time log entry console.log('New log:', msg.log.log.message); break; case 'WS_MESSAGE_TYPE_COMMAND_RESULT': // Command execution result console.log('Command result:', msg.commandResult); break; } }; // Send command to server function sendCommand(serverId, command) { ws.send(JSON.stringify({ type: 'WS_MESSAGE_TYPE_COMMAND', command: { serverId, command } })); } // Unsubscribe from logs function unsubscribe(serverId) { ws.send(JSON.stringify({ type: 'WS_MESSAGE_TYPE_UNSUBSCRIBE', unsubscribe: { serverId } })); } ``` -------------------------------- ### Create a Custom Role Source: https://context7.com/nickheyer/discopanel/llms.txt Use this endpoint to define new roles with specific permissions for users. Ensure the Authorization header is set with a valid token. ```bash curl -X POST http://localhost:8080/discopanel.v1.RoleService/CreateRole \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "name": "server-operator", "description": "Can manage servers but not users", "isDefault": false, "permissions": [ {"resource": "servers", "action": "read"}, {"resource": "servers", "action": "update"}, {"resource": "servers", "action": "start"}, {"resource": "servers", "action": "stop"} ] }' ``` -------------------------------- ### Update Server Configuration Source: https://context7.com/nickheyer/discopanel/llms.txt Modify existing server settings such as memory limits and player counts. ```bash curl -X POST http://localhost:8080/discopanel.v1.ServerService/UpdateServer \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "id": "srv_abc123", "name": "Survival Plus", "description": "Updated survival server", "memory": 6144, "maxPlayers": 30, "autoStart": true, "detached": false }' ``` -------------------------------- ### Read and Update Files Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieves file content and updates configuration files. Note that content must be base64 encoded. ```bash # Read file content curl -X POST http://localhost:8080/discopanel.v1.FileService/GetFile \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "serverId": "srv_abc123", "path": "/server.properties" }' # Update file content curl -X POST http://localhost:8080/discopanel.v1.FileService/UpdateFile \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "serverId": "srv_abc123", "path": "/server.properties", "content": "bW90ZD1XZWxjb21lIQ==" }' # Note: content is base64 encoded ``` -------------------------------- ### POST /discopanel.v1.ModuleService/ListModuleTemplates Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieves available module templates for server integration. ```APIDOC ## POST /discopanel.v1.ModuleService/ListModuleTemplates ### Description Get available module templates for creating module instances. ### Method POST ### Endpoint http://localhost:8080/discopanel.v1.ModuleService/ListModuleTemplates ### Request Body - **category** (string) - Optional - Filter by category ### Response #### Success Response (200) - **templates** (array) - List of available module templates ### Response Example { "templates": [ { "id": "tpl_bluemap", "name": "BlueMap" } ] } ``` -------------------------------- ### Configuration Service API Source: https://context7.com/nickheyer/discopanel/llms.txt APIs for managing server configurations and environment variables. ```APIDOC ## POST /discopanel.v1.ConfigService/GetServerConfig ### Description Retrieve all configurable environment variables for a server. ### Method POST ### Endpoint http://localhost:8080/discopanel.v1.ConfigService/GetServerConfig ### Request Body - **serverId** (string) - Required - The ID of the server to retrieve configurations for. ### Request Example ```json { "serverId": "srv_abc123" } ``` ### Response #### Success Response (200) - **categories** (array) - A list of configuration categories. - **name** (string) - The name of the category. - **properties** (array) - A list of configuration properties within the category. - **key** (string) - The internal key for the property. - **label** (string) - The display label for the property. - **value** (string) - The current value of the property. - **defaultValue** (string) - The default value of the property. - **type** (string) - The input type for the property (e.g., "text", "checkbox"). - **description** (string) - A description of the property. - **envVar** (string) - The corresponding environment variable name. #### Response Example ```json { "categories": [ { "name": "JVM Configuration", "properties": [ { "key": "memory", "label": "Memory", "value": "4G", "defaultValue": "1G", "type": "text", "description": "JVM heap memory allocation", "envVar": "MEMORY" }, { "key": "useAikarFlags", "label": "Use Aikar's Flags", "value": "true", "type": "checkbox", "envVar": "USE_AIKAR_FLAGS" } ] } ] } ``` ## POST /discopanel.v1.ConfigService/UpdateServerConfig ### Description Modify server environment variables. ### Method POST ### Endpoint http://localhost:8080/discopanel.v1.ConfigService/UpdateServerConfig ### Request Body - **serverId** (string) - Required - The ID of the server to update. - **updates** (object) - Required - An object containing the key-value pairs of configurations to update. ### Request Example ```json { "serverId": "srv_abc123", "updates": { "memory": "6G", "useAikarFlags": "true", "viewDistance": "12", "maxPlayers": "50" } } ``` ``` -------------------------------- ### Docker Compose Configuration Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/src/content/docs/getting-started/docker-compose.mdx The recommended configuration file for running the DiscoPanel service. ```yaml version: '3.8' services: discopanel: image: ghcr.io/nickheyer/discopanel:latest container_name: discopanel restart: unless-stopped ports: - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./data:/app/data environment: - DISCOPANEL_HOST_DATA_PATH=/opt/discopanel/data - DISCOPANEL_DATA_DIR=/app/data ``` -------------------------------- ### Create Registration Invite Source: https://context7.com/nickheyer/discopanel/llms.txt Generate an invite link for new user registration. Invites can be configured with specific roles, PIN protection, maximum uses, and expiration times. ```bash curl -X POST http://localhost:8080/discopanel.v1.AuthService/CreateInvite \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "description": "Server moderators invite", "roles": ["editor"], "pin": "1234", "maxUses": 5, "expiresInHours": 168 }' # Response: # { # "invite": { # "id": "inv_xyz", # "code": "ABC123DEF", # "description": "Server moderators invite", # "roles": ["editor"], # "hasPin": true, # "maxUses": 5, # "useCount": 0, # "expiresAt": "2024-01-08T00:00:00Z" # } # } ``` -------------------------------- ### List All Servers Source: https://context7.com/nickheyer/discopanel/llms.txt Retrieve a list of all managed Minecraft servers. Optionally include detailed runtime statistics such as CPU usage, memory, and player counts. ```bash curl -X POST http://localhost:8080/discopanel.v1.ServerService/ListServers \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{"fullStats": true}' # Response: # { # "servers": [ # { # "id": "srv_abc123", # "name": "Survival", # "description": "Main survival server", # "modLoader": "MOD_LOADER_PAPER", # "mcVersion": "1.21.4", # "status": "SERVER_STATUS_RUNNING", # "port": 25566, # "proxyHostname": "survival", # "maxPlayers": 20, # "memory": 4096, # "playersOnline": 5, # "memoryUsage": 2048000000, # "cpuPercent": 15.5, # "tps": 19.8 # } # ] # } ``` -------------------------------- ### Manage Roles and Permissions Source: https://context7.com/nickheyer/discopanel/llms.txt Lists available roles within the system for access control management. ```bash # List all roles curl -X POST http://localhost:8080/discopanel.v1.RoleService/ListRoles \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{}' ``` -------------------------------- ### Initialize Scalar API Reference Source: https://github.com/nickheyer/discopanel/blob/main/docs/discopanel/public/api-reference.html Configures the Scalar API reference component with specific display settings and schema source. ```javascript window.Scalar.createApiReference('#api-reference', { url: '/schemav1.yaml', showDeveloperTools: 'never', showToolbar: 'never', hideTestRequestButton: true, baseServerURL: '', agent: { disabled: true, }, }); ``` -------------------------------- ### Configure Proxy Settings Source: https://context7.com/nickheyer/discopanel/llms.txt Updates the proxy status and base URL for hostname routing. ```bash curl -X POST http://localhost:8080/discopanel.v1.ProxyService/UpdateProxyConfig \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "enabled": true, "baseUrl": "mc.mydomain.com" }' # After configuration, servers can be accessed via: # - survival.mc.mydomain.com:25565 # - creative.mc.mydomain.com:25565 # - modded.mc.mydomain.com:25565 ``` -------------------------------- ### Retrieve Server Logs Source: https://context7.com/nickheyer/discopanel/llms.txt Fetch container logs for a specific server instance. ```bash curl -X POST http://localhost:8080/discopanel.v1.ServerService/GetServerLogs \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "id": "srv_abc123", "tail": 100 }' # Response: # { # "logs": [ # { # "timestamp": "2024-01-01T12:00:00Z", # "message": "[Server] Player joined the game", # "level": "INFO", # "source": "minecraft", # "isCommand": false, # "isError": false # } # ], # "total": 100 # } ```