### Execute GoDoxy Automatic Setup Script Source: https://docs.godoxy.dev/Setup This command executes the GoDoxy automatic setup script directly from the GitHub repository. It downloads and runs the `setup.sh` script using `curl` and `bash` to automate the installation process, preparing the environment for GoDoxy. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/yusing/godoxy/main/scripts/setup.sh)" ``` -------------------------------- ### Download GoDoxy Docker Compose File Manually Source: https://docs.godoxy.dev/Setup This command downloads the `compose.example.yml` file from the GoDoxy GitHub repository and saves it as `compose.yml`. This file defines the Docker services and their configurations for running GoDoxy, enabling containerized deployment. ```shell wget https://raw.githubusercontent.com/yusing/godoxy/main/compose.example.yml -O compose.yml ``` -------------------------------- ### Download GoDoxy Main Configuration File Manually Source: https://docs.godoxy.dev/Setup This command creates a `config` directory if it doesn't exist and then downloads the `config.example.yml` file from the GoDoxy GitHub repository, saving it as `config/config.yml` for manual configuration. This file contains core application settings. ```shell mkdir -p config && wget https://raw.githubusercontent.com/yusing/godoxy/main/config.example.yml -O config/config.yml ``` -------------------------------- ### Download GoDoxy Environment Variables File Manually Source: https://docs.godoxy.dev/Setup This command downloads the `.env.example` file from the GoDoxy GitHub repository and saves it as `.env`. This file is used to define environment variables, such as listening ports, for the GoDoxy application, allowing for easy customization. ```shell wget https://raw.githubusercontent.com/yusing/godoxy/main/.env.example -O .env ``` -------------------------------- ### Enable OIDC Middleware in Docker Compose Source: https://docs.godoxy.dev/Home Example Docker Compose snippet demonstrating how to enable the OIDC middleware for a specific application service by adding a proxy label to its configuration. ```yaml services: your_app: ... labels: proxy.#1.middlewares.oidc: ``` -------------------------------- ### Godoxy Proxy Rule Configuration Examples Source: https://docs.godoxy.dev/Rule-Based-Routing This section provides practical configuration examples for Godoxy proxy rules across different deployment contexts, including Docker Compose, a dedicated Route file, and `config.yml`. Examples demonstrate how to block specific HTTP methods, handle WebSocket connections, and implement URL rewriting and static file serving. ```yaml # docker compose services: app: container_name: goaccess ... labels: proxy.goaccess.rules: | - name: block POST and PUT requests on: method POST | method PUT do: error 403 "Not allowed" - name: websocket on: | header Connection Upgrade header Upgrade websocket do: pass - name: default do: | rewrite / /report.html serve /tmp/access # Route file goaccess: rules: - name: websocket on: | header Connection Upgrade header Upgrade websocket do: pass - name: default do: | rewrite / /report.html serve /tmp/access # config.yml # same as above, under `entrypoint` section entrypoint: rules: ... ``` -------------------------------- ### GoDoxy Docker Compose Configuration Example Source: https://docs.godoxy.dev/WebUI Example Docker Compose configuration demonstrating how to define a service (GitLab) with GoDoxy proxy labels. These labels enable alias management, port mapping, and homepage customization, including the ability to hide specific aliases from the WebUI. ```yaml services: gitlab: image: gitlab/gitlab-ce:latest container_name: gitlab restart: always labels: proxy.aliases: gitlab,gitlab-reg,gitlab-ssh proxy.gitlab: | port: 80 homepage: name: GitLab icon: "/-/pwa-icons/logo-192.png" proxy.gitlab-reg: | port: 5050 homepage: show: false proxy.gitlab-ssh: | port: 22223:22 homepage: show: false shm_size: 256m ``` -------------------------------- ### GoDoxy Route File Configuration Example Source: https://docs.godoxy.dev/WebUI Example of a GoDoxy route file entry for AdGuard Home. This configuration specifies the host IP address and custom homepage details, including the display name and an icon sourced from selfh.st, demonstrating how to integrate services via route files. ```yaml adgh: host: 10.0.2.1 homepage: name: AdGuard Home icon: "@selfhst/adguard-home.png" ``` -------------------------------- ### YAML Configuration Syntax Examples for Middlewares Source: https://docs.godoxy.dev/Middlewares Illustrates various YAML syntax formats for configuring middlewares, including direct configuration in `config.yml`, Docker labels (both multi-line and single-line comma-separated), and route file definitions. Examples show `cidr_whitelist` and `modify_request` middleware usage. ```yaml # config.yml entrypoint: middlewares: - use: cidr_whitelist allow: - 127.0.0.1 - 10.0.0.0/16 # docker labels (yaml style) proxy.#1.middlewares.cidr_whitelist.allow: | - 127.0.0.1 - 10.0.0.0/16 # single line comma separated proxy.#1.middlewares.cidr_whitelist.allow: 127.0.0.1, 10.0.0.0/16 # route file openai: host: https://api.openai.com/ middlewares: cidr_whitelist: allow: - 127.0.0.1 - 10.0.0.0/16 modify_request: set_headers: Host: api.openai.com homepage: show: false ``` -------------------------------- ### Example Docker Compose Configuration with GoDoxy Labels Source: https://docs.godoxy.dev/Docker-labels-and-Route-Files Provides a complete `compose.yml` example demonstrating how to apply GoDoxy-specific Docker labels. It configures service ports, idle timeouts, homepage settings, and hides a backend service from the homepage, showcasing common GoDoxy configurations. ```yaml service: app: image: app container_name: app ports: - 80 # e.g. frontend - 8080 # e.g. backend labels: proxy.app.port: 80 proxy.app-backend.port: 8080 # wildcard * means all services # put container to sleep after 1 hour of inactivity proxy.*.idle_timeout: 1h # homepage config proxy.app.homepage: | name: App icon: "@selfhst/app.svg" description: An app category: app # hide backend from homepage proxy.app-backend.homepage.show: false ``` -------------------------------- ### GoDoxy Full Route Configuration Example Source: https://docs.godoxy.dev/Docker-labels-and-Route-Files A comprehensive example of a GoDoxy route configuration, showcasing various features including scheme, host, port, detailed path patterns, health checks, load balancing with IP hash, multiple middlewares (CIDR whitelist, hideXForwarded), homepage settings, and advanced access log configurations with filtering and field redaction. ```yaml example: # matching `example.y.z` scheme: http host: 10.0.0.254 port: 80 path_patterns: # Check https://pkg.go.dev/net/http#hdr-Patterns-ServeMux for syntax - GET / # accept any GET request - POST /auth # for /auth and /auth/* accept only POST - GET /home/{$} # for exactly /home healthcheck: disabled: false path: / interval: 5s load_balance: link: app mode: ip_hash options: header: X-Forwarded-For middlewares: cidr_whitelist: allow: - 127.0.0.1 - 10.0.0.0/8 status_code: 403 message: IP not allowed hideXForwarded: homepage: name: Example App icon: png/example.png description: An example app category: example access_log: buffer_size: 100 path: /var/log/example.log filters: status_codes: values: - 200-299 - 101 method: values: - GET host: values: - example.y.z headers: negative: true values: - foo=bar - baz cidr: values: - 192.168.10.0/24 fields: headers: default: keep config: foo: redact query: default: drop config: foo: keep cookies: default: redact config: foo: keep ``` -------------------------------- ### Request Level Whitelist Configuration Example Source: https://docs.godoxy.dev/Access-Control Partial example YAML configuration for request-level IP whitelisting, showing how to define allowed IPs/CIDRs, custom status codes, and error messages. ```yaml # config.yml ``` -------------------------------- ### Full Access Log Configuration Example (YAML) Source: https://docs.godoxy.dev/Access-Control Comprehensive example demonstrating advanced access log configuration, including status code, method, host, header, and CIDR filters, along with detailed field handling for headers, query parameters, and cookies. ```yaml entrypoint: access_log: format: json path: /var/log/example.log filters: status_codes: values: - 200-299 - 101 method: values: - GET host: values: - example.y.z headers: negative: true values: - foo=bar # when key "foo" is present and value is `bar` - baz # when key "baz" is present cidr: values: - 192.168.10.0/24 fields: headers: default: keep config: foo: redact query: default: drop config: foo: keep cookies: default: redact config: foo: keep # route file # same as above, but under your app config, e.g. app1: access_log: format: json ... ``` -------------------------------- ### GoDoxy Route File YAML Anchor Example Source: https://docs.godoxy.dev/Docker-labels-and-Route-Files Demonstrates the use of YAML anchors (`x-proxy`) to define reusable proxy configurations and inherit them in specific routes. This example sets a common HTTPS scheme and modifies request headers for the 'api.example.com' route. ```yaml x-proxy: &proxy # ignored scheme: https middlewares: hideXForwarded: modifyRequest: setHeaders: Host: $req_host api.example.com: <<: *proxy # inherit from proxy host: api.example.com ``` -------------------------------- ### Configure GoDoxy for Multi-Port Applications Source: https://docs.godoxy.dev/Examples This example shows how to configure GoDoxy to proxy an application that exposes multiple internal ports. It uses `proxy.aliases` to define additional hostnames and `proxy.#.port` to map specific internal container ports to GoDoxy's proxy. ```yaml services: app: ... labels: proxy.aliases: app, app-backend proxy.#1.port: 8080 proxy.#2.port: 8081 ``` -------------------------------- ### GoDoxy Authentication Environment Variables (Common) Source: https://docs.godoxy.dev/Home Common environment variables for JWT configuration, including secure flag, secret, and token time-to-live. ```APIDOC Environment Variable: GODOXY_API_JWT_SECURE Description: Secure flag for JWT cookie Default: true Values: boolean Environment Variable: GODOXY_API_JWT_SECRET Description: Base64 JWT secret for api server (you will have to login again after restarting GoDoxy) Default: random Values: string Environment Variable: GODOXY_API_JWT_TOKEN_TTL Description: JWT Time-to-live Default: 24h Values: [duration](https://pkg.go.dev/time#ParseDuration) ``` -------------------------------- ### Secure GoDoxy Containers: Ports vs. Expose Source: https://docs.godoxy.dev/Home Illustrates how to secure GoDoxy containers by replacing 'ports' mapping with 'expose' in 'docker-compose.yml' to limit host-exposed services to GoDoxy only. ```yaml # Before ports: - 8080:80 - 4433:443 # After expose: - 80 - 443 ``` -------------------------------- ### GoDoxy Core Environment Variables Source: https://docs.godoxy.dev/Home Defines core environment variables for configuring GoDoxy's network addresses, ports, HTTP/3, and debug mode. Also notes compatibility with older prefixes. ```APIDOC Environment Variable: GODOXY_FRONTEND_PORT Description: Frontend listening port Default: 3000 Values: integer Environment Variable: GODOXY_HTTP_ADDR Description: HTTP server listening address Default: :80 Values: [host]:port Environment Variable: GODOXY_HTTPS_ADDR Description: HTTPS server listening address (if enabled) Default: :443 Values: [host]:port Environment Variable: GODOXY_API_ADDR Description: API server listening address Default: 127.0.0.1:8888 Values: [host]:port Environment Variable: GODOXY_HTTP3_ENABLED Description: Enable HTTP/3 Default: true Values: boolean Environment Variable: GODOXY_DEBUG Description: Enable debug behaviors and logging Default: false Values: boolean ``` -------------------------------- ### Docker Compose Example: GoDoxy Healthcheck `use_get` Source: https://docs.godoxy.dev/Health-monitoring This Docker Compose snippet demonstrates how to configure a service to use the `GET` HTTP method for GoDoxy's health checks instead of the default `HEAD` method. This is achieved by setting the `proxy.qbt.healthcheck.use_get` label to `true`. ```yaml services: qbittorrent: container_name: qbt image: nginx labels: proxy.qbt.healthcheck.use_get: true restart: unless-stopped ``` -------------------------------- ### GoDoxy OIDC Authentication Environment Variables Source: https://docs.godoxy.dev/Home Environment variables for configuring OpenID Connect (OIDC) authentication, including issuer URL, client credentials, allowed users/groups, and scopes. ```APIDOC Environment Variable: GODOXY_OIDC_ISSUER_URL Description: OIDC issuer URL Default: empty Environment Variable: GODOXY_OIDC_CLIENT_ID Description: OIDC client ID Default: empty Environment Variable: GODOXY_OIDC_CLIENT_SECRET Description: OIDC client secret Default: empty Environment Variable: GODOXY_OIDC_ALLOWED_USERS Description: OIDC allowed users (optional when ALLOWED_GROUPS is set) Default: empty Environment Variable: GODOXY_OIDC_ALLOWED_GROUPS Description: OIDC allowed groups (optional when ALLOWED_USERS is set) Default: empty Environment Variable: GODOXY_OIDC_SCOPES Description: OIDC scopes Default: openid,profile,email,groups ``` -------------------------------- ### GoDoxy User Password Authentication Environment Variables Source: https://docs.godoxy.dev/Home Environment variables for configuring the default username and password for WebUI login. ```APIDOC Environment Variable: GODOXY_API_USER Description: WebUI login username Default: admin Values: string Environment Variable: GODOXY_API_PASSWORD Description: WebUI login password Default: password Values: string ``` -------------------------------- ### GoProxy YAML Configuration for X-Forwarded Headers Source: https://docs.godoxy.dev/Middlewares Example YAML configuration for integrating the `set_x_forwarded` middleware in GoProxy, showing how to define it using both Docker labels and within a route file. ```yaml # docker labels proxy.myapp.middlewares.set_x_forwarded: # route file myapp: middlewares: set_x_forwarded: ``` -------------------------------- ### GoDoxy OIDC Environment Variables Source: https://docs.godoxy.dev/Home Configuration variables required for setting up OpenID Connect authentication in GoDoxy, including the Identity Provider's base URL, client ID, client secret, and lists for allowed users and groups. ```APIDOC GODOXY_OIDC_ISSUER_URL: IdP's base URL (e.g., https://id.domain.com or https://auth.domain.com/application/o//) GODOXY_OIDC_CLIENT_ID: Client ID GODOXY_OIDC_CLIENT_SECRET: Client secret GODOXY_OIDC_ALLOWED_USERS: Comma separated list of allowed users GODOXY_OIDC_ALLOWED_GROUPS: Comma separated list of allowed groups ``` -------------------------------- ### Godoxy Proxy `do` Action Execution Order Examples Source: https://docs.godoxy.dev/Rule-Based-Routing This snippet illustrates the execution order of `do` actions in Godoxy proxy rules. It highlights that actions which return (terminate request processing, e.g., `serve`, `redirect`) must be the last action in a sequence, providing both invalid and valid configuration examples. ```yaml # invalid on: method GET do: | serve /static/index.html serve /static/404.html # invalid on: method GET do: | redirect /foo/bar serve /static/index.html # valid on: method GET do: | rewrite / /index.html serve /static ``` -------------------------------- ### GoDoxy Comprehensive Provider Configuration Source: https://docs.godoxy.dev/Configurations This extensive configuration example demonstrates how to set up various GoDoxy providers. It covers including external route files, configuring multiple Docker hosts (local, remote TCP, SSH), defining GoDoxy agents, integrating notification services like Gotify, setting up Proxmox credentials, and configuring MaxMind for geolocation services. ```yaml providers: include: - file1.yml - file2.yml docker: local: $DOCKER_HOST remote-1: tcp://10.0.2.1:2375 remote-2: ssh://root:1234@10.0.2.2 agents: - 10.0.0.1:8899 - 10.0.0.2:8899 notification: - name: gotify provider: gotify url: https://gotify.example.com token: your-token proxmox: - url: https://pve.domain.com:8006/api2/json token_id: root@pam!abcdef secret: aaaa-bbbb-cccc-dddd no_tls_verify: true maxmind: account_id: 123456 license_key: your-license-key database: geolite # or geoip2 if you have subscription ``` -------------------------------- ### GoDoxy Authentication Environment Variables (General) Source: https://docs.godoxy.dev/Home General environment variables related to API authentication, specifically for JWT cookie security. Warns against insecure settings. ```APIDOC Note: If you desire to use WebUI HTTP Only, set GODOXY_API_JWT_SECURE to false (Not recommended) ``` -------------------------------- ### GoDoxy Route File Example: Healthcheck `use_get` Source: https://docs.godoxy.dev/Health-monitoring This YAML configuration for a GoDoxy route file shows how to enable the `use_get` option for health checks for a specific application. Setting `healthcheck.use_get: true` ensures GoDoxy uses the `GET` method for its health probes. ```yaml qbt: host: 10.0.0.1 port: 8080 healthcheck: use_get: true ``` -------------------------------- ### Configuring `autocert` and `match_domains` for a Primary Domain Source: https://docs.godoxy.dev/Certificates-and-domain-matching This example demonstrates how to set up both `autocert.domains` for SSL certificate generation and `match_domains` for route access control, ensuring a consistent primary domain for your application. ```yaml autocert: domains: - my.app match_domains: - my.app ``` -------------------------------- ### Connection Level ACL Configuration Example Source: https://docs.godoxy.dev/Access-Control Example YAML configuration for connection-level access control, including default actions, allow/deny lists for IPs, CIDRs, countries, and timezones, and logging settings. It also shows MaxMind provider configuration for geographical filtering. ```yaml # config.yml acl: default: allow # or deny (default: allow) allow_local: true # or false (default: true) allow: - ip:1.2.3.4 - cidr:1.2.3.4/32 - country:US - tz:Asia/Shanghai deny: - ip:1.2.3.4 - cidr:1.2.3.4/32 - country:US - tz:Asia/Shanghai log: buffer_size: 65536 # (default: 64KB) path: /app/logs/acl.log # (default: none) stdout: false # (default: false) keep: last 10 # (default: none) log_allowed: true # (default: false) providers: maxmind: account_id: 123456 license_key: your-license-key database: geolite # or geoip2 if you have subscription ``` -------------------------------- ### Bash String Quoting and Escaping Examples Source: https://docs.godoxy.dev/Rule-Based-Routing Demonstrates how to quote and escape strings containing spaces and special characters in GoDoxy's rule syntax, similar to Linux shell behavior. It shows examples for double quotes, single quotes, and backslash escaping. ```bash header Some-Header "foo bar" # foo bar header Some-Header 'foo bar' # foo bar header Some-Header foo\ bar # foo bar header Some-Header 'foo \"bar\"' # foo "bar" ``` -------------------------------- ### OIDC Scopes Definition Source: https://docs.godoxy.dev/Home Defines the standard and custom scopes available for OpenID Connect authentication in GoDoxy, indicating whether they are optional for client requests. ```APIDOC Scope: - openid: OpenID Connect scope (Required) - profile: User profile scope (Required) - email: User email scope (Optional) - groups: User groups scope (Optional) - offline_access: Offline access scope for refresh token (Optional) ``` -------------------------------- ### Full GoDoxy Idle-Sleep Configuration Example Source: https://docs.godoxy.dev/Idle-Sleep This comprehensive YAML example showcases the `idle-sleep` feature in GoDoxy for a Docker Compose service. It configures `proxy.idle_timeout` to automatically put the `app` service to sleep after inactivity and defines its dependencies (`redis`, `postgres`) with specific startup conditions, ensuring proper application lifecycle management. ```yaml services: app: image: example/app labels: proxy.idle_timeout: 1h30s depends_on: redis: condition: service_healthy postgres: condition: service_started ``` -------------------------------- ### Configure GoDoxy for TCP Port Forwarding Source: https://docs.godoxy.dev/Examples This snippet illustrates how to set up TCP forwarding for a service. By setting `proxy.#.scheme` to `tcp`, GoDoxy can forward traffic directly to a specified container port, allowing for non-HTTP/S services to be proxied. ```yaml services: app: ... labels: proxy.#1.scheme: tcp proxy.#1.port: 2222:22 # forward container port 22 to host ``` -------------------------------- ### GoDoxy Auto SSL and Domain Matching Configuration Source: https://docs.godoxy.dev/Configurations This example illustrates how to configure automatic SSL certificate provisioning using a specified provider (e.g., Cloudflare) and define the email for certificate registration. It also shows how to list domains for which the application should respond, enabling domain-specific routing and SSL. ```yaml autocert: provider: cloudflare email: your-email@example.com domains: - *.yourdomain.com match_domains: - yourdomain.com ``` -------------------------------- ### GoDoxy WebUI Application Configuration Properties Source: https://docs.godoxy.dev/WebUI This section details the configurable properties for applications displayed within the GoDoxy WebUI, including display options, naming, icon sources, URL overrides, and categorization. These properties allow fine-grained control over how applications appear and behave in the dashboard. ```APIDOC Property: show Description: Whether to show the app Default: true Allowed Values / Syntax: boolean Property: name Description: Display name on dashboard Default: Sanitized *alias* Allowed Values / Syntax: string Property: icon Description: Icon source for the app. Can be from walkxcode, selfh.st, an absolute URL, or a relative path to proxy target. Default: Automatic detected Allowed Values / Syntax: "@walkxcode/.png", "@selfhst/.svg", "https://example.com/icon.png", "/path/to/icon.png" Property: url Description: Override app URL Default: Dynamic Allowed Values / Syntax: Absolute URL Property: category Description: Category on dashboard. Can be a preset value if container image or alias matched selfh.st's or godoxy's lists, 'Docker' for Docker containers, or 'Others' otherwise. Default: Preset value if container image or `alias` matched selfh.st's list or godoxy's list; `Docker` for a docker containers; `Others` otherwise Allowed Values / Syntax: string Property: description Description: A short description shown under app name Default: empty Allowed Values / Syntax: string Property: widget_config Description: Reserved, may support widgets in the future Default: null Allowed Values / Syntax: widget specific ``` -------------------------------- ### Configure GoDoxy for HTTPS-only Applications Source: https://docs.godoxy.dev/Examples This configuration snippet demonstrates how to set up a service to be proxied via HTTPS. It explicitly sets `proxy.scheme` to `https` and optionally disables TLS verification (`proxy.no_tls_verify`) for applications using self-signed certificates or maintaining only local connections. ```yaml services: smtp: image: bytemark/smtp container_name: smtp restart: always environment: ... labels: # set it to proxy to https proxy.smtp.scheme: https # disable TLS, assuming the app is using self signed cert # and maintains only local connection. proxy.smtp.no_tls_verify: true ``` -------------------------------- ### Nginx Equivalents for Header Modification Source: https://docs.godoxy.dev/Middlewares Provides Nginx configuration examples that achieve similar header modification functionalities as the `modify_request` and `modify_response` middlewares, including adding, setting, and clearing headers. ```Nginx location / { add_header X-Custom-Header1 value1, value2; more_set_headers "X-Custom-Header1: value1, value2"; more_set_headers "X-Custom-Header2: value3"; more_clear_headers "X-Custom-Header1"; more_clear_headers "X-Custom-Header2"; } ``` -------------------------------- ### GoDoxy Metrics Environment Variables Source: https://docs.godoxy.dev/Home Environment variables to disable specific metric collection types in GoDoxy, allowing users to control what system data is gathered (CPU, memory, disk I/O, network I/O, and sensor information). ```APIDOC GODOXY_METRICS_DISABLE_CPU: Disable cpu usage collection (Default: false, Type: boolean) GODOXY_METRICS_DISABLE_MEMORY: Disable memory usage collection (Default: false, Type: boolean) GODOXY_METRICS_DISABLE_DISK: Disable disk usage, I/O collection (Default: false, Type: boolean) GODOXY_METRICS_DISABLE_NETWORK: Disable network I/O collection (Default: false, Type: boolean) GODOXY_METRICS_DISABLE_SENSORS: Disable sensors info collection (Default: false, Type: boolean) ``` -------------------------------- ### Docker Compose Port Exposure for Proxy Visibility Source: https://docs.godoxy.dev/Docker-labels-and-Route-Files Provides an example of how to expose container ports within a Docker Compose configuration, which is crucial for ensuring that containers are discoverable and routable by the GoDoxy proxy. ```yaml services: nginx-1: expose: - 80 ``` -------------------------------- ### Configure GoDoxy for Idle-Sleep Functionality Source: https://docs.godoxy.dev/Examples This configuration demonstrates how to enable idle-sleep for a service, allowing GoDoxy to automatically put the service to sleep after a specified period of inactivity. The `proxy.idle_timeout` label defines the duration before the service is considered idle. ```yaml services: app: ... labels: proxy.idle_timeout: 1h30s ``` -------------------------------- ### Docker Label Configuration for CIDR Whitelist Source: https://docs.godoxy.dev/Access-Control Example of configuring a CIDR whitelist middleware using Docker labels, specifying allowed IP ranges, status code, and a custom message for forbidden access. ```yaml proxy.#1.middlewares.cidr_whitelist: | allow: - 10.0.0.0/8 - 192.168.0.0/16 status_code: 403 message: "IP not allowed" ``` -------------------------------- ### Configure Gotify Notifications in YAML Source: https://docs.godoxy.dev/Notifications Example YAML configuration for enabling Gotify notifications in GoDoxy. This snippet defines a notification entry named 'gotify' using the 'gotify' provider, specifying the Gotify server URL and an authentication token for secure communication. ```yaml notification: - name: gotify provider: gotify url: https://gotify.my.site token: abcdef.12345 ``` -------------------------------- ### Configure Add Headers Middleware Source: https://docs.godoxy.dev/Middlewares Examples illustrating how to use the `add_headers` option within the request modification middleware to append new HTTP headers, provided for both Docker labels and route file configurations. ```YAML # docker labels proxy.myapp.middlewares.request.add_headers: | X-Custom-Header1: value1, value2 X-Custom-Header2: value3 ``` ```YAML # route file myapp: middlewares: request: add_headers: X-Custom-Header1: value1, value2 X-Custom-Header2: value3 ``` -------------------------------- ### GoDoxy Core Configuration Parameters Source: https://docs.godoxy.dev/Idle-Sleep Defines the core configuration parameters for GoDoxy's idle sleep functionality, including timeouts, stop methods, and dependency management. Each parameter specifies its label, purpose, example usage, default value, and accepted input formats. ```APIDOC GoDoxy Configuration Parameters: Parameter: idle_timeout Description: inactivity timeout before put it into sleep ❌TCP/UDP Example: 1h30s Default: empty (disabled) Accepted values: number[unit]... Parameter: wake_timeout Description: time to wait for target site to be ready Example: Default: 30s Accepted values: number[unit]... Parameter: stop_method Description: method to stop after idle_timeout Example: Default: stop Accepted values: stop, pause, kill Parameter: stop_timeout Description: time to wait for stop command Example: Default: 10s Accepted values: number[unit]... Parameter: stop_signal Description: signal sent to container for stop and kill methods Example: Default: docker's default Accepted values: SIGINT, SIGTERM, SIGHUP, SIGQUIT and those without SIG prefix Parameter: start_endpoint Description: allow waking only from specific endpoint Example: /start Default: empty (allow any) Accepted values: relative URI Parameter: depends_on Description: container to wait and wake/stop together Example: Default: depends_on field from docker compose file Accepted values: alias or docker compose service[:condition] ``` -------------------------------- ### Configure Load Balancing using a Route File Source: https://docs.godoxy.dev/Load-Balancing This example illustrates how to define load balancing for multiple hosts using a GoDoxy route file. It groups 'whoami' hosts with different IP addresses under the same 'load_balance.link', demonstrating how to apply 'round_robin' mode. ```yaml whoami-1: host: 10.0.2.1 load_balance: link: whoami mode: round_robin whoami-2: host: 10.0.2.2 load_balance: link: whoami whoami-3: host: 10.0.2.3 load_balance: link: whoami ``` -------------------------------- ### Configure Set Headers Middleware Source: https://docs.godoxy.dev/Middlewares Examples demonstrating how to use the `set_headers` option within the request modification middleware to set or overwrite HTTP headers, shown for both Docker labels and route file configurations. ```YAML # docker labels proxy.myapp.middlewares.request.set_headers: | X-Custom-Header1: value1, value2 X-Real-IP: $$remote_host ``` ```YAML # route file myapp: middlewares: request: set_headers: X-Custom-Header1: value1, value2 X-Real-IP: $remote_host ``` -------------------------------- ### Configure Load Balancing with Docker Compose (Single Node) Source: https://docs.godoxy.dev/Load-Balancing This example demonstrates how to configure a service for load balancing using Docker Compose. It sets up a 'whoami' service with 10 replicas and applies load balancing labels with a 'round_robin' mode, linking them under 'whoami'. ```yaml services: whoami: image: traefik/whoami deploy: replicas: 10 labels: proxy.*.load_balance: | link: whoami mode: round_robin ports: - 80 restart: unless-stopped ``` -------------------------------- ### Real IP Middleware API Documentation Source: https://docs.godoxy.dev/Middlewares Documentation for the 'real_ip' middleware, used for accurately resolving the client's true IP address from a specified header (e.g., X-Real-IP). This affects logging and other IP-dependent middlewares like CIDRWhitelist. It details configuration options including header, trusted CIDRs, and recursive mode behavior with an illustrative example. ```APIDOC Name: real_ip Description: This middleware is used for resolving the correct client IP from real_ip.header (e.g. X-Real-IP). This affects $remote_addr and $remote_host, IP in the access log, and CIDRWhitelist Middleware. Recommended to use on entrypoint. Options: header: Description: Real IP header Default: X-Real-IP Required: No from: Description: List of trusted CIDRs Default: "" Required: Yes recursive: Description: Recursive mode Default: true Required: No Recursive Mode Explanation: true: Choose the first IP that does not match the 'from' list false: Choose the last IP that does not match the 'from' list Example: X-Forwarded-For: 1.2.3.4, 192.168.0.123, 10.0.0.123 from: 192.168.0.0/16 Recursive true Result: 1.2.3.4 Recursive false Result: 10.0.0.123 ``` -------------------------------- ### Example Webhook JSON Payload Source: https://docs.godoxy.dev/Notifications An illustrative JSON structure for a webhook payload, demonstrating how to use the available variables ($title, $fields, $color) within an embed object for services like Discord. This example shows a basic embed configuration. ```json { "embeds": [ { "title": $title, "fields": $fields, "color": "$color" } ] } ``` -------------------------------- ### Basic GoDoxy Docker Provider Configuration Source: https://docs.godoxy.dev/Configurations This snippet demonstrates a fundamental GoDoxy configuration file, specifically setting up a Docker provider. It shows how to define the Docker host for local operations within the `providers` section. ```yaml providers: docker: local: $DOCKER_HOST ``` -------------------------------- ### Define Middlewares using Compose or Entrypoint Syntax Source: https://docs.godoxy.dev/Middlewares Illustrates the YAML syntax for defining middlewares in `middleware compose` files (e.g., `config/middlewares/whitelist.yml`) or directly within the `entrypoint` section of `config.yml`. It shows how to specify middleware usage and its associated options, such as `CloudflareRealIP` and `CIDRWhitelist`. ```yaml # middleware compose / entrypoint middleware syntax : - use: {middleware} {option1}: {value1} {option2}: {value2} ... # middleware compose # config/middlewares/whitelist.yml myWhitelist: - use: CloudflareRealIP - use: CIDRWhitelist allow: - 127.0.0.1 - 223.0.0.0/8 # config/config.yml entrypoint: middlewares: - use: CloudflareRealIP - use: CIDRWhitelist allow: - 127.0.0.1 - 223.0.0.0/8 ``` -------------------------------- ### GoDoxy Entrypoint and Access Log Configuration Source: https://docs.godoxy.dev/Configurations This configuration snippet defines how GoDoxy handles incoming requests. It includes setting up middleware, such as a CIDR Whitelist for access control with specific allowed IP ranges and custom error responses. Additionally, it configures access logging, specifying the format, output path, and options for filtering and fields. ```yaml entrypoint: middlewares: - use: CIDRWhitelist allow: - "127.0.0.1" - "10.0.0.0/8" - "192.168.0.0/16" status: 403 message: "Forbidden" access_log: format: combined path: /app/logs/access.log filters: ... fields: ... ``` -------------------------------- ### Defining Services with Short Aliases for Main Domain Access Source: https://docs.godoxy.dev/Certificates-and-domain-matching Illustrates how to configure services within your `docker compose` or `config.yml` with short aliases. When `match_domains` is set, these services will be accessible at `[alias].my.app`. ```yaml services: adguard: # adguard.my.app ... labels: proxy.aliases: adguard sonarr: # sonarr.my.app ... labels: proxy.aliases: sonarr ``` -------------------------------- ### GoDoxy File Server Configuration Properties Reference Source: https://docs.godoxy.dev/Docker-labels-and-Route-Files Details the essential properties for configuring the GoDoxy file server, specifically defining the scheme and the root directory from which files will be served. ```APIDOC scheme: Description: set it to fileserver root: Description: the root directory to serve files from ```