* fix: resolve Prism syntax highlighting error in peer config modal
The PeerViewModal and InterfaceViewModal components displayed:
Error: The language "undefined" has no grammar.
Root cause: vue-prism-component bundles its own instance of prismjs
(separate from the one imported elsewhere), so registering the ini
grammar on a different Prism instance had no effect on the one
actually performing the highlighting.
Fix: bypass vue-prism-component entirely. Import a single Prism
instance via a new helper (frontend/src/helpers/prism-setup.js) that
also registers the ini grammar, then render highlighted HTML directly
with <pre><code v-html="highlightedConfig">. This ensures the same
Prism object that owns the ini grammar is the one calling highlight().
Affected files:
- frontend/src/helpers/prism-setup.js (new): imports prismjs, defines
the ini grammar on the Prism instance, re-exports it
- frontend/src/components/PeerViewModal.vue: replaces <Prism> with
v-html using the shared Prism instance
- frontend/src/components/InterfaceViewModal.vue: same replacement
- frontend/src/main.js: removes the now-unused prism-setup import
Fixes #726
* Revert "fix: resolve Prism syntax highlighting error in peer config modal"
This reverts commit 8d1155224d.
* fix: resolve Prism syntax highlighting error in peer config modal
The PeerViewModal displayed: Error: The language "undefined" has no grammar.
Root cause: Vite bundled prismjs as separate instances per lazy-loaded
chunk, so the ini grammar registered in one instance was invisible to
vue-prism-component which used a different instance.
Fix:
- Add dedupe: ['prismjs'] to vite.config.mjs to force a single Prism
instance across all chunks
- Add the missing 'prismjs/components/prism-ini' import in
PeerViewModal.vue (InterfaceViewModal already had it)
WireGuard Portal v2
Introduction
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.
Features
- Self-hosted - the whole application is a single binary
- Responsive multi-language web UI with dark-mode written in Vue.js
- Automatically selects IP from the network pool assigned to the client
- QR-Code for convenient mobile client configuration
- Sends email to the client with QR-code and client config
- Enable / Disable clients seamlessly
- Generation of wg-quick configuration file (
wgX.conf) if required - User authentication (database, OAuth, or LDAP), Passkey support
- IPv6 ready
- Docker ready
- Can be used with existing WireGuard setups
- Support for multiple WireGuard interfaces
- Supports multiple WireGuard backends (wgctrl, MikroTik, or pfSense)
- Peer Expiry Feature
- Handles route and DNS settings like wg-quick does
- Exposes Prometheus metrics for monitoring and alerting
- REST API for management and client deployment
- Webhook for custom actions on peer, interface, or user updates
Documentation
For the complete documentation visit wgportal.org.
What is out of scope
- Automatic generation or application of any
iptablesornftablesrules. - Support for operating systems other than linux.
- Automatic import of private keys of an existing WireGuard setup.
Application stack
- wgctrl-go and netlink for interface handling
- Bootstrap, for the HTML templates
- Vue.js, for the frontend
License
- MIT License. MIT or https://opensource.org/licenses/MIT
Contributors and Sponsors
Thanks so much for all your contributions! They’re truly appreciated and help keep WireGuard Portal moving ahead.
Want to support the project? You can buy me a coffee or join as a contributor - every bit of support helps! Become a sponsor!
Important
Since the project was accepted by the Docker-Sponsored Open Source Program, the Docker image location has moved to wgportal/wg-portal. Please update the Docker image from h44z/wg-portal to wgportal/wg-portal.
