From 514aa0333774acedf89ea21c4e022cdeb88c9b69 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 08:29:40 +0000 Subject: [PATCH] Deployed e176e07 to master with MkDocs 1.6.1 and mike 2.1.3 --- .../getting-started/docker/index.html | 45 ++++++++++-------- master/search/search_index.json | 2 +- master/sitemap.xml | 22 ++++----- master/sitemap.xml.gz | Bin 303 -> 303 bytes 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/master/documentation/getting-started/docker/index.html b/master/documentation/getting-started/docker/index.html index 978b4bd..7613bcf 100644 --- a/master/documentation/getting-started/docker/index.html +++ b/master/documentation/getting-started/docker/index.html @@ -1,4 +1,4 @@ - Docker - WireGuard Portal
Skip to content

Docker

Image Usage

The preferred way to start WireGuard Portal as Docker container is to use Docker Compose.

A sample docker-compose.yml:

---
+ Docker - WireGuard Portal      

Docker

Image Usage

The WireGuard Portal Docker image is available on both Docker Hub and GitHub Container Registry. It is built on the official Alpine Linux base image and comes pre-packaged with all necessary WireGuard dependencies.

This container allows you to establish WireGuard VPN connections without relying on a host system that supports WireGuard or using the linuxserver/wireguard Docker image.

The recommended method for deploying WireGuard Portal is via Docker Compose for ease of configuration and management.

A sample docker-compose.yml:

---
 services:
   wg-portal:
     image: wgportal/wg-portal:latest
@@ -15,15 +15,16 @@
       - /etc/wireguard:/etc/wireguard
       - ./data:/app/data
       - ./config:/app/config
-

By default, the webserver is listening on port 8888.

Volumes for /app/data and /app/config should be used ensure data persistence across container restarts.

Image Versioning

All images are hosted on Docker Hub at https://hub.docker.com/r/wgportal/wg-portal. There are three types of tags in the repository:

Semantic versioned tags

For example, 1.0.19.

These are official releases of WireGuard Portal. They correspond to the GitHub tags that we make, and you can see the release notes for them here: https://github.com/h44z/wg-portal/releases.

Once these tags show up in this repository, they will never change.

For production deployments of WireGuard Portal, we strongly recommend using one of these tags, e.g. wgportal/wg-portal:1.0.19, instead of the latest or canary tags.

If you only want to stay at the same major or major+minor version, use either v[MAJOR] or [MAJOR].[MINOR] tags. For example v1 or 1.0.

Version 1 is currently stable, version 2 is in development.

latest

This is the most recent build to master! It changes a lot and is very unstable.

We recommend that you don't use it except for development purposes.

Branch tags

For each commit in the master and the stable branch, a corresponding Docker image is build. These images use the master or stable tags.

Configuration

You can configure WireGuard Portal using a yaml configuration file. The filepath of the yaml configuration file defaults to /app/config/config.yml. It is possible to override the configuration filepath using the environment variable WG_PORTAL_CONFIG.

By default, WireGuard Portal uses a SQLite database. The database is stored in /app/data/sqlite.db.

You should mount those directories as a volume:

  • /app/data
  • /app/config

A detailed description of the configuration options can be found here.

Running WireGuard inside Docker

Modern Linux distributions ship with a kernel that supports WireGuard out of the box. This means that you can run WireGuard directly on the host system without the need for a Docker container. WireGuard Portal can then manage the WireGuard interfaces directly on the host.

If you still want to run WireGuard inside a Docker container, you can use the following example docker-compose.yml:

services:
+

By default, the webserver is listening on port 8888.

Volumes for /app/data and /app/config should be used ensure data persistence across container restarts.

WireGuard Interface Handling

WireGuard Portal supports managing WireGuard interfaces through three distinct deployment methods, providing flexibility based on your system architecture and operational preferences:

  • Directly on the host system: WireGuard Portal can control WireGuard interfaces natively on the host, without using containers. This setup is ideal for environments where direct access to system networking is preferred. To use this method, you need to set the network mode to host in your docker-compose.yml file.

    services:
    +  wg-portal:
    +    ...
    +    network_mode: "host"
    +    ...
    +

  • Within the WireGuard Portal Docker container: WireGuard interfaces can be managed directly from within the WireGuard Portal container itself. This is the recommended approach when running WireGuard Portal via Docker, as it encapsulates all functionality in a single, portable container without requiring a separate WireGuard host or image. The sample docker-compose.yml file provided above is configured for this method.

  • Via a separate Docker container: WireGuard Portal can interface with and control WireGuard running in another Docker container, such as the linuxserver/wireguard image. This method is useful in setups that already use linuxserver/wireguard or where you want to isolate the VPN backend from the portal frontend. For this, you need to set the network mode to service:wireguard in your docker-compose.yml file, wireguard is the service name of your WireGuard container.

    services:
       wg-portal:
         image: wgportal/wg-portal:latest
         container_name: wg-portal
    -    restart: unless-stopped
    -    logging:
    -      options:
    -        max-size: "10m"
    -        max-file: "3"
    +    ...
         cap_add:
           - NET_ADMIN
         network_mode: "service:wireguard" # So we ensure to stay on the same network as the wireguard container.
    @@ -33,19 +34,19 @@
           - ./wg/config:/app/config
     
       wireguard:
    -      image: lscr.io/linuxserver/wireguard:latest
    -      container_name: wireguard
    -      restart: unless-stopped
    -      cap_add:
    -        - NET_ADMIN
    -      ports:
    -        - "51820:51820/udp" # WireGuard port, needs to match the port in wg-portal interface config
    -        - "127.0.0.1:8888:8888" # Noticed that the port of the web UI is exposed in the wireguard container.
    -      volumes:
    -        - ./wg/etc:/config/wg_confs # We share the configuration (wgx.conf) between wg-portal and wireguard
    -      sysctls:
    -        - net.ipv4.conf.all.src_valid_mark=1
    -

    For this to work, you need to have at least the following configuration set in your WireGuard Portal config:

    core:
    +    image: lscr.io/linuxserver/wireguard:latest
    +    container_name: wireguard
    +    restart: unless-stopped
    +    cap_add:
    +      - NET_ADMIN
    +    ports:
    +      - "51820:51820/udp" # WireGuard port, needs to match the port in wg-portal interface config
    +      - "8888:8888/tcp" # Noticed that the port of the web UI is exposed in the wireguard container.
    +    volumes:
    +      - ./wg/etc:/config/wg_confs # We share the configuration (wgx.conf) between wg-portal and wireguard
    +    sysctls:
    +      - net.ipv4.conf.all.src_valid_mark=1
    +
    As the linuxserver/wireguard image uses wg-quick to manage the interfaces, you need to have at least the following configuration set for WireGuard Portal:
    core:
       # The WireGuard container uses wg-quick to manage the WireGuard interfaces - this conflicts with WireGuard Portal during startup.
       # To avoid this, we need to set the restore_state option to false so that wg-quick can create the interfaces.
       restore_state: false
    @@ -54,4 +55,6 @@
     advanced:
       # WireGuard Portal needs to export the WireGuard configuration as wg-quick config files so that the WireGuard container can use them.
       config_storage_path: /etc/wireguard/
    -

    Also make sure that you restart the WireGuard container after you create or delete an interface in WireGuard Portal.

\ No newline at end of file +

Image Versioning

All images are hosted on Docker Hub at https://hub.docker.com/r/wgportal/wg-portal or in the GitHub Container Registry. There are three types of tags in the repository:

Semantic versioned tags

For example, 2.0.0-rc.1 or v2.0.0-rc.1.

These are official releases of WireGuard Portal. They correspond to the GitHub tags that we make, and you can see the release notes for them here: https://github.com/h44z/wg-portal/releases.

Once these tags show up in this repository, they will never change.

For production deployments of WireGuard Portal, we strongly recommend using one of these tags, e.g. wgportal/wg-portal:1.0.19, instead of the latest or canary tags.

If you only want to stay at the same major or major+minor version, use either v[MAJOR] or [MAJOR].[MINOR] tags. For example v1 or 1.0.

Version 1 is currently stable, version 2 is in development.

latest

This is the most recent build to master! It changes a lot and is very unstable.

We recommend that you don't use it except for development purposes.

Branch tags

For each commit in the master and the stable branch, a corresponding Docker image is build. These images use the master or stable tags.

Configuration

You can configure WireGuard Portal using a YAML configuration file. The filepath of the YAML configuration file defaults to /app/config/config.yml. It is possible to override the configuration filepath using the environment variable WG_PORTAL_CONFIG.

By default, WireGuard Portal uses an SQLite database. The database is stored in /app/data/sqlite.db.

You should mount those directories as a volume:

  • /app/data
  • /app/config

A detailed description of the configuration options can be found here.

If you want to access configuration files in wg-quick format, you can mount the /etc/wireguard directory to a location of your choice. Also enable the config_storage_path option in the configuration file:

advanced:
+  config_storage_path: /etc/wireguard
+

\ No newline at end of file diff --git a/master/search/search_index.json b/master/search/search_index.json index 9d58bf0..986357a 100644 --- a/master/search/search_index.json +++ b/master/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"documentation/overview/","title":"Overview","text":"

WireGuard Portal is a simple, web-based configuration portal for WireGuard server management. The portal uses the WireGuard wgctrl library to manage existing VPN interfaces. This allows for the seamless activation or deactivation of new users without disturbing existing VPN connections.

The configuration portal supports using a database (SQLite, MySQL, MsSQL or Postgres), OAuth or LDAP (Active Directory or OpenLDAP) as a user source for authentication and profile data.

"},{"location":"documentation/overview/#features","title":"Features","text":""},{"location":"documentation/configuration/examples/","title":"Examples","text":"

Below are some sample YAML configurations demonstrating how to override some default values.

