From 8cd6c654f7bd2467e9c256a7f39c44e6f5fb5b3d Mon Sep 17 00:00:00 2001 From: Daan Date: Thu, 29 Oct 2026 14:48:36 +0100 Subject: [PATCH] feat: try to build out --- .github/agents/wgd-auth.agent.md | 33 + .github/agents/wgd-devops.agent.md | 30 + .github/agents/wgd-features.agent.md | 33 + .github/agents/wgd-foundation.agent.md | 32 + .github/agents/wgd-frontend.agent.md | 33 + .github/agents/wgd-legacy-researcher.agent.md | 25 + .github/agents/wgd-migration.agent.md | 30 + .github/agents/wgd-orchestrator.agent.md | 34 + .github/agents/wgd-reviewer.agent.md | 28 + .github/agents/wgd-wireguard.agent.md | 33 + .github/dependabot.yml | 4 +- .../instructions/python-style.instructions.md | 63 + .../instructions/vue-style.instructions.md | 49 + .github/workflows/backend.yml | 38 + .github/workflows/ci.yml | 47 + .gitignore | 3 +- .pre-commit-config.yaml | 50 + AGENTS.md | 40 + GUIDELINES.md | 7 +- alembic.ini | 39 + docs/roadmap.md | 721 +++++++++ pyproject.toml | 53 + src/gunicorn.conf.py | 27 + src/main.py | 171 +- src/modules/config/config.py | 8 +- src/modules/config/config_utils.py | 6 +- src/modules/config/legacy_keys.py | 32 + src/modules/database/alembic/env.py | 98 ++ src/modules/database/alembic/script.py.mako | 26 + .../alembic/versions/0001_initial_schema.py | 148 ++ src/modules/database/database.py | 5 +- src/modules/database/database_utils.py | 46 +- src/modules/database/functions.py | 1 - src/modules/database/schema.py | 177 +-- src/modules/routes/locale.py | 26 +- src/modules/routes/routes_general.py | 96 +- src/modules/routes/routes_utils.py | 17 +- src/modules/routes/routes_welcome.py | 24 +- src/modules/utilities/utilities.py | 55 +- src/requirements.txt | 4 +- src/static/client/proxy.js | 1 - src/{static => web}/admin/.gitignore | 0 src/{static => web}/admin/build.sh | 0 src/web/admin/eslint.config.js | 74 + src/{static => web}/admin/index.html | 0 src/{static => web}/admin/jsconfig.json | 0 src/{static => web}/admin/package-lock.json | 1360 +++++++++++++++- src/{static => web}/admin/package.json | 12 +- src/{static => web}/admin/proxy.js | 0 .../admin/public/img/Logo-1-128x128.png | Bin .../admin/public/img/Logo-1-256x256.png | Bin .../admin/public/img/Logo-1-384x384.png | Bin .../admin/public/img/Logo-1-512x512.png | Bin .../public/img/Logo-1-Maskable-512x512.png | Bin .../public/img/Logo-1-Rounded-128x128.png | Bin .../public/img/Logo-1-Rounded-256x256.png | Bin .../public/img/Logo-1-Rounded-384x384.png | Bin .../public/img/Logo-1-Rounded-512x512.png | Bin .../admin/public/img/Logo-2-128x128.png | Bin .../admin/public/img/Logo-2-256x256.png | Bin .../admin/public/img/Logo-2-384x384.png | Bin .../admin/public/img/Logo-2-512x512.png | Bin .../public/img/Logo-2-Rounded-128x128.png | Bin .../public/img/Logo-2-Rounded-256x256.png | Bin .../public/img/Logo-2-Rounded-384x384.png | Bin .../public/img/Logo-2-Rounded-512x512.png | Bin .../admin/public/json/manifest.json | 0 src/{static => web}/admin/src/App.vue | 0 .../clientComponents/availablePeersGroup.vue | 0 .../clientComponents/clientAssignedPeers.vue | 0 .../clientComponents/clientDelete.vue | 0 .../clientComponents/clientGroup.vue | 0 .../clientComponents/clientProfile.vue | 0 .../clientComponents/clientResetPassword.vue | 0 .../clientSettingComponents/oidcSettings.vue | 0 .../clientComponents/clientSettings.vue | 0 .../clientComponents/clientViewer.vue | 0 .../backupRestoreComponents/backup.vue | 0 .../configurationBackupRestore.vue | 0 .../configurationDescription.vue | 0 .../deleteConfiguration.vue | 0 .../editConfiguration.vue | 0 .../editPeerSettingsOverride.vue | 0 .../editRawConfigurationFile.vue | 0 .../updateConfigurationName.vue | 0 .../newPeersComponents/allowedIPsInput.vue | 0 .../newPeersComponents/bulkAdd.vue | 0 .../newPeersComponents/dnsInput.vue | 0 .../newPeersComponents/endpointAllowedIps.vue | 0 .../newPeersComponents/mtuInput.vue | 0 .../newPeersComponents/nameInput.vue | 0 .../newPeersComponents/notesInput.vue | 0 .../persistentKeepAliveInput.vue | 0 .../newPeersComponents/presharedKeyInput.vue | 0 .../privatePublicKeyInput.vue | 0 .../configurationComponents/peer.vue | 0 .../configurationComponents/peerAddModal.vue | 0 .../peerAssignModal.vue | 0 .../assignedClients.vue | 0 .../peerAssignModalComponents/assignment.vue | 0 .../searchClients.vue | 0 .../searchClientsGroup.vue | 0 .../peerConfigurationFile.vue | 0 .../configurationComponents/peerCreate.vue | 0 .../peerDetailsModal.vue | 0 .../peerIntersectionObserver.vue | 0 .../configurationComponents/peerJobs.vue | 0 .../peerJobsAllModal.vue | 0 .../peerJobsLogsModal.vue | 0 .../configurationComponents/peerList.old.vue | 0 .../configurationComponents/peerList.vue | 0 .../peerDataUsageCharts.vue | 0 .../peerListComponents/peerListModals.vue | 0 .../configurationComponents/peerQRCode.vue | 0 .../configurationComponents/peerRow.vue | 0 .../scheduleDropdown.vue | 0 .../schedulePeerJob.vue | 0 .../configurationComponents/peerSearch.vue | 0 .../configurationComponents/peerSearchBar.vue | 0 .../configurationComponents/peerSettings.vue | 0 .../peerSettingsDropdown.vue | 0 .../peerSettingsDropdownTool.vue | 0 .../peerTagSelectDropdown.vue | 0 .../peerShareWithEmail.vue | 0 .../peerShareWithEmailBodyPreview.vue | 0 .../peerShareLinkModal.vue | 0 .../configurationComponents/peerTag.vue | 0 .../configurationComponents/peerTagBadge.vue | 0 .../peerTagComponents/peerTagColorPicker.vue | 0 .../peerTagComponents/peerTagIconPicker.vue | 0 .../peerTagComponents/peerTagSetting.vue | 0 .../restrictedPeers.vue | 0 .../configurationComponents/selectPeers.vue | 0 .../src/components/configurationList.vue | 0 .../configurationCard.vue | 0 .../admin/src/components/map/osmap.vue | 0 .../messageCentreComponent/message.vue | 0 .../admin/src/components/navbar.vue | 0 .../navbarComponents/agentContainer.vue | 0 .../navbarComponents/agentMessage.vue | 0 .../navbarComponents/agentModal.vue | 0 .../components/navbarComponents/helpModal.vue | 0 .../newConfigurationTemplate.vue | 0 .../newConfigurationTemplates.vue | 0 .../peerEndpoints.vue | 0 .../peerSession.vue | 0 .../peerSessionCalendarDay.vue | 0 .../peerSessionCalendarView.vue | 0 .../peerSessions.vue | 0 .../peerTraffics.vue | 0 .../admin/src/components/protocolBadge.vue | 0 .../backupGroup.vue | 0 .../confirmBackup.vue | 0 .../uploadModal.vue | 0 .../accountSettingsInputPassword.vue | 0 .../accountSettingsInputUsername.vue | 0 .../settingsComponent/accountSettingsMFA.vue | 0 .../settingsComponent/dashboardAPIKeys.vue | 0 .../dashboardAPIKey.vue | 0 .../newDashboardAPIKey.vue | 0 .../dashboardEmailSettings.vue | 0 .../dashboardIPPortInput.vue | 0 .../settingsComponent/dashboardLanguage.vue | 0 ...dashboardSettingsInputIPAddressAndPort.vue | 0 ...ettingsInputWireguardConfigurationPath.vue | 0 ...ettingsWireguardConfigurationAutostart.vue | 0 .../settingsComponent/dashboardTheme.vue | 0 .../settingsComponent/dashboardWebHooks.vue | 0 .../addWebHook.vue | 0 .../previousWebHookSession.vue | 0 .../webHookSession.vue | 0 .../webHookSessions.vue | 0 ...ashboardWireguardConfigurationTracking.vue | 0 .../configurationTracking.vue | 0 .../settingsComponent/peerDefaultSettings.vue | 0 .../peersDefaultSettingsInput.vue | 0 .../settingsComponent/wgdashboardSettings.vue | 0 .../wireguardConfigurationSettings.vue | 0 .../src/components/setupComponent/totp.vue | 0 .../src/components/signIn/signInInput.vue | 0 .../src/components/signIn/signInTOTP.vue | 0 .../signInComponents/RemoteServer.vue | 0 .../signInComponents/RemoteServerList.vue | 0 .../systemStatusComponents/cpuCore.vue | 0 .../networkInterface.vue | 0 .../systemStatusComponents/process.vue | 0 .../systemStatusComponents/storageMount.vue | 0 .../systemStatusWidget.vue | 0 .../admin/src/components/text/localeText.vue | 0 .../admin/src/css/dashboard.css | 0 src/{static => web}/admin/src/main.js | 0 .../src/models/WireguardConfigurations.js | 0 .../admin/src/router/router.js | 0 .../stores/DashboardClientAssignmentStore.js | 0 .../src/stores/DashboardConfigurationStore.js | 0 .../stores/WireguardConfigurationsStore.js | 0 .../admin/src/utilities/cookie.js | 0 .../admin/src/utilities/fetch.js | 0 .../admin/src/utilities/locale.js | 0 .../src/utilities/parseConfigurationFile.js | 0 .../utilities/parseConfigurationFile.test.js | 30 + .../simple-code-editor/CodeEditor.vue | 0 .../utilities/simple-code-editor/Dropdown.vue | 0 .../simple-code-editor/themes/themes.css | 0 .../admin/src/utilities/wireguard.js | 0 .../admin/src/views/clients.vue | 0 .../admin/src/views/configuration.vue | 0 src/{static => web}/admin/src/views/index.vue | 0 .../admin/src/views/newConfiguration.vue | 0 src/{static => web}/admin/src/views/ping.vue | 0 .../admin/src/views/restoreConfiguration.vue | 0 .../admin/src/views/settings.vue | 0 src/{static => web}/admin/src/views/setup.vue | 0 src/{static => web}/admin/src/views/share.vue | 0 .../admin/src/views/signin.vue | 0 .../admin/src/views/systemStatus.vue | 0 .../admin/src/views/traceroute.vue | 0 src/{static => web}/admin/vite.config.js | 0 src/{static => web}/build-app.sh | 0 src/{static => web}/client/.gitignore | 0 src/{static => web}/client/README.md | 0 src/{static => web}/client/build.sh | 0 src/web/client/eslint.config.js | 54 + src/{static => web}/client/index.html | 0 src/{static => web}/client/jsconfig.json | 0 src/{static => web}/client/package-lock.json | 1394 ++++++++++++++++- src/{static => web}/client/package.json | 11 +- .../client/public/img/Logo-1-128x128.png | Bin .../client/public/img/Logo-1-256x256.png | Bin .../client/public/img/Logo-1-384x384.png | Bin .../client/public/img/Logo-1-512x512.png | Bin .../public/img/Logo-1-Maskable-512x512.png | Bin .../public/img/Logo-1-Rounded-128x128.png | Bin .../public/img/Logo-1-Rounded-256x256.png | Bin .../public/img/Logo-1-Rounded-384x384.png | Bin .../public/img/Logo-1-Rounded-512x512.png | Bin .../client/public/img/Logo-2-128x128.png | Bin .../client/public/img/Logo-2-256x256.png | Bin .../client/public/img/Logo-2-384x384.png | Bin .../client/public/img/Logo-2-512x512.png | Bin .../public/img/Logo-2-Rounded-128x128.png | Bin .../public/img/Logo-2-Rounded-256x256.png | Bin .../public/img/Logo-2-Rounded-384x384.png | Bin .../public/img/Logo-2-Rounded-512x512.png | Bin .../fabrizio-conti-aExT3y92x5o-unsplash.jpg | Bin .../lachlan-gowen-0s0WCiys0ZI-unsplash.jpg | Bin src/{static => web}/client/src/App.vue | 0 .../assets/fonts/Plus_Jakarta_Sans/OFL.txt | 0 ...usJakartaSans-Italic-VariableFont_wght.ttf | Bin .../PlusJakartaSans-VariableFont_wght.ttf | Bin .../assets/fonts/Plus_Jakarta_Sans/README.txt | 0 .../static/PlusJakartaSans-Bold.ttf | Bin .../static/PlusJakartaSans-BoldItalic.ttf | Bin .../static/PlusJakartaSans-ExtraBold.ttf | Bin .../PlusJakartaSans-ExtraBoldItalic.ttf | Bin .../static/PlusJakartaSans-ExtraLight.ttf | Bin .../PlusJakartaSans-ExtraLightItalic.ttf | Bin .../static/PlusJakartaSans-Italic.ttf | Bin .../static/PlusJakartaSans-Light.ttf | Bin .../static/PlusJakartaSans-LightItalic.ttf | Bin .../static/PlusJakartaSans-Medium.ttf | Bin .../static/PlusJakartaSans-MediumItalic.ttf | Bin .../static/PlusJakartaSans-Regular.ttf | Bin .../static/PlusJakartaSans-SemiBold.ttf | Bin .../static/PlusJakartaSans-SemiBoldItalic.ttf | Bin .../client/src/assets/images/bg1.jpg | Bin .../client/src/assets/main.css | 0 .../Configuration/configuration.vue | 0 .../Configuration/configurationQRCode.vue | 0 .../components/Notification/notification.vue | 0 .../Notification/notificationList.vue | 0 .../src/components/Settings/profile.vue | 0 .../components/Settings/updatePassword.vue | 0 .../src/components/SignIn/oidc/oidc.vue | 0 .../src/components/SignIn/oidc/oidcBtn.vue | 0 .../client/src/components/SignIn/qrcode.vue | 0 .../src/components/SignIn/signInForm.vue | 0 .../client/src/components/SignIn/totpForm.vue | 0 src/{static => web}/client/src/main.js | 0 .../client/src/router/router.js | 0 .../client/src/stores/clientStore.js | 0 .../client/src/utilities/request.js | 0 src/web/client/src/utilities/request.test.js | 17 + .../client/src/views/forgotPassword.vue | 0 .../client/src/views/index.vue | 0 .../client/src/views/settings.vue | 0 .../client/src/views/signin.vue | 0 .../client/src/views/signup.vue | 0 src/{static => web}/client/vite.config.js | 0 src/{static => web}/locales/ar-SA.json | 0 src/{static => web}/locales/be-BY.json | 0 src/{static => web}/locales/bg-BG.json | 0 src/{static => web}/locales/ca-ES.json | 0 src/{static => web}/locales/cs-CZ.json | 0 src/{static => web}/locales/de-DE.json | 0 src/{static => web}/locales/es-ES.json | 0 src/{static => web}/locales/fa-IR.json | 0 src/{static => web}/locales/fr-CA.json | 0 src/{static => web}/locales/fr-FR.json | 0 src/{static => web}/locales/hu-HU.json | 0 src/{static => web}/locales/id-ID.json | 0 src/{static => web}/locales/it-IT.json | 0 src/{static => web}/locales/ja-JP.json | 0 src/{static => web}/locales/ko-KR.json | 0 src/{static => web}/locales/locale_manager.py | 0 .../locales/locale_template.json | 0 src/{static => web}/locales/nl-NL.json | 0 src/{static => web}/locales/pl-PL.json | 0 src/{static => web}/locales/pt-BR.json | 0 src/{static => web}/locales/ru-RU.json | 0 .../locales/supported_locales.json | 0 src/{static => web}/locales/sv-SE.json | 0 src/{static => web}/locales/th-TH.json | 0 src/{static => web}/locales/tr-TR.json | 0 src/{static => web}/locales/uk-UA.json | 0 src/{static => web}/locales/zh-CN.json | 0 src/{static => web}/locales/zh-HK.json | 0 tests/conftest.py | 78 + tests/test_foundation.py | 231 +++ 319 files changed, 5364 insertions(+), 290 deletions(-) create mode 100644 .github/agents/wgd-auth.agent.md create mode 100644 .github/agents/wgd-devops.agent.md create mode 100644 .github/agents/wgd-features.agent.md create mode 100644 .github/agents/wgd-foundation.agent.md create mode 100644 .github/agents/wgd-frontend.agent.md create mode 100644 .github/agents/wgd-legacy-researcher.agent.md create mode 100644 .github/agents/wgd-migration.agent.md create mode 100644 .github/agents/wgd-orchestrator.agent.md create mode 100644 .github/agents/wgd-reviewer.agent.md create mode 100644 .github/agents/wgd-wireguard.agent.md create mode 100644 .github/instructions/python-style.instructions.md create mode 100644 .github/instructions/vue-style.instructions.md create mode 100644 .github/workflows/backend.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .pre-commit-config.yaml create mode 100644 AGENTS.md create mode 100644 alembic.ini create mode 100644 docs/roadmap.md create mode 100644 pyproject.toml create mode 100644 src/gunicorn.conf.py create mode 100644 src/modules/config/legacy_keys.py create mode 100644 src/modules/database/alembic/env.py create mode 100644 src/modules/database/alembic/script.py.mako create mode 100644 src/modules/database/alembic/versions/0001_initial_schema.py delete mode 100644 src/static/client/proxy.js rename src/{static => web}/admin/.gitignore (100%) rename src/{static => web}/admin/build.sh (100%) create mode 100644 src/web/admin/eslint.config.js rename src/{static => web}/admin/index.html (100%) rename src/{static => web}/admin/jsconfig.json (100%) rename src/{static => web}/admin/package-lock.json (86%) rename src/{static => web}/admin/package.json (79%) rename src/{static => web}/admin/proxy.js (100%) rename src/{static => web}/admin/public/img/Logo-1-128x128.png (100%) rename src/{static => web}/admin/public/img/Logo-1-256x256.png (100%) rename src/{static => web}/admin/public/img/Logo-1-384x384.png (100%) rename src/{static => web}/admin/public/img/Logo-1-512x512.png (100%) rename src/{static => web}/admin/public/img/Logo-1-Maskable-512x512.png (100%) rename src/{static => web}/admin/public/img/Logo-1-Rounded-128x128.png (100%) rename src/{static => web}/admin/public/img/Logo-1-Rounded-256x256.png (100%) rename src/{static => web}/admin/public/img/Logo-1-Rounded-384x384.png (100%) rename src/{static => web}/admin/public/img/Logo-1-Rounded-512x512.png (100%) rename src/{static => web}/admin/public/img/Logo-2-128x128.png (100%) rename src/{static => web}/admin/public/img/Logo-2-256x256.png (100%) rename src/{static => web}/admin/public/img/Logo-2-384x384.png (100%) rename src/{static => web}/admin/public/img/Logo-2-512x512.png (100%) rename src/{static => web}/admin/public/img/Logo-2-Rounded-128x128.png (100%) rename src/{static => web}/admin/public/img/Logo-2-Rounded-256x256.png (100%) rename src/{static => web}/admin/public/img/Logo-2-Rounded-384x384.png (100%) rename src/{static => web}/admin/public/img/Logo-2-Rounded-512x512.png (100%) rename src/{static => web}/admin/public/json/manifest.json (100%) rename src/{static => web}/admin/src/App.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/availablePeersGroup.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientAssignedPeers.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientDelete.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientGroup.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientProfile.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientResetPassword.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientSettingComponents/oidcSettings.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientSettings.vue (100%) rename src/{static => web}/admin/src/components/clientComponents/clientViewer.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/backupRestoreComponents/backup.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/configurationBackupRestore.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/configurationDescription.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/deleteConfiguration.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/editConfiguration.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/editConfigurationComponents/editPeerSettingsOverride.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/editConfigurationComponents/editRawConfigurationFile.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/editConfigurationComponents/updateConfigurationName.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/allowedIPsInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/bulkAdd.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/dnsInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/endpointAllowedIps.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/mtuInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/nameInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/notesInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/persistentKeepAliveInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/presharedKeyInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/newPeersComponents/privatePublicKeyInput.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peer.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerAddModal.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerAssignModal.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerAssignModalComponents/assignedClients.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerAssignModalComponents/assignment.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerAssignModalComponents/searchClients.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerAssignModalComponents/searchClientsGroup.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerConfigurationFile.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerCreate.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerDetailsModal.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerIntersectionObserver.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerJobs.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerJobsAllModal.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerJobsLogsModal.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerList.old.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerList.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerListComponents/peerDataUsageCharts.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerListComponents/peerListModals.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerQRCode.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerRow.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerScheduleJobsComponents/scheduleDropdown.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerScheduleJobsComponents/schedulePeerJob.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerSearch.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerSearchBar.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerSettings.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerSettingsDropdown.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerSettingsDropdownComponents/peerSettingsDropdownTool.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerSettingsDropdownComponents/peerTagSelectDropdown.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerShareLinkComponents/peerShareWithEmail.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerShareLinkComponents/peerShareWithEmailBodyPreview.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerShareLinkModal.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerTag.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerTagBadge.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerTagComponents/peerTagColorPicker.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerTagComponents/peerTagIconPicker.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/peerTagComponents/peerTagSetting.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/restrictedPeers.vue (100%) rename src/{static => web}/admin/src/components/configurationComponents/selectPeers.vue (100%) rename src/{static => web}/admin/src/components/configurationList.vue (100%) rename src/{static => web}/admin/src/components/configurationListComponents/configurationCard.vue (100%) rename src/{static => web}/admin/src/components/map/osmap.vue (100%) rename src/{static => web}/admin/src/components/messageCentreComponent/message.vue (100%) rename src/{static => web}/admin/src/components/navbar.vue (100%) rename src/{static => web}/admin/src/components/navbarComponents/agentContainer.vue (100%) rename src/{static => web}/admin/src/components/navbarComponents/agentMessage.vue (100%) rename src/{static => web}/admin/src/components/navbarComponents/agentModal.vue (100%) rename src/{static => web}/admin/src/components/navbarComponents/helpModal.vue (100%) rename src/{static => web}/admin/src/components/newConfigurationComponents/newConfigurationTemplate.vue (100%) rename src/{static => web}/admin/src/components/newConfigurationComponents/newConfigurationTemplates.vue (100%) rename src/{static => web}/admin/src/components/peerDetailsModalComponents/peerEndpoints.vue (100%) rename src/{static => web}/admin/src/components/peerDetailsModalComponents/peerSession.vue (100%) rename src/{static => web}/admin/src/components/peerDetailsModalComponents/peerSessionCalendarDay.vue (100%) rename src/{static => web}/admin/src/components/peerDetailsModalComponents/peerSessionCalendarView.vue (100%) rename src/{static => web}/admin/src/components/peerDetailsModalComponents/peerSessions.vue (100%) rename src/{static => web}/admin/src/components/peerDetailsModalComponents/peerTraffics.vue (100%) rename src/{static => web}/admin/src/components/protocolBadge.vue (100%) rename src/{static => web}/admin/src/components/restoreConfigurationComponents/backupGroup.vue (100%) rename src/{static => web}/admin/src/components/restoreConfigurationComponents/confirmBackup.vue (100%) rename src/{static => web}/admin/src/components/restoreConfigurationComponents/uploadModal.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/accountSettingsInputPassword.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/accountSettingsInputUsername.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/accountSettingsMFA.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardAPIKeys.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardAPIKeysComponents/dashboardAPIKey.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardAPIKeysComponents/newDashboardAPIKey.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardEmailSettings.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardIPPortInput.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardLanguage.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardSettingsInputIPAddressAndPort.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardSettingsInputWireguardConfigurationPath.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardSettingsWireguardConfigurationAutostart.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardTheme.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWebHooks.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWebHooksComponents/addWebHook.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWebHooksComponents/previousWebHookSession.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWebHooksComponents/webHookSession.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWebHooksComponents/webHookSessions.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWireguardConfigurationTracking.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/dashboardWireguardConfigurationTrackingComponents/configurationTracking.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/peerDefaultSettings.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/peersDefaultSettingsInput.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/wgdashboardSettings.vue (100%) rename src/{static => web}/admin/src/components/settingsComponent/wireguardConfigurationSettings.vue (100%) rename src/{static => web}/admin/src/components/setupComponent/totp.vue (100%) rename src/{static => web}/admin/src/components/signIn/signInInput.vue (100%) rename src/{static => web}/admin/src/components/signIn/signInTOTP.vue (100%) rename src/{static => web}/admin/src/components/signInComponents/RemoteServer.vue (100%) rename src/{static => web}/admin/src/components/signInComponents/RemoteServerList.vue (100%) rename src/{static => web}/admin/src/components/systemStatusComponents/cpuCore.vue (100%) rename src/{static => web}/admin/src/components/systemStatusComponents/networkInterface.vue (100%) rename src/{static => web}/admin/src/components/systemStatusComponents/process.vue (100%) rename src/{static => web}/admin/src/components/systemStatusComponents/storageMount.vue (100%) rename src/{static => web}/admin/src/components/systemStatusComponents/systemStatusWidget.vue (100%) rename src/{static => web}/admin/src/components/text/localeText.vue (100%) rename src/{static => web}/admin/src/css/dashboard.css (100%) rename src/{static => web}/admin/src/main.js (100%) rename src/{static => web}/admin/src/models/WireguardConfigurations.js (100%) rename src/{static => web}/admin/src/router/router.js (100%) rename src/{static => web}/admin/src/stores/DashboardClientAssignmentStore.js (100%) rename src/{static => web}/admin/src/stores/DashboardConfigurationStore.js (100%) rename src/{static => web}/admin/src/stores/WireguardConfigurationsStore.js (100%) rename src/{static => web}/admin/src/utilities/cookie.js (100%) rename src/{static => web}/admin/src/utilities/fetch.js (100%) rename src/{static => web}/admin/src/utilities/locale.js (100%) rename src/{static => web}/admin/src/utilities/parseConfigurationFile.js (100%) create mode 100644 src/web/admin/src/utilities/parseConfigurationFile.test.js rename src/{static => web}/admin/src/utilities/simple-code-editor/CodeEditor.vue (100%) rename src/{static => web}/admin/src/utilities/simple-code-editor/Dropdown.vue (100%) rename src/{static => web}/admin/src/utilities/simple-code-editor/themes/themes.css (100%) rename src/{static => web}/admin/src/utilities/wireguard.js (100%) rename src/{static => web}/admin/src/views/clients.vue (100%) rename src/{static => web}/admin/src/views/configuration.vue (100%) rename src/{static => web}/admin/src/views/index.vue (100%) rename src/{static => web}/admin/src/views/newConfiguration.vue (100%) rename src/{static => web}/admin/src/views/ping.vue (100%) rename src/{static => web}/admin/src/views/restoreConfiguration.vue (100%) rename src/{static => web}/admin/src/views/settings.vue (100%) rename src/{static => web}/admin/src/views/setup.vue (100%) rename src/{static => web}/admin/src/views/share.vue (100%) rename src/{static => web}/admin/src/views/signin.vue (100%) rename src/{static => web}/admin/src/views/systemStatus.vue (100%) rename src/{static => web}/admin/src/views/traceroute.vue (100%) rename src/{static => web}/admin/vite.config.js (100%) rename src/{static => web}/build-app.sh (100%) rename src/{static => web}/client/.gitignore (100%) rename src/{static => web}/client/README.md (100%) rename src/{static => web}/client/build.sh (100%) create mode 100644 src/web/client/eslint.config.js rename src/{static => web}/client/index.html (100%) rename src/{static => web}/client/jsconfig.json (100%) rename src/{static => web}/client/package-lock.json (71%) rename src/{static => web}/client/package.json (63%) rename src/{static => web}/client/public/img/Logo-1-128x128.png (100%) rename src/{static => web}/client/public/img/Logo-1-256x256.png (100%) rename src/{static => web}/client/public/img/Logo-1-384x384.png (100%) rename src/{static => web}/client/public/img/Logo-1-512x512.png (100%) rename src/{static => web}/client/public/img/Logo-1-Maskable-512x512.png (100%) rename src/{static => web}/client/public/img/Logo-1-Rounded-128x128.png (100%) rename src/{static => web}/client/public/img/Logo-1-Rounded-256x256.png (100%) rename src/{static => web}/client/public/img/Logo-1-Rounded-384x384.png (100%) rename src/{static => web}/client/public/img/Logo-1-Rounded-512x512.png (100%) rename src/{static => web}/client/public/img/Logo-2-128x128.png (100%) rename src/{static => web}/client/public/img/Logo-2-256x256.png (100%) rename src/{static => web}/client/public/img/Logo-2-384x384.png (100%) rename src/{static => web}/client/public/img/Logo-2-512x512.png (100%) rename src/{static => web}/client/public/img/Logo-2-Rounded-128x128.png (100%) rename src/{static => web}/client/public/img/Logo-2-Rounded-256x256.png (100%) rename src/{static => web}/client/public/img/Logo-2-Rounded-384x384.png (100%) rename src/{static => web}/client/public/img/Logo-2-Rounded-512x512.png (100%) rename src/{static => web}/client/public/img/fabrizio-conti-aExT3y92x5o-unsplash.jpg (100%) rename src/{static => web}/client/public/img/lachlan-gowen-0s0WCiys0ZI-unsplash.jpg (100%) rename src/{static => web}/client/src/App.vue (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/OFL.txt (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/PlusJakartaSans-Italic-VariableFont_wght.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/PlusJakartaSans-VariableFont_wght.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/README.txt (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-Bold.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-BoldItalic.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-ExtraBold.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-ExtraBoldItalic.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-ExtraLight.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-ExtraLightItalic.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-Italic.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-Light.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-LightItalic.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-Medium.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-MediumItalic.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-Regular.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-SemiBold.ttf (100%) rename src/{static => web}/client/src/assets/fonts/Plus_Jakarta_Sans/static/PlusJakartaSans-SemiBoldItalic.ttf (100%) rename src/{static => web}/client/src/assets/images/bg1.jpg (100%) rename src/{static => web}/client/src/assets/main.css (100%) rename src/{static => web}/client/src/components/Configuration/configuration.vue (100%) rename src/{static => web}/client/src/components/Configuration/configurationQRCode.vue (100%) rename src/{static => web}/client/src/components/Notification/notification.vue (100%) rename src/{static => web}/client/src/components/Notification/notificationList.vue (100%) rename src/{static => web}/client/src/components/Settings/profile.vue (100%) rename src/{static => web}/client/src/components/Settings/updatePassword.vue (100%) rename src/{static => web}/client/src/components/SignIn/oidc/oidc.vue (100%) rename src/{static => web}/client/src/components/SignIn/oidc/oidcBtn.vue (100%) rename src/{static => web}/client/src/components/SignIn/qrcode.vue (100%) rename src/{static => web}/client/src/components/SignIn/signInForm.vue (100%) rename src/{static => web}/client/src/components/SignIn/totpForm.vue (100%) rename src/{static => web}/client/src/main.js (100%) rename src/{static => web}/client/src/router/router.js (100%) rename src/{static => web}/client/src/stores/clientStore.js (100%) rename src/{static => web}/client/src/utilities/request.js (100%) create mode 100644 src/web/client/src/utilities/request.test.js rename src/{static => web}/client/src/views/forgotPassword.vue (100%) rename src/{static => web}/client/src/views/index.vue (100%) rename src/{static => web}/client/src/views/settings.vue (100%) rename src/{static => web}/client/src/views/signin.vue (100%) rename src/{static => web}/client/src/views/signup.vue (100%) rename src/{static => web}/client/vite.config.js (100%) rename src/{static => web}/locales/ar-SA.json (100%) rename src/{static => web}/locales/be-BY.json (100%) rename src/{static => web}/locales/bg-BG.json (100%) rename src/{static => web}/locales/ca-ES.json (100%) rename src/{static => web}/locales/cs-CZ.json (100%) rename src/{static => web}/locales/de-DE.json (100%) rename src/{static => web}/locales/es-ES.json (100%) rename src/{static => web}/locales/fa-IR.json (100%) rename src/{static => web}/locales/fr-CA.json (100%) rename src/{static => web}/locales/fr-FR.json (100%) rename src/{static => web}/locales/hu-HU.json (100%) rename src/{static => web}/locales/id-ID.json (100%) rename src/{static => web}/locales/it-IT.json (100%) rename src/{static => web}/locales/ja-JP.json (100%) rename src/{static => web}/locales/ko-KR.json (100%) rename src/{static => web}/locales/locale_manager.py (100%) rename src/{static => web}/locales/locale_template.json (100%) rename src/{static => web}/locales/nl-NL.json (100%) rename src/{static => web}/locales/pl-PL.json (100%) rename src/{static => web}/locales/pt-BR.json (100%) rename src/{static => web}/locales/ru-RU.json (100%) rename src/{static => web}/locales/supported_locales.json (100%) rename src/{static => web}/locales/sv-SE.json (100%) rename src/{static => web}/locales/th-TH.json (100%) rename src/{static => web}/locales/tr-TR.json (100%) rename src/{static => web}/locales/uk-UA.json (100%) rename src/{static => web}/locales/zh-CN.json (100%) rename src/{static => web}/locales/zh-HK.json (100%) create mode 100644 tests/conftest.py create mode 100644 tests/test_foundation.py diff --git a/.github/agents/wgd-auth.agent.md b/.github/agents/wgd-auth.agent.md new file mode 100644 index 0000000..9186b79 --- /dev/null +++ b/.github/agents/wgd-auth.agent.md @@ -0,0 +1,33 @@ +--- +name: wgd-auth +description: "Use when working on WS-5 Auth & accounts or WS-6 Client portal & OIDC of the WGDashboard rewrite: admin sign-in, sessions, TOTP, API keys, rate limiting, CORS/cookies, client sign-up/sign-in/password reset, client peer assignments, OIDC for admin and client." +tools: [read, edit, search, execute, todo, agent] +agents: [wgd-legacy-researcher, wgd-reviewer] +argument-hint: "Workstream, e.g. 'WS-5' or 'WS-6'" +handoffs: + - label: Review auth work + agent: wgd-reviewer + prompt: Review the WS-5 / WS-6 changes against docs/roadmap.md, with extra focus on roadmap §9. + send: false +--- +You own **WS-5 Auth & accounts** and **WS-6 Client portal & OIDC** in [docs/roadmap.md](../../docs/roadmap.md) §7. + +## Constraints +- DO NOT store secrets in plain text: hash passwords (bcrypt) and API keys; encrypt TOTP secrets at rest. +- DO NOT log credentials, tokens or secrets. +- DO NOT start WS-6 before WS-5 and WS-2 are done. +- DO NOT edit `reference/`. + +## Approach +1. Read [AGENTS.md](../../AGENTS.md), roadmap §2–§5, §9, §10 (D3, D4) and your workstream section. +2. Ask `wgd-legacy-researcher` for legacy flows (`dashboard.py` auth, `client.py`, `DashboardClients*.py`, `DashboardOIDC.py`). +3. Implement auth modules under `src/modules/auth/` and `src/modules/clients/`, with migrations. +4. Public routes declared explicitly; a test asserts the whitelist matches `app.url_map`. +5. Tests for failure paths: wrong password/TOTP, expired API key, rate limit, expired reset token, invalid OIDC signature (mocked provider). +6. Run lint + tests until green; update roadmap §5 / §8. + +## Output Format +- Files changed +- Endpoints implemented (legacy → new) +- Security requirements from §9 covered +- Check results diff --git a/.github/agents/wgd-devops.agent.md b/.github/agents/wgd-devops.agent.md new file mode 100644 index 0000000..8e52505 --- /dev/null +++ b/.github/agents/wgd-devops.agent.md @@ -0,0 +1,30 @@ +--- +name: wgd-devops +description: "Use when working on WS-8 Packaging & release of the WGDashboard rewrite: Dockerfile, compose, entrypoint, gunicorn, install/start/stop script replacing wgd.sh, systemd unit, upgrade guide." +tools: [read, edit, search, execute, todo, agent] +agents: [wgd-legacy-researcher, wgd-reviewer] +handoffs: + - label: Review packaging + agent: wgd-reviewer + prompt: Review the WS-8 packaging changes against docs/roadmap.md. + send: false +--- +You own **WS-8 Packaging & release** in [docs/roadmap.md](../../docs/roadmap.md) §7. + +## Constraints +- DO NOT push images, tags or branches. +- DO NOT use `sudo` or change the host system; test in containers. +- Shell scripts: `set -euo pipefail`, quoted variables, readable named functions. +- DO NOT edit `reference/`. + +## Approach +1. Read [AGENTS.md](../../AGENTS.md) and the WS-8 section. +2. Ask `wgd-legacy-researcher` what `reference/src/wgd.sh`, `reference/docker/entrypoint.sh` and `wg-dashboard.service` do. +3. Align `docker/` with `create_app()` + gunicorn, config path, volumes, `/healthz` healthcheck, and the legacy importer on first start. +4. Write the replacement install script and systemd unit. +5. Verify a fresh install and a legacy upgrade in Docker. + +## Output Format +- Files changed +- Build / run commands used and results +- Remaining manual steps diff --git a/.github/agents/wgd-features.agent.md b/.github/agents/wgd-features.agent.md new file mode 100644 index 0000000..f6f475a --- /dev/null +++ b/.github/agents/wgd-features.agent.md @@ -0,0 +1,33 @@ +--- +name: wgd-features +description: "Use when working on WS-3 Scheduler & tracking or WS-4 Dashboard features of the WGDashboard rewrite: background scheduler, peer stats, traffic/endpoint tracking, peer jobs, backups/restore, config templates, share links, email, webhooks, ping/traceroute, plugins, system status, dashboard settings, locale." +tools: [read, edit, search, execute, todo, agent] +agents: [wgd-legacy-researcher, wgd-reviewer] +argument-hint: "Workstream or feature, e.g. 'WS-3' or 'WS-4 webhooks'" +handoffs: + - label: Review feature work + agent: wgd-reviewer + prompt: Review the WS-3 / WS-4 changes against docs/roadmap.md. + send: false +--- +You own **WS-3 Scheduler & tracking** and **WS-4 Dashboard features** in [docs/roadmap.md](../../docs/roadmap.md) §7. + +## Constraints +- DO NOT modify `src/modules/wireguard/*` internals; use its service functions. Report missing functions instead. +- DO NOT make outbound network calls in tests; mock SMTP, webhooks, geolocation, GitHub. +- Third-party geolocation and plugins are opt-in and disabled by default. +- DO NOT edit `reference/`. + +## Approach +1. Read [AGENTS.md](../../AGENTS.md), roadmap §2–§5, §9 and your workstream section. +2. Ask `wgd-legacy-researcher` for legacy behaviour (intervals, job operators/actions, backup layout, webhook payloads, email templates). +3. Scheduler: one scheduler per process, injectable clock, clean shutdown. +4. Each feature: model + migration → service in `features/` → routes → tests. +5. Security: path traversal tests on backups, SSRF guard on webhooks, rate limit on share links. +6. Run lint + tests until green; update roadmap §5 / §8. + +## Output Format +- Files changed (grouped by feature) +- Endpoints implemented (legacy → new) +- Check results +- Behaviour differences from legacy diff --git a/.github/agents/wgd-foundation.agent.md b/.github/agents/wgd-foundation.agent.md new file mode 100644 index 0000000..dccf988 --- /dev/null +++ b/.github/agents/wgd-foundation.agent.md @@ -0,0 +1,32 @@ +--- +name: wgd-foundation +description: "Use when working on WS-0 Foundation of the WGDashboard rewrite: fixing known issues in src/, lint/type tooling (ruff, pyright, eslint, prettier, pre-commit), pytest/vitest setup, CI, Alembic setup, config key unification, persistent secret key, create_app factory." +tools: [read, edit, search, execute, todo, agent] +agents: [wgd-legacy-researcher, wgd-reviewer] +handoffs: + - label: Review WS-0 + agent: wgd-reviewer + prompt: Review the WS-0 Foundation changes against docs/roadmap.md. + send: false +--- +You own **WS-0 Foundation** in [docs/roadmap.md](../../docs/roadmap.md) §7. + +## Constraints +- DO NOT implement WireGuard, peer, feature, auth-extension or frontend-feature work (other workstreams). +- DO NOT edit `reference/`. +- ONLY change what WS-0 lists, plus the issues in roadmap §6 assigned to WS-0. + +## Approach +1. Read [AGENTS.md](../../AGENTS.md), roadmap §1–§4, §6 and the WS-0 section. +2. Fix roadmap §6 issues first, each with a regression test. +3. Add tooling (`pyproject.toml`, `.pre-commit-config.yaml`, ESLint/Prettier/Vitest in both web apps, GitHub Actions). +4. Introduce `create_app()`, persistent secret key, unified config keys + `config/legacy_keys.py`. +5. Set up Alembic and convert models to SQLAlchemy 2.0 typed style; generate the first migration. +6. Run lint + tests until green. +7. Update roadmap §5 / §6 / §8 statuses. + +## Output Format +- Files changed (grouped) +- Issues from §6 fixed +- Check results (lint, type check, tests) +- Anything left open or blocked diff --git a/.github/agents/wgd-frontend.agent.md b/.github/agents/wgd-frontend.agent.md new file mode 100644 index 0000000..b6fb848 --- /dev/null +++ b/.github/agents/wgd-frontend.agent.md @@ -0,0 +1,33 @@ +--- +name: wgd-frontend +description: "Use when working on WS-9 Frontend shared layer, WS-10 Admin UI parity or WS-11 Client UI parity of the WGDashboard rewrite: Vue 3 Composition API, Pinia stores, shared API client, locale helper, porting legacy components one-to-one." +tools: [read, edit, search, execute, todo, agent] +agents: [wgd-legacy-researcher, wgd-reviewer] +argument-hint: "Workstream or view, e.g. 'WS-9' or 'WS-10 peerList'" +handoffs: + - label: Review frontend work + agent: wgd-reviewer + prompt: Review the frontend changes against docs/roadmap.md and .github/instructions/vue-style.instructions.md. + send: false +--- +You own **WS-9**, **WS-10** and **WS-11** in [docs/roadmap.md](../../docs/roadmap.md) §7. + +## Constraints +- DO NOT change backend code. If an endpoint is missing or wrong, report it. +- DO NOT call `fetch`/`axios` in components; only via `src/web/shared` API modules. +- Only wire a view to endpoints whose status in roadmap §5 is `done`. +- Keep component names and folder structure aligned with `reference/src/static/app` and `reference/src/static/client`. +- DO NOT edit `reference/`. + +## Approach +1. Read [AGENTS.md](../../AGENTS.md), `.github/instructions/vue-style.instructions.md`, roadmap §5 and your workstream section. +2. WS-9 first: shared HTTP client, per-domain API modules matching §5, locale helper, shared inputs, Vitest tests. +3. For each legacy component: ask `wgd-legacy-researcher` what it does, then rewrite it in ` + + +``` diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml new file mode 100644 index 0000000..966bff2 --- /dev/null +++ b/.github/workflows/backend.yml @@ -0,0 +1,38 @@ +name: Backend checks + +on: + push: + pull_request: + +jobs: + python: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:16 + env: + POSTGRES_USER: wgdashboard + POSTGRES_PASSWORD: wgdashboard + POSTGRES_DB: wgdashboard + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U wgdashboard -d wgdashboard" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: pip + cache-dependency-path: src/requirements.txt + - run: python -m venv .venv + - run: .venv/bin/python -m pip install -r src/requirements.txt pytest pyright ruff + - run: .venv/bin/ruff check + - run: .venv/bin/pyright + - run: .venv/bin/pytest + - run: .venv/bin/alembic upgrade head + env: + WGDASHBOARD_DATABASE_URL: postgresql+psycopg://wgdashboard:wgdashboard@localhost:5432/wgdashboard diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c4fa4bc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + python: + name: Python lint and tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r src/requirements.txt pytest ruff + - name: Lint Python + run: ruff check src + - name: Run Python tests + run: pytest -q + + web: + name: ${{ matrix.app }} lint and tests + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + app: [admin, client] + defaults: + run: + working-directory: src/web/${{ matrix.app }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "26" + cache: npm + cache-dependency-path: src/web/${{ matrix.app }}/package-lock.json + - run: npm ci + - run: npm run lint + - run: npm test diff --git a/.gitignore b/.gitignore index a395b4d..f03fee9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ - +reference/ *.db dist +/src/secret_key # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e1ac547 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,50 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.5.3 + hooks: + - id: prettier + files: ^src/web/.*\.(css|html|js|json|md|ts|vue|yaml|yml)$ + + - repo: local + hooks: + - id: ruff + name: ruff + entry: ruff check + language: system + types: [python] + - id: pyright + name: pyright + entry: pyright + language: system + pass_filenames: false + - id: admin-eslint + name: admin ESLint + entry: npm --prefix src/web/admin run lint + language: system + pass_filenames: false + files: ^src/web/admin/ + - id: admin-vitest + name: admin Vitest + entry: npm --prefix src/web/admin test + language: system + pass_filenames: false + files: ^src/web/admin/ + - id: client-eslint + name: client ESLint + entry: npm --prefix src/web/client run lint + language: system + pass_filenames: false + files: ^src/web/client/ + - id: client-vitest + name: client Vitest + entry: npm --prefix src/web/client test + language: system + pass_filenames: false + files: ^src/web/client/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..ba36b1b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,40 @@ +# WGDashboard Rewrite – Agent Rules + +These rules apply to every agent and contributor working in this repository. + +## Project + +- `reference/` is the **legacy** WGDashboard. It is read-only: never edit, move or format anything in it. +- `src/` is the rewrite (Flask backend + `src/web/admin` and `src/web/client` Vue apps). +- [docs/roadmap.md](docs/roadmap.md) is the source of truth: architecture (§3), conventions (§4), + endpoint mapping (§5), known issues (§6), workstreams (§7), parity checklist (§8), + security requirements (§9) and open decisions (§10). +- Role agents live in [.github/agents/](.github/agents/). Coding style rules live in + [.github/instructions/](.github/instructions/) and in [GUIDELINES.md](GUIDELINES.md). + +## Always + +1. Readability is the top priority. More lines of clear code beats fewer lines of clever code. +2. Re-implement legacy behaviour; never copy legacy code style. +3. Stay inside the scope of your workstream. If something outside it is broken, report it instead of fixing it. +4. Check a workstream's *Depends on* list in the roadmap before starting it. +5. Follow the **recommended default** of any decision in roadmap §10 that is still `open`. +6. Ship tests with every change (pytest for backend, Vitest for frontend). +7. Ship an Alembic migration with every schema change. +8. After implementing a route or feature, update its status in roadmap §5 and §8. + +## Never + +- Use `shell=True`, or call `wg`/`awg`/`wg-quick`/`awg-quick`/`ip`/`iptables` outside `src/modules/wireguard/cli.py`. +- Build SQL with string formatting. +- Log passwords, private keys, TOTP secrets, API keys or tokens. +- Add files to `reference/`. + +## Layering + +``` +routes/* -> parse + validate request (pydantic), call one service, return make_resp_obj +services -> business logic +database/* -> ORM models and queries +wireguard/cli.py -> the only place that runs subprocesses +``` diff --git a/GUIDELINES.md b/GUIDELINES.md index 35cb3bb..474328c 100644 --- a/GUIDELINES.md +++ b/GUIDELINES.md @@ -1,6 +1,9 @@ # WGDashboard Coding Guidelines -## Rules: +## Rules -- Utility functions should ALWAYS use DEBUG statements. +Follow the readability, typing, logging, SQLAlchemy, and layering conventions in +[docs/roadmap.md](docs/roadmap.md) §2. + +- Utility functions must log at DEBUG; services log state changes at INFO and failures at ERROR. - Code as verbose as possible and where reason allows it. \ No newline at end of file diff --git a/alembic.ini b/alembic.ini new file mode 100644 index 0000000..d18d0a3 --- /dev/null +++ b/alembic.ini @@ -0,0 +1,39 @@ +[alembic] +script_location = %(here)s/src/modules/database/alembic +prepend_sys_path = %(here)s/src +path_separator = os +sqlalchemy.url = + +[loggers] +keys = root,sqlalchemy,alembic + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = WARNING +handlers = console +qualname = + +[logger_sqlalchemy] +level = WARNING +handlers = +qualname = sqlalchemy.engine + +[logger_alembic] +level = INFO +handlers = +qualname = alembic + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(levelname)-5.5s [%(name)s] %(message)s +datefmt = %H:%M:%S diff --git a/docs/roadmap.md b/docs/roadmap.md new file mode 100644 index 0000000..f28c3ad --- /dev/null +++ b/docs/roadmap.md @@ -0,0 +1,721 @@ +# WGDashboard Rewrite – Roadmap + +This document is the single source of truth for the rewrite. It is written so that an +agent (or contributor) can pick up **one workstream** and work on it independently. + +- Legacy code (read-only reference): `reference/` +- New code: `src/` (backend + `src/web/` frontends), `docker/` +- Goal: full feature parity with legacy, with an (almost) one-to-one Vue frontend, on a + modern, readable, tested and secure codebase. + +--- + +## 0. How to use this document (for agents) + +1. Read **§1 Ground rules**, **§2 Coding style** and **§3 Architecture** – they apply to every workstream. +2. Pick a workstream from **§7 Workstreams**. Check its *Depends on* list is done. +3. Use the *Legacy reference* files only to understand behaviour. **Do not copy legacy code + style** – re-implement following §2. +4. Satisfy every item in *Acceptance criteria* before marking the workstream done. +5. Update **§8 Parity checklist** and the endpoint table in **§5** when you finish. +6. Never modify anything inside `reference/`. + +Shared agent rules live in [AGENTS.md](../AGENTS.md), style rules in +[.github/instructions/](../.github/instructions/) and role agents in +[.github/agents/](../.github/agents/): + +| Agent | Workstreams | +|---|---| +| `wgd-orchestrator` | coordinates all, delegates, updates statuses | +| `wgd-legacy-researcher` | read-only legacy behaviour lookups | +| `wgd-reviewer` | read-only review + lint/tests | +| `wgd-foundation` | WS-0 | +| `wgd-wireguard` | WS-1, WS-2 | +| `wgd-features` | WS-3, WS-4 | +| `wgd-auth` | WS-5, WS-6 | +| `wgd-migration` | WS-7 | +| `wgd-devops` | WS-8 | +| `wgd-frontend` | WS-9, WS-10, WS-11 | + +--- + +## 1. Ground rules + +- Readability is the top priority. More lines of clear code beats fewer lines of clever code. +- Routes are thin; business logic lives in services; SQL lives in the database layer; + subprocess calls live only in `src/modules/wireguard/cli.py`. +- Every new backend feature ships with pytest tests; every new frontend store/composable + ships with Vitest tests. +- Every schema change ships with an Alembic migration. +- No secrets in logs. No `shell=True`. No raw SQL string formatting. +- Keep the existing response envelope (`make_resp_obj`, see §4.1). + +--- + +## 2. Coding style (mandatory) + +The legacy codebase often uses compact, dense constructs. The rewrite deliberately does +the opposite. + +### 2.1 Before / after + +Legacy (`reference/src/modules/WireguardConfiguration.py` ~L915): +```python +"Total": sum(list(map(lambda x: x.cumu_data + x.total_data, self.Peers))), +"ConnectedPeers": len(list(filter(lambda x: x.status == "running", self.Peers))), +``` + +Rewrite: +```python +total_data_usage = 0.0 +connected_peer_count = 0 + +for peer in peers: + total_data_usage += peer.cumulative_data + peer.total_data + + if peer.status == PeerStatus.RUNNING: + connected_peer_count += 1 +``` + +Legacy (`WireguardConfiguration.py` ~L1170): `list(islice(filter(lambda ip: ..., map(lambda iph: ..., network.hosts())), threshold))` + +Rewrite: a named helper `find_available_addresses(network, used_addresses, limit)` with a +plain `for` loop and an early `break`. + +### 2.2 Python rules + +1. No `lambda`, `map()` or `filter()`. Use `for` loops, or a single-level comprehension with at most one simple `if`. +2. No nested ternaries; a ternary must fit comfortably on one short line. +3. One action per line. Use descriptively named intermediate variables instead of chained calls. +4. Early returns over nested `if/else`. Max ~3 indentation levels inside a function body. +5. Descriptive names: `peer`, `interface_name`, `allowed_ips` – never `p`, `ca`, `iph`, `x`. +6. Type hints on **every** parameter and return value. SQLAlchemy models use 2.0 `Mapped[...]` / `mapped_column`. +7. Error convention: functions return `tuple[bool, value]` (as already used in `config.py`). Be consistent. *(See decision D5.)* +8. Logging (from `GUIDELINES.md`): utility functions ALWAYS log at DEBUG. Services log INFO on state changes and ERROR on failure. Use `import logging as log` as existing modules do. +9. Never `subprocess` with `shell=True`. Arguments are lists. Only `wireguard/cli.py` may call `wg`/`awg`/`wg-quick`/`awg-quick`/`ip`/`iptables`. +10. Function ≲ 50 lines, file ≲ 400 lines. Split by responsibility. +11. Enums / constants instead of magic strings (`PeerStatus`, `Protocol`, `JobAction`, `JobOperator`). +12. Keep existing conventions: `#!/bin/env python3` header, snake_case functions, classes grouping `@staticmethod`s where already used, `'''docstring'''` one-liners. + +### 2.3 Vue rules + +1. `