Compare commits

..

396 Commits

Author SHA1 Message Date
Bernd Storath 4890bb28e5 Bump version to 15.0.0-beta.8 2025-03-12 13:47:46 +01:00
Bernd Storath c3dbd3a815 Fix: Add ui port to template (#1735)
* add ui port to template

* update changelog
2025-03-12 13:44:45 +01:00
Bernd Storath fc480df910 Fix: Update ip outside of cidr (#1733)
* update packages

* check if ip is included on update

* update package manager
2025-03-12 12:47:12 +01:00
dependabot[bot] b3bd2502af build(deps): bump nuxt from 3.15.4 to 3.16.0 in /src (#1727)
Bumps [nuxt](https://github.com/nuxt/nuxt/tree/HEAD/packages/nuxt) from 3.15.4 to 3.16.0.
- [Release notes](https://github.com/nuxt/nuxt/releases)
- [Commits](https://github.com/nuxt/nuxt/commits/v3.16.0/packages/nuxt)

---
updated-dependencies:
- dependency-name: nuxt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 12:26:21 +01:00
dependabot[bot] eb5ad91022 build(deps-dev): bump eslint from 9.21.0 to 9.22.0 in /src (#1726)
Bumps [eslint](https://github.com/eslint/eslint) from 9.21.0 to 9.22.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.21.0...v9.22.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 08:11:31 +01:00
dependabot[bot] f2955a1278 build(deps): bump @nuxtjs/i18n from 9.2.1 to 9.3.1 in /src (#1728)
Bumps [@nuxtjs/i18n](https://github.com/nuxt-modules/i18n) from 9.2.1 to 9.3.1.
- [Release notes](https://github.com/nuxt-modules/i18n/releases)
- [Changelog](https://github.com/nuxt-modules/i18n/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nuxt-modules/i18n/compare/v9.2.1...v9.3.1)

---
updated-dependencies:
- dependency-name: "@nuxtjs/i18n"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 07:34:37 +01:00
dependabot[bot] 1b76c066e0 build(deps-dev): bump @nuxt/eslint from 1.1.0 to 1.2.0 in /src (#1729)
Bumps [@nuxt/eslint](https://github.com/nuxt/eslint/tree/HEAD/packages/module) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/nuxt/eslint/releases)
- [Commits](https://github.com/nuxt/eslint/commits/v1.2.0/packages/module)

---
updated-dependencies:
- dependency-name: "@nuxt/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 07:27:29 +01:00
Bernd Storath 5b68cc7311 Feat: Confirm setup password (#1722)
confirm setup password
2025-03-07 16:05:40 +01:00
Bernd Storath 0597470f4c Bump version to 15.0.0-beta.7 2025-03-07 15:00:12 +01:00
Bernd Storath 159a51cff4 Feat: Global config override (#1720)
* be able to change dns. implement global override

* link donate to readme

* implement global config for allowed ips

* change translations, fix generation

* improve docs
2025-03-07 14:59:06 +01:00
Bernd Storath 9fc6ebafb3 Bump version to 15.0.0-beta.6 2025-03-07 12:02:03 +01:00
Bernd Storath 9a029eeb23 improve docs, add version script 2025-03-07 12:02:02 +01:00
Bernd Storath e5fb6ff3a6 Fix: OneTimeLinks (#1719)
* fix otls

* one otl per client

* revert some code

* revert some more code, add comments

* adjust migration
2025-03-07 09:16:24 +01:00
杨黄林 fcb5049dab Add PreUp, PostUp, PreDown, PostDown for client (#1714)
* Fix create client popup background is not white

* Fix no Add button when client Allowed Ips or Server Allowed Ips is empty

* Add preUp preDown postUp postDown for client

* Add description of hooks for client config

* Move hooks's label text into 'hooks' in en.json

---------

Co-authored-by: yanghuanglin <yanghuanglin@qq.com>
Co-authored-by: Bernd Storath <999999bst@gmail.com>
2025-03-07 08:17:33 +01:00
Bernd Storath 93db67bab6 fix: only require metrics password if set (#1715) 2025-03-06 11:45:03 +01:00
Bernd Storath 842475f799 Fix: Cidr Change (#1712)
* only calculate ip if cidr changed

if the cidr did not change, the ip will not change to prevent ip shifts

* fix lint
2025-03-06 10:04:49 +01:00
Bernd Storath f4d3608da7 Fix: Various (#1711)
* fix docs

* fix migration
2025-03-06 08:15:18 +01:00
Bernd Storath 84ee8c35f0 fix labels, date field, enable 2025-03-05 15:38:09 +01:00
Bernd Storath ded148a0f5 fix docs action 2025-03-05 13:37:16 +01:00
Bernd Storath 9b29d72991 Version 15.0.0-beta.1: Rewrite in Nuxt and Typescript, Move to UI (#1333)
* Add Nuxt, ESM, Typescript (#1244)

* wip: add nuxt

* basic implementation

* add changes from c9ff248

* update workflow, add eslint

* add types, fix wrong error message

* install correct bcrypt, move eslint to dev modules

* add docker dev script

* fix styling

* add wireguard routes

* typescript, vendors

* fix lint workflow

* lint fixes

* add prettier, format

* fix lint, add vscode settings

* better typescript

* use auto imports

* add prettier eslint config

* cache config

* fix styling issue, fix formatting

* fix tailwind problems

* fix logout not showing

* fix lint action

* Fix session middleware

* split files into correct methods

* use type safe api, fix typescript errors

* better return types

not tested

* change default working directory

* update workflows

* fix error

* correct session middleware, type safe session

* convert undefined to boolean

* correct key for api errors

* use zod to validate input

* add more jobs to check for good code

* add pinia

Co-authored-by: Sergei Birukov <suxscribe@gmail.com>
Co-authored-by: Bernd Storath <bernd.storath@offizium.de>

* use color mode plugin

* !! use better storage key name

Breaking as if old key exists it breaks as "auto" is not compatible with new "system"

* better local dev while dev container is running

use `docker compose -f docker-compose.dev.yml up`
or after changing dockerfile
`docker compose -f docker-compose.dev.yml up --build`

* update translation to match new theme mode

* improve dx

new devs get extensions recommended to catch errors, etc directly in vscode

* reduce errors, improve typing

* Split components (#1)

* update: introduce pages & components

 fix lint

* update: starting split components

* use auto imports

* Improve workflows and docker

workflow fix step naming

simplify docker dev

simplify docker prod

revert to node 18

dockerfile naming scheme

* Split components (#2)

* update: starting split components

* upd: rebase & continue splitting components

- layouts: header & footer
- components: basic buttton
- pages: login page

* update: login page

* package.json: remove dev:pass script

* Split into Components, migrate to nuxt

fixup

shutdown wireguard properly

fix styling, fix store

split even more

clear interval

split even more

split even more

handle auth middleware on server

avoid flicker of login page

* fix: buttons spaces & move layouts to components (#3)

* update: icons into components

- fix: header login page

* fix: tailwind handle btn class

* Split into icons

fix avatar

move class to view not icon itself

fix icon

format

* invalidate cache to make restoreConfig work

* fix apexchart

* use different color mode module

other one resulted in hydration mismatch

* fix dialog

* fix bad i18n merge

* use nuxt 4

* fix typing, fix redirect, latest release on server

* start wireguard on start

* wait for shutdown

* improve zod errors, consistent server errors

* migrate to useFetch

this makes sure that there is no double fetching

* fix hydration issues, remove unnecessary state, rename function

* fetch globalstore globally

otherwise this will load on login to homepage

* migrate to useFetch

no javascript support

TODO: not properly tested

* update backend

* wip: frontend

* update frontend

* update pnpm lock

---------

Co-authored-by: Sergei Birukov <suxscribe@gmail.com>
Co-authored-by: Bernd Storath <bernd.storath@offizium.de>
Co-authored-by: tetuaoro <65575727+tetuaoro@users.noreply.github.com>

* Fix various issues

fix router param

fix max age

unit is seconds not ms

fix regressions

fix missing expire date in client create dialog
fix wrong type rules
fix wrong api endpoint

properly catch error running cron job

fix type issues

* add database (#1330)

* add: database abstraction

* update: get lang from database

* udpate: with repositories

* add: interfaces to connect a database provider

- easy swapping between database provider

* add: setup page

- add: in-memory database provider
- create a new account (signup)
- login with username and password
- first setup page to create an account
- PASSWORD_HASH was removed from environment and files was updated/removed due to that change

* update: Dockerfile

* fix: review done

- remove: REQUIRES_PASSWORD & RELEASE environment variables

* fix: i18n translation

- rename directories

* update: use database

* fix: typecheck

* fix: review

* rebase & add: persistent lowdb provider

* update: french translation

* revert: due to rebase

* remove & document

* Refactor New UI (#1342)

* refactor code

* refactor code

* add some todos

* update pnpm, start migrating to database

* add missing i18n key

* add todo

* basic setup styling

* nuxt 4 folder structure, update packages

* Feat: Migrations (#1344)

* add migrations

* improve migration runner

* improve migration runner

* document what each migration does

* Feat: Rewrite Wireguard to use Database (#1345)

* update wireguard

* update

* update

* remove all config

* move all features into one route

* improve code

* fix some issues

add wg_path, update documentation

* Feat: Cidr Support (#1347)

* cidr support

* add cidr

* fix some errors

fix server config

missing cidr block in server config

* Fix: Database Date type (#1349)

* Feat: IPv6 (#1354)

* start supporting ipv6

* add ipv6 support

* build server with es2020

es2019 doesn't support bigint

* fix issues, better naming

* Fix: Security (#1355)

* separate route for onboarding

* zse zod for validation

* use argon2id

* add build tools

* Feat: Server AllowedIPs, MTU (#1356)

* add wireguard helpers

* improve wireguard helpers

* add server mtu

* fix wg0.conf formatting

* add ipv6 support to docker compose and readme

* Feat: Docs (#1361)

* basic docs

* use semver versioning

* Feat: Migration (#1363)

* start migration

* improve migration

* remove endpoint from client

* improve docker

* Chore: Deprecate Dockerless (#1377)

* deprecate dockerless

* Feat: Improve Repository pattern (#1380)

* improve repository pattern

* fix errors

* Feat: Improve Database Handling (#1383)

* improve docker build

* build doc workflow

* Feat: Changelog, Release Notes (#1385)

* add changelog, use semver for update message

* use first line of release for short changelog

* load ipv6 iptables module

* Feat: Show Version in Footer (#1389)

update ui logic, always store release in global store.

new release logic uses rate limited github api, avoid using cache

* use i18n ally (#1391)

* improve gh actions

* Setup UI (#1392)

* update: setup ui page

* rebase

* remove script addition

* Fixed usage of Ukrainian instead of Russian in ru.json (#1414)

* Added translations for the Belarusian language (#1472)

* Install kmod from alpine repository (#1553)

Because the busybox modprobe utility is unable to load zstd compressed modules.

Co-authored-by: Matt <mmoore2012@users.noreply.github.com>

* WIP: Feat: UI, General Improvements (#1397)

* update: setup ui page

* remove script addition

* add admin panel

* basic user menu and admin page

* make usable admin panel

* add radix vue, improve ui

* fix features, add toast

* rewrite middleware logic, support basic auth

* add todo marker

* active tailwind forms

* remove some console.logs

* check if user is enabled

frontend doesn't handle this state yet, nothing will work as api routes will fail

* add email to user, basic account page

* better group database

* group even more

* basic statistics page

* update: admin ui

- add: common panel components to get same UI
- i18n: french

* update: setup page error handle

- use fetch error data to provide error message
- use translation to provider error message

* update: me page

* fix: :text props

* update: login page

* update: i18n french support

* fix: use radix toast duration

* update: reduce templates

- remake: setup page to add others step configuration (host/port/migration)

* udpate: setup page use wizard form step

* update: ui

* update: step page

- first step to choose a language
- use red color in light mode
- validate step before move toward

* update: setup page

- use radix select component to reduce boilerplate

* update: setup page

- add: database langugage method
- update: api lang & export supported languages

* update: setup page

- update ui select language
- change lang on selection

* fix: use global store

* fix: initial value

- update: sort langs by value

* fix: ui center paragraph

* fix: remove file extension & some revert

- add: script to run checks script

* update: setup page

- add: host/port section
- i18n: french
- fix: fallback translation

* refactor: split setup into files

* update: setup page

- redirect to login when the setup is done
- allow user to return to previous steps
- prompt error message
- i18n french

* add: migration UI step

- rename: components
- fix: label for & form child id
- i18n french sup

* add: migration server

* fix: use string instead of File

* improve: with zod validation

* restore: clients

* rework setup

* add client page, move api routes

* improve setup

* switch to agpl

* add step back

* update licensed under texts

cc -> agpl

* make db results readonly

avoid weird side effects, when modifying the db object as its only allowed inside e.g. lowdb.ts

* update footer links

* improve client edit page, add mtu

* reorder tailwind classes

* update packages

* update comments

* better toast, better avatar

* delete feature toggle

* remove chart, statistics from server

let user decide what he wants to display

* move into own components

* switch from AGPL-3.0-or-later to AGPL-3.0-only

AGPL-3.0-or-later is not OSI approved

* fix building source

fixes https://github.com/wg-easy/wg-easy/issues/1563

* update packages

---------

Co-authored-by: tetuaoro <65575727+tetuaoro@users.noreply.github.com>

* update readme

* Feat: Settings, UI, General Improvements (#1572)

* deprecate other languages

new ui has too many new strings

* fix wrong license in readme

* properly fetch release

* order safe data structure for migrations

* empty server allowed ips by default

* show userconfig in admin panel

* remove routes, fix config

* add ability to update clients

* handle form submit using js

avoid weird behavior with FormData

* global toast, be able to update client

* update packages

* fix date field

* delete client using radix dialog

* remove lang from backend, let users decide

* be able to change interface and general

* be able to update user config

* consistent allowedips

* fix array field

* improve avatar, code cleanup

* basic metrics support

* remove dateTime helper

* be able to change hooks

* start cidr update

* be able to update cidr

* Feat: SQLite (#1619)

* start drizzle migration

* split schema

* improve schema

* improve schema, cascade, unique

* improve structure, start migration

* migrate to sqlite

* work in prod docker

* start adding a better permission handler

* permission matrix, permission handler

* update packages

* move session timeout to session config, use new permission handler

* improve docker dev

only install dependencies if changed

* implement setup

* migrate to sqlite

* improve debug, fix custom migration

* migrate to sqlite

* regenerate migrations

* ignore autogenerated migrations from prettier

* migrate to sqlite

* migrate to sqlite

* Migrate to sqlite

* fix prod error

* move nuxt middleware from server to nuxt

* update corepack in prod dockerfile

* use correct branch for workflow

* make docker file build on armv6/v7

* fix client update

* update zod locales

* cancel pr workflow if new commit

* test concurrency

* Feat: Account (#1645)

* be able to change name, email

* be able to change password

* consistent naming

zod is a schema not a type

* use transaction instance

* add zod strings

* Feat: Prometheus (#1655)

* check metrics password

* rewrite prometheus and json metric endpoints

* move metrics to general

metrics is not per interface

* change metrics settings in admin panel

* add i18n keys

* Chore: Remove multi interface support (#1657)

* streamline references to wg0

database wg0 name makes no sense anymore
wg0 only in database, could be easily replaced, or support for custom name added

* fix default key gen

* Feat: Permission System (#1660)

* wip: add abac

* wip: add admin abac

* add me abac

* fix type issue

* move from role check

avoid authStore.userData?.role === roles.ADMIN

* Feat: Zod Generic String (#1661)

* start improving zod translations

* update zod translations

* Feat: Migration (#1663)

* show error for old env vars

* reorder setup, be able to migrate

* fix type issue

* footer and header in setup, remove lang setup step

* remove backup / restore

* refactor dialog (#1665)

* fixed Dockerfile HEALTHCHECK syntax (#1686)

HEALTHCHECK options should always come before the CMD instruction

* Feat: Info (#1666)

* add tooltip info, extract strings

* multi type toast

* improve useSubmit, i18n

* better login screen

* improve

* consistent folder casing

* consistent casing

* fix even more stuff

* temp

* fix type errors

* remove armv6/7 support for now

* add information to client page

* optimize dockerfile

* update base image in Dockerfile to use node:lts-alpine

* fix build stage

* Chore: TODOs (#1695)

* verify setup step

* improve readme

* format todos

* move id

* remove objectMessage

* style array field

* Chore: TODOs (#1696)

* fix chart

* replace localstorage with cookies

* Chore: Improvments (#1697)

* update packages

* fix tab issues

* consistent imports

* use eslint module

* update date

* improve docs

* update docs

* format

* fix docs, fix cookie

* recognize timing attack potential

* improve gh actions, issue templates (#1700)

* Feat improv (#1702)

* add insecure option, link readme to docs

* improve docs

* update version

* add warning to readme

---------

Co-authored-by: Sergei Birukov <suxscribe@gmail.com>
Co-authored-by: Bernd Storath <bernd.storath@offizium.de>
Co-authored-by: tetuaoro <65575727+tetuaoro@users.noreply.github.com>
Co-authored-by: laperuz92 <31198184+laperuz92@users.noreply.github.com>
Co-authored-by: Siomkin Alexander <siomkin.alexander@gmail.com>
Co-authored-by: Matt <102529127+mmoore2012@users.noreply.github.com>
Co-authored-by: Matt <mmoore2012@users.noreply.github.com>
Co-authored-by: Denis Kazimirov <rokiden@users.noreply.github.com>
2025-03-05 13:06:31 +01:00
Philip H. c6dce0f6fb Dockerfile: don't update npm to latest, fix iptables paths (#1574)
* Dockerfile: don't update npm to latest

It's breaking nightly builds

* Dockerfile: path for iptables-legacy dosn't exist

* Dockerfile: fix iptables paths

* fixup: iptables-legacy

* Update Dockerfile
2024-12-22 14:14:01 +01:00
shalafi99 ddc7394e1b Document updates: docker-compose.yml / How_to_generate_an_bcrypt_hash.md (#1529)
* Update How_to_generate_an_bcrypt_hash.md

inclusion of single quotes for password with docker run command

addition of "--rm" parameter to docker run command as to cleanup the wg-easy container created with the password hash generation command

* Update docker-compose.yml

addition of missing # before the comment on PASSWORD_HASH line
2024-11-24 15:49:01 +01:00
Bernd Storath 6c752941f3 Update CODEOWNERS
Remove pheiduck
Reorder so WeeJeWel is not pinged on every PR
2024-10-18 09:02:26 +02:00
Philip H. eda8040a03 README.md: add donation link for WireGuard 2024-10-14 18:13:04 +02:00
dependabot[bot] bf77386ec6 build(deps): bump express-session from 1.18.0 to 1.18.1 in /src (#1470)
Bumps [express-session](https://github.com/expressjs/session) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/expressjs/session/releases)
- [Changelog](https://github.com/expressjs/session/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/session/compare/v1.18.0...v1.18.1)

---
updated-dependencies:
- dependency-name: express-session
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-14 09:23:24 +02:00
dependabot[bot] 6f2811c637 build(deps): bump h3 from 1.12.0 to 1.13.0 in /src (#1454)
Bumps [h3](https://github.com/unjs/h3) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/unjs/h3/releases)
- [Changelog](https://github.com/unjs/h3/blob/v1.13.0/CHANGELOG.md)
- [Commits](https://github.com/unjs/h3/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: h3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 09:56:08 +02:00
dependabot[bot] e75719b803 build(deps-dev): bump tailwindcss from 3.4.12 to 3.4.13 in /src (#1446)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.12 to 3.4.13.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.13/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.12...v3.4.13)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 13:29:41 +02:00
Gašper Spagnolo 3fc0e02798 Add slovene translation (#1440) 2024-09-28 11:37:09 +02:00
Philip H. 5aed67838c README.md: fixup urls
fix error 404
2024-09-23 12:27:57 +02:00
Edgars 99e1e15b03 Make minor improvements for ReadMe.md (#1428)
The following minor improvements were made to `README.md`:

- The notice about stable version was styled as block quote to emphasize
  it more and it was moved right after the title of the section
  "Versions", and a link to the production branch was added;
- versions table was updated to add links to branches for easier
  navigation;
- some typos were fixed;
- wording was changed in couple of places to make it simpler;
- the `docker run` command was updated to:
  - use long options to make it more self-explanatory;
  - wrap password hash value placeholder in single quotes to avoid
    variable expanding as password hashes tend to contain `$`;
  - some other very minor changes to make `docker run` options uniform.

Co-authored-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
2024-09-23 12:02:33 +02:00
dependabot[bot] 6dc89257ff build(deps-dev): bump nodemon from 3.1.4 to 3.1.7 in /src (#1426)
Bumps [nodemon](https://github.com/remy/nodemon) from 3.1.4 to 3.1.7.
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v3.1.4...v3.1.7)

---
updated-dependencies:
- dependency-name: nodemon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 10:07:33 +02:00
dependabot[bot] a32655992f build(deps-dev): bump tailwindcss from 3.4.11 to 3.4.12 in /src (#1425)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.11 to 3.4.12.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.12/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.11...v3.4.12)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 10:05:04 +02:00
Philip H. 2bd1dffe7e CODEOWNERS: fixup request review by all Maintainers
Emile will also be on this list, should be fine anyways.
2024-09-17 17:39:25 +02:00
Naoki Ishikawa 3c959ba3bb Add japanese translation. (#1403) 2024-09-16 08:31:28 +02:00
dependabot[bot] 0b204a6f21 build(deps-dev): bump tailwindcss from 3.4.10 to 3.4.11 in /src (#1412)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.4.10 to 3.4.11.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.4.11/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.4.10...v3.4.11)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 08:28:26 +02:00
Philip H. efe5cccb02 index.html: Emile Nijssen's blog url changed 2024-09-13 18:24:41 +02:00
Tristan 31c59c1b26 Update README.md (#1390) 2024-09-11 09:05:32 +02:00
Vadim Babadzhanyan 6e891ad9fb Prometheus password fix (#1319)
* Russian translation

* Fix require prometheus password

---------

Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
2024-09-10 18:46:09 +02:00
Philip H. e2fe3b8b32 fixup: deploy.yml
echo moved by a mistake
2024-09-09 15:31:18 +02:00
Philip H. c0fbc3f647 Update deploy.yml 2024-09-09 13:33:52 +02:00
Xiwangly f3324cbb28 Update i18n.js, add chs & cht translations (#1374) 2024-09-08 08:21:26 +02:00
Vadim Babadzhanyan 33b4c3859d Fix onetimelink (#1367)
* Russian translation

* fix onetime link for android tv

---------

Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
2024-09-07 08:43:59 +02:00
Philip H 067b7bcf84 CI: fixup dev deploy too
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-09-06 16:39:34 +02:00
Philip H. 942f35916c deploy-nightly.yml: reference to master branch 2024-09-06 16:35:03 +02:00
dependabot[bot] 52d83dbf35 build(deps): bump debug from 4.3.6 to 4.3.7 in /src (#1365)
Bumps [debug](https://github.com/debug-js/debug) from 4.3.6 to 4.3.7.
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](https://github.com/debug-js/debug/compare/4.3.6...4.3.7)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 16:29:05 +02:00
Philip H. 4dc56a0718 CI: use dependabot instead of gh action (#1364) 2024-09-06 16:26:27 +02:00
NPM Update Bot 66c64af7cf npm: package updates 2024-09-05 16:09:17 +00:00
Philip H. f4b3d4fb6b wg-password(docu): fixup docker command 2024-09-05 18:08:49 +02:00
NPM Update Bot 3427d677f6 npm: package updates 2024-09-04 16:37:44 +00:00
Bernd Storath 4ba7dc244c early fail if old password variable (#1350) 2024-09-04 18:37:11 +02:00
NPM Update Bot 3f6b6f3c9b npm: package updates 2024-09-03 20:34:41 +00:00
Hans 11872de321 Allow wgpw to prompt for a password through stdin (#1348)
* Allow wgpw to prompt for a password through stdin

If the user does not pass the password as a parameter, they are prompted
for it through stdin.
The password is not echoed back, just like any other command-line log-in
prompt (ie. sudo).

* Fix lint errors in wgpw
2024-09-03 22:34:08 +02:00
NPM Update Bot 4758c0dddc npm: package updates 2024-09-02 00:03:22 +00:00
NPM Update Bot 96030c08f4 npm: package updates 2024-08-30 11:17:49 +00:00
Kirk1984 ba989aa829 Fix typo in How_to_generate_an_bcrypt_hash.md (#1332) 2024-08-30 13:17:20 +02:00
NPM Update Bot 78fab2b5d8 npm: package updates 2024-08-26 00:03:04 +00:00
NPM Update Bot dd04dd285d npm: package updates 2024-08-23 10:11:05 +00:00
Vadim Babadzhanyan 7be9884aec Feat Prometheus metrics (#1299)
* Russian translation

* Add Prometheus metrics
[Feat]: Simple Stats API #1285

* Revert "Add Prometheus metrics"

This reverts commit a998f6be8a.

* Add Prometheus metrics
[Feat]: Simple Stats API #1285

* Fix short link. Generate One Time Link (#1301)

Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>

* fix one time links (#1304)

Closes #1302
Co-authored-by: Bernd Storath <999999bst@gmail.com>

* fixup: issue templates due to labels reorg

Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>

* Separate port for prometheus metrics
Add Prometheus metrics [Feat]: Simple Stats API #1285

* Separate port for prometheus metrics
Add Prometheus metrics [Feat]: Simple Stats API #1285

* Fix port in Readme
Separate port for prometheus metrics
Add Prometheus metrics [Feat]: Simple Stats API #1285

* Add Prometheus port in Service
Separate port for prometheus metrics
Add Prometheus metrics [Feat]: Simple Stats API #1285

* Revert "Add Prometheus port in Service"

This reverts commit a7376abcf1.

* Revert "Fix port in Readme"

This reverts commit 9760bde2f2.

* Revert "Separate port for prometheus metrics"

This reverts commit 58f5b6806e.

* Revert "Separate port for prometheus metrics"

This reverts commit 6d246ea4bd.

* Add Prometheus metrics with Basic Auth
[Feat]: Simple Stats API #1285

* Disable by default
[Feat]: Simple Stats API #1285

* [Feat]: Simple Stats API #1285

* Update README.md

---------

Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
Co-authored-by: Bernd Storath <bernd.storath@offizium.de>
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-08-23 12:10:20 +02:00
Bernd Storath 41be774761 rename features, fix formatting 2024-08-23 08:32:47 +02:00
Philip H. ed93c6c8ed CODEOWNERS: make it commplete 2024-08-22 23:46:04 +02:00
NPM Update Bot bbffc22ae3 npm: package updates 2024-08-22 21:45:42 +00:00
Philip H. 800ec155c1 CODEOWNERS: add kaaax0815 2024-08-22 23:45:04 +02:00
Philip H 75df17476f fixup: issue templates due to labels reorg
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-08-21 17:07:46 +02:00
Bernd Storath 86f968499a fix one time links (#1304)
Closes #1302
Co-authored-by: Bernd Storath <999999bst@gmail.com>
2024-08-21 15:55:35 +02:00
Vadim Babadzhanyan 968d2b90a0 Fix short link. Generate One Time Link (#1301)
Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
2024-08-20 16:19:07 +02:00
Philip H 352a022f30 nodejs: use lts as version tag
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-08-19 14:30:41 +02:00
Vadim Babadzhanyan 8145809e22 Feat expiration date (#1296)
Closes #1287
Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
2024-08-18 23:18:09 +02:00
Vadim Babajanyan 40af030266 Update Russian translation (#1291)
Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
2024-08-16 21:48:22 +02:00
Vadim Babajanyan bb2e8d2751 Fix sort clients (#1290)
Co-authored-by: Vadim Babadzhanyan <vadim.babadzhanyan@my.games>
2024-08-16 20:47:31 +02:00
Võ Hoàng ca7ee32052 feat(www): add sort clients by name (#1227)
Co-authored-by: Philip H. <47042125+pheiduck@users.noreply.github.com>
2024-08-16 19:40:24 +02:00
Philip H. 7c521e8733 Add Remember me (#1276) 2024-08-16 19:27:30 +02:00
Philip H. f5885e335c Merge branch 'master' into remember-me 2024-08-16 19:25:36 +02:00
Philip H. 36b9ff60c8 Supports displaying short links (#1288) 2024-08-16 19:24:43 +02:00
Vadim Babadzhanyan cd3d4efebf Supports displaying short links, for easy downloading on TVs and Android TVs: fix lint errors 2024-08-16 20:20:31 +03:00
Vadim Babadzhanyan 81633de07b Supports displaying short links, for easy downloading on TVs and Android TVs: Add crc-32 package 2024-08-16 20:08:30 +03:00
Vadim Babadzhanyan 0a33b1f7df Supports displaying short links, for easy downloading on TVs and Android TVs 2024-08-16 18:39:24 +03:00
NPM Update Bot 2ea37dd7ba npm: package updates 2024-08-15 15:04:36 +00:00
Philip H. 2fe5269bbe Additional Korean language updates (#1278) 2024-08-15 17:04:07 +02:00
jkh0kr 8591b35d4e Update i18n.js
Additional Korean language updates
2024-08-14 10:00:58 +09:00
Philip H. 7fbc2702a6 fix pr template location (#1277)
Co-authored-by: Bernd Storath <999999bst@gmail.com>
2024-08-13 14:54:46 +02:00
Bernd Storath 4ead4c2cc9 fix pr template location 2024-08-13 08:30:51 +02:00
Viktor Yudov 3e6ded18a5 Add Remember me 2024-08-13 02:51:05 +03:00
NPM Update Bot 4e79d0ee03 npm: package updates 2024-08-12 14:56:03 +00:00
Philip H. 6d59e16161 add better issue template (#1274)
Co-authored-by: Bernd Storath <999999bst@gmail.com>
2024-08-12 16:55:29 +02:00
Bernd Storath 0386a0da6b add better issue template
Co-authored-by: Bernd Storath <bernd.storath@offizium.de>
2024-08-12 16:34:01 +02:00
NPM Update Bot 0bf266d5cb npm: package updates 2024-08-12 08:56:59 +00:00
Philip H. 0ca39b4f34 fix(Doc): fix escaping issue for PASSWORD_HASH in docker-compose.yml (#1270)
For users using docker-compose.yml, please note that you should not wrap the generated hash password in single quotes. Instead, replace each `$` symbol with two `$$` symbols.

For example, for the password 'foobar123', use the following command to generate the hash:
`docker run ghcr.io/wg-easy/wg-easy wgpw foobar123`

The resulting hash should be used in docker-compose.yml like this:
``` yaml
- PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG
```

Signed-off-by: cyicz123 <cyicz123@outlook.com>
2024-08-12 10:56:32 +02:00
程越 a268422e9d fix(Doc): fix escaping issue for PASSWORD_HASH in docker-compose.yml
For users using docker-compose.yml, please note that you should not wrap the generated hash password in single quotes. Instead, replace each `$` symbol with two `$$` symbols.

For example, for the password 'foobar123', use the following command to generate the hash:
`docker run ghcr.io/wg-easy/wg-easy wgpw foobar123`

The resulting hash should be used in docker-compose.yml like this:
``` yaml
- PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG
```

Signed-off-by: cyicz123 <cyicz123@outlook.com>
2024-08-12 11:25:17 +08:00
Philip H. 8921d6c661 docker-compose.yml: reflect How_to_generate_an_bcrypt_hash.md 2024-08-10 19:33:30 +02:00
Philip H. b18f919419 fixup How_to_generate_an_bcrypt_hash.md
Password hash has to be in single quotes
2024-08-10 10:34:46 +02:00
Philip H. ea99f56484 Update How_to_generate_an_bcrypt_hash.md (#1262)
explain about double $ usage on password.
2024-08-10 10:28:29 +02:00
Jouy Durao aea653a071 Update How_to_generate_an_bcrypt_hash.md
explain about double $ on password
2024-08-09 18:40:39 -03:00
NPM Update Bot a18a715f6f npm: package updates 2024-08-08 18:37:52 +00:00
Philip H. ec202d8575 fix: Status Bar Color Issue in PWA on iOS 18 (#1257)
#1256
Reported by @xK1t
2024-08-08 20:37:19 +02:00
Philip H 9dd7f256ba fix: Status Bar Color Issue in PWA on iOS 18
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-08-08 20:33:01 +02:00
Philip H. 33e95bac5e Update Ukraine translation (#1251) 2024-08-07 17:23:09 +02:00
Nikolas 72fe64385e Update i18n.js 2024-08-07 17:20:38 +02:00
NPM Update Bot 2b7c846823 npm: package updates 2024-08-07 14:11:55 +00:00
Philip H. 9275cf611a Add autocomplete attribute to password input (#1249) 2024-08-07 16:11:25 +02:00
İbrahim Çetin 95934c6008 Add autocomplete attribute to password input 2024-08-07 10:29:33 +03:00
Philip H. babb9983aa chore: Update i18n.js Turkish translations (#1238)
Thank you @babico!
2024-08-03 09:22:51 +02:00
Müslüm Barış Korkmazer c9ff248011 chore: Update i18n.js Turkish translations 2024-08-02 22:49:56 +03:00
Philip H. f9edec0ac1 Create pull_request_template.md (#1226) 2024-08-02 19:48:08 +02:00
Philip H. eb0fa90cd0 Create pull_request_template.md 2024-08-02 19:47:30 +02:00
Philip H. 1607fd1562 fixup: docker-compose.dev.yml (#1236)
Improving compose file for dev.
Some variables are missed which lead to an error.
Fixes: #1234
2024-08-01 20:09:01 +02:00
Philip H. 5938474bf8 fixup: docker-compose.dev.yml
Improving compose file for dev.
Some variables are missed which lead to an error.
Fixes: #1234
2024-08-01 17:20:11 +02:00
Philip H. ff9c1b49b6 CODEOWNERS: add maintainer 2024-08-01 17:11:01 +02:00
Philip H. 72562dc660 Spelling in How_to_generate_an_bcrypt_hash.md (#1233) 2024-08-01 07:30:28 +02:00
kikawala 4ffa6b37de Spelling in How_to_generate_an_bcrypt_hash.md 2024-07-31 17:10:25 -05:00
Philip H. 1416613cc6 README.md: Reduce confusion in the readme 2024-07-30 17:57:15 +02:00
Philip H. a3c5cf359f remove PASSWORD env unused and replace by PASSWORD_HASH (#1229) 2024-07-30 17:47:18 +02:00
pheiduck d8a48aef29 remove PASSWORD env unused and replace by PASSWORD_HASH 2024-07-30 17:45:00 +02:00
NPM Update Bot 5dad038796 npm: package updates 2024-07-27 11:05:05 +00:00
Philip H. 63f49a20ed translations: Add missing Russian translations (#1219)
thank you @mcmimik!
2024-07-27 13:04:32 +02:00
Андрей 39949d2704 translations: Add missing Russian translations 2024-07-27 14:00:48 +03:00
Андрей 13fcccb2f2 translations: Add missing Russian translations 2024-07-27 13:50:18 +03:00
NPM Update Bot 200332df4b npm: package updates 2024-07-24 15:54:42 +00:00
Philip H. 3d0070f3f6 prepare: version bump and changelog (#1211) 2024-07-24 17:54:08 +02:00
pheiduck 14fd01f4d0 prepare: version bump and changelog
Signed-off-by: pheiduck <47042125+pheiduck@users.noreply.github.com>
2024-07-24 17:46:31 +02:00
Philip H. 52bcfb056a Get the version info inside the release object (#1208)
Fix "invalid reference format" in production Docker build
2024-07-23 07:47:07 +02:00
Dartegnian d5b8d707ef Get the version info inside the release object 2024-07-23 13:01:08 +08:00
Philip H. caad2e4162 fix: responsive buttons on mobile (#1206)
* fix: buttons on mobile
* fix: lint error with workspaces
* fix: redundant css
2024-07-22 13:49:46 +02:00
tetuaoro 3d376e542f fix: redundant css 2024-07-22 13:28:30 +02:00
tetuaoro 74372dc05d fix: lint error with workspaces 2024-07-22 13:05:18 +02:00
tetuaoro b46018efd8 fix: buttons on mobile 2024-07-22 12:44:53 +02:00
NPM Update Bot 2ef264d06f npm: package updates 2024-07-20 14:35:18 +00:00
Philip H. d23c5f7d01 Bugfix: Line Charts
Fixes: #1111
2024-07-20 16:34:46 +02:00
Sergei Birukov 73f2ad4ac3 Fix #1111 2024-07-20 17:20:54 +03:00
Philip H 5a075683c4 fix typo: How_to_generate_an_bcrypt_hash.md 2024-07-15 15:20:15 +02:00
Philip H c28e5befa6 feat: PASSWORD_HASH helpers (#1180)
* feat: generate PASSWORD_HASH on the fly

* remove PASSWORD environment variable in favor of PASSWORD_HASH
* enhance password validity check server function
* update Dockerfile to include building a binary for generating hashed password
* update README with comprehensive Docker usage instructions hash generation

* fix: try fix git action docker build

* Dockerfile: use alpine-base image and install required build packages

* rewrite in js

* move files

* fix: lint errors

* some corrections

---------

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-07-15 10:32:38 +02:00
NPM Update Bot 42ad29b494 npm: package updates 2024-07-15 00:03:14 +00:00
tetuaoro 53dad56bb6 some corrections 2024-07-14 18:33:11 +02:00
tetuaoro f5d93f6c5a fix: lint errors 2024-07-14 18:09:13 +02:00
tetuaoro a9c798deda move files 2024-07-14 17:59:52 +02:00
tetuaoro 781d56d0ff Merge branch 'wgpassword_js' into wgpassword 2024-07-14 17:20:47 +02:00
tetuaoro 883ca34182 rewrite in js 2024-07-14 17:13:27 +02:00
Philip H cc5d45b833 Dockerfile: use alpine-base image and install required build packages 2024-07-14 16:43:53 +02:00
tetuaoro 8bfcb5d502 fix: try fix git action docker build 2024-07-12 22:39:26 +02:00
tetuaoro 9a19430dc8 feat: generate PASSWORD_HASH on the fly
* remove PASSWORD environment variable in favor of PASSWORD_HASH
* enhance password validity check server function
* update Dockerfile to include building a binary for generating hashed password
* update README with comprehensive Docker usage instructions hash generation
2024-07-12 21:24:09 +02:00
NPM Update Bot 62ea932d33 npm: package updates 2024-07-11 13:46:35 +00:00
Philip H be8a592072 refactor: optimize build config, factorize code, enhance SVG icons (#1174)
* focus on syncing configuration without shutting down current wg session
	refactor build configuration logic to optimize code structure
* enhance SVG icons for better visual appeal (https://github.com/wg-easy/wg-easy/pull/1166#issuecomment-2222418606)
* update the screenshot to reflect the latest UI changes
* fix: prevent logging private key during user creation
2024-07-11 15:45:58 +02:00
tetuaoro 9371b78a21 refactor: optimize build config, factorize code, enhance SVG icons
* focus on syncing configuration without shutting down current wg session
	refactor build configuration logic to optimize code structure
* enhance SVG icons for better visual appeal (https://github.com/wg-easy/wg-easy/pull/1166#issuecomment-2222418606)
* update the screenshot to reflect the latest UI changes
* fix: prevent logging private key during user creation
2024-07-11 12:58:25 +02:00
Philip H 4ba638c09c i18n.js: fix typo 2024-07-10 18:55:24 +02:00
NPM Update Bot 3ad2607515 npm: package updates 2024-07-10 16:49:35 +00:00
Philip H 7f05448a5d import & export configuration (#1161,#1166)
* fix: auto formatter

* Revert "i18n.js: german translation"

This reverts commit e4a7ff08c6.

* fix conficts

* feat: load configuration from file

* import json config file & update the config (restore)
* export the config and save it to json file (backup)

* fix: reload configuration

* run linter
* screenshot update

* feat: support more langs

* add translations for French, Spanish, and Italian
* change the wording for better understanding of this feature:
    - "import" to "restore"
    - "export" to "backup"
* rename functions to reflect these changes

* i18n.js: german translation

* npm: package updates

* fix: icons & buttons view

* update the viewBox of svg elements
* add cursor pointer when hover the restore button
* rebuild the css

---------

Co-authored-by: tetuaoro <tetuaoropro@gmail.com>
Co-authored-by: tetuaoro <65575727+tetuaoro@users.noreply.github.com>
2024-07-10 18:48:33 +02:00
Philip H c5b3bcd31d fix: icons & buttons view (#1167)
* update the viewBox of svg elements
* add cursor pointer when hover the restore button
* rebuild the css
2024-07-10 18:40:15 +02:00
tetuaoro 10d24fa04b fix: icons & buttons view
* update the viewBox of svg elements
* add cursor pointer when hover the restore button
* rebuild the css
2024-07-10 18:11:28 +02:00
Philip H 3dc83f9c25 start fix pr 1161 (#1165)
* feat: load configuration from file

* import json config file & update the config (restore)
* export the config and save it to json file (backup)

* fix: reload configuration

* run linter
* screenshot update

* feat: support more langs

* add translations for French, Spanish, and Italian
* change the wording for better understanding of this feature:
    - "import" to "restore"
    - "export" to "backup"
* rename functions to reflect these changes

* i18n.js: german translation

* npm: package updates

* Revert "import & export configuration"

* npm: package updates

* Revert "import & export configuration"

* fix: auto formatter

* Revert "i18n.js: german translation"

This reverts commit e4a7ff08c6.

* fix conficts

---------

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Co-authored-by: NPM Update Bot <npmupbot@users.noreply.github.com>
2024-07-10 15:51:38 +02:00
Philip H 1a54a0b016 Merge branch 'imexport' into imexport 2024-07-10 15:49:42 +02:00
NPM Update Bot a0ed35fd76 npm: package updates 2024-07-10 15:46:36 +02:00
Philip H 8421e313b5 i18n.js: german translation 2024-07-10 15:46:36 +02:00
tetuaoro ce20bb7fcb feat: support more langs
* add translations for French, Spanish, and Italian
* change the wording for better understanding of this feature:
    - "import" to "restore"
    - "export" to "backup"
* rename functions to reflect these changes
2024-07-10 15:46:36 +02:00
tetuaoro e3ee09b755 fix: reload configuration
* run linter
* screenshot update
2024-07-10 15:46:36 +02:00
tetuaoro 03b7d8e537 feat: load configuration from file
* import json config file & update the config (restore)
* export the config and save it to json file (backup)
2024-07-10 15:46:36 +02:00
tetuaoro e7d4bbc12c Merge branch 'master' into imexport 2024-07-10 15:14:41 +02:00
tetuaoro 45087a9683 fix conficts 2024-07-10 15:01:39 +02:00
tetuaoro 39d32b0a1c Revert "i18n.js: german translation"
This reverts commit e4a7ff08c6.
2024-07-10 14:44:40 +02:00
tetuaoro f47e740861 fix: auto formatter 2024-07-10 14:34:57 +02:00
Philip H ba85c085ab Revert "import & export configuration" (#1163) 2024-07-10 13:12:56 +02:00
Philip H 9aafbd73d2 Revert "import & export configuration" 2024-07-10 12:51:45 +02:00
NPM Update Bot 9efac11680 npm: package updates 2024-07-10 10:49:29 +00:00
Philip H e5131fb707 Revert "import & export configuration" (#1162) 2024-07-10 12:48:50 +02:00
Philip H abdf96011e Revert "import & export configuration" 2024-07-10 12:44:59 +02:00
NPM Update Bot 8b2706e3c2 npm: package updates 2024-07-10 10:38:02 +00:00
Philip H 6fe197f4fd import & export configuration (#1161)
* feat: load configuration from file

* import json config file & update the config (restore)
* export the config and save it to json file (backup)

* fix: reload configuration

* run linter
* screenshot update

* feat: support more langs

* add translations for French, Spanish, and Italian
* change the wording for better understanding of this feature:
    - "import" to "restore"
    - "export" to "backup"
* rename functions to reflect these changes

* i18n.js: german translation

---------

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-07-10 12:37:28 +02:00
Philip H e4a7ff08c6 i18n.js: german translation 2024-07-10 12:34:11 +02:00
tetuaoro 43b193b76d feat: support more langs
* add translations for French, Spanish, and Italian
* change the wording for better understanding of this feature:
    - "import" to "restore"
    - "export" to "backup"
* rename functions to reflect these changes
2024-07-10 12:06:25 +02:00
tetuaoro 4deca34faf fix: reload configuration
* run linter
* screenshot update
2024-07-09 19:49:40 +02:00
tetuaoro 72ba79b5f2 feat: load configuration from file
* import json config file & update the config (restore)
* export the config and save it to json file (backup)
2024-07-09 17:06:19 +02:00
NPM Update Bot 94d87681c3 npm: package updates 2024-07-09 15:01:53 +00:00
Philip H e3315d92c4 Fix a small typo in README.md (#1160)
Thank you @ThreadR-r!
2024-07-09 17:01:15 +02:00
Elian (ThreadR) Freyermuth a0c495ddad Fix a small typo in README.md
Changed from "Home Assistent" to "Home Assistant"
2024-07-09 14:11:07 +02:00
NPM Update Bot c73c6c7291 npm: package updates 2024-07-08 08:42:56 +00:00
Philip H 04d1ca18b7 Fix bcrypt hash one-liner (#1154)
Thank you @steviegalluscio!
2024-07-08 10:42:23 +02:00
Stevie Galluscio 438fc7ccf9 Fix bcrypt hash one-liner 2024-07-08 10:39:29 +02:00
Philip H a2c758dbcb How_to_generate_an_bcrypt_hash.md: macos homebrew 2024-07-07 19:15:57 +02:00
NPM Update Bot 6a588ee3fa npm: package updates 2024-07-07 17:13:42 +00:00
Philip H 378464a424 How_to_generate_an_bcrypt_hash.md: macos guide 2024-07-07 19:13:03 +02:00
Philip H 7ecf7b08b1 fixup: typos 2024-07-05 22:42:38 +02:00
Philip H cea9e9302d translations: Update Traditional Chinese translations (#1145)
Thank you @bluehomewu!
2024-07-04 19:02:19 +02:00
EdwardWu 11f5122c39 translations: Update Traditional Chinese translations
* Update strings closer than Taiwanese used.

Signed-off-by: EdwardWu <bluehome.wu@gmail.com>
2024-07-04 10:47:18 +08:00
NPM Update Bot ee117ddb91 npm: package updates 2024-07-01 00:03:23 +00:00
NPM Update Bot d3e8e627e9 npm: package updates 2024-06-28 10:37:56 +00:00
Philip H 864bb00d0b Enhance bcrypt doc: rename, add one-liner, usage info, and assert (#1138)
Thank you @mathys-lopinto!
2024-06-28 12:37:22 +02:00
Mathys Lopinto 7608f91913 Right README
Push the latest README.md
2024-06-27 21:06:15 +02:00
Mathys Lopinto 4d849fc508 Enhance bcrypt doc: rename, add one-liner, usage info, and assert
- Rename the file to a more readable name
- Add one-liner command for quick execution
- Include dedicated paragraph on using the output
- Implement assert to prevent bcrypt limitation issues
- Comment the python script
- Improves clarity and usability of bcrypt documentation
- Mention documentation file in docker-compose.yml and README.me file
2024-06-27 21:00:11 +02:00
NPM Update Bot 436ccac824 npm: package updates 2024-06-27 18:34:47 +00:00
Philip H b4ca454ec5 Add: Generate.bcrypt.hash.md (#1135)
Thank you @mathys-lopinto!
2024-06-27 20:34:05 +02:00
Philip H 8044c53815 add: Fedora and Arch Linux install guide 2024-06-27 10:18:09 +02:00
Philip H e7e374cfd7 comment: created by 2024-06-26 18:11:02 +02:00
Philip H 9afd549273 Add: Generate.bcrypt.hash.md
Thanks to: @mathys-lopinto
2024-06-26 13:03:14 +02:00
Philip H 6b67f20b6a build(deps): bump docker/build-push-action from 5 to 6 (#1134) 2024-06-24 10:34:41 +02:00
dependabot[bot] d31524a531 build(deps): bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 04:23:33 +00:00
NPM Update Bot 34c28805c4 npm: package updates 2024-06-24 00:04:04 +00:00
Philip H 9b6ac7cd8d docker-compose.yml: PASSWORD_HASH is replacing PASSWORD
in nightly and next releases
2024-06-20 16:15:10 +02:00
Philip H 3613d26d4a docker-compose.yml: fixup every single $ has to be $$ 2024-06-20 14:43:17 +02:00
Philip H ccacc5ea87 docker-compose.yml: refinements 2024-06-20 14:37:12 +02:00
Philip H bfd7ef9e46 docker-compose.yml: fixup use '' for hashed Password
otherwise docker think it is an env variable and set it to blank
2024-06-20 12:24:57 +02:00
NPM Update Bot 2f956248db npm: package updates 2024-06-20 09:46:37 +00:00
Philip H e0e2a6deba docker-compose.yml: add missing PASSWORD_HASH option (#1121) 2024-06-20 11:46:03 +02:00
Philip H 304506d26d docker-compose.yml: add missing PASSWORD_HASH option 2024-06-20 11:43:23 +02:00
Peter Lewis e0775c0d2e Merge pull request #1117 from wg-easy/peterlewis-patch-1
README refinements
2024-06-18 22:38:04 +01:00
Peter Lewis 8598a167ef Update README.md
Refinement
2024-06-18 22:30:28 +01:00
Philip H 6659785514 feat: introduce PASSWORD_HASH and deprecate PASSWORD (#1116)
Thank you @RobertHeim!
2024-06-18 22:50:57 +02:00
Robert Heim 34ae8e42f3 fix: lint errors 2024-06-18 22:30:55 +02:00
Robert Heim eaa4b1ebaa feat: introduce PASSWORD_HASH and deprecate PASSWORD 2024-06-18 20:17:00 +02:00
Philip H 72fbf1baf6 README.md: add docs for WG_CONFIG_PORT 2024-06-17 15:22:54 +02:00
Philip H 2a102eea93 deploy-development.yml: disable pull request
until we can deploy on other branches from contributors/authors
2024-06-16 19:02:32 +02:00
Philip H 85913b71ed CI: no cache-dependency-path
it's useless and can lead to confusion
2024-06-16 16:25:51 +02:00
NPM Update Bot 7d0e2729b6 npm: package updates 2024-06-16 14:14:58 +00:00
Philip H b5372f0dbc bring password hash back
users want to have this instead cleartext password. Mitigates security issues.
2024-06-16 16:14:19 +02:00
NPM Update Bot 390b72c94a npm: package updates 2024-06-10 00:03:26 +00:00
Philip H de22768079 config: Add support for custom client port configuration (#1090)
Thank you @adriy-be!
This will enable homeassistant support
2024-06-08 11:47:52 +02:00
Philip H 00acd1a07e config: Add support for custom client port configuration (#1080)
merge for testing (1)
2024-06-07 12:55:14 +02:00
adrien a082a40bf6 config: Add support for custom client port configuration
This commit introduces the ability to specify a custom port for the client
configuration. This feature is particularly useful when the WireGuard server
is behind a port forwarding setup, allowing clients to connect using the
correct port number.

With this change, users can now define the desired client port in the
configuration file, ensuring seamless connectivity even in scenarios where
the client's listening port differs from the standard WireGuard port.
2024-06-07 12:53:54 +02:00
Philip H 3d1e42c722 fix typo in Server.js (#1089)
Thank you @Max-42!
2024-06-07 09:04:58 +02:00
Max e6d2d95340 fix typo in Server.js 2024-06-06 23:01:39 +02:00
NPM Update Bot 1370141f03 npm: package updates 2024-06-06 15:21:02 +00:00
Philip H ac552e0384 Readme: Inform Podman users about cap-add=NET_RAW (#1085)
Thank you @iguanajuice!
2024-06-06 17:20:26 +02:00
iguanajuice ca737f9452 Inform Podman users about cap-add=NET_RAW 2024-06-04 01:17:05 -04:00
NPM Update Bot b60f0e9668 npm: package updates 2024-06-02 13:20:07 +00:00
Philip H 0e1ad23f17 Everyting owned by WeeJeWel 2024-06-02 15:19:29 +02:00
Philip H 3638e81718 Update CODEOWNERS 2024-05-30 15:28:13 +02:00
NPM Update Bot 44417d3db6 npm: package updates 2024-05-30 11:48:00 +00:00
Philip H e5e63c43e6 package.json: fixup license identifier 2024-05-30 13:47:24 +02:00
NPM Update Bot f06b7e00aa npm: package updates 2024-05-30 07:31:06 +00:00
Philip H 70d59d0fdd cdnjs: apexcharts.min.js 3.49.1 (#1081) 2024-05-30 09:30:29 +02:00
Philip H 332039de56 cdnjs: apexcharts.min.js 3.49.1 2024-05-30 09:24:58 +02:00
Philip H 5e015bfdb5 Security vulnerability patched and minor improvements (#1071)
Thank you so much @davide-acanfora!
2024-05-27 20:41:46 +02:00
davide-acanfora d2d15fca2a Path traversal vulnerability resolved 2024-05-27 20:25:00 +02:00
davide-acanfora c26b536b65 Remove unnecessary bcryptjs module usage 2024-05-27 20:25:00 +02:00
davide-acanfora 859dd2f25b Replace uuid module with built in crypto for UUIDv4 generation 2024-05-27 20:25:00 +02:00
davide-acanfora e80ff54ebc Don't print release number to anyone who visits the service 2024-05-27 20:25:00 +02:00
NPM Update Bot 4bfef3c0c0 npm: package updates 2024-05-27 00:03:06 +00:00
NPM Update Bot 93d9f0b6fe npm: package updates 2024-05-24 19:35:49 +00:00
Philip H 54236eb8b4 Documentation: image tags and UI_CHART_TYPE (#1057) 2024-05-24 21:35:11 +02:00
Philip H 8249b92a34 fixup: add UI_CHART_TYPE docs 2024-05-24 21:32:17 +02:00
Philip H 4cd5d5459a Documentation: docker image versions 2024-05-23 11:32:13 +02:00
NPM Update Bot 678cf5bffb npm: package updates 2024-05-23 07:46:21 +00:00
Philip H ad80017846 Dockerfile: remove unused parts
We expose ports another way
2024-05-23 09:45:37 +02:00
Philip H 975c61df6d fixup: desktop example iOS -> macOS 2024-05-20 12:52:18 +02:00
Philip H 211e0b6aa2 Update README.md 2024-05-18 14:13:03 +02:00
taohua 8df1b6ff54 Update config.js
should respect WG_PORT, not hard code 51820.
2024-05-18 14:13:03 +02:00
Philip H cf94b98482 fixup: Server.js for instance without docker (#1044)
patch for v13
2024-05-16 20:21:37 +02:00
NPM Update Bot 3844d04569 npm: package updates 2024-05-16 20:19:22 +02:00
Philip H 68c6f6252e fixup: Server.js for instance without docker
Some users can no longer access the Web UI since the release of v13.
2024-05-16 20:19:22 +02:00
Philip H 519f4efa20 Version 13: new framework, UI_CHART_TYPE, some bugfixes and more (#967)
Thanks to all contributors to get us able to release v13!
2024-05-13 20:44:16 +02:00
NPM Update Bot c6dd456a07 npm: package updates 2024-05-13 00:03:03 +00:00
NPM Update Bot a43d2201fc npm: package updates 2024-05-09 18:01:15 +00:00
Philip H 86146ccc68 Dockerfile: ensure to use latest npm cli 2024-05-09 20:00:36 +02:00
NPM Update Bot 191dd74b0c npm: package updates 2024-05-09 15:29:08 +00:00
Philip H e2eb7bc362 avoid warnings on ci
as we support nodejs latest lts version on instance without docker
2024-05-09 17:28:28 +02:00
NPM Update Bot b60461e917 npm: package updates 2024-05-09 11:21:47 +00:00
Philip H fb628bcb89 Update npm to patched version of latest nodejs lts 2024-05-09 13:21:09 +02:00
NPM Update Bot 195e307ff5 npm: package updates 2024-05-04 19:00:17 +00:00
Philip H e46efd6088 package.json: rollback nodejs 18
because of build hang on newer nodejs version stick to nodejs 18
2024-05-04 20:59:36 +02:00
NPM Update Bot 66bb13ed30 npm: package updates 2024-05-04 13:19:02 +00:00
Philip H. 34fdc313ae docker-compose: version is obsolete 2024-05-04 13:18:20 +00:00
NPM Update Bot 9b5b8c77c3 npm: package updates 2024-04-30 17:53:00 +00:00
Philip H 7d05a82dae Improved local development and Dockerfile (#1015)
Thanks @davide-acanfora
2024-04-30 19:52:20 +02:00
Philip H a25d28755c Improved local development and Dockerfile (#1014)
Thanks @davide-acanfora
2024-04-30 19:35:13 +02:00
davide-acanfora cada04ad0e Use the newer Docker Compose 2024-04-30 17:04:33 +02:00
davide-acanfora 6b2f57f2f1 Added nodemon as a dev dependency and removed unnecessary instructions from the Dockerfile 2024-04-30 17:03:48 +02:00
davide-acanfora 488e3c32b3 Fix typo in code comments 2024-04-30 17:00:53 +02:00
NPM Update Bot 4cc07c5312 npm: package updates 2024-04-29 00:03:04 +00:00
Philip H c5d328be2a fixup: Dockerfile 2024-04-27 18:55:06 +02:00
Philip H 155541fbdb fixup: add timeout otherwise it reports unhealthy 2024-04-27 18:44:05 +02:00
Philip H 3f763d2607 implement healthcheck into Dockerfile (#1009)
Thanks @CosasDePuma
2024-04-27 18:39:40 +02:00
Philip H f9656d0bfe healthcheck is integrated internally 2024-04-27 18:35:22 +02:00
Philip H 83408f6a9b add healthcheck into Dockerfile
Thanks @CosasDePuma
2024-04-27 18:34:20 +02:00
NPM Update Bot 4911082a34 npm: package updates 2024-04-27 16:19:23 +00:00
Philip H a3a69654fc docker-compose.yml: add healthcheck
Thanks @CosasDePuma
2024-04-27 18:18:51 +02:00
Philip H 4f8ee27d77 Create CODEOWNERS 2024-04-25 12:24:48 +02:00
NPM Update Bot 1e2da39a87 npm: package updates 2024-04-20 16:06:25 +00:00
Philip H e153998d29 Dockerfile: bump to nodejs 20 (#999) 2024-04-20 18:05:41 +02:00
Philip H 6b284cb27c Dockerfile: add note 2024-04-19 17:12:07 +02:00
Philip H e6db5e8b7f Dockerfile: missing operator 2024-04-19 17:12:07 +02:00
Philip H 6e7f2f730e Dockerfile: move all npm steps 2024-04-19 17:12:07 +02:00
Philip H c8224f34f9 Dockerfile: use nodejs 18 for build
workaround to get nodejs 20 working on older arm architectures
2024-04-19 17:12:07 +02:00
pheiduck 3032163814 bump to node 20 2024-04-19 17:12:07 +02:00
Philip H 2eec97ff25 Bugfix: differnt Ports usage (#973) 2024-04-19 17:11:50 +02:00
Philip H ae60493414 Merge branch 'master' into issue-972 2024-04-18 19:00:07 +02:00
Philip H e43688a091 npm: revert update-browserslist-db
is not needed
2024-04-18 18:50:29 +02:00
Philip H c29ba35d41 npm: update-browserslist-db 2024-04-18 18:47:52 +02:00
Peter Lewis a05b71c652 Update README.md
https://github.com/wg-easy/wg-easy/commit/2a3acdcad5b7c73feccdd47e4f3c5d743593e393#r141068572
2024-04-17 21:39:08 +01:00
Philip H e6b5f2e33c fixup: README 2024-04-17 19:22:07 +02:00
Philip H 187888e078 WireGuard.js: fixup ListenPort 2024-04-14 19:51:04 +02:00
Philip H f9daa3e5be Bugfix: differnt Ports usage 2024-04-14 19:51:04 +02:00
Philip H c2482f494a [combine] gitignore
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-04-14 19:16:41 +02:00
Philip H ed369ff199 Revert "feat: cidr notation" (#969) 2024-04-06 15:21:41 +02:00
Philip H 2a3acdcad5 Merge branch 'master' into revert-888-feat-cidr-notation 2024-04-06 15:17:43 +02:00
Philip H 9be036aefa Merge branch 'production' into master 2024-04-05 19:04:13 +02:00
Philip H 9507454d3f [fixup] Grammar
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-04-05 19:02:44 +02:00
Philip H 9e925c2ebb [prepare] version bump to 13 and updated changelog
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-04-05 18:59:41 +02:00
Philip H 31c34367b2 Fix comment in docker-compose.yml (#960) 2024-04-03 12:34:28 +02:00
Michael van Tricht 990a7ae548 Fix comment in docker-compose.yml 2024-04-03 12:31:02 +02:00
Philip H 6dc75b7f1e i18n.js: complete words in Spanish (#956) 2024-04-01 23:39:35 +02:00
Rubén León 4868f32f1e i18n.js: complete words in Spanish 2024-04-01 23:16:57 +02:00
Philip H 61b57a885c README.md: make commands easier to copy 2024-04-01 18:04:29 +02:00
NPM Update Bot 074b3548d2 npm: package updates 2024-03-31 17:37:34 +00:00
Philip H 2dafeae54d Fix WG_DEFAULT_ADDRESS if not set (#951) 2024-03-31 19:36:57 +02:00
Philip H 2d7460f35a fix default WG_DEFAULT_ADDRESS issue (#948) 2024-03-31 19:32:22 +02:00
Utkarsh Goel 4981b72d00 fix unambiguous boolean operators 2024-03-27 22:23:37 +08:00
Utkarsh Goel 33634211a9 check for empty WG_DEFAULT_ADDRESS 2024-03-27 22:19:27 +08:00
Philip H 6045c2ada5 fix backward compatibility issue (#946) 2024-03-27 15:09:10 +01:00
Philip H bf214fb4d3 Revert "feat: cidr notation" 2024-03-27 14:41:31 +01:00
Philip H 9332e8b663 fix backward compatibility issue (#945)
in #888
fixes #943
2024-03-27 14:33:18 +01:00
Utkarsh Goel dbbfdd5357 Add backward compatibility for WG_DEFAULT_ADDRESS 2024-03-27 21:27:43 +08:00
NPM Update Bot cb63d5c67f npm: package updates 2024-03-26 16:40:32 +00:00
Philip H 3fce6e8d1d feat: cidr notation (#888) 2024-03-26 17:39:56 +01:00
Philip H 2f9364aa31 wg-easy.service: add missing WG_DEFAULT_ADDRESS_RANGE 2024-03-25 18:31:06 +01:00
Philip H 479c51d741 WG_DEFAULT_ADDRESS_RANGE / is not needed 2024-03-25 17:18:14 +01:00
Philip H 196cb63c6e README.md: add WG_DEFAULT_ADDRESS_RANGE 2024-03-25 17:15:30 +01:00
Philip H d024018bba fix cidr block calculation issue, fix post down config (#939)
Thanks for your work @utkarsh867!
2024-03-25 16:54:22 +01:00
Utkarsh Goel 5cdacd6cc3 Fix CIDR block calculation issue, fix POST_DOWN config 2024-03-25 23:28:36 +08:00
Philip H. fe7d77e481 fixup: packages 2024-03-23 20:34:43 +00:00
Philip H 6c0049770e Merge branch 'master' into feat-cidr-notation 2024-03-23 21:30:52 +01:00
Philip H f134a3671a fix: add Content-Type header for static files (#933) 2024-03-23 20:15:20 +01:00
cany748 8d00c5456a fix: add Content-Type header for static files 2024-03-23 19:37:33 +01:00
NPM Update Bot c2829d79e0 npm: package updates 2024-03-23 18:36:33 +00:00
Philip H ac47789561 revert: Workaround CVE-2023-42282
newest images have updated ip package
2024-03-23 19:35:58 +01:00
NPM Update Bot 5afb701013 npm: package updates 2024-03-21 10:42:32 +00:00
Philip H 81cae5e231 Use one command for updating with Docker Compose (#929) 2024-03-21 11:42:00 +01:00
Edgars 6c567d0082 Use one command for updating with Docker Compose
`README.md` was updated to use a one-liner to update WireGuard Easy with
Docker Compose.
A note about image tag was added to avoid confusion when one is
specified in Compose file and it is other than `latest`, as that would
result in no pull and no WireGuard Easy container recreation.
2024-03-21 09:02:08 +02:00
NPM Update Bot 62703ffbd6 npm: package updates 2024-03-20 12:38:50 +00:00
Philip H 19589e7ee7 refactor!: migrate from express to h3 (#914) 2024-03-20 13:38:14 +01:00
NPM Update Bot d40536c3fb npm: package updates 2024-03-19 21:10:54 +00:00
Philip H f979d23704 Add Chart and Auto/Light/Dark mode toggles (#925)
A banging contribution from @suxscribe. Many thanks!
2024-03-19 22:10:22 +01:00
Philip H 99c8081fe9 Add Chart and Auto/Light/Dark mode toggles (#924) 2024-03-19 21:24:14 +01:00
suxscribe 1c98e466c6 Merge branch 'feat-stats' into feat-toggles 2024-03-19 18:34:41 +03:00
Philip H 953a67bbdd fixup: Server.js 2024-03-19 14:18:29 +01:00
Philip H 5fbfb26937 fixup: Server.js 2024-03-19 14:16:44 +01:00
Philip H 74f3e2f320 fixup: Server.js 2024-03-19 14:11:03 +01:00
Philip H c107920df2 Merge branch 'master' into feat-h3 2024-03-19 14:09:42 +01:00
NPM Update Bot e666a14612 npm: package updates 2024-03-19 12:54:01 +00:00
Philip H a7ecb2a067 Fix TX/RX charts. Add UI_CHART_TYPE (#915) 2024-03-19 13:53:28 +01:00
Philip H 88b1b20e48 docker-compose.yml: add UI_CHART_TYPE 2024-03-18 21:25:08 +01:00
Sergei Birukov ac6a05f9be Fix lint errors 2024-03-18 21:25:08 +01:00
Sergei Birukov 262318df27 Disable debug 2024-03-18 21:25:08 +01:00
Sergei Birukov 98a5daf458 Fix charts on mobile 2024-03-18 21:25:08 +01:00
Sergei Birukov 71c208133d Remove .env from repo 2024-03-18 21:25:08 +01:00
Sergei Birukov aedb691b2b Fix traffic charts. Add chart vars
Add UI_TRAFFIC_STATS, UI_CHART_TYPE
2024-03-18 21:25:08 +01:00
Philip H ed0e46788a Update deploy.yml 2024-03-18 21:25:08 +01:00
Philip H 90bcdd1259 deploy.yml: rebuild v11
mistake
2024-03-18 21:25:08 +01:00
Sergei Birukov 81ccf8762d Header mobile layout 2024-03-18 10:05:12 +03:00
NPM Update Bot 90431ff9c5 npm: package updates 2024-03-18 00:03:46 +00:00
Sergei Birukov 32fc78589a Lint 2024-03-17 20:38:21 +03:00
Sergei Birukov f3a8ff6490 Add dark/light mode toggle. Add chart toggle
Change dark/light mode detection
Add saving uiShowCharts to local storage
Add saving uiTheme to local storage
Add ui buttons
2024-03-17 20:38:21 +03:00
Philip H f7bd362538 fixup: Server.js 2024-03-15 15:23:12 +01:00
Philip H 44cc5683d4 Merge branch 'master' into feat-h3 2024-03-15 15:22:17 +01:00
Philip H 4d5a5c9e0d docker-compose.yml: add UI_CHART_TYPE 2024-03-15 15:20:35 +01:00
Sergei Birukov 12b72cf389 Fix lint errors 2024-03-15 15:20:35 +01:00
Sergei Birukov ccde2fdfd3 Disable debug 2024-03-15 15:20:35 +01:00
Sergei Birukov 166a58a685 Fix charts on mobile 2024-03-15 15:20:35 +01:00
Sergei Birukov 73242c61c3 Remove .env from repo 2024-03-15 15:20:35 +01:00
Sergei Birukov 3d11730926 Fix traffic charts. Add chart vars
Add UI_TRAFFIC_STATS, UI_CHART_TYPE
2024-03-15 15:20:35 +01:00
Philip H 8ce2d44c08 Update deploy.yml 2024-03-15 15:20:35 +01:00
Philip H 3cb83dc53a deploy.yml: rebuild v11
mistake
2024-03-15 15:20:35 +01:00
NPM Update Bot e2242daef1 npm: package updates 2024-03-15 14:18:17 +00:00
Philip H ee5a2c6c5a Server.js: remove cookie setting
Proxy is recommended else use only internally
2024-03-15 15:17:41 +01:00
Philip H 68187e07a1 Merge branch 'master' into feat-cidr-notation 2024-03-14 13:49:26 +01:00
Philip H. 7596385d5a fixup: lint errors and uninstall express 2024-03-14 12:18:47 +00:00
Philip H 9a35b56f5c Update README.md 2024-03-14 09:33:08 +01:00
Philip H. 10f246ea59 fixup: Server.js 2024-03-14 08:19:29 +00:00
Philip H. 3f2495a0ea fixup: UI_TRAFFIC_STATS 2024-03-14 08:14:52 +00:00
Philip H. b7c2c81cc7 fixup: lint errors 2024-03-14 08:05:09 +00:00
Philip H b3306bee48 refactor!: migrate from express to h3 (#880) 2024-03-14 09:00:38 +01:00
Philip H 064e264ce8 Server.js: add missing ')' 2024-03-14 08:59:31 +01:00
Philip H 08c412fd14 Server.js: remove white-space 2024-03-14 08:57:38 +01:00
Philip H 8c771b054c Server.js: add UI_TRAFFIC_STATS 2024-03-14 08:55:15 +01:00
Philip H e9480a5ed5 fixup Server.js: even to master 2024-03-14 08:50:31 +01:00
Philip H 1a3cff855e Merge branch 'feat-h3' into master 2024-03-14 08:48:53 +01:00
Philip H f0ec8e45a0 i18n.js: add Hindi language translation (#902) 2024-03-13 18:55:40 +01:00
Rahil Bhimjiani d91f08eb1b i18n.js: add Hindi language translation
Signed-off-by: Rahil Bhimjiani <me@rahil.rocks>
2024-03-13 18:52:25 +01:00
Philip H 17fdb3396f Add setup and update instructions for Compose (#901) 2024-03-13 18:52:06 +01:00
Edgars 2f5878d406 Add setup and update instructions for Compose
`README.md` was updated to provide installation and update instructions
for Docker Compose as well.
2024-03-13 18:49:49 +01:00
NPM Update Bot 4dc439f041 npm: package updates 2024-03-13 17:49:02 +00:00
Philip H f69aa9dc65 PR: Build Docker images (#912) 2024-03-13 18:48:32 +01:00
Philip H 11a56ffdc5 needed for testing on our test branches 2024-03-13 13:12:16 +01:00
Philip H bad7bff98e Update deploy-pr.yml 2024-03-13 13:09:32 +01:00
Philip H a4c3bf0291 PR: Build Docker images
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-03-13 13:05:08 +01:00
Philip H 2ffb68eeb2 [update] package.json and changelog to current release 12
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-03-12 18:46:50 +01:00
Philip H a36ab8891e fixup: WireGuard.js 2024-03-06 16:43:07 +01:00
Philip H 5ee284b973 fixup: WireGuard.js 2024-03-05 19:35:38 +01:00
Philip H 754b5f29af fixup: WireGuard.js
well I was on the client side so I hope I get all stuff fixed now.
2024-03-05 19:29:14 +01:00
Philip H 84b2b61d63 Merge branch 'master' into feat-cidr-notation 2024-03-05 18:39:15 +01:00
Philip H 63faf4c507 fixup: WireGuard.js 2024-03-05 18:24:42 +01:00
Philip H 76a3d7f81d fixing stuff and formating 2024-03-05 18:15:42 +01:00
Philip H bbc919608c Update docker-compose.yml 2024-03-05 17:57:49 +01:00
Philip H 2f89765112 WireGuard.js: fixup undefined CIDR 2024-03-05 17:56:13 +01:00
Thomas Willems cb45bc1c43 update ip package to 2.0.1 2024-03-05 16:58:19 +01:00
Thomas Willems c4d4da38e7 correct CIDR notation 2024-03-05 16:58:19 +01:00
Thomas Willems 89415a2258 refactor to support CIDR and legacy notation
for WG_DEFAULT_ADDRESS
2024-03-05 16:58:19 +01:00
Thomas Willems 577af9947d introduce WG_DEFAULT_ADDRESS_RANGE (CIDR notation)
This PR allows the use of Address Ranges using the CIDR notation.

To make it backward compatible, i introduced a new env variable WG_DEFAULT_ADDRESS_RANGE (defaults to the previous default of 24).

This allows the usage of smaller subnets (or possibly larger; but i didn't test that due to restrictions on my network). Client IPs will be calculated with correct IP addresses instead of making assumptions of the address space.
2024-03-05 16:58:19 +01:00
cany748 7efdbf38e4 fix: revert ServerError.js 2024-02-28 16:27:33 +07:00
cany748 e8a160b14f refactor!: migrate from express to h3 2024-02-28 15:48:09 +07:00
285 changed files with 21405 additions and 10083 deletions
+3
View File
@@ -0,0 +1,3 @@
/src/node_modules
/src/.nuxt
/src/.output
+23
View File
@@ -0,0 +1,23 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# The JSON files contain newlines inconsistently
[*.json]
insert_final_newline = ignore
# Minified JavaScript files shouldn't be changed
[**.min.js]
indent_style = ignore
insert_final_newline = ignore
[*.md]
trim_trailing_whitespace = false
+5
View File
@@ -0,0 +1,5 @@
# Copyright (c) Emile Nijssen (WeeJeWel)
# Founder and Codeowner of WireGuard Easy (wg-easy)
# Maintained by Bernd Storath (kaaax0815)
* @WeeJeWel
* @kaaax0815
+1 -1
View File
@@ -1,3 +1,3 @@
# These are supported funding model platforms
github: weejewel
github: [weejewel, kaaax0815]
+37
View File
@@ -0,0 +1,37 @@
---
name: 🐛 Bug Report
description: Create a report to help us improve
title: "[Bug]: "
type: Bug
body:
- type: markdown
attributes:
value: |
**Thanks :heart: for taking the time to fill out this bug report!**
We kindly ask that you search to see if an issue [already exists](https://github.com/wg-easy/wg-easy/issues?q=is%3Aissue+sort%3Acreated-desc+) for the bug you encountered.
- type: textarea
id: what-happened
attributes:
label: Describe the bug
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: what-should-happen
attributes:
label: Expected behavior
placeholder: Tell us what you expected!
value: "Work just fine!"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
@@ -0,0 +1,47 @@
---
name: 🛠️ Feature Request
description: Suggest an idea to help us improve
title: "[Feat]: "
type: Feature
body:
- type: markdown
attributes:
value: |
**Thanks :heart: for taking the time to fill out this feature request report!**
We kindly ask that you search to see if an issue [already exists](https://github.com/wg-easy/wg-easy/issues?q=is%3Aissue+sort%3Acreated-desc+) for your feature.
We are also happy to accept contributions from our users. For more details see [here](https://github.com/wg-easy/wg-easy/blob/master/contributing.md).
- type: textarea
attributes:
label: Description
description: |
A clear and concise description of the feature you're interested in.
validations:
required: true
- type: textarea
attributes:
label: Suggested Solution
description: |
Describe the solution you'd like. A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
Describe alternatives you've considered.
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
validations:
required: false
-38
View File
@@ -1,38 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+5
View File
@@ -0,0 +1,5 @@
contact_links:
- name: Get Help
url: https://github.com/wg-easy/wg-easy/discussions/new?category=q-a
about: If you can't get something to work the way you expect, open a question in the discussions.
blank_issues_enabled: false
+28
View File
@@ -0,0 +1,28 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->
## Screenshots (if appropriate):
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
+10
View File
@@ -5,3 +5,13 @@ updates:
schedule:
interval: "weekly"
rebase-strategy: "auto"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
rebase-strategy: "auto"
- package-ecosystem: "npm"
directory: "/src/"
schedule:
interval: "weekly"
rebase-strategy: "auto"
+18 -16
View File
@@ -1,10 +1,12 @@
name: "CodeQL"
name: CodeQL
on:
push:
branches: [ "master" ]
branches:
- master
pull_request:
branches: [ "master" ]
branches:
- master
schedule:
- cron: "15 0 * * *"
@@ -21,21 +23,21 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
language: ["javascript-typescript"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
+56 -23
View File
@@ -1,38 +1,71 @@
name: Build & Publish Development
name: Development
on:
workflow_dispatch:
pull_request:
jobs:
deploy:
name: Build & Deploy
docker:
name: Build & Deploy Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: production
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Publish Docker Image
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
tags: ghcr.io/wg-easy/wg-easy:development
- name: Build & Publish Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:development
cache-from: type=gha
cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
contents: write
needs: docker
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
cache-dependency-path: docs/requirements.txt
- name: Install Dependencies
run: |
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases development
+60 -22
View File
@@ -1,4 +1,4 @@
name: Build & Publish Nightly
name: Nightly
on:
workflow_dispatch:
@@ -6,34 +6,72 @@ on:
- cron: "0 0 * * *"
jobs:
deploy:
name: Build & Deploy
docker:
name: Build & Deploy Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: production
- uses: actions/checkout@v4
with:
ref: master
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Publish Docker Image
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
tags: ghcr.io/wg-easy/wg-easy:nightly
- name: Build & Publish Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:nightly
cache-from: type=gha
cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
contents: write
needs: docker
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
cache-dependency-path: docs/requirements.txt
- name: Install Dependencies
run: |
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases nightly
+43
View File
@@ -0,0 +1,43 @@
name: Pull Request
on:
workflow_dispatch:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
name: Build Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: false
platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:pr
cache-from: type=gha
cache-to: type=gha,mode=min
+87 -27
View File
@@ -1,43 +1,103 @@
name: Build & Publish Latest
name: Production
on:
workflow_dispatch:
push:
branches:
- production
tags:
- "v*"
jobs:
deploy:
name: Build & Deploy
docker:
name: Build & Deploy Docker
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
if: |
github.repository_owner == 'wg-easy' &&
startsWith(github.ref, 'refs/tags/v')
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: production
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/wg-easy/wg-easy
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Set environment variables
run: echo RELEASE=$(cat ./src/package.json | jq -r .release) >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Publish Docker Image
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
tags: ghcr.io/wg-easy/wg-easy:latest, ghcr.io/wg-easy/wg-easy:${{ env.RELEASE }}
- name: Build & Publish Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: |
github.repository_owner == 'wg-easy' &&
startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
needs: docker
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
cache-dependency-path: docs/requirements.txt
- name: Install Dependencies
run: |
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1 || true
# latest will point to old docs if old tag is pushed
# Extract version numbers
DOCS_VERSION=${GITHUB_REF#refs/tags/} # e.g. v1.2.3 or v1.2.3-beta
MINOR_VERSION=$(echo $DOCS_VERSION | cut -d. -f1,2) # e.g. v1.2
# Check if it's a stable release (only numbers, no '-')
if [[ "$DOCS_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Stable release detected: $DOCS_VERSION"
mike deploy --push --update-aliases $MINOR_VERSION latest
else
echo "Pre-release detected: $DOCS_VERSION"
mike deploy --push --update-aliases Pre-release
fi
+18 -9
View File
@@ -4,7 +4,6 @@ on:
push:
branches:
- master
- production
pull_request:
jobs:
@@ -12,21 +11,31 @@ jobs:
name: Lint
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
strategy:
fail-fast: false
max-parallel: 3
matrix:
command: ["lint", "typecheck", "format:check"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "lts/*"
check-latest: true
cache: 'npm'
cache-dependency-path: |
package-lock.json
src/package-lock.json
cache: "pnpm"
- name: npm run lint
- name: pnpm ${{ matrix.command }}
run: |
cd src
npm ci
npm run lint
pnpm install
pnpm ${{ matrix.command }}
-43
View File
@@ -1,43 +0,0 @@
name: NPM Update Bot 🤖
on:
push:
branches: [ "master" ]
schedule:
- cron: "0 0 * * 1"
jobs:
npmupbot:
name: NPM Update Bot 🤖
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: wg-easy/wg-easy
ref: master
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
check-latest: true
cache: 'npm'
cache-dependency-path: |
package-lock.json
src/package-lock.json
- name: Bot 🤖 "Updating NPM Packages..."
run: |
npm install -g --silent npm-check-updates
ncu -u
npm update
cd src
ncu -u
npm update
npm run buildcss
git config --global user.name 'NPM Update Bot'
git config --global user.email 'npmupbot@users.noreply.github.com'
git add .
git commit -am "npm: package updates" || true
git push
+3 -4
View File
@@ -8,11 +8,10 @@ name: Mark stale issues and pull requests
on:
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'
- cron: "*/5 * * * *"
jobs:
stale:
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
@@ -20,8 +19,8 @@ jobs:
pull-requests: write
steps:
- uses: actions/stale@v9
with:
- uses: actions/stale@v9
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
-3
View File
@@ -1,5 +1,2 @@
/config
/wg0.conf
/wg0.json
.DS_Store
*.swp
+14
View File
@@ -0,0 +1,14 @@
{
"recommendations": [
"aaron-bond.better-comments",
"dbaeumer.vscode-eslint",
"antfu.goto-alias",
"visualstudioexptteam.vscodeintellicode",
"Nuxtr.nuxtr-vscode",
"esbenp.prettier-vscode",
"yoavbls.pretty-ts-errors",
"bradlc.vscode-tailwindcss",
"vue.volar",
"lokalise.i18n-ally"
]
}
+25
View File
@@ -0,0 +1,25 @@
{
"editor.tabSize": 2,
"editor.useTabStops": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"nuxtr.vueFiles.style.addStyleTag": false,
"nuxtr.piniaFiles.defaultTemplate": "setup",
"nuxtr.monorepoMode.DirectoryName": "src",
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "./src/node_modules/typescript/lib",
"i18n-ally.enabledFrameworks": ["vue"],
"i18n-ally.localesPaths": ["src/i18n/locales"],
"i18n-ally.sortKeys": false,
"i18n-ally.keepFulfilled": false,
"i18n-ally.keystyle": "nested",
"editor.gotoLocation.multipleDefinitions": "goto"
}
+34
View File
@@ -0,0 +1,34 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
We're super excited to announce v15!
This update is an entire rewrite to make it even easier to set up your own VPN.
## Major Changes
- Almost all Environment variables removed
- New and Improved UI
- API Basic Authentication
- Added Docs
- Incrementing Version -> Semantic Versioning
- CIDR Support
- IPv6 Support
- Changed API Structure
- SQLite Database
- Deprecated Dockerless Installations
- Added Docker Volume Mount (`/lib/modules`)
- Removed ARMv6 and ARMv7 support
- Connections over HTTP require setting the `INSECURE` env var
- Changed license from CC BY-NC-SA 4.0 to AGPL-3.0-only
## [14.0.0] - 2024-09-04
### Major changes
- `PASSWORD` has been replaced by `PASSWORD_HASH`
+32 -32
View File
@@ -1,54 +1,54 @@
# There's an issue with node:20-alpine.
# Docker deployment is canceled after 25< minutes.
FROM docker.io/library/node:lts-alpine AS build
WORKDIR /app
FROM docker.io/library/node:18-alpine AS build_node_modules
# update corepack
RUN npm install --global corepack@latest
# Install pnpm
RUN corepack enable pnpm
# Copy Web UI
COPY src/ /app/
WORKDIR /app
RUN npm ci --omit=dev &&\
mv node_modules /node_modules
COPY src/package.json src/pnpm-lock.yaml ./
RUN pnpm install
# Build UI
COPY src ./
RUN pnpm build
# Copy build result to a new image.
# This saves a lot of disk space.
FROM docker.io/library/node:18-alpine
COPY --from=build_node_modules /app /app
FROM docker.io/library/node:lts-alpine
WORKDIR /app
# Move node_modules one directory up, so during development
# we don't have to mount it in a volume.
# This results in much faster reloading!
#
# Also, some node_modules might be native, and
# the architecture & OS of your development machine might differ
# than what runs inside of docker.
COPY --from=build_node_modules /node_modules /node_modules
HEALTHCHECK --interval=1m --timeout=5s --retries=3 CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1"
RUN \
# Enable this to run `npm run serve`
npm i -g nodemon &&\
# Workaround CVE-2023-42282
npm uninstall -g ip &&\
# Delete unnecessary files
npm cache clean --force && rm -rf ~/.npm
# Copy build
COPY --from=build /app/.output /app
# Copy migrations
COPY --from=build /app/server/database/migrations /app/server/database/migrations
# libsql
RUN npm install --no-save libsql
# Install Linux packages
RUN apk add --no-cache \
dpkg \
dumb-init \
iptables \
ip6tables \
kmod \
iptables-legacy \
wireguard-tools
# Use iptables-legacy
RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save
# Expose Ports
EXPOSE 51820/udp
EXPOSE 51821/tcp
RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables-legacy 10 --slave /usr/sbin/iptables-restore iptables-restore /usr/sbin/iptables-legacy-restore --slave /usr/sbin/iptables-save iptables-save /usr/sbin/iptables-legacy-save
RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save
# Set Environment
ENV DEBUG=Server,WireGuard
ENV DEBUG=Server,WireGuard,Database,CMD
ENV PORT=51821
ENV HOST=0.0.0.0
ENV INSECURE=false
LABEL org.opencontainers.image.source=https://github.com/wg-easy/wg-easy
# Run Web UI
WORKDIR /app
CMD ["/usr/bin/dumb-init", "node", "server.js"]
CMD ["/usr/bin/dumb-init", "node", "server/index.mjs"]
+37
View File
@@ -0,0 +1,37 @@
FROM docker.io/library/node:lts-alpine
WORKDIR /app
# update corepack
RUN npm install --global corepack@latest
# Install pnpm
RUN corepack enable pnpm
HEALTHCHECK --interval=1m --timeout=5s --retries=3 CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1"
# Install Linux packages
RUN apk add --no-cache \
dpkg \
dumb-init \
iptables \
ip6tables \
kmod \
iptables-legacy \
wireguard-tools
# Use iptables-legacy
RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables-legacy 10 --slave /usr/sbin/iptables-restore iptables-restore /usr/sbin/iptables-legacy-restore --slave /usr/sbin/iptables-save iptables-save /usr/sbin/iptables-legacy-save
RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save
# Set Environment
ENV DEBUG=Server,WireGuard,Database,CMD
ENV PORT=51821
ENV HOST=0.0.0.0
ENV INSECURE=false
# Install Dependencies
COPY src/package.json src/pnpm-lock.yaml ./
RUN pnpm install
# Copy Project
COPY src ./
+661 -437
View File
File diff suppressed because it is too large Load Diff
+100 -79
View File
@@ -1,123 +1,144 @@
# WireGuard Easy
[![Build & Publish Docker Image to Docker Hub](https://github.com/wg-easy/wg-easy/actions/workflows/deploy.yml/badge.svg?branch=production)](https://github.com/wg-easy/wg-easy/actions/workflows/deploy.yml)
[![Build & Publish latest Image](https://github.com/wg-easy/wg-easy/actions/workflows/deploy.yml/badge.svg?branch=production)](https://github.com/wg-easy/wg-easy/actions/workflows/deploy.yml)
[![Lint](https://github.com/wg-easy/wg-easy/actions/workflows/lint.yml/badge.svg?branch=master)](https://github.com/wg-easy/wg-easy/actions/workflows/lint.yml)
![Docker](https://img.shields.io/docker/pulls/weejewel/wg-easy.svg)
[![Sponsor](https://img.shields.io/github/sponsors/weejewel)](https://github.com/sponsors/WeeJeWel)
![GitHub Stars](https://img.shields.io/github/stars/wg-easy/wg-easy)
[![GitHub Stars](https://img.shields.io/github/stars/wg-easy/wg-easy)](https://github.com/wg-easy/wg-easy/stargazers)
[![License](https://img.shields.io/github/license/wg-easy/wg-easy)](LICENSE)
[![GitHub Release](https://img.shields.io/github/v/release/wg-easy/wg-easy)](https://github.com/wg-easy/wg-easy/releases/latest)
[![Image Pulls](https://img.shields.io/badge/image_pulls-11M-blue)](https://github.com/wg-easy/wg-easy/pkgs/container/wg-easy)
<!-- TODO: remove after release -->
> [!WARNING]
> You are viewing the README of the pre-release of v15.
> If you want to setup wg-easy right now. Read the README in the production branch here: [README](https://github.com/wg-easy/wg-easy/tree/production) or here for the last nightly: [README](https://github.com/wg-easy/wg-easy/tree/c6dce0f6fb2e28e7e40ddac1498bd67e9bb17cba)
You have found the easiest way to install & manage WireGuard on any Linux host!
<!-- TOOD: update screenshot -->
<p align="center">
<img src="./assets/screenshot.png" width="802" />
</p>
## Features
* All-in-one: WireGuard + Web UI.
* Easy installation, simple to use.
* List, create, edit, delete, enable & disable clients.
* Show a client's QR code.
* Download a client's configuration file.
* Statistics for which clients are connected.
* Tx/Rx charts for each connected client.
* Gravatar support.
* Automatic Light / Dark Mode
* Multilanguage Support
* UI_TRAFFIC_STATS (default off)
- All-in-one: WireGuard + Web UI.
- Easy installation, simple to use.
- List, create, edit, delete, enable & disable clients.
- Show a client's QR code.
- Download a client's configuration file.
- Statistics for which clients are connected.
- Tx/Rx charts for each connected client.
- Gravatar support.
- Automatic Light / Dark Mode
- Multilanguage Support
- One Time Links
- Client Expiration
- Prometheus metrics support
- IPv6 support
- CIDR support
> [!NOTE]
> To better manage documentation for this project, it has its own site here: [https://wg-easy.github.io/wg-easy/latest](https://wg-easy.github.io/wg-easy/latest)
<!-- TODO: remove after release -->
> [!WARNING]
> As the Docs are still in Pre-release, you can access them here [https://wg-easy.github.io/wg-easy/Pre-release](https://wg-easy.github.io/wg-easy/Pre-release)
- [Getting Started](https://wg-easy.github.io/wg-easy/latest/getting-started/)
- [Basic Installation](https://wg-easy.github.io/wg-easy/latest/examples/tutorials/basic-installation/)
- [Caddy](https://wg-easy.github.io/wg-easy/latest/examples/tutorials/caddy/)
- [Nginx](https://wg-easy.github.io/wg-easy/latest/examples/tutorials/nginx/)
- [Traefik](https://wg-easy.github.io/wg-easy/latest/examples/tutorials/traefik/)
- [Podman](https://wg-easy.github.io/wg-easy/latest/examples/tutorials/podman/)
- [AdGuard Home](https://wg-easy.github.io/wg-easy/latest/examples/tutorials/adguard/)
> [!NOTE]
> If you want to migrate from the old version to the new version, you can find the migration guide here: [Migration Guide](https://wg-easy.github.io/wg-easy/latest/advanced/migrate/)
## Requirements
* A host with a kernel that supports WireGuard (all modern kernels).
* A host with Docker installed.
- A host with a kernel that supports WireGuard (all modern kernels).
- A host with Docker installed.
## Versions
> 💡 We follow semantic versioning (semver)
We offer multiple Docker image tags to suit your needs. The table below is in a particular order, with the first tag being the most recommended:
| tag | Branch | Example | Description |
| ------------- | ---------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `15` | latest minor for that major tag | `ghcr.io/wg-easy/wg-easy:15` | latest features for specific major versions, no breaking changes |
| `latest` | latest tag | `ghcr.io/wg-easy/wg-easy:latest` or `ghcr.io/wg-easy/wg-easy` | stable as possible get bug fixes quickly when needed, see Releases for more information. |
| `15.0` | latest patch for that minor tag | `ghcr.io/wg-easy/wg-easy:15.0` | latest patches for specific minor version |
| `15.0.0` | specific tag | `ghcr.io/wg-easy/wg-easy:15.0.0` | specific release, don't use this as this will not get updated |
| `nightly` | [`master`](https://github.com/wg-easy/wg-easy/tree/master) | `ghcr.io/wg-easy/wg-easy:nightly` | mostly unstable gets frequent package and code updates, deployed against [`master`](https://github.com/wg-easy/wg-easy/tree/master). |
| `development` | pull requests | `ghcr.io/wg-easy/wg-easy:development` | used for development, testing code from PRs before landing into [`master`](https://github.com/wg-easy/wg-easy/tree/master). |
## Installation
### 1. Install Docker
If you haven't installed Docker yet, install it by running:
If you haven't installed Docker yet, install it by running as root:
```bash
$ curl -sSL https://get.docker.com | sh
$ sudo usermod -aG docker $(whoami)
$ exit
```shell
curl -sSL https://get.docker.com | sh
exit
```
And log in again.
### 2. Run WireGuard Easy
To automatically install & run wg-easy, simply run:
The easiest way to run WireGuard Easy is with Docker Compose.
<pre>
$ docker run -d \
--name=wg-easy \
-e LANG=de \
-e WG_HOST=<b>🚨YOUR_SERVER_IP</b> \
-e PASSWORD=<b>🚨YOUR_ADMIN_PASSWORD</b> \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
--restart unless-stopped \
ghcr.io/wg-easy/wg-easy
</pre>
Just download [`docker-compose.yml`](docker-compose.yml), make necessary adjustments and
execute `sudo docker compose up -d`.
> 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname.
>
> 💡 Replace `YOUR_ADMIN_PASSWORD` with a password to log in on the Web UI.
Now setup a reverse proxy to be able to access the Web UI from the internet.
The Web UI will now be available on `http://0.0.0.0:51821`.
If you want to access the Web UI over HTTP, change the env var `INSECURE` to `true`. This is not recommended. Only use this for testing
> 💡 Your configuration files will be saved in `~/.wg-easy`
### Donate
### 3. Sponsor
Are you enjoying this project? Consider donating.
Are you enjoying this project? [Buy Emile a beer!](https://github.com/sponsors/WeeJeWel) 🍻
Founder: [Buy Emile a beer!](https://github.com/sponsors/WeeJeWel) 🍻
## Options
Maintainer: [Buy kaaax0815 a coffee!](https://github.com/sponsors/kaaax0815) ☕
These options can be configured by setting environment variables using `-e KEY="VALUE"` in the `docker run` command.
## Development
| Env | Default | Example | Description |
| - | - | - | - |
| `PORT` | `51821` | `6789` | TCP port for Web UI. |
| `WEBUI_HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. |
| `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. |
| `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. |
| `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. |
| `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will always listen on 51820 inside the Docker container. |
| `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. |
| `WG_PERSISTENT_KEEPALIVE` | `0` | `25` | Value in seconds to keep the "connection" open. If this value is 0, then connections won't be kept alive. |
| `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range. |
| `WG_DEFAULT_DNS` | `1.1.1.1` | `8.8.8.8, 8.8.4.4` | DNS server clients will use. If set to blank value, clients will not use any DNS. |
| `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use. |
| `WG_PRE_UP` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L19) for the default value. |
| `WG_POST_UP` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L20) for the default value. |
| `WG_PRE_DOWN` | `...` | - | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L27) for the default value. |
| `WG_POST_DOWN` | `...` | `iptables ...` | See [config.js](https://github.com/wg-easy/wg-easy/blob/master/src/config.js#L28) for the default value. |
| `LANG` | `en` | `de` | Web UI language (Supports: en, ua, ru, tr, no, pl, fr, de, ca, es, ko, vi, nl, is, pt, chs, cht, it, th). |
| `UI_TRAFFIC_STATS` | `false` | `true` | Enable detailed RX / TX client stats in Web UI |
### Prerequisites
> If you change `WG_PORT`, make sure to also change the exposed port.
- Docker
- Node LTS & corepack enabled
- Visual Studio Code
## Updating
### Dev Server
To update to the latest version, simply run:
This starts the development server with docker
```bash
docker stop wg-easy
docker rm wg-easy
docker pull ghcr.io/wg-easy/wg-easy
```shell
pnpm dev
```
And then run the `docker run -d \ ...` command above again.
### Update Auto Imports
## Common Use Cases
If you add something that should be auto-importable and VSCode complains, run:
* [Using WireGuard-Easy with Pi-Hole](https://github.com/wg-easy/wg-easy/wiki/Using-WireGuard-Easy-with-Pi-Hole)
* [Using WireGuard-Easy with nginx/SSL](https://github.com/wg-easy/wg-easy/wiki/Using-WireGuard-Easy-with-nginx-SSL)
```shell
cd src
pnpm install
```
For less common or specific edge-case scenarios, please refer to the detailed information provided in the [Wiki](https://github.com/wg-easy/wg-easy/wiki).
## License
This project is licensed under the AGPL-3.0-only License - see the [LICENSE](LICENSE) file for details
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Jason A. Donenfeld, ZX2C4 or Edge Security
"WireGuard" and the "WireGuard" logo are registered trademarks of Jason A. Donenfeld
Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 104 KiB

+20 -6
View File
@@ -1,10 +1,24 @@
version: "3.8"
services:
wg-easy:
image: wg-easy
command: npm run serve
build:
dockerfile: ./Dockerfile.dev
command: pnpm run dev
volumes:
- ./src/:/app/
environment:
# - PASSWORD=p
- WG_HOST=192.168.1.233
- temp:/app/.nuxt/
- temp1:/app/node_modules/
- /lib/modules:/lib/modules:ro
# - ./data/:/etc/wireguard
ports:
- "51820:51820/udp"
- "51821:51821/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
# folders should be generated inside container
volumes:
temp:
driver: local
temp1:
driver: local
+25 -23
View File
@@ -1,35 +1,23 @@
version: "3.8"
volumes:
etc_wireguard:
services:
wg-easy:
environment:
# Change Language:
# (Supports: en, ua, ru, tr, no, pl, fr, de, ca, es, ko, vi, nl, is, pt, chs, cht, it, th)
- LANG=de
# ⚠️ Required:
# Change this to your host's public address
- WG_HOST=raspberrypi.local
#environment:
# Optional:
# - PORT=51821
# - HOST=0.0.0.0
# - INSECURE=false
# Optional:
# - PASSWORD=foobar123
# - WG_PORT=51820
# - WG_DEFAULT_ADDRESS=10.8.0.x
# - WG_DEFAULT_DNS=1.1.1.1
# - WG_MTU=1420
# - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24
# - WG_PERSISTENT_KEEPALIVE=25
# - WG_PRE_UP=echo "Pre Up" > /etc/wireguard/pre-up.txt
# - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt
# - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt
# - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt
# - UI_TRAFFIC_STATS=true
image: ghcr.io/wg-easy/wg-easy
image: ghcr.io/wg-easy/wg-easy:15
container_name: wg-easy
networks:
wg:
ipv4_address: 10.42.42.42
ipv6_address: fdcc:ad94:bacf:61a3::2a
volumes:
- etc_wireguard:/etc/wireguard
- /lib/modules:/lib/modules:ro
ports:
- "51820:51820/udp"
- "51821:51821/tcp"
@@ -37,6 +25,20 @@ services:
cap_add:
- NET_ADMIN
- SYS_MODULE
# - NET_RAW # ⚠️ Uncomment if using Podman Compose
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
- net.ipv6.conf.all.disable_ipv6=0
- net.ipv6.conf.all.forwarding=1
- net.ipv6.conf.default.forwarding=1
networks:
wg:
driver: bridge
enable_ipv6: true
ipam:
driver: default
config:
- subnet: 10.42.42.0/24
- subnet: fdcc:ad94:bacf:61a3::/64
+5
View File
@@ -0,0 +1,5 @@
---
title: API
---
TODO
@@ -0,0 +1,11 @@
---
title: Optional Configuration
---
TODO
| Env | Default | Example | Description |
| ---------- | --------- | ----------- | ------------------------------ |
| `PORT` | `51821` | `6789` | TCP port for Web UI. |
| `HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. |
| `INSECURE` | `false` | `true` | If access over http is allowed |
@@ -0,0 +1,7 @@
---
title: Prometheus
---
TODO
<!-- TOOD: add to docs: Grafana dashboard [21733](https://grafana.com/grafana/dashboards/21733-wireguard/) -->
@@ -0,0 +1,52 @@
---
title: Migrate from v14 to v15
---
This guide will help you migrate from `v14` to version `v15` of `wg-easy`.
## Changes
- This is a complete rewrite of the `wg-easy` project. Therefore the configuration files and the way you interact with the project have changed.
- If you use armv6 or armv7, you can't migrate to `v15` yet. We are working on it.
- If you are connecting to the web ui via HTTP, you need to set the `INSECURE` environment variable to `true` in the new container.
## Migration
### Backup
Before you start the migration, make sure to backup your existing configuration files.
Go into the Web Ui and click the Backup button, this should download a `wg0.json` file.
Or download the `wg0.json` file from your container volume to your pc.
You will need this file for the migration
### Remove old container
1. Stop the running container
If you are using `docker run`
```shell
docker stop wg-easy
```
If you are using `docker-compose`
```shell
docker-compose down
```
### Start new container
Follow the instructions in the [Getting Started][docs-getting-started] or [Basic Installation][docs-examples] guide to start the new container.
In the setup wizard, select that you already already have a configuration file and upload the `wg0.json` file you downloaded in the backup step.
[docs-getting-started]: ../../getting-started.md
[docs-examples]: ../../examples/tutorials/basic-installation.md
### Done
You have now successfully migrated to `v15` of `wg-easy`.
+7
View File
@@ -0,0 +1,7 @@
---
title: Migrate
---
If you want to migrate from an older version of `wg-easy` to the new version, you can find the migration guides listed below.
- [Migrate from v14 to v15](./from-14-to-15.md) : This guide should also work for any version before `v14`.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -1,6 +1,6 @@
{
"1": "Initial version. Enjoy!",
"2": "You can now rename a client, and update the address. Enjoy!",
"2": "You can now rename a client & update the address. Enjoy!",
"3": "Many improvements and small changes. Enjoy!",
"4": "Now with pretty charts for client's network speed. Enjoy!",
"5": "Many small improvements & feature requests. Enjoy!",
@@ -9,6 +9,8 @@
"8": "Updated to Node.js v18.",
"9": "Fixed issue running on devices with older kernels.",
"10": "Added sessionless HTTP API auth & automatic dark mode.",
"11": "Multilanguage Support & various bugfixes",
"12": "UI_TRAFFIC_STATS, Import json configurations with no PreShared-Key, allow clients with no privateKey & more."
"11": "Multilanguage Support & various bugfixes.",
"12": "UI_TRAFFIC_STATS, Import json configurations with no PreShared-Key, allow clients with no privateKey & more.",
"13": "New framework (h3), UI_CHART_TYPE, some bugfixes & more.",
"14": "Home Assistent support, PASSWORD_HASH (inc. Helper), translation updates bugfixes & more."
}
+23
View File
@@ -0,0 +1,23 @@
---
title: General Information
---
## Coding Style
When refactoring, writing or altering files, adhere to these rules:
1. **Adjust your style of coding to the style that is already present**! Even if you do not like it, this is due to consistency. There was a lot of work involved in making all files consistent.
2. **Use `pnpm lint` to check your scripts**! Your contributions are checked by GitHub Actions too, so you will need to do this.
3. **Use the provided `.vscode/settings.json`** file.
## Documentation
Make sure to select `nightly` in the dropdown menu at the top. Navigate to the page you would like to edit and click the edit button in the top right. This allows you to make changes and create a pull-request.
Alternatively you can make the changes locally. For that you'll need to have Docker installed. Run
```sh
pnpm docs:serve
```
This serves the documentation on your local machine on port `8080`. Each change will be hot-reloaded onto the page you view, just edit, save and look at the result.
@@ -0,0 +1,58 @@
---
title: Issues and Pull Requests
---
This project is Open Source. That means that you can contribute on enhancements, bug fixing or improving the documentation.
## Opening an Issue
/// note | Attention
**Before opening an issue**, read the [`README`][github-file-readme] carefully, study the docs for your version (maybe [latest][docs-latest]) and your search engine you trust. The issue tracker is not meant to be used for unrelated questions!
///
When opening an issue, please provide details use case to let the community reproduce your problem.
/// note | Attention
**Use the issue templates** to provide the necessary information. Issues which do not use these templates are not worked on and closed.
///
By raising issues, I agree to these terms and I understand, that the rules set for the issue tracker will help both maintainers as well as everyone to find a solution.
Maintainers take the time to improve on this project and help by solving issues together. It is therefore expected from others to make an effort and **comply with the rules**.
### Filing a Bug Report
Thank you for participating in this project and reporting a bug. wg-easy is a community-driven project, and each contribution counts!
Maintainers and moderators are volunteers. We greatly appreciate reports that take the time to provide detailed information via the template, enabling us to help you in the best and quickest way. Ignoring the template provided may seem easier, but discourages receiving any support (_via assignment of the label `meta/no template - no support`_).
Markdown formatting can be used in almost all text fields (_unless stated otherwise in the description_).
Be as precise as possible, and if in doubt, it's best to add more information that too few.
When an option is marked with "not officially supported" / "unsupported", then support is dependent on availability from specific maintainers.
## Pull Requests
/// question | Motivation
You want to add a feature? Feel free to start creating an issue explaining what you want to do and how you're thinking doing it. Other users may have the same need and collaboration may lead to better results.
///
### Submit a Pull-Request
The development workflow is the following:
1. Fork the project
2. Write the code that is needed :D
3. Document your improvements if necessary
4. [Commit][commit] (and [sign your commit][gpg]), push and create a pull-request to merge into `master`. Please **use the pull-request template** to provide a minimum of contextual information and make sure to meet the requirements of the checklist.
Pull requests are automatically tested against the CI and will be reviewed when tests pass. When your changes are validated, your branch is merged. CI builds the new `:nightly` image every night and your changes will be includes in the next version release.
[docs-latest]: https://wg-easy.github.io/wg-easy/latest
[github-file-readme]: https://github.com/wg-easy/wg-easy/blob/master/README.md
[commit]: https://help.github.com/articles/closing-issues-via-commit-messages/
[gpg]: https://docs.github.com/en/github/authenticating-to-github/generating-a-new-gpg-key
@@ -0,0 +1,5 @@
---
title: AdGuard Home
---
TODO
@@ -0,0 +1,34 @@
---
title: Auto Updates
---
## Docker Compose
With Docker Compose `wg-easy` can be updated with a single command:
Replace `$DIR` with the directory where your `docker-compose.yml` is located.
```shell
cd $DIR
sudo docker compose up -d --pull always
```
## Docker Run
```shell
sudo docker stop wg-easy
sudo docker rm wg-easy
sudo docker pull ghcr.io/wg-easy/wg-easy
```
And then run the `docker run -d \ ...` command from [Docker Run][docker-run] again.
[docker-run]: ./docker-run.md
## Podman
To update `wg-easy` (and every container that has auto updates enabled), you can run the following command:
```shell
sudo podman auto-update
```
@@ -0,0 +1,71 @@
---
title: Basic Installation
---
<!-- TOOD: add docs for pihole, nginx, caddy, traefik -->
## Requirements
1. You need to have a host that you can manage
2. You need to have a domain name or a public IP address
3. You need a supported architecture (x86_64, arm64)
4. You need curl installed on your host
## Install Docker
Follow the Docs here: <https://docs.docker.com/engine/install/> and install Docker on your host.
## Install `wg-easy`
1. Create a directory for the configuration files (you can choose any directory you like):
```shell
DIR=/docker/wg-easy
sudo mkdir -p $DIR
```
2. Download docker compose file
```shell
sudo curl -o $DIR/docker-compose.yml https://raw.githubusercontent.com/wg-easy/wg-easy/master/docker-compose.yml
```
3. Start `wg-easy`
```shell
sudo docker-compose -f $DIR/docker-compose.yml up -d
```
## Setup Firewall
If you are using a firewall, you need to open the following ports:
- UDP 51820 (WireGuard)
- TCP 51821 (Web UI)
These ports can be changed, so if you change them you have to update your firewall rules accordingly.
## Setup Reverse Proxy
TODO
## Access the Web UI
Open your browser and navigate to `https://<your-domain>:51821` or `https://<your-ip>:51821`.
Follow the instructions to set up your WireGuard VPN.
## Update `wg-easy`
To update `wg-easy` to the latest version, run:
```shell
sudo docker-compose -f $DIR/docker-compose.yml pull
sudo docker-compose -f $DIR/docker-compose.yml up -d
```
## Auto Update
If you want to enable auto-updates, follow the instructions here: [Auto Updates][auto-updates]
[auto-updates]: ./auto-updates.md
+5
View File
@@ -0,0 +1,5 @@
---
title: Caddy
---
TODO
@@ -0,0 +1,43 @@
---
title: Docker Run
---
To setup the IPv6 Network, simply run once:
```shell
docker network create \
-d bridge --ipv6 \
-d default \
--subnet 10.42.42.0/24 \
--subnet fdcc:ad94:bacf:61a3::/64 wg \
```
<!-- ref: major version -->
To automatically install & run ``wg-easy, simply run:
```shell
docker run -d \
--net wg \
-e INSECURE=true \
--name wg-easy \
--ip6 fdcc:ad94:bacf:61a3::2a \
--ip 10.42.42.42 \
-v ~/.wg-easy:/etc/wireguard \
-v /lib/modules:/lib/modules:ro \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add NET_ADMIN \
--cap-add SYS_MODULE \
--sysctl net.ipv4.ip_forward=1 \
--sysctl net.ipv4.conf.all.src_valid_mark=1 \
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
--sysctl net.ipv6.conf.all.forwarding=1 \
--sysctl net.ipv6.conf.default.forwarding=1 \
--restart unless-stopped \
ghcr.io/wg-easy/wg-easy:15
```
The Web UI will now be available on `http://0.0.0.0:51821`.
> 💡 Your configuration files will be saved in `~/.wg-easy`
@@ -0,0 +1,5 @@
---
title: Without Docker
---
TODO
+5
View File
@@ -0,0 +1,5 @@
---
title: NGINX
---
TODO
+113
View File
@@ -0,0 +1,113 @@
---
title: Podman
---
This guide will show you how to run `wg-easy` with rootful Podman and nftables.
## Requirements
1. Podman installed with version 4.4 or higher
## Configuration
Create a Folder for the configuration files:
```shell
sudo mkdir -p /etc/containers/systemd/wg-easy
sudo mkdir -p /etc/containers/volumes/wg-easy
```
Create a file `/etc/containers/systemd/wg-easy/wg-easy.container` with the following content:
<!-- ref: major version -->
```ini
[Container]
ContainerName=wg-easy
Image=ghcr.io/wg-easy/wg-easy:15
AutoUpdate=registry
Volume=/etc/containers/volumes/wg-easy:/etc/wireguard:Z
Network=wg-easy.network
PublishPort=51820:51820/udp
PublishPort=51821:51821/tcp
# this is used to allow access over HTTP
# remove this when using a reverse proxy
Environment=INSECURE=true
AddCapability=NET_ADMIN
AddCapability=SYS_MODULE
AddCapability=NET_RAW
Sysctl=net.ipv4.ip_forward=1
Sysctl=net.ipv4.conf.all.src_valid_mark=1
Sysctl=net.ipv6.conf.all.disable_ipv6=0
Sysctl=net.ipv6.conf.all.forwarding=1
Sysctl=net.ipv6.conf.default.forwarding=1
[Install]
# this is used to start the container on boot
WantedBy=default.target
```
Create a file `/etc/containers/systemd/wg-easy/wg-easy.network` with the following content:
```ini
[Network]
NetworkName=wg-easy
IPv6=true
```
## Load Kernel Modules
You will need to load the following kernel modules
```txt
wireguard
nft_masq
```
Create a file `/etc/modules-load.d/wg-easy.conf` with the following content:
```txt
wireguard
nft_masq
```
## Start the Container
```shell
sudo systemctl daemon-reload
sudo systemctl start wg-easy
```
## Edit Hooks
In the Admin Panel of your WireGuard server, go to the `Hooks` tab and add the following hook:
1. PostUp
```shell
apk add nftables; nft add table inet wg_table; nft add chain inet wg_table postrouting { type nat hook postrouting priority 100 \; }; nft add rule inet wg_table postrouting ip saddr {{ipv4Cidr}} oifname {{device}} masquerade; nft add rule inet wg_table postrouting ip6 saddr {{ipv6Cidr}} oifname {{device}} masquerade; nft add chain inet wg_table input { type filter hook input priority 0 \; policy drop \; }; nft add rule inet wg_table input udp dport {{port}} accept; nft add rule inet wg_table input tcp dport {{uiPort}} accept; nft add chain inet wg_table forward { type filter hook forward priority 0 \; policy drop \; }; nft add rule inet wg_table forward iifname "wg0" accept; nft add rule inet wg_table forward oifname "wg0" accept;
```
2. PostDown
```shell
nft delete table inet wg_table
```
If you don't have iptables loaded on your server, you could see many errors in the logs or in the UI. You can ignore them.
## Restart the Container
Restart the container to apply the new hooks:
```shell
sudo systemctl restart wg-easy
```
<!--
TODO: improve docs after better nftables support
TODO: fix accept web ui port
-->
@@ -0,0 +1,5 @@
---
title: Traefik
---
TODO
+92
View File
@@ -0,0 +1,92 @@
---
title: Getting Started
hide:
- navigation
---
This page explains how to get started with wg-easy. The guide uses Docker Compose as a reference. In our examples, we mount the named volume `etc_wireguard` to `/etc/wireguard` inside the container.
## Preliminary Steps
Before you can get started with deploying your own VPN, there are some requirements to be met:
1. You need to have a host that you can manage
2. You need to have a domain name or a public IP address
3. You need a supported architecture (x86_64, arm64)
### Host Setup
There are a few requirements for a suitable host system:
1. You need to have a container runtime installed
/// note | About the Container Runtime
On the host, you need to have a suitable container runtime (like _Docker_ or _Podman_) installed. We assume [_Docker Compose_][docker-compose] is [installed][docker-compose-installation]. We have aligned file names and configuration conventions with the latest [Docker Compose specification][docker-compose-specification].
If you're using podman, make sure to read the related [documentation][docs-podman].
///
[docker-compose]: https://docs.docker.com/compose/
[docker-compose-installation]: https://docs.docker.com/compose/install/
[docker-compose-specification]: https://docs.docker.com/compose/compose-file/
[docs-podman]: ./examples/tutorials/podman.md
## Deploying the Actual Image
### Tagging Convention
To understand which tags you should use, read this section carefully. [Our CI][github-ci] will automatically build, test and push new images to the following container registry:
1. GitHub Container Registry ([`ghcr.io/wg-easy/wg-easy`][ghcr-image])
All workflows are using the tagging convention listed below. It is subsequently applied to all images.
| Event | Image Tags |
| ----------------------- | ----------------------------- |
| `cron` on `master` | `nightly` |
| `push` a tag (`v1.2.3`) | `1.2.3`, `1.2`, `1`, `latest` |
When publishing a tag we follow the [Semantic Versioning][semver] specification. The `latest` tag is always pointing to the latest stable release. If you want to avoid breaking changes, use the major version tag (e.g. `15`).
[github-ci]: https://github.com/wg-easy/wg-easy/actions
[ghcr-image]: https://github.com/wg-easy/wg-easy/pkgs/container/wg-easy
[semver]: https://semver.org/
### Get All Files
Issue the following command to acquire the necessary file:
```shell
wget "https://raw.githubusercontent.com/wg-easy/wg-easy/master/docker-compose.yml"
```
### Start the Container
To start the container, issue the following command:
```shell
sudo docker compose up -d
```
### Configuration Steps
Now follow the setup process in your web browser
### Stopping the Container
To stop the container, issue the following command:
```shell
sudo docker compose down
```
/// danger | Using the Correct Commands For Stopping and Starting wg-easy
**Use `sudo docker compose up / down`, not `sudo docker compose start / stop`**. Otherwise, the container is not properly destroyed and you may experience problems during startup because of inconsistent state.
///
**That's it! It really is that easy**.
If you need more help you can read the [Basic Installation Tutorial][basic-installation].
[basic-installation]: ./examples/tutorials/basic-installation.md
+41
View File
@@ -0,0 +1,41 @@
---
title: Home
hide:
- navigation
---
# Welcome to the Documentation for `wg-easy`
/// info | This Documentation is Versioned
**Make sure** to select the correct version of this documentation! It should match the version of the image you are using. The default version corresponds to the `:latest` image tag - [the most recent stable release][docs-tagging].
///
This documentation provides you not only with the basic setup and configuration of wg-easy but also with advanced configuration, elaborate usage scenarios, detailed examples, hints and more.
[docs-tagging]: ./getting-started.md#tagging-convention
## About
`wg-easy` is the easiest way to run WireGuard VPN + Web-based Admin UI.
## Contents
### Getting Started
If you're new to wg-easy, make sure to read the [_Getting Started_ chapter][docs-getting-started] first. If you want to look at examples for Docker Run and Compose, we have an [_Examples_ page][docs-examples].
[docs-getting-started]: ./getting-started.md
[docs-examples]: ./examples/tutorials/basic-installation.md
### Contributing
We are always happy to welcome new contributors. For guidelines and entrypoints please have a look at the [Contributing section][docs-contributing].
[docs-contributing]: ./contributing/issues-and-pull-requests.md
### Migration
If you are migrating from an older version of `wg-easy`, please read the [_Migration_ chapter][docs-migration].
[docs-migration]: ./advanced/migrate/from-14-to-15.md
+87
View File
@@ -0,0 +1,87 @@
site_name: "wg-easy"
site_description: "The easiest way to run WireGuard VPN + Web-based Admin UI."
site_author: "WireGuard Easy"
copyright: >
<p>
&copy <a href="https://github.com/wg-easy"><em>Wireguard Easy</em></a><br/>
<span>This project is licensed under AGPL-3.0-only.</span><br/>
<span>This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Jason A. Donenfeld, ZX2C4 or Edge Security</span><br/>
<span>"WireGuard" and the "WireGuard" logo are registered trademarks of Jason A. Donenfeld</span>
</p>
repo_url: https://github.com/wg-easy/wg-easy
repo_name: wg-easy
edit_uri: "edit/master/docs/content"
docs_dir: "content/"
site_url: https://wg-easy.github.io/wg-easy
theme:
name: material
favicon: assets/logo/favicon.png
logo: assets/logo/logo.png
icon:
repo: fontawesome/brands/github
features:
- navigation.tabs
- navigation.top
- navigation.expand
- navigation.instant
- content.action.edit
- content.action.view
- content.code.annotate
palette:
# Light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: grey
accent: red
toggle:
icon: material/weather-night
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: grey
accent: red
toggle:
icon: material/weather-sunny
name: Switch to light mode
extra:
version:
provider: mike
markdown_extensions:
- toc:
anchorlink: true
- abbr
- attr_list
- pymdownx.blocks.admonition:
types:
- danger
- note
- info
- question
- warning
- pymdownx.details
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
slugify: !!python/object/apply:pymdownx.slugs.slugify
kwds:
case: lower
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.magiclink
- pymdownx.inlinehilite
- pymdownx.tilde
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
+4
View File
@@ -0,0 +1,4 @@
mkdocs-material
pillow
cairosvg
mike
-11
View File
@@ -1,11 +0,0 @@
{
"name": "wg-easy",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"version": "1.0.1"
}
}
}
+8 -5
View File
@@ -1,8 +1,11 @@
{
"version": "1.0.1",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "DOCKER_BUILDKIT=1 docker build --tag wg-easy .",
"serve": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up",
"start": "docker run --env WG_HOST=0.0.0.0 --name wg-easy --cap-add=NET_ADMIN --cap-add=SYS_MODULE --sysctl=\"net.ipv4.conf.all.src_valid_mark=1\" --mount type=bind,source=\"$(pwd)\"/config,target=/etc/wireguard -p 51820:51820/udp -p 51821:51821/tcp wg-easy"
}
"dev": "docker compose -f docker-compose.dev.yml up --build",
"build": "docker build -t wg-easy .",
"docs:preview": "docker run --rm -it -p 8080:8080 -v ./docs:/docs squidfunk/mkdocs-material serve -a 0.0.0.0:8080",
"scripts:version": "bash scripts/version.sh"
},
"packageManager": "pnpm@10.6.2"
}
+9
View File
@@ -0,0 +1,9 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.: {}
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
package_json="src/package.json"
# Function to update the version in package.json
update_version() {
local new_version=$1
jq --arg new_version "$new_version" '.version = $new_version' $package_json > tmp.json && mv tmp.json $package_json
}
# Get the current version from package.json
current_version=$(jq -r '.version' $package_json)
echo "Current version: $current_version"
# Prompt the user for the new version
read -p "Enter the new version (following SemVer): " new_version
# Official SemVer regex for validation
semver_regex="^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
# Validate the new version
if ! echo "$new_version" | grep -Eq "$semver_regex"; then
echo "Invalid version format. Please use SemVer format (e.g., 1.0.0 or 1.0.0-alpha)."
exit 1
fi
# Update the version in package.json
update_version $new_version
echo "Updated package.json to version $new_version"
echo "----"
echo "If you changed the major version, remember to update the docker-compose.yml file and docs (search for: ref: major version)"
echo "----"
echo "If you did everything press 'y' to commit the changes and create a new tag"
read -p "Do you want to continue? (y/n): " confirm
if [ "$confirm" != "y" ]; then
echo "Aborted."
exit 1
fi
# Commit the changes
git add $package_json
git commit -m "Bump version to $new_version"
echo "Committed the changes"
# Create a new Git tag
git tag -a "v$new_version" -m "Release version $new_version"
echo "Created Git tag v$new_version"
# Push the commit & tag to the remote repository
git push origin master --follow-tags
echo "Pushed Git commit and tag v$new_version to remote repository"
-11
View File
@@ -1,11 +0,0 @@
{
"extends": "athom",
"ignorePatterns": [
"**/vendor/*.js"
],
"rules": {
"consistent-return": "off",
"no-shadow": "off",
"max-len": "off"
}
}
+26 -1
View File
@@ -1 +1,26 @@
/node_modules
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example
wg-easy.db
+1
View File
@@ -0,0 +1 @@
public-hoist-pattern[]=@libsql/linux*
+2
View File
@@ -0,0 +1,2 @@
pnpm-lock.yaml
server/database/migrations/meta
+7
View File
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"plugins": ["prettier-plugin-tailwindcss"]
}
+57
View File
@@ -0,0 +1,57 @@
<template>
<ToastProvider>
<NuxtLayout>
<NuxtPage />
<ToastViewport
class="fixed bottom-0 right-0 z-[2147483647] m-0 flex w-[390px] max-w-[100vw] list-none flex-col gap-[10px] p-[var(--viewport-padding)] outline-none [--viewport-padding:_25px]"
>
<BaseToast ref="toastRef" />
</ToastViewport>
</NuxtLayout>
</ToastProvider>
</template>
<script setup lang="ts">
const toast = useToast();
const toastRef = useTemplateRef('toastRef');
toast.setToast(toastRef);
// make sure to fetch release early
useGlobalStore();
useHead({
bodyAttrs: {
class: 'bg-gray-50 dark:bg-neutral-800',
},
link: [
{
rel: 'manifest',
href: '/manifest.json',
},
{
rel: 'icon',
type: 'image/png',
href: '/favicon.png',
},
{
rel: 'apple-touch-icon',
href: '/apple-touch-icon.png',
},
],
meta: [
{
name: 'mobile-web-app-capable',
content: 'yes',
},
{
name: 'apple-mobile-web-app-capable',
content: 'yes',
},
{
name: 'apple-mobile-web-app-status-bar-style',
content: 'black-translucent',
},
],
title: 'WireGuard',
});
</script>
+34
View File
@@ -0,0 +1,34 @@
<template>
<BaseDialog :trigger-class="triggerClass">
<template #trigger><slot /></template>
<template #title>{{ $t('admin.interface.changeCidr') }}</template>
<template #description>
<FormGroup>
<FormTextField id="ipv4Cidr" v-model="ipv4Cidr" label="IPv4" />
<FormTextField id="ipv6Cidr" v-model="ipv6Cidr" label="IPv6" />
</FormGroup>
</template>
<template #actions>
<DialogClose as-child>
<BaseButton>{{ $t('dialog.cancel') }}</BaseButton>
</DialogClose>
<DialogClose as-child>
<BaseButton @click="$emit('change', ipv4Cidr, ipv6Cidr)">
{{ $t('dialog.change') }}
</BaseButton>
</DialogClose>
</template>
</BaseDialog>
</template>
<script lang="ts" setup>
defineEmits(['change']);
const props = defineProps<{
triggerClass?: string;
ipv4Cidr: string;
ipv6Cidr: string;
}>();
const ipv4Cidr = ref(props.ipv4Cidr);
const ipv6Cidr = ref(props.ipv6Cidr);
</script>
+20
View File
@@ -0,0 +1,20 @@
<template>
<AvatarRoot
class="mr-2 inline-flex select-none items-center justify-center overflow-hidden rounded-full align-middle"
>
<AvatarImage
class="h-full w-full rounded-[inherit] object-cover"
:src="img ?? ''"
/>
<AvatarFallback
class="leading-1 flex h-full w-full items-center justify-center bg-white text-sm font-medium"
:delay-ms="600"
>
<slot />
</AvatarFallback>
</AvatarRoot>
</template>
<script lang="ts" setup>
defineProps<{ img?: string }>();
</script>
+26
View File
@@ -0,0 +1,26 @@
<template>
<component
:is="elementType"
role="button"
class="inline-flex items-center rounded border-2 border-gray-100 px-4 py-2 text-gray-700 transition hover:border-red-800 hover:bg-red-800 hover:text-white dark:border-neutral-600 dark:text-neutral-200"
v-bind="attrs"
>
<slot />
</component>
</template>
<script setup lang="ts">
const props = defineProps({
as: {
type: String,
default: 'button',
},
});
const elementType = computed(() => props.as);
const attrs = computed(() => {
const { as, ...attrs } = props;
return attrs;
});
</script>
+20
View File
@@ -0,0 +1,20 @@
<template>
<ClientOnly>
<apexchart
width="100%"
height="100%"
v-bind="$attrs"
:options="options"
:series="series"
/>
</ClientOnly>
</template>
<script setup lang="ts">
import type { VueApexChartsComponent } from 'vue3-apexcharts';
defineProps<{
options: VueApexChartsComponent['options'];
series: VueApexChartsComponent['series'];
}>();
</script>
+31
View File
@@ -0,0 +1,31 @@
<template>
<DialogRoot :modal="true">
<DialogTrigger :class="triggerClass"><slot name="trigger" /></DialogTrigger>
<DialogPortal>
<DialogOverlay
class="fixed inset-0 z-30 bg-gray-500 opacity-75 dark:bg-black dark:opacity-50"
/>
<DialogContent
class="fixed left-1/2 top-1/2 z-[100] max-h-[85vh] w-[90vw] max-w-md -translate-x-1/2 -translate-y-1/2 rounded-md bg-white p-6 shadow-2xl focus:outline-none dark:bg-neutral-700"
>
<DialogTitle
class="m-0 text-lg font-semibold text-gray-900 dark:text-neutral-200"
>
<slot name="title" />
</DialogTitle>
<DialogDescription
class="mb-5 mt-2 text-sm leading-normal text-gray-500 dark:text-neutral-300"
>
<slot name="description" />
</DialogDescription>
<div class="mt-6 flex justify-end gap-2">
<slot name="actions" />
</div>
</DialogContent>
</DialogPortal>
</DialogRoot>
</template>
<script lang="ts" setup>
defineProps<{ triggerClass?: string }>();
</script>
+10
View File
@@ -0,0 +1,10 @@
<template>
<input
v-model="data"
class="rounded-lg border-2 border-gray-100 text-gray-500 focus:border-red-800 focus:outline-0 focus:ring-0 dark:border-neutral-800 dark:bg-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-400"
/>
</template>
<script lang="ts" setup>
const data = defineModel<unknown>();
</script>
+17
View File
@@ -0,0 +1,17 @@
<template>
<SwitchRoot
:id="id"
v-model:checked="data"
:name="id"
class="relative flex h-6 w-10 cursor-default rounded-full bg-gray-200 shadow-sm focus-within:outline focus-within:outline-red-700 data-[state=checked]:bg-red-800 dark:bg-neutral-400"
>
<SwitchThumb
class="my-auto block h-4 w-4 translate-x-1 rounded-full bg-white shadow-sm transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[20px]"
/>
</SwitchRoot>
</template>
<script lang="ts" setup>
defineProps<{ id?: string }>();
const data = defineModel<boolean>();
</script>
+46
View File
@@ -0,0 +1,46 @@
<template>
<ToastRoot
v-for="(e, i) in count"
:key="i"
:class="[
`grid grid-cols-[auto_max-content] items-center gap-x-3 rounded-md p-3 text-neutral-200 shadow-lg [grid-template-areas:_'title_action'_'description_action'] data-[swipe=cancel]:translate-x-0 data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]`,
{
'bg-green-800': e.type === 'success',
'bg-red-800': e.type === 'error',
},
]"
>
<ToastTitle class="mb-1 text-sm font-medium [grid-area:_title]">
{{ e.title }}
</ToastTitle>
<ToastDescription class="m-0 text-sm [grid-area:_description]">{{
e.message
}}</ToastDescription>
<ToastAction as-child alt-text="toast" class="[grid-area:_action]">
<slot />
</ToastAction>
<ToastClose aria-label="Close">
<span aria-hidden>×</span>
</ToastClose>
</ToastRoot>
</template>
<script setup lang="ts">
import {
ToastAction,
ToastClose,
ToastDescription,
ToastRoot,
ToastTitle,
} from 'radix-vue';
defineExpose({
publish,
});
const count = reactive<ToastParams[]>([]);
function publish(e: ToastParams) {
count.push({ type: e.type, title: e.title, message: e.message });
}
</script>
+24
View File
@@ -0,0 +1,24 @@
<template>
<TooltipProvider>
<TooltipRoot>
<TooltipTrigger
class="inline-flex h-8 w-8 items-center justify-center rounded-full text-gray-400 outline-none focus:shadow-sm focus:shadow-black"
>
<slot />
</TooltipTrigger>
<TooltipPortal>
<TooltipContent
class="select-none rounded bg-gray-600 px-3 py-2 text-sm leading-none text-white shadow-lg will-change-[transform,opacity]"
:side-offset="5"
>
{{ text }}
<TooltipArrow class="fill-gray-600" :width="8" />
</TooltipContent>
</TooltipPortal>
</TooltipRoot>
</TooltipProvider>
</template>
<script lang="ts" setup>
defineProps<{ text: string }>();
</script>
+11
View File
@@ -0,0 +1,11 @@
<template>
<span class="inline-block">
{{ client.ipv4Address }}, {{ client.ipv6Address }}
</span>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
+30
View File
@@ -0,0 +1,30 @@
<template>
<div class="relative mt-2 h-10 w-10 self-start rounded-full bg-gray-50">
<BaseAvatar :img="client.avatar" class="h-10 w-10">
<IconsAvatar class="h-6 w-6 text-gray-300" />
</BaseAvatar>
<div
v-if="
isPeerConnected({
latestHandshakeAt: client.latestHandshakeAt
? new Date(client.latestHandshakeAt)
: null,
})
"
>
<div
class="absolute -bottom-1 -right-1 h-4 w-4 animate-ping rounded-full bg-red-100 p-1 dark:bg-red-100"
/>
<div
class="absolute bottom-0 right-0 h-2 w-2 rounded-full bg-red-800 dark:bg-red-600"
/>
</div>
</div>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
+136
View File
@@ -0,0 +1,136 @@
<template>
<div
:class="`absolute bottom-0 left-0 right-0 z-0 h-6 ${globalStore.uiChartType === 'line' && 'line-chart'}`"
>
<BaseChart :options="chartOptionsTX" :series="client.transferTxSeries" />
</div>
<div
:class="`absolute left-0 right-0 top-0 z-0 h-6 ${globalStore.uiChartType === 'line' && 'line-chart'}`"
>
<BaseChart
:options="chartOptionsRX"
:series="client.transferRxSeries"
style="transform: scaleY(-1)"
/>
</div>
</template>
<script setup lang="ts">
import type { ApexOptions } from 'apexcharts';
defineProps<{
client: LocalClient;
}>();
const globalStore = useGlobalStore();
const theme = useTheme();
const chartOptionsTX = computed(() => {
const opts = {
...chartOptions,
colors: [CHART_COLORS.tx[theme.value]],
};
opts.chart.type = globalStore.uiChartType;
opts.stroke.width = UI_CHART_PROPS[globalStore.uiChartType].strokeWidth;
return opts;
});
const chartOptionsRX = computed(() => {
const opts = {
...chartOptions,
colors: [CHART_COLORS.rx[theme.value]],
};
opts.chart.type = globalStore.uiChartType;
opts.stroke.width = UI_CHART_PROPS[globalStore.uiChartType].strokeWidth;
return opts;
});
const chartOptions = {
chart: {
type: undefined as ApexChart['type'],
background: 'transparent',
stacked: false,
toolbar: {
show: false,
},
animations: {
enabled: false,
},
parentHeightOffset: 0,
sparkline: {
enabled: true,
},
},
colors: [],
stroke: {
curve: 'smooth',
width: 0,
},
fill: {
type: 'gradient',
gradient: {
shade: 'dark',
type: 'vertical',
shadeIntensity: 0,
gradientToColors: CHART_COLORS.gradient[theme.value],
inverseColors: false,
opacityTo: 0,
stops: [0, 100],
},
},
dataLabels: {
enabled: false,
},
plotOptions: {
bar: {
horizontal: false,
},
},
xaxis: {
labels: {
show: false,
},
axisTicks: {
show: false,
},
axisBorder: {
show: false,
},
},
yaxis: {
labels: {
show: false,
},
min: 0,
},
tooltip: {
enabled: false,
},
legend: {
show: false,
},
grid: {
show: false,
padding: {
left: -10,
right: 0,
bottom: -15,
top: -15,
},
column: {
opacity: 0,
},
xaxis: {
lines: {
show: false,
},
},
},
} satisfies ApexOptions;
</script>
<style scoped lang="css">
.line-chart .apexcharts-svg {
transform: translateY(3px);
}
</style>
@@ -0,0 +1,51 @@
<template>
<ClientCardCharts :client="client" />
<div
class="relative z-10 flex flex-col justify-between gap-3 px-3 py-3 sm:flex-row md:py-5"
>
<div class="flex w-full items-center gap-3 md:gap-4">
<ClientCardAvatar :client="client" />
<div class="flex w-full flex-col gap-2 xxs:flex-row">
<div class="flex flex-grow flex-col gap-1">
<ClientCardName :client="client" />
<div
class="flex flex-col pb-1 text-xs text-gray-500 md:inline-block md:pb-0 dark:text-neutral-400"
>
<div>
<ClientCardAddress :client="client" />
</div>
<div>
<ClientCardLastSeen :client="client" />
</div>
</div>
<ClientCardOneTimeLink :client="client" />
<ClientCardExpireDate :client="client" />
</div>
<div
class="mt-px flex shrink-0 items-center justify-end gap-2 text-xs text-gray-400 dark:text-neutral-400"
>
<ClientCardTransfer :client="client" />
</div>
</div>
</div>
<div class="flex items-center justify-end">
<div
class="flex items-center justify-between gap-1 text-gray-400 dark:text-neutral-400"
>
<ClientCardSwitch :client="client" />
<ClientCardEdit :client="client" />
<ClientCardQRCode :client="client" />
<ClientCardConfig :client="client" />
<ClientCardOneTimeLinkBtn :client="client" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
+16
View File
@@ -0,0 +1,16 @@
<template>
<a
:href="'/api/client/' + client.id + '/configuration'"
download
class="inline-block rounded bg-gray-100 p-2 align-middle transition hover:bg-red-800 hover:text-white dark:bg-neutral-600 dark:text-neutral-300 dark:hover:bg-red-800 dark:hover:text-white"
:title="$t('client.downloadConfig')"
>
<IconsDownload class="w-5" />
</a>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
+14
View File
@@ -0,0 +1,14 @@
<template>
<NuxtLink
class="rounded bg-gray-100 p-2 align-middle transition hover:bg-red-800 hover:text-white dark:bg-neutral-600 dark:text-neutral-300 dark:hover:bg-red-800 dark:hover:text-white"
:to="`/clients/${client.id}`"
>
<IconsEdit class="w-5" />
</NuxtLink>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
@@ -0,0 +1,23 @@
<template>
<div
class="block pb-1 text-xs text-gray-500 md:inline-block md:pb-0 dark:text-neutral-400"
>
<span class="inline-block">{{ expiredDateFormat(client.expiresAt) }}</span>
</div>
</template>
<script setup lang="ts">
defineProps<{ client: LocalClient }>();
const { t, locale } = useI18n();
function expiredDateFormat(value: string | null) {
if (value === null) return t('client.permanent');
const dateTime = new Date(value);
return dateTime.toLocaleDateString(locale.value, {
year: 'numeric',
month: 'long',
day: 'numeric',
});
}
</script>
@@ -0,0 +1,16 @@
<template>
<span
v-if="client.latestHandshakeAt"
:title="$t('client.lastSeen') + $d(new Date(client.latestHandshakeAt))"
>
{{ timeago(new Date(client.latestHandshakeAt)) }}
</span>
</template>
<script setup lang="ts">
import { format as timeago } from 'timeago.js';
defineProps<{
client: LocalClient;
}>();
</script>
+16
View File
@@ -0,0 +1,16 @@
<template>
<div
class="text-sm text-gray-700 md:text-base dark:text-neutral-200"
:title="$t('client.createdOn') + $d(new Date(client.createdAt))"
>
<span class="border-b-2 border-t-2 border-transparent">
{{ client.name }}
</span>
</div>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
@@ -0,0 +1,51 @@
<template>
<div v-if="client.oneTimeLink !== null" class="text-xs text-gray-400">
<a :href="'./cnf/' + client.oneTimeLink.oneTimeLink">{{ path }}</a>
</div>
</template>
<script setup lang="ts">
const props = defineProps<{ client: LocalClient }>();
const path = ref('Loading...');
const timer = ref<NodeJS.Timeout | null>(null);
const { localeProperties } = useI18n();
onMounted(() => {
timer.value = setIntervalImmediately(() => {
if (props.client.oneTimeLink === null) {
return;
}
const timeLeft =
new Date(props.client.oneTimeLink.expiresAt).getTime() - Date.now();
if (timeLeft <= 0) {
path.value = `${document.location.protocol}//${document.location.host}/cnf/${props.client.oneTimeLink.oneTimeLink} (00:00)`;
return;
}
const formatter = new Intl.DateTimeFormat(localeProperties.value.language, {
minute: '2-digit',
second: '2-digit',
hourCycle: 'h23',
});
const minutes = Math.floor(timeLeft / 60000);
const seconds = Math.floor((timeLeft % 60000) / 1000);
const date = new Date(0);
date.setMinutes(minutes);
date.setSeconds(seconds);
path.value = `${document.location.protocol}//${document.location.host}/cnf/${props.client.oneTimeLink.oneTimeLink} (${formatter.format(date)})`;
}, 1000);
});
onUnmounted(() => {
if (timer.value) {
clearTimeout(timer.value);
}
});
</script>
@@ -0,0 +1,32 @@
<template>
<button
class="inline-block rounded bg-gray-100 p-2 align-middle transition hover:bg-red-800 hover:text-white dark:bg-neutral-600 dark:text-neutral-300 dark:hover:bg-red-800 dark:hover:text-white"
:title="$t('client.otlDesc')"
@click="showOneTimeLink"
>
<IconsLink class="w-5" />
</button>
</template>
<script setup lang="ts">
const props = defineProps<{ client: LocalClient }>();
const clientsStore = useClientsStore();
const _showOneTimeLink = useSubmit(
`/api/client/${props.client.id}/generateOneTimeLink`,
{
method: 'post',
},
{
revert: async () => {
await clientsStore.refresh();
},
noSuccessToast: true,
}
);
function showOneTimeLink() {
return _showOneTimeLink(undefined);
}
</script>
+16
View File
@@ -0,0 +1,16 @@
<template>
<ClientsQRCodeDialog :qr-code="`./api/client/${client.id}/qrcode.svg`">
<div
class="rounded bg-gray-100 p-2 align-middle transition hover:bg-red-800 hover:text-white dark:bg-neutral-600 dark:text-neutral-300 dark:hover:bg-red-800 dark:hover:text-white"
:title="$t('client.showQR')"
>
<IconsQRCode class="w-5" />
</div>
</ClientsQRCodeDialog>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
+53
View File
@@ -0,0 +1,53 @@
<template>
<BaseSwitch
v-model="enabled"
:title="
client.enabled ? $t('client.disableClient') : $t('client.enableClient')
"
@click="toggleClient"
/>
</template>
<script setup lang="ts">
const props = defineProps<{
client: LocalClient;
}>();
const enabled = ref(props.client.enabled);
const clientsStore = useClientsStore();
const _disableClient = useSubmit(
`/api/client/${props.client.id}/disable`,
{
method: 'post',
},
{
revert: async () => {
await clientsStore.refresh();
},
noSuccessToast: true,
}
);
const _enableClient = useSubmit(
`/api/client/${props.client.id}/enable`,
{
method: 'post',
},
{
revert: async () => {
await clientsStore.refresh();
},
noSuccessToast: true,
}
);
async function toggleClient() {
if (props.client.enabled) {
await _disableClient(undefined);
} else {
await _enableClient(undefined);
}
}
</script>
@@ -0,0 +1,45 @@
<template>
<!-- Transfer TX -->
<div v-if="client.transferTx" class="min-w-20 md:min-w-24">
<span
class="flex gap-1"
:title="$t('client.totalDownload') + bytes(client.transferTx)"
>
<IconsArrowDown class="mt-0.5 inline h-3 align-middle" />
<div>
<span class="text-gray-700 dark:text-neutral-200"
>{{ bytes(client.transferTxCurrent) }}/s</span
>
<!-- Total TX -->
<br /><span class="font-regular" style="font-size: 0.85em">{{
bytes(client.transferTx)
}}</span>
</div>
</span>
</div>
<!-- Transfer RX -->
<div v-if="client.transferRx" class="min-w-20 md:min-w-24">
<span
class="flex gap-1"
:title="$t('client.totalUpload') + bytes(client.transferRx)"
>
<IconsArrowUp class="mt-0.5 inline h-3 align-middle" />
<div>
<span class="text-gray-700 dark:text-neutral-200"
>{{ bytes(client.transferRxCurrent) }}/s</span
>
<!-- Total RX -->
<br /><span class="font-regular" style="font-size: 0.85em">{{
bytes(client.transferRx)
}}</span>
</div>
</span>
</div>
</template>
<script setup lang="ts">
defineProps<{
client: LocalClient;
}>();
</script>
@@ -0,0 +1,53 @@
<template>
<BaseDialog :trigger-class="triggerClass">
<template #trigger>
<slot />
</template>
<template #title>
{{ $t('client.new') }}
</template>
<template #description>
<div class="flex flex-col">
<FormTextField id="name" v-model="name" :label="$t('client.name')" />
<FormDateField
id="expiresAt"
v-model="expiresAt"
:label="$t('client.expireDate')"
/>
</div>
</template>
<template #actions>
<DialogClose as-child>
<BaseButton>{{ $t('dialog.cancel') }}</BaseButton>
</DialogClose>
<DialogClose as-child>
<BaseButton @click="createClient">{{ $t('client.create') }}</BaseButton>
</DialogClose>
</template>
</BaseDialog>
</template>
<script lang="ts" setup>
const name = ref<string>('');
const expiresAt = ref<string | null>(null);
const clientsStore = useClientsStore();
const { t } = useI18n();
defineProps<{ triggerClass?: string }>();
function createClient() {
return _createClient({ name: name.value, expiresAt: expiresAt.value });
}
const _createClient = useSubmit(
'/api/client',
{
method: 'post',
},
{
revert: () => clientsStore.refresh(),
successMsg: t('client.created'),
}
);
</script>
@@ -0,0 +1,26 @@
<template>
<BaseDialog :trigger-class="triggerClass">
<template #trigger><slot /></template>
<template #title>{{ $t('client.deleteClient') }}</template>
<template #description>
{{ $t('client.deleteDialog1') }}
<strong>{{ clientName }}</strong
>? {{ $t('client.deleteDialog2') }}
</template>
<template #actions>
<DialogClose as-child>
<BaseButton>{{ $t('dialog.cancel') }}</BaseButton>
</DialogClose>
<DialogClose as-child>
<BaseButton @click="$emit('delete')">{{
$t('client.deleteClient')
}}</BaseButton>
</DialogClose>
</template>
</BaseDialog>
</template>
<script lang="ts" setup>
defineEmits(['delete']);
defineProps<{ triggerClass?: string; clientName: string }>();
</script>
+11
View File
@@ -0,0 +1,11 @@
<template>
<p class="m-10 text-center text-sm text-gray-400 dark:text-neutral-400">
{{ $t('client.empty') }}<br /><br />
<ClientsCreateDialog>
<BaseButton as="span">
<IconsPlus class="w-4 md:mr-2" />
<span class="text-sm">{{ $t('client.new') }}</span>
</BaseButton>
</ClientsCreateDialog>
</p>
</template>
+13
View File
@@ -0,0 +1,13 @@
<template>
<div
v-for="client in clientsStore.clients"
:key="client.id"
class="relative overflow-hidden border-b border-solid border-gray-100 last:border-b-0 dark:border-neutral-600"
>
<ClientCard :client="client" />
</div>
</template>
<script setup lang="ts">
const clientsStore = useClientsStore();
</script>
+8
View File
@@ -0,0 +1,8 @@
<template>
<ClientsCreateDialog>
<BaseButton as="span">
<IconsPlus class="w-4 md:mr-2" />
<span class="text-sm max-md:hidden">{{ $t('client.newShort') }}</span>
</BaseButton>
</ClientsCreateDialog>
</template>
@@ -0,0 +1,19 @@
<template>
<BaseDialog>
<template #trigger>
<slot />
</template>
<template #description>
<img :src="qrCode" />
</template>
<template #actions>
<DialogClose>
<BaseButton>{{ $t('dialog.cancel') }}</BaseButton>
</DialogClose>
</template>
</BaseDialog>
</template>
<script setup lang="ts">
defineProps<{ qrCode: string }>();
</script>
+20
View File
@@ -0,0 +1,20 @@
<template>
<BaseButton @click="toggleSort">
<IconsArrowDown
v-if="globalStore.sortClient === true"
class="w-4 md:mr-2"
/>
<IconsArrowUp v-else class="w-4 md:mr-2" />
<span class="text-sm max-md:hidden"> {{ $t('client.sort') }}</span>
</BaseButton>
</template>
<script setup lang="ts">
const globalStore = useGlobalStore();
const clientsStore = useClientsStore();
function toggleSort() {
globalStore.sortClient = !globalStore.sortClient;
clientsStore.refresh().catch(console.error);
}
</script>
+16
View File
@@ -0,0 +1,16 @@
<template>
<input
:value="label"
:type="type ?? 'button'"
class="col-span-2 rounded-lg border-2 border-gray-100 py-2 text-gray-500 hover:border-red-800 hover:bg-red-800 hover:text-white focus:border-red-800 focus:outline-0 focus:ring-0 dark:border-neutral-800 dark:bg-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-400"
/>
</template>
<script lang="ts" setup>
import type { InputTypeHTMLAttribute } from 'vue';
defineProps<{
label: string;
type?: InputTypeHTMLAttribute;
}>();
</script>
+58
View File
@@ -0,0 +1,58 @@
<template>
<div class="flex flex-col gap-2">
<div v-if="data?.length === 0">
{{ emptyText || $t('form.noItems') }}
</div>
<div v-for="(item, i) in data" v-else :key="i">
<div class="mt-1 flex flex-row gap-1">
<input
:value="item"
:name="name"
type="text"
class="rounded-lg border-2 border-gray-100 text-gray-500 focus:border-red-800 focus:outline-0 focus:ring-0 dark:border-neutral-800 dark:bg-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-400"
@input="update($event, i)"
/>
<BaseButton
as="input"
type="button"
class="rounded-lg"
value="-"
@click="del(i)"
/>
</div>
</div>
<div class="mt-2">
<BaseButton
as="input"
type="button"
class="rounded-lg"
:value="$t('form.add')"
@click="add"
/>
</div>
</div>
</template>
<script lang="ts" setup>
const data = defineModel<string[]>();
defineProps<{ emptyText?: string[]; name: string }>();
function update(e: Event, i: number) {
const v = (e.target as HTMLInputElement).value;
if (!data.value) {
return;
}
data.value[i] = v;
}
function add() {
data.value?.push('');
}
function del(i: number) {
if (!data.value) {
return;
}
data.value.splice(i, 1);
}
</script>
+44
View File
@@ -0,0 +1,44 @@
<template>
<div class="flex items-center">
<FormLabel :for="id">
{{ label }}
</FormLabel>
<BaseTooltip v-if="description" :text="description">
<IconsInfo class="size-4" />
</BaseTooltip>
</div>
<BaseInput
:id="id"
:model-value="formattedDate"
:name="id"
type="date"
max="9999-12-31"
@update:model-value="updateDate"
/>
</template>
<script lang="ts" setup>
defineProps<{ id: string; label: string; description?: string }>();
const data = defineModel<string | null>();
const date = ref(data);
const formattedDate = computed(() => {
return date.value ? date.value.split('T')[0] : '';
});
const updateDate = (value: unknown) => {
if (typeof value !== 'string' && value !== null) {
return;
}
const temp = value?.trim() ?? null;
if (temp === '' || temp === null) {
date.value = null;
} else {
date.value = new Date(temp).toISOString();
}
};
</script>
+5
View File
@@ -0,0 +1,5 @@
<template>
<form>
<slot />
</form>
</template>
+9
View File
@@ -0,0 +1,9 @@
<template>
<section class="grid grid-cols-1 gap-4 md:grid-cols-2">
<slot />
<Separator
decorative
class="col-span-2 h-px w-full bg-gray-100 dark:bg-neutral-600"
/>
</section>
</template>
+12
View File
@@ -0,0 +1,12 @@
<template>
<h4 class="col-span-full flex items-center py-6 text-2xl">
<slot />
<BaseTooltip v-if="description" :text="description">
<IconsInfo class="size-4" />
</BaseTooltip>
</h4>
</template>
<script lang="ts" setup>
defineProps<{ description?: string }>();
</script>
+11
View File
@@ -0,0 +1,11 @@
<template>
<RLabel :for="props.for" class="md:align-middle md:leading-10"
><slot
/></RLabel>
</template>
<script lang="ts" setup>
import { Label as RLabel } from 'radix-vue';
const props = defineProps<{ for: string }>();
</script>
@@ -0,0 +1,68 @@
<template>
<div class="flex flex-col gap-2">
<div v-if="data === null">
{{ emptyText || $t('form.nullNoItems') }}
</div>
<div v-for="(item, i) in data" v-else :key="i">
<div class="mt-1 flex flex-row gap-1">
<input
:value="item"
:name="name"
type="text"
class="rounded-lg border-2 border-gray-100 text-gray-500 focus:border-red-800 focus:outline-0 focus:ring-0 dark:border-neutral-800 dark:bg-neutral-700 dark:text-neutral-200 dark:placeholder:text-neutral-400"
@input="update($event, i)"
/>
<BaseButton
as="input"
type="button"
class="rounded-lg"
value="-"
@click="del(i)"
/>
</div>
</div>
<div class="mt-2">
<BaseButton
as="input"
type="button"
class="rounded-lg"
:value="$t('form.add')"
@click="add"
/>
</div>
</div>
</template>
<script lang="ts" setup>
const data = defineModel<string[] | null>();
defineProps<{ emptyText?: string[]; name: string }>();
function update(e: Event, i: number) {
const v = (e.target as HTMLInputElement).value;
if (!data.value) {
return;
}
data.value[i] = v;
}
function add() {
if (data.value === undefined) {
return;
}
if (data.value === null) {
data.value = [''];
} else {
data.value.push('');
}
}
function del(i: number) {
if (!data.value) {
return;
}
data.value.splice(i, 1);
if (data.value.length === 0) {
data.value = null;
}
}
</script>

Some files were not shown because too many files have changed in this diff Show More