"},{"location":"documentation/configuration/examples/#basic","title":"Basic","text":"
core:\n  admin_user: test@example.com\n  admin_password: password\n  admin_api_token: super-s3cr3t-api-token-or-a-UUID\n  import_existing: false\n  create_default_peer: true\n  self_provisioning_allowed: true\n\nweb:\n  site_title: My WireGuard Server\n  site_company_name: My Company\n  listening_address: :8080\n  external_url: https://my.externa-domain.com\n  csrf_secret: super-s3cr3t-csrf\n  session_secret: super-s3cr3t-session\n  request_logging: true\n\nadvanced:\n  log_level: trace\n  log_pretty: true\n  log_json: false\n  config_storage_path: /etc/wireguard\n  expiry_check_interval: 5m\n\ndatabase:\n  debug: true\n  type: sqlite\n  dsn: data/sqlite.db\n
"},{"location":"documentation/configuration/examples/#ldap-authentication-and-synchronization","title":"LDAP Authentication and Synchronization","text":"
# ... (basic configuration)\n\nauth:\n  ldap:\n    # a sample LDAP provider with user sync enabled\n    - id: ldap\n      provider_name: Active Directory\n      url: ldap://srv-ad1.company.local:389\n      bind_user: ldap_wireguard@company.local\n      bind_pass: super-s3cr3t-ldap\n      base_dn: DC=COMPANY,DC=LOCAL\n      login_filter: (&(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2))\n      sync_interval: 15m\n      sync_filter: (&(objectClass=organizationalPerson)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*))\n      disable_missing: true\n      field_map:\n        user_identifier: sAMAccountName\n        email: mail\n        firstname: givenName\n        lastname: sn\n        phone: telephoneNumber\n        department: department\n        memberof: memberOf\n      admin_group: CN=WireGuardAdmins,OU=Some-OU,DC=COMPANY,DC=LOCAL\n      registration_enabled: true\n      log_user_info: true\n
"},{"location":"documentation/configuration/examples/#openid-connect-oidc-authentication","title":"OpenID Connect (OIDC) Authentication","text":"
# ... (basic configuration)\n\nauth:\n  oidc:\n    # a sample Entra ID provider with environment variable substitution\n    - id: azure\n      provider_name: azure\n      display_name: Login with</br>Entra ID\n      registration_enabled: true\n      base_url: \"https://login.microsoftonline.com/${AZURE_TENANT_ID}/v2.0\"\n      client_id: \"${AZURE_CLIENT_ID}\"\n      client_secret: \"${AZURE_CLIENT_SECRET}\"\n      extra_scopes:\n        - profile\n        - email\n\n    # a sample provider where users with the attribute `wg_admin` set to `true` are considered as admins\n    - id: oidc-with-admin-attribute\n      provider_name: google\n      display_name: Login with</br>Google\n      base_url: https://accounts.google.com\n      client_id: the-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      extra_scopes:\n        - https://www.googleapis.com/auth/userinfo.email\n        - https://www.googleapis.com/auth/userinfo.profile\n      field_map:\n        user_identifier: sub\n        email: email\n        firstname: given_name\n        lastname: family_name\n        phone: phone_number\n        department: department\n        is_admin: wg_admin\n      admin_mapping:\n        admin_value_regex: ^true$\n      registration_enabled: true\n      log_user_info: true\n\n    # a sample provider where users in the group `the-admin-group` are considered as admins\n    - id: oidc-with-admin-group\n      provider_name: google2\n      display_name: Login with</br>Google2\n      base_url: https://accounts.google.com\n      client_id: another-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      extra_scopes:\n        - https://www.googleapis.com/auth/userinfo.email\n        - https://www.googleapis.com/auth/userinfo.profile\n      field_map:\n        user_identifier: sub\n        email: email\n        firstname: given_name\n        lastname: family_name\n        phone: phone_number\n        department: department\n        user_groups: groups\n      admin_mapping:\n        admin_group_regex: ^the-admin-group$\n      registration_enabled: true\n      log_user_info: true\n
"},{"location":"documentation/configuration/examples/#plain-oauth2-authentication","title":"Plain OAuth2 Authentication","text":"
# ... (basic configuration)\n\nauth:\n  oauth:\n    # a sample provider where users with the attribute `this-attribute-must-be-true` set to `true` or `True`\n    # are considered as admins\n    - id: google_plain_oauth-with-admin-attribute\n      provider_name: google3\n      display_name: Login with</br>Google3\n      client_id: another-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      auth_url: https://accounts.google.com/o/oauth2/v2/auth\n      token_url: https://oauth2.googleapis.com/token\n      user_info_url: https://openidconnect.googleapis.com/v1/userinfo\n      scopes:\n        - openid\n        - email\n        - profile\n      field_map:\n        user_identifier: sub\n        email: email\n        firstname: name\n        is_admin: this-attribute-must-be-true\n      admin_mapping:\n        admin_value_regex: ^(True|true)$\n      registration_enabled: true\n\n    # a sample provider where either users with the attribute `this-attribute-must-be-true` set to `true` or \n    # users in the group `admin-group-name` are considered as admins\n    - id: google_plain_oauth_with_groups\n      provider_name: google4\n      display_name: Login with</br>Google4\n      client_id: another-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      auth_url: https://accounts.google.com/o/oauth2/v2/auth\n      token_url: https://oauth2.googleapis.com/token\n      user_info_url: https://openidconnect.googleapis.com/v1/userinfo\n      scopes:\n        - openid\n        - email\n        - profile\n        - i-want-some-groups\n      field_map:\n        email: email\n        firstname: name\n        user_identifier: sub\n        is_admin: this-attribute-must-be-true\n        user_groups: groups\n      admin_mapping:\n        admin_value_regex: ^true$\n        admin_group_regex: ^admin-group-name$\n      registration_enabled: true\n      log_user_info: true\n
"},{"location":"documentation/configuration/overview/","title":"Overview","text":"

This page provides an overview of all available configuration options for WireGuard Portal.

You can supply these configurations in a YAML file (e.g. config.yaml) when starting the Portal. The path of the configuration file defaults to config/config.yml in the working directory of the executable. It is possible to override configuration filepath using the environment variable WG_PORTAL_CONFIG. For example: WG_PORTAL_CONFIG=/etc/wg-portal/config.yaml ./wg-portal. Also, environment variable substitution in config file is supported. Refer to syntax.

Configuration examples are available on the Examples page.

Default configuration
core:\n  admin_user: admin@wgportal.local\n  admin_password: wgportal\n  editable_keys: true\n  create_default_peer: false\n  create_default_peer_on_creation: false\n  re_enable_peer_after_user_enable: true\n  delete_peer_after_user_deleted: false\n  self_provisioning_allowed: false\n  import_existing: true\n  restore_state: true\n\nadvanced:\n  log_level: info\n  log_pretty: false\n  log_json: false\n  start_listen_port: 51820\n  start_cidr_v4: 10.11.12.0/24\n  start_cidr_v6: fdfd:d3ad:c0de:1234::0/64\n  use_ip_v6: true\n  config_storage_path: \"\"\n  expiry_check_interval: 15m\n  rule_prio_offset: 20000\n  api_admin_only: true\n\ndatabase:\n  debug: false\n  slow_query_threshold: 0\n  type: sqlite\n  dsn: data/sqlite.db\n\nstatistics:\n  use_ping_checks: true\n  ping_check_workers: 10\n  ping_unprivileged: false\n  ping_check_interval: 1m\n  data_collection_interval: 1m\n  collect_interface_data: true\n  collect_peer_data: true\n  collect_audit_data: true\n  listening_address: :8787\n\nmail:\n  host: 127.0.0.1\n  port: 25\n  encryption: none\n  cert_validation: true\n  username: \"\"\n  password: \"\"\n  auth_type: plain\n  from: Wireguard Portal <noreply@wireguard.local>\n  link_only: false\n\nauth:\n  oidc: []\n  oauth: []\n  ldap: []\n\nweb:\n  listening_address: :8888\n  external_url: http://localhost:8888\n  site_company_name: WireGuard Portal\n  site_title: WireGuard Portal\n  session_identifier: wgPortalSession\n  session_secret: very_secret\n  csrf_secret: extremely_secret\n  request_logging: false\n  cert_file: \"\"\n  key_File: \"\"\n\nwebhook:\n  url: \"\"\n  authentication: \"\"\n  timeout: 10s\n

Below you will find sections like core, advanced, database, statistics, mail, auth, web and webhook. Each section describes the individual configuration keys, their default values, and a brief explanation of their purpose.

"},{"location":"documentation/configuration/overview/#core","title":"Core","text":"

These are the primary configuration options that control fundamental WireGuard Portal behavior. More advanced options are found in the subsequent Advanced section.

"},{"location":"documentation/configuration/overview/#admin_user","title":"admin_user","text":""},{"location":"documentation/configuration/overview/#admin_password","title":"admin_password","text":""},{"location":"documentation/configuration/overview/#admin_api_token","title":"admin_api_token","text":""},{"location":"documentation/configuration/overview/#editable_keys","title":"editable_keys","text":""},{"location":"documentation/configuration/overview/#create_default_peer","title":"create_default_peer","text":""},{"location":"documentation/configuration/overview/#create_default_peer_on_creation","title":"create_default_peer_on_creation","text":""},{"location":"documentation/configuration/overview/#re_enable_peer_after_user_enable","title":"re_enable_peer_after_user_enable","text":""},{"location":"documentation/configuration/overview/#delete_peer_after_user_deleted","title":"delete_peer_after_user_deleted","text":""},{"location":"documentation/configuration/overview/#self_provisioning_allowed","title":"self_provisioning_allowed","text":""},{"location":"documentation/configuration/overview/#import_existing","title":"import_existing","text":""},{"location":"documentation/configuration/overview/#restore_state","title":"restore_state","text":""},{"location":"documentation/configuration/overview/#advanced","title":"Advanced","text":"

Additional or more specialized configuration options for logging and interface creation details.

"},{"location":"documentation/configuration/overview/#log_level","title":"log_level","text":""},{"location":"documentation/configuration/overview/#log_pretty","title":"log_pretty","text":""},{"location":"documentation/configuration/overview/#log_json","title":"log_json","text":""},{"location":"documentation/configuration/overview/#start_listen_port","title":"start_listen_port","text":""},{"location":"documentation/configuration/overview/#start_cidr_v4","title":"start_cidr_v4","text":""},{"location":"documentation/configuration/overview/#start_cidr_v6","title":"start_cidr_v6","text":""},{"location":"documentation/configuration/overview/#use_ip_v6","title":"use_ip_v6","text":""},{"location":"documentation/configuration/overview/#config_storage_path","title":"config_storage_path","text":""},{"location":"documentation/configuration/overview/#expiry_check_interval","title":"expiry_check_interval","text":""},{"location":"documentation/configuration/overview/#rule_prio_offset","title":"rule_prio_offset","text":""},{"location":"documentation/configuration/overview/#route_table_offset","title":"route_table_offset","text":""},{"location":"documentation/configuration/overview/#api_admin_only","title":"api_admin_only","text":""},{"location":"documentation/configuration/overview/#database","title":"Database","text":"

