wg-portal/v2.0.0-beta.5/search/search_index.json

1 line
44 KiB
JSON

{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"documentation/overview/","title":"Overview","text":"<p>WireGuard Portal is a simple, web based configuration portal for WireGuard. The portal uses the WireGuard wgctrl library to manage existing VPN interfaces. This allows for seamless activation or deactivation of new users, without disturbing existing VPN connections.</p> <p>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.</p>"},{"location":"documentation/overview/#features","title":"Features","text":"<ul> <li>Self-hosted - the whole application is a single binary</li> <li>Responsive web UI written in Vue.JS</li> <li>Automatically select IP from the network pool assigned to client</li> <li>QR-Code for convenient mobile client configuration</li> <li>Sent email to client with QR-code and client config</li> <li>Enable / Disable clients seamlessly</li> <li>Generation of wg-quick configuration file (<code>wgX.conf</code>) if required</li> <li>User authentication (database, OAuth or LDAP)</li> <li>IPv6 ready</li> <li>Docker ready</li> <li>Can be used with existing WireGuard setups</li> <li>Support for multiple WireGuard interfaces</li> <li>Peer Expiry Feature</li> <li>Handle route and DNS settings like wg-quick does</li> <li>REST API for management and client deployment</li> </ul>"},{"location":"documentation/overview/#quick-start","title":"Quick-Start","text":"<p>The easiest way to get started is to use the provided Docker image.</p>"},{"location":"documentation/configuration/examples/","title":"Examples","text":"<p>Below are some sample YAML configurations demonstrating how to override some default values. </p>"},{"location":"documentation/configuration/examples/#basic-configuration","title":"Basic Configuration","text":"<pre><code>core:\n admin_user: test@example.com\n admin_password: password\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</code></pre>"},{"location":"documentation/configuration/examples/#ldap-authentication-and-synchronization-configuration","title":"LDAP Authentication and Synchronization Configuration","text":"<pre><code># ... (basic configuration)\n\nauth:\n ldap:\n\n # a sample LDAP provider with user sync enabled\n - id: ldap\n provider_name: Active Directory\n display_name: Login with&lt;/br&gt;AD\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: (&amp;(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2))\n sync_interval: 15m\n sync_filter: (&amp;(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</code></pre>"},{"location":"documentation/configuration/examples/#openid-connect-oidc-authentication-configuration","title":"OpenID Connect (OIDC) Authentication Configuration","text":"<pre><code># ... (basic configuration)\n\nauth:\n oidc:\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&lt;/br&gt;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&lt;/br&gt;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</code></pre>"},{"location":"documentation/configuration/examples/#plain-oauth2-authentication-configuration","title":"Plain OAuth2 Authentication Configuration","text":"<pre><code># ... (basic configuration)\n\nauth:\n oauth:\n\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&lt;/br&gt;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&lt;/br&gt;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</code></pre>"},{"location":"documentation/configuration/overview/","title":"WireGuard Portal Configuration","text":"<p>This page provides an overview of all available configuration options for WireGuard Portal. You can supply these configurations in a YAML file (e.g. <code>config.yaml</code>) when starting the Portal. Complete configuration examples are available in the Configuration Examples page.</p> <p>Below you will find sections like <code>core</code>, <code>advanced</code>, <code>statistics</code>, <code>mail</code>, <code>auth</code>, <code>database</code>, and <code>web</code>. Each section describes the individual configuration keys, their default values, and a brief explanation of their purpose.</p>"},{"location":"documentation/configuration/overview/#core","title":"Core","text":"<p>These are the primary configuration options that control fundamental WireGuard Portal behavior. More advanced options are found in the subsequent <code>Advanced</code> section.</p>"},{"location":"documentation/configuration/overview/#admin_user","title":"<code>admin_user</code>","text":"<ul> <li>Default: <code>admin@wgportal.local</code></li> <li>Description: The administrator user. This user will be created as a default admin if it does not yet exist.</li> </ul>"},{"location":"documentation/configuration/overview/#admin_password","title":"<code>admin_password</code>","text":"<ul> <li>Default: <code>wgportal</code></li> <li>Description: The administrator password. The default password of <code>wgportal</code> should be changed immediately.</li> </ul>"},{"location":"documentation/configuration/overview/#editable_keys","title":"<code>editable_keys</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: Allow editing of WireGuard key-pairs directly in the UI.</li> </ul>"},{"location":"documentation/configuration/overview/#create_default_peer","title":"<code>create_default_peer</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If a user logs in for the first time with no existing peers, automatically create a new WireGuard peer for all server interfaces.</li> </ul>"},{"location":"documentation/configuration/overview/#create_default_peer_on_creation","title":"<code>create_default_peer_on_creation</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If an LDAP user is created (e.g., through LDAP sync) and has no peers, automatically create a new WireGuard peer for all server interfaces.</li> </ul>"},{"location":"documentation/configuration/overview/#re_enable_peer_after_user_enable","title":"<code>re_enable_peer_after_user_enable</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: Re-enable all peers that were previously disabled if the associated user is re-enabled.</li> </ul>"},{"location":"documentation/configuration/overview/#delete_peer_after_user_deleted","title":"<code>delete_peer_after_user_deleted</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If a user is deleted, remove all linked peers. Otherwise, peers remain but are disabled.</li> </ul>"},{"location":"documentation/configuration/overview/#self_provisioning_allowed","title":"<code>self_provisioning_allowed</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: Allow registered (non-admin) users to self-provision peers from their profile page.</li> </ul>"},{"location":"documentation/configuration/overview/#import_existing","title":"<code>import_existing</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: On startup, import existing WireGuard interfaces and peers into WireGuard Portal.</li> </ul>"},{"location":"documentation/configuration/overview/#restore_state","title":"<code>restore_state</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: Restore the WireGuard interface states (up/down) that existed before WireGuard Portal started.</li> </ul>"},{"location":"documentation/configuration/overview/#advanced","title":"Advanced","text":"<p>Additional or more specialized configuration options for logging and interface creation details.</p>"},{"location":"documentation/configuration/overview/#log_level","title":"<code>log_level</code>","text":"<ul> <li>Default: <code>info</code></li> <li>Description: The log level used by the application. Valid options are: <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code>, <code>error</code>.</li> </ul>"},{"location":"documentation/configuration/overview/#log_pretty","title":"<code>log_pretty</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If <code>true</code>, log messages are colorized and formatted for readability (pretty-print).</li> </ul>"},{"location":"documentation/configuration/overview/#log_json","title":"<code>log_json</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If <code>true</code>, log messages are structured in JSON format.</li> </ul>"},{"location":"documentation/configuration/overview/#start_listen_port","title":"<code>start_listen_port</code>","text":"<ul> <li>Default: <code>51820</code></li> <li>Description: The first port to use when automatically creating new WireGuard interfaces.</li> </ul>"},{"location":"documentation/configuration/overview/#start_cidr_v4","title":"<code>start_cidr_v4</code>","text":"<ul> <li>Default: <code>10.11.12.0/24</code></li> <li>Description: The initial IPv4 subnet to use when automatically creating new WireGuard interfaces.</li> </ul>"},{"location":"documentation/configuration/overview/#start_cidr_v6","title":"<code>start_cidr_v6</code>","text":"<ul> <li>Default: <code>fdfd:d3ad:c0de:1234::0/64</code></li> <li>Description: The initial IPv6 subnet to use when automatically creating new WireGuard interfaces.</li> </ul>"},{"location":"documentation/configuration/overview/#use_ip_v6","title":"<code>use_ip_v6</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: Enable or disable IPv6 support.</li> </ul>"},{"location":"documentation/configuration/overview/#config_storage_path","title":"<code>config_storage_path</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Path to a directory where <code>wg-quick</code> style configuration files will be stored (if you need local filesystem configs).</li> </ul>"},{"location":"documentation/configuration/overview/#expiry_check_interval","title":"<code>expiry_check_interval</code>","text":"<ul> <li>Default: <code>15m</code></li> <li>Description: Interval after which existing peers are checked if they are expired. Format uses <code>s</code>, <code>m</code>, <code>h</code>, <code>d</code> for seconds, minutes, hours, days, see time.ParseDuration.</li> </ul>"},{"location":"documentation/configuration/overview/#rule_prio_offset","title":"<code>rule_prio_offset</code>","text":"<ul> <li>Default: <code>20000</code></li> <li>Description: Offset for IP route rule priorities when configuring routing.</li> </ul>"},{"location":"documentation/configuration/overview/#route_table_offset","title":"<code>route_table_offset</code>","text":"<ul> <li>Default: <code>20000</code></li> <li>Description: Offset for IP route table IDs when configuring routing.</li> </ul>"},{"location":"documentation/configuration/overview/#api_admin_only","title":"<code>api_admin_only</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: If <code>true</code>, the public REST API is accessible only to admin users. The API docs live at <code>/api/v1/doc.html</code>.</li> </ul>"},{"location":"documentation/configuration/overview/#database","title":"Database","text":"<p>Configuration for the underlying database used by WireGuard Portal. Supported databases include SQLite, MySQL, Microsoft SQL Server, and Postgres.</p>"},{"location":"documentation/configuration/overview/#debug","title":"<code>debug</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If <code>true</code>, logs all database statements (verbose).</li> </ul>"},{"location":"documentation/configuration/overview/#slow_query_threshold","title":"<code>slow_query_threshold</code>","text":"<ul> <li>Default: 0</li> <li>Description: A time threshold (e.g., <code>100ms</code>) above which queries are considered slow and logged as warnings. If empty or zero, slow query logging is disabled. Format uses <code>s</code>, <code>ms</code> for seconds, milliseconds, see time.ParseDuration.</li> </ul>"},{"location":"documentation/configuration/overview/#type","title":"<code>type</code>","text":"<ul> <li>Default: <code>sqlite</code></li> <li>Description: The database type. Valid options: <code>sqlite</code>, <code>mssql</code>, <code>mysql</code>, <code>postgres</code>.</li> </ul>"},{"location":"documentation/configuration/overview/#dsn","title":"<code>dsn</code>","text":"<ul> <li>Default: <code>data/sqlite.db</code></li> <li>Description: The Data Source Name (DSN) for connecting to the database. For example: <pre><code>user:pass@tcp(1.2.3.4:3306)/dbname?charset=utf8mb4&amp;parseTime=True&amp;loc=Local\n</code></pre></li> </ul>"},{"location":"documentation/configuration/overview/#statistics","title":"Statistics","text":"<p>Controls how WireGuard Portal collects and reports usage statistics, including ping checks and Prometheus metrics.</p>"},{"location":"documentation/configuration/overview/#use_ping_checks","title":"<code>use_ping_checks</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: Enable periodic ping checks to verify that peers remain responsive.</li> </ul>"},{"location":"documentation/configuration/overview/#ping_check_workers","title":"<code>ping_check_workers</code>","text":"<ul> <li>Default: <code>10</code></li> <li>Description: Number of parallel worker processes for ping checks.</li> </ul>"},{"location":"documentation/configuration/overview/#ping_unprivileged","title":"<code>ping_unprivileged</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If <code>false</code>, ping checks run without root privileges. This is currently considered BETA.</li> </ul>"},{"location":"documentation/configuration/overview/#ping_check_interval","title":"<code>ping_check_interval</code>","text":"<ul> <li>Default: <code>1m</code></li> <li>Description: Interval between consecutive ping checks for all peers. Format uses <code>s</code>, <code>m</code>, <code>h</code>, <code>d</code> for seconds, minutes, hours, days, see time.ParseDuration.</li> </ul>"},{"location":"documentation/configuration/overview/#data_collection_interval","title":"<code>data_collection_interval</code>","text":"<ul> <li>Default: <code>1m</code></li> <li>Description: Interval between data collection cycles (bytes sent/received, handshake times, etc.). Format uses <code>s</code>, <code>m</code>, <code>h</code>, <code>d</code> for seconds, minutes, hours, days, see time.ParseDuration.</li> </ul>"},{"location":"documentation/configuration/overview/#collect_interface_data","title":"<code>collect_interface_data</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: If <code>true</code>, collects interface-level data (bytes in/out) for monitoring and statistics.</li> </ul>"},{"location":"documentation/configuration/overview/#collect_peer_data","title":"<code>collect_peer_data</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: If <code>true</code>, collects peer-level data (bytes, last handshake, endpoint, etc.).</li> </ul>"},{"location":"documentation/configuration/overview/#collect_audit_data","title":"<code>collect_audit_data</code>","text":"<ul> <li>Default: <code>true</code></li> <li>Description: If <code>true</code>, logs certain portal events (such as user logins) to the database.</li> </ul>"},{"location":"documentation/configuration/overview/#listening_address","title":"<code>listening_address</code>","text":"<ul> <li>Default: <code>:8787</code></li> <li>Description: Address and port for the integrated Prometheus metric server (e.g., <code>:8787</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#mail","title":"Mail","text":"<p>Options for configuring email notifications or sending peer configurations via email.</p>"},{"location":"documentation/configuration/overview/#host","title":"<code>host</code>","text":"<ul> <li>Default: <code>127.0.0.1</code></li> <li>Description: Hostname or IP of the SMTP server.</li> </ul>"},{"location":"documentation/configuration/overview/#port","title":"<code>port</code>","text":"<ul> <li>Default: <code>25</code></li> <li>Description: Port number for the SMTP server.</li> </ul>"},{"location":"documentation/configuration/overview/#encryption","title":"<code>encryption</code>","text":"<ul> <li>Default: <code>none</code></li> <li>Description: SMTP encryption type. Valid values: <code>none</code>, <code>tls</code>, <code>starttls</code>.</li> </ul>"},{"location":"documentation/configuration/overview/#cert_validation","title":"<code>cert_validation</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If <code>true</code>, validate the SMTP server certificate (relevant if <code>encryption</code> = <code>tls</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#username","title":"<code>username</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Optional SMTP username for authentication.</li> </ul>"},{"location":"documentation/configuration/overview/#password","title":"<code>password</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Optional SMTP password for authentication.</li> </ul>"},{"location":"documentation/configuration/overview/#auth_type","title":"<code>auth_type</code>","text":"<ul> <li>Default: <code>plain</code></li> <li>Description: SMTP authentication type. Valid values: <code>plain</code>, <code>login</code>, <code>crammd5</code>.</li> </ul>"},{"location":"documentation/configuration/overview/#from","title":"<code>from</code>","text":"<ul> <li>Default: <code>Wireguard Portal &lt;noreply@wireguard.local&gt;</code></li> <li>Description: The default \"From\" address when sending emails.</li> </ul>"},{"location":"documentation/configuration/overview/#link_only","title":"<code>link_only</code>","text":"<ul> <li>Default: <code>false</code></li> <li>Description: If <code>true</code>, emails only contain a link to WireGuard Portal, rather than attaching the full configuration.</li> </ul>"},{"location":"documentation/configuration/overview/#auth","title":"Auth","text":"<p>WireGuard Portal supports multiple authentication strategies, including OpenID Connect (<code>oidc</code>), OAuth (<code>oauth</code>), and LDAP (<code>ldap</code>). Each can have multiple providers configured. Below are the relevant keys.</p>"},{"location":"documentation/configuration/overview/#oidc-provider-properties","title":"OIDC Provider Properties","text":"<p>The <code>oidc</code> array contains a list of OpenID Connect providers. Below are the properties for each OIDC provider entry inside <code>auth.oidc</code>:</p>"},{"location":"documentation/configuration/overview/#provider_name","title":"<code>provider_name</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A unique name for this provider. Must not conflict with other providers.</li> </ul>"},{"location":"documentation/configuration/overview/#display_name","title":"<code>display_name</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A user-friendly name shown on the login page (e.g., \"Login with Google\").</li> </ul>"},{"location":"documentation/configuration/overview/#base_url","title":"<code>base_url</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The OIDC provider\u2019s base URL (e.g., <code>https://accounts.google.com</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#client_id","title":"<code>client_id</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The OAuth client ID from the OIDC provider.</li> </ul>"},{"location":"documentation/configuration/overview/#client_secret","title":"<code>client_secret</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The OAuth client secret from the OIDC provider.</li> </ul>"},{"location":"documentation/configuration/overview/#extra_scopes","title":"<code>extra_scopes</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A list of additional OIDC scopes (e.g., <code>profile</code>, <code>email</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#field_map","title":"<code>field_map</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Maps OIDC claims to WireGuard Portal user fields. </li> <li> <p>Available fields: <code>user_identifier</code>, <code>email</code>, <code>firstname</code>, <code>lastname</code>, <code>phone</code>, <code>department</code>, <code>is_admin</code>, <code>user_groups</code>.</p> Field Typical OIDC Claim Explanation <code>user_identifier</code> <code>sub</code> or <code>preferred_username</code> A unique identifier for the user. Often the OIDC <code>sub</code> claim is used because it\u2019s guaranteed to be unique for the user within the IdP. Some providers also support <code>preferred_username</code> if it\u2019s unique. <code>email</code> <code>email</code> The user\u2019s email address as provided by the IdP. Not always verified, depending on IdP settings. <code>firstname</code> <code>given_name</code> The user\u2019s first name, typically provided by the IdP in the <code>given_name</code> claim. <code>lastname</code> <code>family_name</code> The user\u2019s last (family) name, typically provided by the IdP in the <code>family_name</code> claim. <code>phone</code> <code>phone_number</code> The user\u2019s phone number. This may require additional scopes/permissions from the IdP to access. <code>department</code> Custom claim (e.g., <code>department</code>) If the IdP can provide organizational data, it may store it in a custom claim. Adjust accordingly (e.g., <code>department</code>, <code>org</code>, or another attribute). <code>is_admin</code> Custom claim or derived role If the IdP returns a role or admin flag, you can map that to <code>is_admin</code>. Often this is managed through custom claims or group membership. <code>user_groups</code> <code>groups</code> or another custom claim A list of group memberships for the user. Some IdPs provide <code>groups</code> out of the box; others require custom claims or directory lookups. </li> </ul>"},{"location":"documentation/configuration/overview/#admin_mapping","title":"<code>admin_mapping</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: WgPortal can grant a user admin rights by matching the value of the <code>is_admin</code> claim against a regular expression. Alternatively, a regular expression can be used to check if a user is member of a specific group listed in the <code>user_group</code> claim. The regular expressions are defined in <code>admin_value_regex</code> and <code>admin_group_regex</code>.<ul> <li><code>admin_value_regex</code>: A regular expression to match the <code>is_admin</code> claim. By default, this expression matches the string \"true\" (<code>^true$</code>).</li> <li><code>admin_group_regex</code>: A regular expression to match the <code>user_groups</code> claim. Each entry in the <code>user_groups</code> claim is checked against this regex.</li> </ul> </li> </ul>"},{"location":"documentation/configuration/overview/#registration_enabled","title":"<code>registration_enabled</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, a new user will be created in WireGuard Portal if not already present.</li> </ul>"},{"location":"documentation/configuration/overview/#log_user_info","title":"<code>log_user_info</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, OIDC user data is logged at the trace level upon login (for debugging).</li> </ul>"},{"location":"documentation/configuration/overview/#oauth-provider-properties","title":"OAuth Provider Properties","text":"<p>The <code>oauth</code> array contains a list of plain OAuth2 providers. Below are the properties for each OAuth provider entry inside <code>auth.oauth</code>:</p>"},{"location":"documentation/configuration/overview/#provider_name_1","title":"<code>provider_name</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A unique name for this provider. Must not conflict with other providers.</li> </ul>"},{"location":"documentation/configuration/overview/#display_name_1","title":"<code>display_name</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A user-friendly name shown on the login page.</li> </ul>"},{"location":"documentation/configuration/overview/#client_id_1","title":"<code>client_id</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The OAuth client ID for the provider.</li> </ul>"},{"location":"documentation/configuration/overview/#client_secret_1","title":"<code>client_secret</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The OAuth client secret for the provider.</li> </ul>"},{"location":"documentation/configuration/overview/#auth_url","title":"<code>auth_url</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: URL of the authentication endpoint.</li> </ul>"},{"location":"documentation/configuration/overview/#token_url","title":"<code>token_url</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: URL of the token endpoint.</li> </ul>"},{"location":"documentation/configuration/overview/#user_info_url","title":"<code>user_info_url</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: URL of the user information endpoint.</li> </ul>"},{"location":"documentation/configuration/overview/#scopes","title":"<code>scopes</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A list of OAuth scopes.</li> </ul>"},{"location":"documentation/configuration/overview/#field_map_1","title":"<code>field_map</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Maps OAuth attributes to WireGuard Portal fields.</li> <li> <p>Available fields: <code>user_identifier</code>, <code>email</code>, <code>firstname</code>, <code>lastname</code>, <code>phone</code>, <code>department</code>, <code>is_admin</code>, <code>user_groups</code>.</p> Field Typical Claim Explanation <code>user_identifier</code> <code>sub</code> or <code>preferred_username</code> A unique identifier for the user. Often the OIDC <code>sub</code> claim is used because it\u2019s guaranteed to be unique for the user within the IdP. Some providers also support <code>preferred_username</code> if it\u2019s unique. <code>email</code> <code>email</code> The user\u2019s email address as provided by the IdP. Not always verified, depending on IdP settings. <code>firstname</code> <code>given_name</code> The user\u2019s first name, typically provided by the IdP in the <code>given_name</code> claim. <code>lastname</code> <code>family_name</code> The user\u2019s last (family) name, typically provided by the IdP in the <code>family_name</code> claim. <code>phone</code> <code>phone_number</code> The user\u2019s phone number. This may require additional scopes/permissions from the IdP to access. <code>department</code> Custom claim (e.g., <code>department</code>) If the IdP can provide organizational data, it may store it in a custom claim. Adjust accordingly (e.g., <code>department</code>, <code>org</code>, or another attribute). <code>is_admin</code> Custom claim or derived role If the IdP returns a role or admin flag, you can map that to <code>is_admin</code>. Often this is managed through custom claims or group membership. <code>user_groups</code> <code>groups</code> or another custom claim A list of group memberships for the user. Some IdPs provide <code>groups</code> out of the box; others require custom claims or directory lookups. </li> </ul>"},{"location":"documentation/configuration/overview/#admin_mapping_1","title":"<code>admin_mapping</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: WgPortal can grant a user admin rights by matching the value of the <code>is_admin</code> claim against a regular expression. Alternatively, a regular expression can be used to check if a user is member of a specific group listed in the <code>user_group</code> claim. The regular expressions are defined in <code>admin_value_regex</code> and <code>admin_group_regex</code>.</li> <li><code>admin_value_regex</code>: A regular expression to match the <code>is_admin</code> claim. By default, this expression matches the string \"true\" (<code>^true$</code>).</li> <li><code>admin_group_regex</code>: A regular expression to match the <code>user_groups</code> claim. Each entry in the <code>user_groups</code> claim is checked against this regex.</li> </ul>"},{"location":"documentation/configuration/overview/#registration_enabled_1","title":"<code>registration_enabled</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, new users are created automatically on successful login.</li> </ul>"},{"location":"documentation/configuration/overview/#log_user_info_1","title":"<code>log_user_info</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, logs user info at the trace level upon login.</li> </ul>"},{"location":"documentation/configuration/overview/#ldap-provider-properties","title":"LDAP Provider Properties","text":"<p>The <code>ldap</code> array contains a list of LDAP authentication providers. Below are the properties for each LDAP provider entry inside <code>auth.ldap</code>:</p>"},{"location":"documentation/configuration/overview/#url","title":"<code>url</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The LDAP server URL (e.g., <code>ldap://srv-ad01.company.local:389</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#start_tls","title":"<code>start_tls</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, use STARTTLS to secure the LDAP connection.</li> </ul>"},{"location":"documentation/configuration/overview/#cert_validation_1","title":"<code>cert_validation</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, validate the LDAP server\u2019s TLS certificate.</li> </ul>"},{"location":"documentation/configuration/overview/#tls_certificate_path","title":"<code>tls_certificate_path</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Path to a TLS certificate if needed for LDAP connections.</li> </ul>"},{"location":"documentation/configuration/overview/#tls_key_path","title":"<code>tls_key_path</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: Path to the corresponding TLS certificate key.</li> </ul>"},{"location":"documentation/configuration/overview/#base_dn","title":"<code>base_dn</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The base DN for user searches (e.g., <code>DC=COMPANY,DC=LOCAL</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#bind_user","title":"<code>bind_user</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The bind user for LDAP (e.g., <code>company\\\\ldap_wireguard</code> or <code>ldap_wireguard@company.local</code>).</li> </ul>"},{"location":"documentation/configuration/overview/#bind_pass","title":"<code>bind_pass</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: The bind password for LDAP authentication.</li> </ul>"},{"location":"documentation/configuration/overview/#field_map_2","title":"<code>field_map</code>","text":"<ul> <li>Default: (empty)</li> <li> <p>Description: Maps LDAP attributes to WireGuard Portal fields.</p> <ul> <li>Available fields: <code>user_identifier</code>, <code>email</code>, <code>firstname</code>, <code>lastname</code>, <code>phone</code>, <code>department</code>, <code>memberof</code>.</li> </ul> WireGuard Portal Field Typical LDAP Attribute Short Description user_identifier sAMAccountName / uid Uniquely identifies the user within the LDAP directory. email mail / userPrincipalName Stores the user's primary email address. firstname givenName Contains the user's first (given) name. lastname sn Contains the user's last (surname) name. phone telephoneNumber / mobile Holds the user's phone or mobile number. department departmentNumber / ou Specifies the department or organizational unit of the user. memberof memberOf Lists the groups and roles to which the user belongs. </li> </ul>"},{"location":"documentation/configuration/overview/#login_filter","title":"<code>login_filter</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: An LDAP filter to restrict which users can log in. Use <code>{{login_identifier}}</code> to insert the username. For example: <pre><code>(&amp;(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2))\n</code></pre></li> </ul>"},{"location":"documentation/configuration/overview/#admin_group","title":"<code>admin_group</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: A specific LDAP group whose members are considered administrators in WireGuard Portal. For example: <pre><code>CN=WireGuardAdmins,OU=Some-OU,DC=YOURDOMAIN,DC=LOCAL\n</code></pre></li> </ul>"},{"location":"documentation/configuration/overview/#sync_interval","title":"<code>sync_interval</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: How frequently (in duration, e.g. <code>30m</code>) to synchronize users from LDAP. Empty or <code>0</code> disables sync. Format uses <code>s</code>, <code>m</code>, <code>h</code>, <code>d</code> for seconds, minutes, hours, days, see time.ParseDuration. Only users that match the <code>sync_filter</code> are synchronized, if <code>disable_missing</code> is <code>true</code>, users not found in LDAP are disabled.</li> </ul>"},{"location":"documentation/configuration/overview/#sync_filter","title":"<code>sync_filter</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: An LDAP filter to select which users get synchronized into WireGuard Portal. For example: <pre><code>(&amp;(objectClass=organizationalPerson)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*))\n</code></pre></li> </ul>"},{"location":"documentation/configuration/overview/#disable_missing","title":"<code>disable_missing</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, any user not found in LDAP (during sync) is disabled in WireGuard Portal.</li> </ul>"},{"location":"documentation/configuration/overview/#auto_re_enable","title":"<code>auto_re_enable</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, users that where disabled because they were missing (see <code>disable_missing</code>) will be re-enabled once they are found again.</li> </ul>"},{"location":"documentation/configuration/overview/#registration_enabled_2","title":"<code>registration_enabled</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, new user accounts are created in WireGuard Portal upon first login.</li> </ul>"},{"location":"documentation/configuration/overview/#log_user_info_2","title":"<code>log_user_info</code>","text":"<ul> <li>Default: (empty)</li> <li>Description: If <code>true</code>, logs LDAP user data at the trace level upon login.</li> </ul>"},{"location":"documentation/getting-started/building/","title":"Building","text":"<p>To build a standalone application, use the Makefile provided in the repository. Go version 1.23 or higher has to be installed to build WireGuard Portal. If you want to re-compile the frontend, NodeJS 18 and NPM &gt;= 9 is required.</p> <pre><code># build the frontend (optional)\nmake frontend\n\n# build the binary\nmake build\n</code></pre>"},{"location":"documentation/getting-started/docker/","title":"Docker Container","text":""},{"location":"documentation/getting-started/docker/#image-usage","title":"Image Usage","text":"<p>The preferred way to start WireGuard Portal as Docker container is to use Docker Compose.</p> <p>A sample docker-compose.yml:</p> <pre><code>version: '3.6'\nservices:\n wg-portal:\n image: wgportal/wg-portal:latest\n restart: unless-stopped\n cap_add:\n - NET_ADMIN\n network_mode: \"host\"\n ports:\n - \"8888:8888\"\n volumes:\n - /etc/wireguard:/etc/wireguard\n - ./data:/app/data\n - ./config:/app/config\n</code></pre> <p>By default, the webserver is listening on port 8888.</p> <p>Volumes for <code>/app/data</code> and <code>/app/config</code> should be used ensure data persistence across container restarts.</p>"},{"location":"documentation/getting-started/docker/#image-versioning","title":"Image Versioning","text":"<p>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:</p>"},{"location":"documentation/getting-started/docker/#semantic-versioned-tags","title":"Semantic versioned tags","text":"<p>For example, <code>1.0.19</code>.</p> <p>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.</p> <p>Once these tags show up in this repository, they will never change.</p> <p>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.</p> <p>If you only want to stay at the same major or major+minor version, use either <code>v[MAJOR]</code> or <code>[MAJOR].[MINOR]</code> tags. For example <code>v1</code> or <code>1.0</code>.</p> <p>Version 1 is currently stable, version 2 is in development.</p>"},{"location":"documentation/getting-started/docker/#latest","title":"latest","text":"<p>This is the most recent build to master! It changes a lot and is very unstable.</p> <p>We recommend that you don't use it except for development purposes.</p>"},{"location":"documentation/getting-started/docker/#branch-tags","title":"Branch tags","text":"<p>For each commit in the master and the stable branch, a corresponding Docker image is build. These images use the <code>master</code> or <code>stable</code> tags.</p>"},{"location":"documentation/getting-started/docker/#configuration","title":"Configuration","text":"<p>You can configure WireGuard Portal using a yaml configuration file. The filepath of the yaml configuration file defaults to <code>/app/config/config.yml</code>. It is possible to override the configuration filepath using the environment variable WG_PORTAL_CONFIG.</p> <p>By default, WireGuard Portal uses a SQLite database. The database is stored in <code>/app/data/sqlite.db</code>.</p> <p>You should mount those directories as a volume: - /app/data - /app/config</p> <p>A detailed description of the configuration options can be found here.</p>"},{"location":"documentation/getting-started/upgrade/","title":"Upgrade from V1","text":"<p>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 in beta and not feature complete.</p>"},{"location":"documentation/getting-started/upgrade/#upgrade-from-v1-to-v2","title":"Upgrade from v1 to v2","text":"<p> Before upgrading from V1, make sure that you have a backup of your currently working configuration files and database!</p> <p>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.</p> <p>To upgrade from a previous SQLite database, start wg-portal like:</p> <pre><code>./wg-portal-amd64 -migrateFrom=old_wg_portal.db\n</code></pre> <p>You can also specify the database type using the parameter -migrateFromType, supported types: mysql, mssql, postgres or sqlite. For example:</p> <pre><code>./wg-portal-amd64 -migrateFromType=mysql -migrateFrom=user:pass@tcp(1.2.3.4:3306)/dbname?charset=utf8mb4&amp;parseTime=True&amp;loc=Local\n</code></pre> <p>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!</p> <p>If you are using Docker, you can adapt the docker-compose.yml file to start the upgrade process:</p> <pre><code>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</code></pre>"},{"location":"documentation/rest-api/api-doc/","title":"REST API","text":""}]}