Configuration for the underlying database used by WireGuard Portal. Supported databases include SQLite, MySQL, Microsoft SQL Server, and Postgres.

"},{"location":"documentation/configuration/overview/#debug","title":"debug","text":""},{"location":"documentation/configuration/overview/#slow_query_threshold","title":"slow_query_threshold","text":""},{"location":"documentation/configuration/overview/#type","title":"type","text":""},{"location":"documentation/configuration/overview/#dsn","title":"dsn","text":""},{"location":"documentation/configuration/overview/#statistics","title":"Statistics","text":"

Controls how WireGuard Portal collects and reports usage statistics, including ping checks and Prometheus metrics.

"},{"location":"documentation/configuration/overview/#use_ping_checks","title":"use_ping_checks","text":""},{"location":"documentation/configuration/overview/#ping_check_workers","title":"ping_check_workers","text":""},{"location":"documentation/configuration/overview/#ping_unprivileged","title":"ping_unprivileged","text":""},{"location":"documentation/configuration/overview/#ping_check_interval","title":"ping_check_interval","text":""},{"location":"documentation/configuration/overview/#data_collection_interval","title":"data_collection_interval","text":""},{"location":"documentation/configuration/overview/#collect_interface_data","title":"collect_interface_data","text":""},{"location":"documentation/configuration/overview/#collect_peer_data","title":"collect_peer_data","text":""},{"location":"documentation/configuration/overview/#collect_audit_data","title":"collect_audit_data","text":""},{"location":"documentation/configuration/overview/#listening_address","title":"listening_address","text":""},{"location":"documentation/configuration/overview/#mail","title":"Mail","text":"

Options for configuring email notifications or sending peer configurations via email.

"},{"location":"documentation/configuration/overview/#host","title":"host","text":""},{"location":"documentation/configuration/overview/#port","title":"port","text":""},{"location":"documentation/configuration/overview/#encryption","title":"encryption","text":""},{"location":"documentation/configuration/overview/#cert_validation","title":"cert_validation","text":""},{"location":"documentation/configuration/overview/#username","title":"username","text":""},{"location":"documentation/configuration/overview/#password","title":"password","text":""},{"location":"documentation/configuration/overview/#auth_type","title":"auth_type","text":""},{"location":"documentation/configuration/overview/#from","title":"from","text":""},{"location":"documentation/configuration/overview/#link_only","title":"link_only","text":""},{"location":"documentation/configuration/overview/#auth","title":"Auth","text":"

WireGuard Portal supports multiple authentication strategies, including OpenID Connect (oidc), OAuth (oauth), and LDAP (ldap). Each can have multiple providers configured. Below are the relevant keys.

"},{"location":"documentation/configuration/overview/#oidc","title":"OIDC","text":"

The oidc array contains a list of OpenID Connect providers. Below are the properties for each OIDC provider entry inside auth.oidc:

"},{"location":"documentation/configuration/overview/#provider_name","title":"provider_name","text":""},{"location":"documentation/configuration/overview/#display_name","title":"display_name","text":""},{"location":"documentation/configuration/overview/#base_url","title":"base_url","text":""},{"location":"documentation/configuration/overview/#client_id","title":"client_id","text":""},{"location":"documentation/configuration/overview/#client_secret","title":"client_secret","text":""},{"location":"documentation/configuration/overview/#extra_scopes","title":"extra_scopes","text":""},{"location":"documentation/configuration/overview/#field_map","title":"field_map","text":""},{"location":"documentation/configuration/overview/#admin_mapping","title":"admin_mapping","text":""},{"location":"documentation/configuration/overview/#registration_enabled","title":"registration_enabled","text":""},{"location":"documentation/configuration/overview/#log_user_info","title":"log_user_info","text":""},{"location":"documentation/configuration/overview/#oauth","title":"OAuth","text":"

The oauth array contains a list of plain OAuth2 providers. Below are the properties for each OAuth provider entry inside auth.oauth:

"},{"location":"documentation/configuration/overview/#provider_name_1","title":"provider_name","text":""},{"location":"documentation/configuration/overview/#display_name_1","title":"display_name","text":""},{"location":"documentation/configuration/overview/#client_id_1","title":"client_id","text":""},{"location":"documentation/configuration/overview/#client_secret_1","title":"client_secret","text":""},{"location":"documentation/configuration/overview/#auth_url","title":"auth_url","text":""},{"location":"documentation/configuration/overview/#token_url","title":"token_url","text":""},{"location":"documentation/configuration/overview/#user_info_url","title":"user_info_url","text":""},{"location":"documentation/configuration/overview/#scopes","title":"scopes","text":""},{"location":"documentation/configuration/overview/#field_map_1","title":"field_map","text":""},{"location":"documentation/configuration/overview/#admin_mapping_1","title":"admin_mapping","text":""},{"location":"documentation/configuration/overview/#registration_enabled_1","title":"registration_enabled","text":""},{"location":"documentation/configuration/overview/#log_user_info_1","title":"log_user_info","text":""},{"location":"documentation/configuration/overview/#ldap","title":"LDAP","text":"

The ldap array contains a list of LDAP authentication providers. Below are the properties for each LDAP provider entry inside auth.ldap:

"},{"location":"documentation/configuration/overview/#provider_name_2","title":"provider_name","text":""},{"location":"documentation/configuration/overview/#url","title":"url","text":""},{"location":"documentation/configuration/overview/#start_tls","title":"start_tls","text":""},{"location":"documentation/configuration/overview/#cert_validation_1","title":"cert_validation","text":""},{"location":"documentation/configuration/overview/#tls_certificate_path","title":"tls_certificate_path","text":""},{"location":"documentation/configuration/overview/#tls_key_path","title":"tls_key_path","text":""},{"location":"documentation/configuration/overview/#base_dn","title":"base_dn","text":""},{"location":"documentation/configuration/overview/#bind_user","title":"bind_user","text":""},{"location":"documentation/configuration/overview/#bind_pass","title":"bind_pass","text":""},{"location":"documentation/configuration/overview/#field_map_2","title":"field_map","text":""},{"location":"documentation/configuration/overview/#login_filter","title":"login_filter","text":""},{"location":"documentation/configuration/overview/#admin_group","title":"admin_group","text":""},{"location":"documentation/configuration/overview/#sync_interval","title":"sync_interval","text":""},{"location":"documentation/configuration/overview/#sync_filter","title":"sync_filter","text":""},{"location":"documentation/configuration/overview/#disable_missing","title":"disable_missing","text":""},{"location":"documentation/configuration/overview/#auto_re_enable","title":"auto_re_enable","text":""},{"location":"documentation/configuration/overview/#registration_enabled_2","title":"registration_enabled","text":""},{"location":"documentation/configuration/overview/#log_user_info_2","title":"log_user_info","text":""},{"location":"documentation/configuration/overview/#web","title":"Web","text":"

The web section contains configuration options for the web server, including the listening address, session management, and CSRF protection. It is important to specify a valid external_url for the web server, especially if you are using a reverse proxy. Without a valid external_url, the login process may fail due to CSRF protection.

"},{"location":"documentation/configuration/overview/#listening_address_1","title":"listening_address","text":""},{"location":"documentation/configuration/overview/#external_url","title":"external_url","text":""},{"location":"documentation/configuration/overview/#site_company_name","title":"site_company_name","text":""},{"location":"documentation/configuration/overview/#site_title","title":"site_title","text":""},{"location":"documentation/configuration/overview/#session_identifier","title":"session_identifier","text":""},{"location":"documentation/configuration/overview/#session_secret","title":"session_secret","text":""},{"location":"documentation/configuration/overview/#csrf_secret","title":"csrf_secret","text":""},{"location":"documentation/configuration/overview/#request_logging","title":"request_logging","text":""},{"location":"documentation/configuration/overview/#cert_file","title":"cert_file","text":""},{"location":"documentation/configuration/overview/#key_file","title":"key_file","text":""},{"location":"documentation/configuration/overview/#webhook","title":"Webhook","text":"

The webhook section allows you to configure a webhook that is called on certain events in WireGuard Portal. A JSON object is sent in a POST request to the webhook URL with the following structure:

{\n  \"event\": \"peer_created\",\n  \"entity\": \"peer\",\n  \"identifier\": \"the-peer-identifier\",\n  \"payload\": {\n    // The payload of the event, e.g. peer data.\n    // Check the API documentation for the exact structure.\n  }\n}\n

"},{"location":"documentation/configuration/overview/#url_1","title":"url","text":""},{"location":"documentation/configuration/overview/#authentication","title":"authentication","text":""},{"location":"documentation/configuration/overview/#timeout","title":"timeout","text":""},{"location":"documentation/getting-started/binaries/","title":"Binaries","text":"

Starting from v2, each release includes compiled binaries for supported platforms. These binary versions can be manually downloaded and installed.

"},{"location":"documentation/getting-started/binaries/#download","title":"Download","text":"

With curl:

curl -L -o wg-portal https://github.com/h44z/wg-portal/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64 \n

With wget:

wget -O wg-portal https://github.com/h44z/wg-portal/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64\n

with gh cli:

gh release download ${WG_PORTAL_VERSION} --repo h44z/wg-portal --output wg-portal --pattern '*amd64'\n
"},{"location":"documentation/getting-started/binaries/#install","title":"Install","text":"
sudo mkdir -p /opt/wg-portal\nsudo install wg-portal /opt/wg-portal/\n
"},{"location":"documentation/getting-started/binaries/#unreleased","title":"Unreleased","text":"

Unreleased versions could be downloaded from GitHub Workflow artifacts also.

"},{"location":"documentation/getting-started/docker/","title":"Docker","text":""},{"location":"documentation/getting-started/docker/#image-usage","title":"Image Usage","text":"

The preferred way to start WireGuard Portal as Docker container is to use Docker Compose.

A sample docker-compose.yml:

---\nservices:\n  wg-portal:\n    image: wgportal/wg-portal:latest\n    container_name: wg-portal\n    restart: unless-stopped\n    logging:\n      options:\n        max-size: \"10m\"\n        max-file: \"3\"\n    cap_add:\n      - NET_ADMIN\n    network_mode: \"host\"\n    volumes:\n      - /etc/wireguard:/etc/wireguard\n      - ./data:/app/data\n      - ./config:/app/config\n

By default, the webserver is listening on port 8888.

Volumes for /app/data and /app/config should be used ensure data persistence across container restarts.

"},{"location":"documentation/getting-started/docker/#image-versioning","title":"Image Versioning","text":"

All images are hosted on Docker Hub at https://hub.docker.com/r/wgportal/wg-portal. There are three types of tags in the repository:

"},{"location":"documentation/getting-started/docker/#semantic-versioned-tags","title":"Semantic versioned tags","text":"

For example, 1.0.19.

These are official releases of WireGuard Portal. They correspond to the GitHub tags that we make, and you can see the release notes for them here: https://github.com/h44z/wg-portal/releases.

Once these tags show up in this repository, they will never change.

For production deployments of WireGuard Portal, we strongly recommend using one of these tags, e.g. wgportal/wg-portal:1.0.19, instead of the latest or canary tags.

If you only want to stay at the same major or major+minor version, use either v[MAJOR] or [MAJOR].[MINOR] tags. For example v1 or 1.0.

Version 1 is currently stable, version 2 is in development.

"},{"location":"documentation/getting-started/docker/#latest","title":"latest","text":"

This is the most recent build to master! It changes a lot and is very unstable.

We recommend that you don't use it except for development purposes.

"},{"location":"documentation/getting-started/docker/#branch-tags","title":"Branch tags","text":"

For each commit in the master and the stable branch, a corresponding Docker image is build. These images use the master or stable tags.

"},{"location":"documentation/getting-started/docker/#configuration","title":"Configuration","text":"

You can configure WireGuard Portal using a yaml configuration file. The filepath of the yaml configuration file defaults to /app/config/config.yml. It is possible to override the configuration filepath using the environment variable WG_PORTAL_CONFIG.

By default, WireGuard Portal uses a SQLite database. The database is stored in /app/data/sqlite.db.

You should mount those directories as a volume:

A detailed description of the configuration options can be found here.

"},{"location":"documentation/getting-started/docker/#running-wireguard-inside-docker","title":"Running WireGuard inside Docker","text":"

Modern Linux distributions ship with a kernel that supports WireGuard out of the box. This means that you can run WireGuard directly on the host system without the need for a Docker container. WireGuard Portal can then manage the WireGuard interfaces directly on the host.

If you still want to run WireGuard inside a Docker container, you can use the following example docker-compose.yml:

services:\n  wg-portal:\n    image: wgportal/wg-portal:latest\n    container_name: wg-portal\n    restart: unless-stopped\n    logging:\n      options:\n        max-size: \"10m\"\n        max-file: \"3\"\n    cap_add:\n      - NET_ADMIN\n    network_mode: \"service:wireguard\" # So we ensure to stay on the same network as the wireguard container.\n    volumes:\n      - ./wg/etc:/etc/wireguard\n      - ./wg/data:/app/data\n      - ./wg/config:/app/config\n\n  wireguard:\n      image: lscr.io/linuxserver/wireguard:latest\n      container_name: wireguard\n      restart: unless-stopped\n      cap_add:\n        - NET_ADMIN\n      ports:\n        - \"51820:51820/udp\" # WireGuard port, needs to match the port in wg-portal interface config\n        - \"127.0.0.1:8888:8888\" # Noticed that the port of the web UI is exposed in the wireguard container.\n      volumes:\n        - ./wg/etc:/config/wg_confs # We share the configuration (wgx.conf) between wg-portal and wireguard\n      sysctls:\n        - net.ipv4.conf.all.src_valid_mark=1\n

For this to work, you need to have at least the following configuration set in your WireGuard Portal config:

core:\n  # The WireGuard container uses wg-quick to manage the WireGuard interfaces - this conflicts with WireGuard Portal during startup.\n  # To avoid this, we need to set the restore_state option to false so that wg-quick can create the interfaces.\n  restore_state: false\n  # Usually, there are no existing interfaces in the WireGuard container, so we can set this to false.\n  import_existing: false\nadvanced:\n  # WireGuard Portal needs to export the WireGuard configuration as wg-quick config files so that the WireGuard container can use them.\n  config_storage_path: /etc/wireguard/\n

Also make sure that you restart the WireGuard container after you create or delete an interface in WireGuard Portal.

"},{"location":"documentation/getting-started/helm/","title":"Helm","text":""},{"location":"documentation/getting-started/helm/#installing-the-chart","title":"Installing the Chart","text":"

To install the chart with the release name wg-portal:

helm install wg-portal oci://ghcr.io/h44z/charts/wg-portal\n

This command deploy wg-portal on the Kubernetes cluster in the default configuration. The Values section lists the parameters that can be configured during installation.

"},{"location":"documentation/getting-started/helm/#values","title":"Values","text":"Key Type Default Description nameOverride string \"\" Partially override resource names (adds suffix) fullnameOverride string \"\" Fully override resource names extraDeploy list [] Array of extra objects to deploy with the release config.advanced tpl/object {} Advanced configuration options. config.auth tpl/object {} Auth configuration options. config.core tpl/object {} Core configuration options. If external admins in auth are defined and there are no admin_user and admin_password defined here, the default admin account will be disabled. config.database tpl/object {} Database configuration options config.mail tpl/object {} Mail configuration options config.statistics tpl/object {} Statistics configuration options config.web tpl/object {} Web configuration options. listening_address will be set automatically from service.web.port. external_url is required to enable ingress and certificate resources. revisionHistoryLimit string 10 The number of old ReplicaSets to retain to allow rollback. workloadType string \"Deployment\" Workload type - Deployment or StatefulSet strategy object {\"type\":\"RollingUpdate\"} Update strategy for the workload Valid values are: RollingUpdate or Recreate for Deployment, RollingUpdate or OnDelete for StatefulSet image.repository string \"ghcr.io/h44z/wg-portal\" Image repository image.pullPolicy string \"IfNotPresent\" Image pull policy image.tag string \"\" Overrides the image tag whose default is the chart appVersion imagePullSecrets list [] Image pull secrets podAnnotations tpl/object {} Extra annotations to add to the pod podLabels object {} Extra labels to add to the pod podSecurityContext object {} Pod Security Context securityContext.capabilities.add list [\"NET_ADMIN\"] Add capabilities to the container initContainers tpl/list [] Pod init containers sidecarContainers tpl/list [] Pod sidecar containers dnsPolicy string \"ClusterFirst\" Set DNS policy for the pod. Valid values are ClusterFirstWithHostNet, ClusterFirst, Default or None. restartPolicy string \"Always\" Restart policy for all containers within the pod. Valid values are Always, OnFailure or Never. hostNetwork string false. Use the host's network namespace. resources object {} Resources requests and limits command list [] Overwrite pod command args list [] Additional pod arguments env tpl/list [] Additional environment variables envFrom tpl/list [] Additional environment variables from a secret or configMap livenessProbe object {} Liveness probe configuration readinessProbe object {} Readiness probe configuration startupProbe object {} Startup probe configuration volumes tpl/list [] Additional volumes volumeMounts tpl/list [] Additional volumeMounts nodeSelector object {\"kubernetes.io/os\":\"linux\"} Node Selector configuration tolerations list [] Tolerations configuration affinity object {} Affinity configuration service.mixed.enabled bool false Whether to create a single service for the web and wireguard interfaces service.mixed.type string \"LoadBalancer\" Service type service.web.annotations object {} Annotations for the web service service.web.type string \"ClusterIP\" Web service type service.web.port int 8888 Web service port Used for the web interface listener service.web.appProtocol string \"http\" Web service appProtocol. Will be auto set to https if certificate is enabled. service.wireguard.annotations object {} Annotations for the WireGuard service service.wireguard.type string \"LoadBalancer\" Wireguard service type service.wireguard.ports list [51820] Wireguard service ports. Exposes the WireGuard ports for created interfaces. Lowerest port is selected as start port for the first interface. Increment next port by 1 for each additional interface. service.metrics.port int 8787 ingress.enabled bool false Specifies whether an ingress resource should be created ingress.className string \"\" Ingress class name ingress.annotations object {} Ingress annotations ingress.tls bool false Ingress TLS configuration. Enable certificate resource or add ingress annotation to create required secret certificate.enabled bool false Specifies whether a certificate resource should be created. If enabled, certificate will be used for the web. certificate.issuer.name string \"\" Certificate issuer name certificate.issuer.kind string \"\" Certificate issuer kind (ClusterIssuer or Issuer) certificate.issuer.group string \"cert-manager.io\" Certificate issuer group certificate.duration string \"\" Optional. Documentation certificate.renewBefore string \"\" Optional. Documentation certificate.commonName string \"\" Optional. Documentation certificate.emailAddresses list [] Optional. Documentation certificate.ipAddresses list [] Optional. Documentation certificate.keystores object {} Optional. Documentation certificate.privateKey object {} Optional. Documentation certificate.secretTemplate object {} Optional. Documentation certificate.subject object {} Optional. Documentation certificate.uris list [] Optional. Documentation certificate.usages list [] Optional. Documentation persistence.enabled bool false Specifies whether an persistent volume should be created persistence.annotations object {} Persistent Volume Claim annotations persistence.storageClass string \"\" Persistent Volume storage class. If undefined (the default) cluster's default provisioner will be used. persistence.accessMode string \"ReadWriteOnce\" Persistent Volume Access Mode persistence.size string \"1Gi\" Persistent Volume size persistence.volumeName string \"\" Persistent Volume Name (optional) serviceAccount.create bool true Specifies whether a service account should be created serviceAccount.annotations object {} Service account annotations serviceAccount.automount bool false Automatically mount a ServiceAccount's API credentials serviceAccount.name string \"\" The name of the service account to use. If not set and create is true, a name is generated using the fullname template monitoring.enabled bool false Enable Prometheus monitoring. monitoring.apiVersion string \"monitoring.coreos.com/v1\" API version of the Prometheus resource. Use azmonitoring.coreos.com/v1 for Azure Managed Prometheus. monitoring.kind string \"PodMonitor\" Kind of the Prometheus resource. Could be PodMonitor or ServiceMonitor. monitoring.labels object {} Resource labels. monitoring.annotations object {} Resource annotations. monitoring.interval string 1m Interval at which metrics should be scraped. If not specified config.statistics.data_collection_interval interval is used. monitoring.metricRelabelings list [] Relabelings to samples before ingestion. monitoring.relabelings list [] Relabelings to samples before scraping. monitoring.scrapeTimeout string \"\" Timeout after which the scrape is ended If not specified, the Prometheus global scrape interval is used. monitoring.jobLabel string \"\" The label to use to retrieve the job name from. monitoring.podTargetLabels object {} Transfers labels on the Kubernetes Pod onto the target. monitoring.dashboard.enabled bool false Enable Grafana dashboard. monitoring.dashboard.annotations object {} Annotations for the dashboard ConfigMap. monitoring.dashboard.labels object {} Additional labels for the dashboard ConfigMap. monitoring.dashboard.namespace string \"\" Dashboard ConfigMap namespace Overrides the namespace for the dashboard ConfigMap."},{"location":"documentation/getting-started/sources/","title":"Sources","text":"

To build the application from source files, use the Makefile provided in the repository.

"},{"location":"documentation/getting-started/sources/#requirements","title":"Requirements","text":""},{"location":"documentation/getting-started/sources/#build","title":"Build","text":"
# Get source code\ngit clone https://github.com/h44z/wg-portal -b ${WG_PORTAL_VERSION:-master} --depth 1\ncd wg-portal\n# Build the frontend\nmake frontend\n# Build the backend\nmake build\n
"},{"location":"documentation/getting-started/sources/#install","title":"Install","text":"

Compiled binary will be available in ./dist directory. For installation instructions, check the Binaries section.

"},{"location":"documentation/monitoring/prometheus/","title":"Monitoring","text":"

By default, WG-Portal exposes Prometheus metrics on port 8787 if interface/peer statistic data collection is enabled.

"},{"location":"documentation/monitoring/prometheus/#exposed-metrics","title":"Exposed Metrics","text":"Metric Type Description wireguard_interface_received_bytes_total gauge Bytes received through the interface. wireguard_interface_sent_bytes_total gauge Bytes sent through the interface. wireguard_peer_last_handshake_seconds gauge Seconds from the last handshake with the peer. wireguard_peer_received_bytes_total gauge Bytes received from the peer. wireguard_peer_sent_bytes_total gauge Bytes sent to the peer. wireguard_peer_up gauge Peer connection state (boolean: 1/0)."},{"location":"documentation/monitoring/prometheus/#prometheus-config","title":"Prometheus Config","text":"

Add following scrape job to your Prometheus config file:

# prometheus.yaml\nscrape_configs:\n  - job_name: wg-portal\n    scrape_interval: 60s\n    static_configs:\n      - targets:\n          - localhost:8787 # Change localhost to IP Address or hostname with WG-Portal\n
"},{"location":"documentation/monitoring/prometheus/#grafana-dashboard","title":"Grafana Dashboard","text":"

You may import dashboard.json into your Grafana instance.

"},{"location":"documentation/rest-api/api-doc/","title":"REST API","text":""},{"location":"documentation/upgrade/v1/","title":"Upgrade","text":"

For production deployments of WireGuard Portal, we strongly recommend using version 1. If you want to use version 2, please be aware that it is still a release candidate and not yet fully stable.

"},{"location":"documentation/upgrade/v1/#upgrade-from-v1-to-v2","title":"Upgrade from v1 to v2","text":"

Before upgrading from V1, make sure that you have a backup of your currently working configuration files and database!

To start the upgrade process, start the wg-portal binary with the -migrateFrom parameter. The configuration (config.yml) for WireGuard Portal must be updated and valid before starting the upgrade.

To upgrade from a previous SQLite database, start wg-portal like:

./wg-portal-amd64 -migrateFrom=old_wg_portal.db\n

You can also specify the database type using the parameter -migrateFromType, supported types: mysql, mssql, postgres or sqlite. For example:

./wg-portal-amd64 -migrateFromType=mysql -migrateFrom='user:pass@tcp(1.2.3.4:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local'\n

The upgrade will transform the old, existing database and store the values in the new database specified in the config.yml configuration file. Ensure that the new database does not contain any data!

If you are using Docker, you can adapt the docker-compose.yml file to start the upgrade process:

services:\n  wg-portal:\n    image: wgportal/wg-portal:latest\n    # ... other settings\n    restart: no\n    command: [\"-migrateFrom=/app/data/wg_portal.db\"]\n
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"documentation/overview/","title":"Overview","text":"

WireGuard Portal is a simple, web-based configuration portal for WireGuard server management. The portal uses the WireGuard wgctrl library to manage existing VPN interfaces. This allows for the seamless activation or deactivation of new users without disturbing existing VPN connections.

The configuration portal supports using a database (SQLite, MySQL, MsSQL or Postgres), OAuth or LDAP (Active Directory or OpenLDAP) as a user source for authentication and profile data.

"},{"location":"documentation/overview/#features","title":"Features","text":""},{"location":"documentation/configuration/examples/","title":"Examples","text":"

Below are some sample YAML configurations demonstrating how to override some default values.

"},{"location":"documentation/configuration/examples/#basic","title":"Basic","text":"
core:\n  admin_user: test@example.com\n  admin_password: password\n  admin_api_token: super-s3cr3t-api-token-or-a-UUID\n  import_existing: false\n  create_default_peer: true\n  self_provisioning_allowed: true\n\nweb:\n  site_title: My WireGuard Server\n  site_company_name: My Company\n  listening_address: :8080\n  external_url: https://my.externa-domain.com\n  csrf_secret: super-s3cr3t-csrf\n  session_secret: super-s3cr3t-session\n  request_logging: true\n\nadvanced:\n  log_level: trace\n  log_pretty: true\n  log_json: false\n  config_storage_path: /etc/wireguard\n  expiry_check_interval: 5m\n\ndatabase:\n  debug: true\n  type: sqlite\n  dsn: data/sqlite.db\n
"},{"location":"documentation/configuration/examples/#ldap-authentication-and-synchronization","title":"LDAP Authentication and Synchronization","text":"
# ... (basic configuration)\n\nauth:\n  ldap:\n    # a sample LDAP provider with user sync enabled\n    - id: ldap\n      provider_name: Active Directory\n      url: ldap://srv-ad1.company.local:389\n      bind_user: ldap_wireguard@company.local\n      bind_pass: super-s3cr3t-ldap\n      base_dn: DC=COMPANY,DC=LOCAL\n      login_filter: (&(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2))\n      sync_interval: 15m\n      sync_filter: (&(objectClass=organizationalPerson)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*))\n      disable_missing: true\n      field_map:\n        user_identifier: sAMAccountName\n        email: mail\n        firstname: givenName\n        lastname: sn\n        phone: telephoneNumber\n        department: department\n        memberof: memberOf\n      admin_group: CN=WireGuardAdmins,OU=Some-OU,DC=COMPANY,DC=LOCAL\n      registration_enabled: true\n      log_user_info: true\n
"},{"location":"documentation/configuration/examples/#openid-connect-oidc-authentication","title":"OpenID Connect (OIDC) Authentication","text":"
# ... (basic configuration)\n\nauth:\n  oidc:\n    # a sample Entra ID provider with environment variable substitution\n    - id: azure\n      provider_name: azure\n      display_name: Login with</br>Entra ID\n      registration_enabled: true\n      base_url: \"https://login.microsoftonline.com/${AZURE_TENANT_ID}/v2.0\"\n      client_id: \"${AZURE_CLIENT_ID}\"\n      client_secret: \"${AZURE_CLIENT_SECRET}\"\n      extra_scopes:\n        - profile\n        - email\n\n    # a sample provider where users with the attribute `wg_admin` set to `true` are considered as admins\n    - id: oidc-with-admin-attribute\n      provider_name: google\n      display_name: Login with</br>Google\n      base_url: https://accounts.google.com\n      client_id: the-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      extra_scopes:\n        - https://www.googleapis.com/auth/userinfo.email\n        - https://www.googleapis.com/auth/userinfo.profile\n      field_map:\n        user_identifier: sub\n        email: email\n        firstname: given_name\n        lastname: family_name\n        phone: phone_number\n        department: department\n        is_admin: wg_admin\n      admin_mapping:\n        admin_value_regex: ^true$\n      registration_enabled: true\n      log_user_info: true\n\n    # a sample provider where users in the group `the-admin-group` are considered as admins\n    - id: oidc-with-admin-group\n      provider_name: google2\n      display_name: Login with</br>Google2\n      base_url: https://accounts.google.com\n      client_id: another-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      extra_scopes:\n        - https://www.googleapis.com/auth/userinfo.email\n        - https://www.googleapis.com/auth/userinfo.profile\n      field_map:\n        user_identifier: sub\n        email: email\n        firstname: given_name\n        lastname: family_name\n        phone: phone_number\n        department: department\n        user_groups: groups\n      admin_mapping:\n        admin_group_regex: ^the-admin-group$\n      registration_enabled: true\n      log_user_info: true\n
"},{"location":"documentation/configuration/examples/#plain-oauth2-authentication","title":"Plain OAuth2 Authentication","text":"
# ... (basic configuration)\n\nauth:\n  oauth:\n    # a sample provider where users with the attribute `this-attribute-must-be-true` set to `true` or `True`\n    # are considered as admins\n    - id: google_plain_oauth-with-admin-attribute\n      provider_name: google3\n      display_name: Login with</br>Google3\n      client_id: another-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      auth_url: https://accounts.google.com/o/oauth2/v2/auth\n      token_url: https://oauth2.googleapis.com/token\n      user_info_url: https://openidconnect.googleapis.com/v1/userinfo\n      scopes:\n        - openid\n        - email\n        - profile\n      field_map:\n        user_identifier: sub\n        email: email\n        firstname: name\n        is_admin: this-attribute-must-be-true\n      admin_mapping:\n        admin_value_regex: ^(True|true)$\n      registration_enabled: true\n\n    # a sample provider where either users with the attribute `this-attribute-must-be-true` set to `true` or \n    # users in the group `admin-group-name` are considered as admins\n    - id: google_plain_oauth_with_groups\n      provider_name: google4\n      display_name: Login with</br>Google4\n      client_id: another-client-id-1234.apps.googleusercontent.com\n      client_secret: A_CLIENT_SECRET\n      auth_url: https://accounts.google.com/o/oauth2/v2/auth\n      token_url: https://oauth2.googleapis.com/token\n      user_info_url: https://openidconnect.googleapis.com/v1/userinfo\n      scopes:\n        - openid\n        - email\n        - profile\n        - i-want-some-groups\n      field_map:\n        email: email\n        firstname: name\n        user_identifier: sub\n        is_admin: this-attribute-must-be-true\n        user_groups: groups\n      admin_mapping:\n        admin_value_regex: ^true$\n        admin_group_regex: ^admin-group-name$\n      registration_enabled: true\n      log_user_info: true\n
"},{"location":"documentation/configuration/overview/","title":"Overview","text":"

This page provides an overview of all available configuration options for WireGuard Portal.

You can supply these configurations in a YAML file (e.g. config.yaml) when starting the Portal. The path of the configuration file defaults to config/config.yml in the working directory of the executable. It is possible to override configuration filepath using the environment variable WG_PORTAL_CONFIG. For example: WG_PORTAL_CONFIG=/etc/wg-portal/config.yaml ./wg-portal. Also, environment variable substitution in config file is supported. Refer to syntax.

Configuration examples are available on the Examples page.

Default configuration
core:\n  admin_user: admin@wgportal.local\n  admin_password: wgportal\n  editable_keys: true\n  create_default_peer: false\n  create_default_peer_on_creation: false\n  re_enable_peer_after_user_enable: true\n  delete_peer_after_user_deleted: false\n  self_provisioning_allowed: false\n  import_existing: true\n  restore_state: true\n\nadvanced:\n  log_level: info\n  log_pretty: false\n  log_json: false\n  start_listen_port: 51820\n  start_cidr_v4: 10.11.12.0/24\n  start_cidr_v6: fdfd:d3ad:c0de:1234::0/64\n  use_ip_v6: true\n  config_storage_path: \"\"\n  expiry_check_interval: 15m\n  rule_prio_offset: 20000\n  api_admin_only: true\n\ndatabase:\n  debug: false\n  slow_query_threshold: 0\n  type: sqlite\n  dsn: data/sqlite.db\n\nstatistics:\n  use_ping_checks: true\n  ping_check_workers: 10\n  ping_unprivileged: false\n  ping_check_interval: 1m\n  data_collection_interval: 1m\n  collect_interface_data: true\n  collect_peer_data: true\n  collect_audit_data: true\n  listening_address: :8787\n\nmail:\n  host: 127.0.0.1\n  port: 25\n  encryption: none\n  cert_validation: true\n  username: \"\"\n  password: \"\"\n  auth_type: plain\n  from: Wireguard Portal <noreply@wireguard.local>\n  link_only: false\n\nauth:\n  oidc: []\n  oauth: []\n  ldap: []\n\nweb:\n  listening_address: :8888\n  external_url: http://localhost:8888\n  site_company_name: WireGuard Portal\n  site_title: WireGuard Portal\n  session_identifier: wgPortalSession\n  session_secret: very_secret\n  csrf_secret: extremely_secret\n  request_logging: false\n  cert_file: \"\"\n  key_File: \"\"\n\nwebhook:\n  url: \"\"\n  authentication: \"\"\n  timeout: 10s\n

Below you will find sections like core, advanced, database, statistics, mail, auth, web and webhook. Each section describes the individual configuration keys, their default values, and a brief explanation of their purpose.

"},{"location":"documentation/configuration/overview/#core","title":"Core","text":"

These are the primary configuration options that control fundamental WireGuard Portal behavior. More advanced options are found in the subsequent Advanced section.

"},{"location":"documentation/configuration/overview/#admin_user","title":"admin_user","text":""},{"location":"documentation/configuration/overview/#admin_password","title":"admin_password","text":""},{"location":"documentation/configuration/overview/#admin_api_token","title":"admin_api_token","text":""},{"location":"documentation/configuration/overview/#editable_keys","title":"editable_keys","text":""},{"location":"documentation/configuration/overview/#create_default_peer","title":"create_default_peer","text":""},{"location":"documentation/configuration/overview/#create_default_peer_on_creation","title":"create_default_peer_on_creation","text":""},{"location":"documentation/configuration/overview/#re_enable_peer_after_user_enable","title":"re_enable_peer_after_user_enable","text":""},{"location":"documentation/configuration/overview/#delete_peer_after_user_deleted","title":"delete_peer_after_user_deleted","text":""},{"location":"documentation/configuration/overview/#self_provisioning_allowed","title":"self_provisioning_allowed","text":""},{"location":"documentation/configuration/overview/#import_existing","title":"import_existing","text":""},{"location":"documentation/configuration/overview/#restore_state","title":"restore_state","text":""},{"location":"documentation/configuration/overview/#advanced","title":"Advanced","text":"

Additional or more specialized configuration options for logging and interface creation details.

"},{"location":"documentation/configuration/overview/#log_level","title":"log_level","text":""},{"location":"documentation/configuration/overview/#log_pretty","title":"log_pretty","text":""},{"location":"documentation/configuration/overview/#log_json","title":"log_json","text":""},{"location":"documentation/configuration/overview/#start_listen_port","title":"start_listen_port","text":""},{"location":"documentation/configuration/overview/#start_cidr_v4","title":"start_cidr_v4","text":""},{"location":"documentation/configuration/overview/#start_cidr_v6","title":"start_cidr_v6","text":""},{"location":"documentation/configuration/overview/#use_ip_v6","title":"use_ip_v6","text":""},{"location":"documentation/configuration/overview/#config_storage_path","title":"config_storage_path","text":""},{"location":"documentation/configuration/overview/#expiry_check_interval","title":"expiry_check_interval","text":""},{"location":"documentation/configuration/overview/#rule_prio_offset","title":"rule_prio_offset","text":""},{"location":"documentation/configuration/overview/#route_table_offset","title":"route_table_offset","text":""},{"location":"documentation/configuration/overview/#api_admin_only","title":"api_admin_only","text":""},{"location":"documentation/configuration/overview/#database","title":"Database","text":"

Configuration for the underlying database used by WireGuard Portal. Supported databases include SQLite, MySQL, Microsoft SQL Server, and Postgres.

"},{"location":"documentation/configuration/overview/#debug","title":"debug","text":""},{"location":"documentation/configuration/overview/#slow_query_threshold","title":"slow_query_threshold","text":""},{"location":"documentation/configuration/overview/#type","title":"type","text":""},{"location":"documentation/configuration/overview/#dsn","title":"dsn","text":""},{"location":"documentation/configuration/overview/#statistics","title":"Statistics","text":"

Controls how WireGuard Portal collects and reports usage statistics, including ping checks and Prometheus metrics.

"},{"location":"documentation/configuration/overview/#use_ping_checks","title":"use_ping_checks","text":""},{"location":"documentation/configuration/overview/#ping_check_workers","title":"ping_check_workers","text":""},{"location":"documentation/configuration/overview/#ping_unprivileged","title":"ping_unprivileged","text":""},{"location":"documentation/configuration/overview/#ping_check_interval","title":"ping_check_interval","text":""},{"location":"documentation/configuration/overview/#data_collection_interval","title":"data_collection_interval","text":""},{"location":"documentation/configuration/overview/#collect_interface_data","title":"collect_interface_data","text":""},{"location":"documentation/configuration/overview/#collect_peer_data","title":"collect_peer_data","text":""},{"location":"documentation/configuration/overview/#collect_audit_data","title":"collect_audit_data","text":""},{"location":"documentation/configuration/overview/#listening_address","title":"listening_address","text":""},{"location":"documentation/configuration/overview/#mail","title":"Mail","text":"

Options for configuring email notifications or sending peer configurations via email.

"},{"location":"documentation/configuration/overview/#host","title":"host","text":""},{"location":"documentation/configuration/overview/#port","title":"port","text":""},{"location":"documentation/configuration/overview/#encryption","title":"encryption","text":""},{"location":"documentation/configuration/overview/#cert_validation","title":"cert_validation","text":""},{"location":"documentation/configuration/overview/#username","title":"username","text":""},{"location":"documentation/configuration/overview/#password","title":"password","text":""},{"location":"documentation/configuration/overview/#auth_type","title":"auth_type","text":""},{"location":"documentation/configuration/overview/#from","title":"from","text":""},{"location":"documentation/configuration/overview/#link_only","title":"link_only","text":""},{"location":"documentation/configuration/overview/#auth","title":"Auth","text":"

WireGuard Portal supports multiple authentication strategies, including OpenID Connect (oidc), OAuth (oauth), and LDAP (ldap). Each can have multiple providers configured. Below are the relevant keys.

"},{"location":"documentation/configuration/overview/#oidc","title":"OIDC","text":"

The oidc array contains a list of OpenID Connect providers. Below are the properties for each OIDC provider entry inside auth.oidc:

"},{"location":"documentation/configuration/overview/#provider_name","title":"provider_name","text":""},{"location":"documentation/configuration/overview/#display_name","title":"display_name","text":""},{"location":"documentation/configuration/overview/#base_url","title":"base_url","text":""},{"location":"documentation/configuration/overview/#client_id","title":"client_id","text":""},{"location":"documentation/configuration/overview/#client_secret","title":"client_secret","text":""},{"location":"documentation/configuration/overview/#extra_scopes","title":"extra_scopes","text":""},{"location":"documentation/configuration/overview/#field_map","title":"field_map","text":""},{"location":"documentation/configuration/overview/#admin_mapping","title":"admin_mapping","text":""},{"location":"documentation/configuration/overview/#registration_enabled","title":"registration_enabled","text":""},{"location":"documentation/configuration/overview/#log_user_info","title":"log_user_info","text":""},{"location":"documentation/configuration/overview/#oauth","title":"OAuth","text":"

The oauth array contains a list of plain OAuth2 providers. Below are the properties for each OAuth provider entry inside auth.oauth:

"},{"location":"documentation/configuration/overview/#provider_name_1","title":"provider_name","text":""},{"location":"documentation/configuration/overview/#display_name_1","title":"display_name","text":""},{"location":"documentation/configuration/overview/#client_id_1","title":"client_id","text":""},{"location":"documentation/configuration/overview/#client_secret_1","title":"client_secret","text":""},{"location":"documentation/configuration/overview/#auth_url","title":"auth_url","text":""},{"location":"documentation/configuration/overview/#token_url","title":"token_url","text":""},{"location":"documentation/configuration/overview/#user_info_url","title":"user_info_url","text":""},{"location":"documentation/configuration/overview/#scopes","title":"scopes","text":""},{"location":"documentation/configuration/overview/#field_map_1","title":"field_map","text":""},{"location":"documentation/configuration/overview/#admin_mapping_1","title":"admin_mapping","text":""},{"location":"documentation/configuration/overview/#registration_enabled_1","title":"registration_enabled","text":""},{"location":"documentation/configuration/overview/#log_user_info_1","title":"log_user_info","text":""},{"location":"documentation/configuration/overview/#ldap","title":"LDAP","text":"

The ldap array contains a list of LDAP authentication providers. Below are the properties for each LDAP provider entry inside auth.ldap:

"},{"location":"documentation/configuration/overview/#provider_name_2","title":"provider_name","text":""},{"location":"documentation/configuration/overview/#url","title":"url","text":""},{"location":"documentation/configuration/overview/#start_tls","title":"start_tls","text":""},{"location":"documentation/configuration/overview/#cert_validation_1","title":"cert_validation","text":""},{"location":"documentation/configuration/overview/#tls_certificate_path","title":"tls_certificate_path","text":""},{"location":"documentation/configuration/overview/#tls_key_path","title":"tls_key_path","text":""},{"location":"documentation/configuration/overview/#base_dn","title":"base_dn","text":""},{"location":"documentation/configuration/overview/#bind_user","title":"bind_user","text":""},{"location":"documentation/configuration/overview/#bind_pass","title":"bind_pass","text":""},{"location":"documentation/configuration/overview/#field_map_2","title":"field_map","text":""},{"location":"documentation/configuration/overview/#login_filter","title":"login_filter","text":""},{"location":"documentation/configuration/overview/#admin_group","title":"admin_group","text":""},{"location":"documentation/configuration/overview/#sync_interval","title":"sync_interval","text":""},{"location":"documentation/configuration/overview/#sync_filter","title":"sync_filter","text":""},{"location":"documentation/configuration/overview/#disable_missing","title":"disable_missing","text":""},{"location":"documentation/configuration/overview/#auto_re_enable","title":"auto_re_enable","text":""},{"location":"documentation/configuration/overview/#registration_enabled_2","title":"registration_enabled","text":""},{"location":"documentation/configuration/overview/#log_user_info_2","title":"log_user_info","text":""},{"location":"documentation/configuration/overview/#web","title":"Web","text":"

The web section contains configuration options for the web server, including the listening address, session management, and CSRF protection. It is important to specify a valid external_url for the web server, especially if you are using a reverse proxy. Without a valid external_url, the login process may fail due to CSRF protection.

"},{"location":"documentation/configuration/overview/#listening_address_1","title":"listening_address","text":""},{"location":"documentation/configuration/overview/#external_url","title":"external_url","text":""},{"location":"documentation/configuration/overview/#site_company_name","title":"site_company_name","text":""},{"location":"documentation/configuration/overview/#site_title","title":"site_title","text":""},{"location":"documentation/configuration/overview/#session_identifier","title":"session_identifier","text":""},{"location":"documentation/configuration/overview/#session_secret","title":"session_secret","text":""},{"location":"documentation/configuration/overview/#csrf_secret","title":"csrf_secret","text":""},{"location":"documentation/configuration/overview/#request_logging","title":"request_logging","text":""},{"location":"documentation/configuration/overview/#cert_file","title":"cert_file","text":""},{"location":"documentation/configuration/overview/#key_file","title":"key_file","text":""},{"location":"documentation/configuration/overview/#webhook","title":"Webhook","text":"

The webhook section allows you to configure a webhook that is called on certain events in WireGuard Portal. A JSON object is sent in a POST request to the webhook URL with the following structure:

{\n  \"event\": \"peer_created\",\n  \"entity\": \"peer\",\n  \"identifier\": \"the-peer-identifier\",\n  \"payload\": {\n    // The payload of the event, e.g. peer data.\n    // Check the API documentation for the exact structure.\n  }\n}\n

"},{"location":"documentation/configuration/overview/#url_1","title":"url","text":""},{"location":"documentation/configuration/overview/#authentication","title":"authentication","text":""},{"location":"documentation/configuration/overview/#timeout","title":"timeout","text":""},{"location":"documentation/getting-started/binaries/","title":"Binaries","text":"

Starting from v2, each release includes compiled binaries for supported platforms. These binary versions can be manually downloaded and installed.

"},{"location":"documentation/getting-started/binaries/#download","title":"Download","text":"

With curl:

curl -L -o wg-portal https://github.com/h44z/wg-portal/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64 \n

With wget:

wget -O wg-portal https://github.com/h44z/wg-portal/releases/download/${WG_PORTAL_VERSION}/wg-portal_linux_amd64\n

with gh cli:

gh release download ${WG_PORTAL_VERSION} --repo h44z/wg-portal --output wg-portal --pattern '*amd64'\n
"},{"location":"documentation/getting-started/binaries/#install","title":"Install","text":"
sudo mkdir -p /opt/wg-portal\nsudo install wg-portal /opt/wg-portal/\n
"},{"location":"documentation/getting-started/binaries/#unreleased","title":"Unreleased","text":"

Unreleased versions could be downloaded from GitHub Workflow artifacts also.

"},{"location":"documentation/getting-started/docker/","title":"Docker","text":""},{"location":"documentation/getting-started/docker/#image-usage","title":"Image Usage","text":"

The WireGuard Portal Docker image is available on both Docker Hub and GitHub Container Registry. It is built on the official Alpine Linux base image and comes pre-packaged with all necessary WireGuard dependencies.

This container allows you to establish WireGuard VPN connections without relying on a host system that supports WireGuard or using the linuxserver/wireguard Docker image.

The recommended method for deploying WireGuard Portal is via Docker Compose for ease of configuration and management.

A sample docker-compose.yml:

---\nservices:\n  wg-portal:\n    image: wgportal/wg-portal:latest\n    container_name: wg-portal\n    restart: unless-stopped\n    logging:\n      options:\n        max-size: \"10m\"\n        max-file: \"3\"\n    cap_add:\n      - NET_ADMIN\n    network_mode: \"host\"\n    volumes:\n      - /etc/wireguard:/etc/wireguard\n      - ./data:/app/data\n      - ./config:/app/config\n

By default, the webserver is listening on port 8888.

Volumes for /app/data and /app/config should be used ensure data persistence across container restarts.

"},{"location":"documentation/getting-started/docker/#wireguard-interface-handling","title":"WireGuard Interface Handling","text":"

WireGuard Portal supports managing WireGuard interfaces through three distinct deployment methods, providing flexibility based on your system architecture and operational preferences:

"},{"location":"documentation/getting-started/docker/#image-versioning","title":"Image Versioning","text":"

All images are hosted on Docker Hub at https://hub.docker.com/r/wgportal/wg-portal or in the GitHub Container Registry. There are three types of tags in the repository:

"},{"location":"documentation/getting-started/docker/#semantic-versioned-tags","title":"Semantic versioned tags","text":"

For example, 2.0.0-rc.1 or v2.0.0-rc.1.

These are official releases of WireGuard Portal. They correspond to the GitHub tags that we make, and you can see the release notes for them here: https://github.com/h44z/wg-portal/releases.

Once these tags show up in this repository, they will never change.

For production deployments of WireGuard Portal, we strongly recommend using one of these tags, e.g. wgportal/wg-portal:1.0.19, instead of the latest or canary tags.

If you only want to stay at the same major or major+minor version, use either v[MAJOR] or [MAJOR].[MINOR] tags. For example v1 or 1.0.

Version 1 is currently stable, version 2 is in development.

"},{"location":"documentation/getting-started/docker/#latest","title":"latest","text":"

This is the most recent build to master! It changes a lot and is very unstable.

We recommend that you don't use it except for development purposes.

"},{"location":"documentation/getting-started/docker/#branch-tags","title":"Branch tags","text":"

For each commit in the master and the stable branch, a corresponding Docker image is build. These images use the master or stable tags.

"},{"location":"documentation/getting-started/docker/#configuration","title":"Configuration","text":"

You can configure WireGuard Portal using a YAML configuration file. The filepath of the YAML configuration file defaults to /app/config/config.yml. It is possible to override the configuration filepath using the environment variable WG_PORTAL_CONFIG.

By default, WireGuard Portal uses an SQLite database. The database is stored in /app/data/sqlite.db.

You should mount those directories as a volume:

A detailed description of the configuration options can be found here.

If you want to access configuration files in wg-quick format, you can mount the /etc/wireguard directory to a location of your choice. Also enable the config_storage_path option in the configuration file:

advanced:\n  config_storage_path: /etc/wireguard\n

"},{"location":"documentation/getting-started/helm/","title":"Helm","text":""},{"location":"documentation/getting-started/helm/#installing-the-chart","title":"Installing the Chart","text":"

To install the chart with the release name wg-portal:

helm install wg-portal oci://ghcr.io/h44z/charts/wg-portal\n

This command deploy wg-portal on the Kubernetes cluster in the default configuration. The Values section lists the parameters that can be configured during installation.

"},{"location":"documentation/getting-started/helm/#values","title":"Values","text":"Key Type Default Description nameOverride string \"\" Partially override resource names (adds suffix) fullnameOverride string \"\" Fully override resource names extraDeploy list [] Array of extra objects to deploy with the release config.advanced tpl/object {} Advanced configuration options. config.auth tpl/object {} Auth configuration options. config.core tpl/object {} Core configuration options. If external admins in auth are defined and there are no admin_user and admin_password defined here, the default admin account will be disabled. config.database tpl/object {} Database configuration options config.mail tpl/object {} Mail configuration options config.statistics tpl/object {} Statistics configuration options config.web tpl/object {} Web configuration options. listening_address will be set automatically from service.web.port. external_url is required to enable ingress and certificate resources. revisionHistoryLimit string 10 The number of old ReplicaSets to retain to allow rollback. workloadType string \"Deployment\" Workload type - Deployment or StatefulSet strategy object {\"type\":\"RollingUpdate\"} Update strategy for the workload Valid values are: RollingUpdate or Recreate for Deployment, RollingUpdate or OnDelete for StatefulSet image.repository string \"ghcr.io/h44z/wg-portal\" Image repository image.pullPolicy string \"IfNotPresent\" Image pull policy image.tag string \"\" Overrides the image tag whose default is the chart appVersion imagePullSecrets list [] Image pull secrets podAnnotations tpl/object {} Extra annotations to add to the pod podLabels object {} Extra labels to add to the pod podSecurityContext object {} Pod Security Context securityContext.capabilities.add list [\"NET_ADMIN\"] Add capabilities to the container initContainers tpl/list [] Pod init containers sidecarContainers tpl/list [] Pod sidecar containers dnsPolicy string \"ClusterFirst\" Set DNS policy for the pod. Valid values are ClusterFirstWithHostNet, ClusterFirst, Default or None. restartPolicy string \"Always\" Restart policy for all containers within the pod. Valid values are Always, OnFailure or Never. hostNetwork string false. Use the host's network namespace. resources object {} Resources requests and limits command list [] Overwrite pod command args list [] Additional pod arguments env tpl/list [] Additional environment variables envFrom tpl/list [] Additional environment variables from a secret or configMap livenessProbe object {} Liveness probe configuration readinessProbe object {} Readiness probe configuration startupProbe object {} Startup probe configuration volumes tpl/list [] Additional volumes volumeMounts tpl/list [] Additional volumeMounts nodeSelector object {\"kubernetes.io/os\":\"linux\"} Node Selector configuration tolerations list [] Tolerations configuration affinity object {} Affinity configuration service.mixed.enabled bool false Whether to create a single service for the web and wireguard interfaces service.mixed.type string \"LoadBalancer\" Service type service.web.annotations object {} Annotations for the web service service.web.type string \"ClusterIP\" Web service type service.web.port int 8888 Web service port Used for the web interface listener service.web.appProtocol string \"http\" Web service appProtocol. Will be auto set to https if certificate is enabled. service.wireguard.annotations object {} Annotations for the WireGuard service service.wireguard.type string \"LoadBalancer\" Wireguard service type service.wireguard.ports list [51820] Wireguard service ports. Exposes the WireGuard ports for created interfaces. Lowerest port is selected as start port for the first interface. Increment next port by 1 for each additional interface. service.metrics.port int 8787 ingress.enabled bool false Specifies whether an ingress resource should be created ingress.className string \"\" Ingress class name ingress.annotations object {} Ingress annotations ingress.tls bool false Ingress TLS configuration. Enable certificate resource or add ingress annotation to create required secret certificate.enabled bool false Specifies whether a certificate resource should be created. If enabled, certificate will be used for the web. certificate.issuer.name string \"\" Certificate issuer name certificate.issuer.kind string \"\" Certificate issuer kind (ClusterIssuer or Issuer) certificate.issuer.group string \"cert-manager.io\" Certificate issuer group certificate.duration string \"\" Optional. Documentation certificate.renewBefore string \"\" Optional. Documentation certificate.commonName string \"\" Optional. Documentation certificate.emailAddresses list [] Optional. Documentation certificate.ipAddresses list [] Optional. Documentation certificate.keystores object {} Optional. Documentation certificate.privateKey object {} Optional. Documentation certificate.secretTemplate object {} Optional. Documentation certificate.subject object {} Optional. Documentation certificate.uris list [] Optional. Documentation certificate.usages list [] Optional. Documentation persistence.enabled bool false Specifies whether an persistent volume should be created persistence.annotations object {} Persistent Volume Claim annotations persistence.storageClass string \"\" Persistent Volume storage class. If undefined (the default) cluster's default provisioner will be used. persistence.accessMode string \"ReadWriteOnce\" Persistent Volume Access Mode persistence.size string \"1Gi\" Persistent Volume size persistence.volumeName string \"\" Persistent Volume Name (optional) serviceAccount.create bool true Specifies whether a service account should be created serviceAccount.annotations object {} Service account annotations serviceAccount.automount bool false Automatically mount a ServiceAccount's API credentials serviceAccount.name string \"\" The name of the service account to use. If not set and create is true, a name is generated using the fullname template monitoring.enabled bool false Enable Prometheus monitoring. monitoring.apiVersion string \"monitoring.coreos.com/v1\" API version of the Prometheus resource. Use azmonitoring.coreos.com/v1 for Azure Managed Prometheus. monitoring.kind string \"PodMonitor\" Kind of the Prometheus resource. Could be PodMonitor or ServiceMonitor. monitoring.labels object {} Resource labels. monitoring.annotations object {} Resource annotations. monitoring.interval string 1m Interval at which metrics should be scraped. If not specified config.statistics.data_collection_interval interval is used. monitoring.metricRelabelings list [] Relabelings to samples before ingestion. monitoring.relabelings list [] Relabelings to samples before scraping. monitoring.scrapeTimeout string \"\" Timeout after which the scrape is ended If not specified, the Prometheus global scrape interval is used. monitoring.jobLabel string \"\" The label to use to retrieve the job name from. monitoring.podTargetLabels object {} Transfers labels on the Kubernetes Pod onto the target. monitoring.dashboard.enabled bool false Enable Grafana dashboard. monitoring.dashboard.annotations object {} Annotations for the dashboard ConfigMap. monitoring.dashboard.labels object {} Additional labels for the dashboard ConfigMap. monitoring.dashboard.namespace string \"\" Dashboard ConfigMap namespace Overrides the namespace for the dashboard ConfigMap."},{"location":"documentation/getting-started/sources/","title":"Sources","text":"

To build the application from source files, use the Makefile provided in the repository.

"},{"location":"documentation/getting-started/sources/#requirements","title":"Requirements","text":""},{"location":"documentation/getting-started/sources/#build","title":"Build","text":"
# Get source code\ngit clone https://github.com/h44z/wg-portal -b ${WG_PORTAL_VERSION:-master} --depth 1\ncd wg-portal\n# Build the frontend\nmake frontend\n# Build the backend\nmake build\n
"},{"location":"documentation/getting-started/sources/#install","title":"Install","text":"

Compiled binary will be available in ./dist directory. For installation instructions, check the Binaries section.

"},{"location":"documentation/monitoring/prometheus/","title":"Monitoring","text":"

By default, WG-Portal exposes Prometheus metrics on port 8787 if interface/peer statistic data collection is enabled.

"},{"location":"documentation/monitoring/prometheus/#exposed-metrics","title":"Exposed Metrics","text":"Metric Type Description wireguard_interface_received_bytes_total gauge Bytes received through the interface. wireguard_interface_sent_bytes_total gauge Bytes sent through the interface. wireguard_peer_last_handshake_seconds gauge Seconds from the last handshake with the peer. wireguard_peer_received_bytes_total gauge Bytes received from the peer. wireguard_peer_sent_bytes_total gauge Bytes sent to the peer. wireguard_peer_up gauge Peer connection state (boolean: 1/0)."},{"location":"documentation/monitoring/prometheus/#prometheus-config","title":"Prometheus Config","text":"

Add following scrape job to your Prometheus config file:

# prometheus.yaml\nscrape_configs:\n  - job_name: wg-portal\n    scrape_interval: 60s\n    static_configs:\n      - targets:\n          - localhost:8787 # Change localhost to IP Address or hostname with WG-Portal\n
"},{"location":"documentation/monitoring/prometheus/#grafana-dashboard","title":"Grafana Dashboard","text":"

You may import dashboard.json into your Grafana instance.

"},{"location":"documentation/rest-api/api-doc/","title":"REST API","text":""},{"location":"documentation/upgrade/v1/","title":"Upgrade","text":"

For production deployments of WireGuard Portal, we strongly recommend using version 1. If you want to use version 2, please be aware that it is still a release candidate and not yet fully stable.

"},{"location":"documentation/upgrade/v1/#upgrade-from-v1-to-v2","title":"Upgrade from v1 to v2","text":"

Before upgrading from V1, make sure that you have a backup of your currently working configuration files and database!

To start the upgrade process, start the wg-portal binary with the -migrateFrom parameter. The configuration (config.yml) for WireGuard Portal must be updated and valid before starting the upgrade.

To upgrade from a previous SQLite database, start wg-portal like:

./wg-portal-amd64 -migrateFrom=old_wg_portal.db\n

You can also specify the database type using the parameter -migrateFromType, supported types: mysql, mssql, postgres or sqlite. For example:

./wg-portal-amd64 -migrateFromType=mysql -migrateFrom='user:pass@tcp(1.2.3.4:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local'\n

The upgrade will transform the old, existing database and store the values in the new database specified in the config.yml configuration file. Ensure that the new database does not contain any data!

If you are using Docker, you can adapt the docker-compose.yml file to start the upgrade process:

services:\n  wg-portal:\n    image: wgportal/wg-portal:latest\n    # ... other settings\n    restart: no\n    command: [\"-migrateFrom=/app/data/wg_portal.db\"]\n
"}]} \ No newline at end of file diff --git a/master/sitemap.xml b/master/sitemap.xml index 916eb03..b98d904 100644 --- a/master/sitemap.xml +++ b/master/sitemap.xml @@ -2,46 +2,46 @@ https://wgportal.org/master/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/overview/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/configuration/examples/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/configuration/overview/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/getting-started/binaries/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/getting-started/docker/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/getting-started/helm/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/getting-started/sources/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/monitoring/prometheus/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/rest-api/api-doc/ - 2025-05-01 + 2025-05-02 https://wgportal.org/master/documentation/upgrade/v1/ - 2025-05-01 + 2025-05-02 \ No newline at end of file diff --git a/master/sitemap.xml.gz b/master/sitemap.xml.gz index e961a6eda1d9afe1f008f97509c23c28e246bae5..d17561d855de5298561715e70cbcec90bf6cd1f6 100644 GIT binary patch delta 29 lcmZ3_w4RAwzMF%Cfm>uE`%1