Browse Source

preplan otp, better qrcode library

pull/1783/head
Bernd Storath 4 days ago
parent
commit
124ae68f8e
  1. 4
      src/app/components/Clients/QRCodeDialog.vue
  2. 4
      src/package.json
  3. 173
      src/pnpm-lock.yaml
  4. 1
      src/server/database/migrations/0000_short_skin.sql
  5. 9
      src/server/database/migrations/meta/0000_snapshot.json
  6. 11
      src/server/database/migrations/meta/0001_snapshot.json
  7. 4
      src/server/database/migrations/meta/_journal.json
  8. 1
      src/server/database/repositories/user/schema.ts
  9. 9
      src/server/utils/WireGuard.ts

4
src/app/components/Clients/QRCodeDialog.vue

@ -4,7 +4,9 @@
<slot />
</template>
<template #description>
<img :src="qrCode" />
<div class="bg-white">
<img :src="qrCode" />
</div>
</template>
<template #actions>
<DialogClose>

4
src/package.json

@ -39,8 +39,9 @@
"js-sha256": "^0.11.0",
"lowdb": "^7.0.1",
"nuxt": "^3.16.1",
"otpauth": "^9.4.0",
"pinia": "^3.0.1",
"qrcode": "^1.5.4",
"qr": "^0.4.0",
"radix-vue": "^1.9.17",
"semver": "^7.7.1",
"tailwindcss": "^3.4.17",
@ -53,7 +54,6 @@
"@nuxt/eslint": "1.3.0",
"@types/debug": "^4.1.12",
"@types/phc__format": "^1.0.1",
"@types/qrcode": "^1.5.5",
"@types/semver": "^7.7.0",
"drizzle-kit": "^0.30.6",
"eslint": "^9.23.0",

173
src/pnpm-lock.yaml

@ -71,12 +71,15 @@ importers:
nuxt:
specifier: ^3.16.1
version: 3.16.1(@libsql/[email protected])(@parcel/[email protected])(@types/[email protected])([email protected](@libsql/[email protected])([email protected](@libsql/[email protected])([email protected])))([email protected](@libsql/[email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])
otpauth:
specifier: ^9.4.0
version: 9.4.0
pinia:
specifier: ^3.0.1
version: 3.0.1([email protected])([email protected]([email protected]))
qrcode:
specifier: ^1.5.4
version: 1.5.4
qr:
specifier: ^0.4.0
version: 0.4.0
radix-vue:
specifier: ^1.9.17
version: 1.9.17([email protected]([email protected]))
@ -108,9 +111,6 @@ importers:
'@types/phc__format':
specifier: ^1.0.1
version: 1.0.1
'@types/qrcode':
specifier: ^1.5.5
version: 1.5.5
'@types/semver':
specifier: ^7.7.0
version: 7.7.0
@ -1026,6 +1026,10 @@ packages:
resolution: {integrity: sha512-z6okREyK8in0486a22Oro0k+YsuyEjDXJt46FpgeOgXqKJ9ElM8QPll0iuLBkpbH33ENiNbIPLd1cuClRQnhiw==}
engines: {node: '>=18.0.0'}
'@noble/[email protected]':
resolution: {integrity: sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==}
engines: {node: ^14.21.3 || >=16}
'@nodelib/[email protected]':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@ -1650,9 +1654,6 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-hoAQFKcP3voXk/ZEl3jrvS63o/HYLszq4nA2mqjytaSEHEy3j3t0gSFtPLnfKtX34k/xfath7etOoGw5ukoqXQ==}
'@types/[email protected]':
resolution: {integrity: sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==}
'@types/[email protected]':
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
@ -2135,10 +2136,6 @@ packages:
resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==}
engines: {node: '>= 6'}
[email protected]:
resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==}
@ -2184,9 +2181,6 @@ packages:
resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==}
engines: {node: '>=18'}
[email protected]:
resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==}
[email protected]:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
@ -2420,10 +2414,6 @@ packages:
supports-color:
optional: true
[email protected]:
resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==}
engines: {node: '>=0.10.0'}
[email protected]:
resolution: {integrity: sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==}
@ -2498,9 +2488,6 @@ packages:
resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==}
engines: {node: '>=0.3.1'}
[email protected]:
resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==}
[email protected]:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
@ -2921,10 +2908,6 @@ packages:
resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==}
engines: {node: '>=18'}
[email protected]:
resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
engines: {node: '>=10'}
@ -3428,7 +3411,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-S3WR8WNCJV1VXraBFUKjDA6+8LcNDJMLm+83qohm1O3YM1iVqV2+/XN3SXOxpxVjuL4g/rLrjO5kzygkPefCFQ==}
cpu: [x64, arm64, wasm32]
os: [darwin, linux, win32]
[email protected]:
@ -3450,10 +3432,6 @@ packages:
resolution: {integrity: sha512-WunYko2W1NcdfAFpuLUoucsgULmgDBRkdxHxWQ7mK0cQqwPiy8E1enjuRBrhLtZkB5iScJ1XIPdhVEFK8aOLSg==}
engines: {node: '>=14'}
[email protected]:
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
engines: {node: '>=10'}
@ -3782,6 +3760,9 @@ packages:
resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
engines: {node: '>= 0.8.0'}
[email protected]:
resolution: {integrity: sha512-fHIfzIG5RqCkK9cmV8WU+dPQr9/ebR5QOwGZn2JAr1RQF+lmAuLL2YdtdqvmBjNmgJlYk3KZ4a0XokaEhg1Jsw==}
[email protected]:
resolution: {integrity: sha512-MNT32sqiTFeSbQZP2WZIRQ/mlIpNNq4sua+/4hBG4qT5aef2iQe+1/BjezZURPlvucZeSfN1Y6b60l7OgBdyUA==}
engines: {node: '>=14.0.0'}
@ -3790,10 +3771,6 @@ packages:
resolution: {integrity: sha512-ZJnAP7VLQhqqnfku7+gssTwmbQyfbZ552Vly4O2BMHkvDwfwLlPtAIYjMq57Lcj5HLmopI0oZlk7xTSML/YsZA==}
engines: {node: '>=14.0.0'}
[email protected]:
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
engines: {node: '>=10'}
@ -3802,10 +3779,6 @@ packages:
resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
[email protected]:
resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
engines: {node: '>=10'}
@ -3814,10 +3787,6 @@ packages:
resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
[email protected]:
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
@ -3934,10 +3903,6 @@ packages:
resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==}
engines: {node: '>=4'}
[email protected]:
resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==}
engines: {node: '>=10.13.0'}
[email protected]:
resolution: {integrity: sha512-73JaFg4NwYNAufDtS5FsFu/PdM49ahJrO1i44aCRsDWju1z5wuGDaqyFUQWR6aJoK2JPDWlaYYAGFNIGTSUHSw==}
engines: {node: '>= 10.12'}
@ -4244,10 +4209,8 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==}
engines: {node: '>=10.13.0'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-Edzwf8GAVJzEIjqPuMHnjwTniwhS92daMuROspUn4ssyYDB1c+AqWSP8Sx+1MJNfBb0+ePykQYWY7PykXZAuuA==}
[email protected]:
resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==}
@ -4335,9 +4298,6 @@ packages:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
[email protected]:
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
[email protected]:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
@ -4434,9 +4394,6 @@ packages:
resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==}
engines: {node: '>= 0.8.0'}
[email protected]:
resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
[email protected]:
resolution: {integrity: sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==}
@ -5060,9 +5017,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
[email protected]:
resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==}
[email protected]:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
@ -5082,10 +5036,6 @@ packages:
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
[email protected]:
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
@ -5113,9 +5063,6 @@ packages:
resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
engines: {node: '>=12'}
[email protected]:
resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==}
[email protected]:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
@ -5136,18 +5083,10 @@ packages:
engines: {node: '>= 14'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
[email protected]:
resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
@ -5981,6 +5920,8 @@ snapshots:
'@netlify/[email protected]': {}
'@noble/[email protected]': {}
'@nodelib/[email protected]':
dependencies:
'@nodelib/fs.stat': 2.0.5
@ -6711,10 +6652,6 @@ snapshots:
dependencies:
'@types/node': 22.13.14
'@types/[email protected]':
dependencies:
'@types/node': 22.13.14
'@types/[email protected]': {}
'@types/[email protected]': {}
@ -7291,8 +7228,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
browserslist: 4.24.4
@ -7349,12 +7284,6 @@ snapshots:
is-wsl: 3.1.0
is64bit: 2.0.0
[email protected]:
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 6.2.0
[email protected]:
dependencies:
string-width: 4.2.3
@ -7554,8 +7483,6 @@ snapshots:
dependencies:
ms: 2.1.3
[email protected]: {}
[email protected]: {}
[email protected]: {}
@ -7599,8 +7526,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]:
@ -8063,11 +7988,6 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
locate-path: 5.0.0
path-exists: 4.0.0
[email protected]:
dependencies:
locate-path: 6.0.0
@ -8642,10 +8562,6 @@ snapshots:
pkg-types: 2.1.0
quansync: 0.2.10
[email protected]:
dependencies:
p-locate: 4.1.0
[email protected]:
dependencies:
p-locate: 5.0.0
@ -9124,6 +9040,10 @@ snapshots:
type-check: 0.4.0
word-wrap: 1.2.5
[email protected]:
dependencies:
'@noble/hashes': 1.7.1
[email protected]:
dependencies:
'@oxc-project/types': 0.56.5
@ -9154,10 +9074,6 @@ snapshots:
'@oxc-parser/binding-win32-arm64-msvc': 0.61.2
'@oxc-parser/binding-win32-x64-msvc': 0.61.2
[email protected]:
dependencies:
p-try: 2.2.0
[email protected]:
dependencies:
yocto-queue: 0.1.0
@ -9166,10 +9082,6 @@ snapshots:
dependencies:
yocto-queue: 1.2.1
[email protected]:
dependencies:
p-limit: 2.3.0
[email protected]:
dependencies:
p-limit: 3.1.0
@ -9178,8 +9090,6 @@ snapshots:
dependencies:
p-limit: 4.0.0
[email protected]: {}
[email protected]: {}
[email protected]:
@ -9274,8 +9184,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
async: 3.2.6
@ -9506,11 +9414,7 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
dijkstrajs: 1.0.3
pngjs: 5.0.0
yargs: 15.4.1
[email protected]: {}
[email protected]: {}
@ -9621,8 +9525,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
@ -9746,8 +9648,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
[email protected]: {}
[email protected]: {}
[email protected]: {}
@ -10379,8 +10279,6 @@ snapshots:
tr46: 0.0.3
webidl-conversions: 3.0.1
[email protected]: {}
[email protected]:
dependencies:
isexe: 2.0.0
@ -10395,12 +10293,6 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1
[email protected]:
dependencies:
ansi-styles: 4.3.0
@ -10419,8 +10311,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
@ -10434,27 +10324,8 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
camelcase: 5.3.1
decamelize: 1.2.0
[email protected]: {}
[email protected]:
dependencies:
cliui: 6.0.0
decamelize: 1.2.0
find-up: 4.1.0
get-caller-file: 2.0.5
require-directory: 2.1.1
require-main-filename: 2.0.0
set-blocking: 2.0.0
string-width: 4.2.3
which-module: 2.0.1
y18n: 4.0.3
yargs-parser: 18.1.3
[email protected]:
dependencies:
cliui: 8.0.1

1
src/server/database/migrations/0000_short_skin.sql

@ -80,6 +80,7 @@ CREATE TABLE `users_table` (
`email` text,
`name` text NOT NULL,
`role` integer NOT NULL,
`totp` text,
`enabled` integer NOT NULL,
`created_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
`updated_at` text DEFAULT (CURRENT_TIMESTAMP) NOT NULL

9
src/server/database/migrations/meta/0000_snapshot.json

@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
"id": "8c2af02b-c4bd-4880-a9ad-b38805636208",
"id": "cd2794c5-3e55-4b55-b2ba-678f53cfdec7",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"clients_table": {
@ -558,6 +558,13 @@
"notNull": true,
"autoincrement": false
},
"totp": {
"name": "totp",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"enabled": {
"name": "enabled",
"type": "integer",

11
src/server/database/migrations/meta/0001_snapshot.json

@ -1,6 +1,6 @@
{
"id": "a61263b1-9af1-4d2e-99e9-80d08127b545",
"prevId": "8c2af02b-c4bd-4880-a9ad-b38805636208",
"id": "8d03a104-4de0-4efe-9348-962fac317055",
"prevId": "cd2794c5-3e55-4b55-b2ba-678f53cfdec7",
"version": "6",
"dialect": "sqlite",
"tables": {
@ -558,6 +558,13 @@
"notNull": true,
"autoincrement": false
},
"totp": {
"name": "totp",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"enabled": {
"name": "enabled",
"type": "integer",

4
src/server/database/migrations/meta/_journal.json

@ -5,14 +5,14 @@
{
"idx": 0,
"version": "6",
"when": 1741355094140,
"when": 1743422046226,
"tag": "0000_short_skin",
"breakpoints": true
},
{
"idx": 1,
"version": "6",
"when": 1741355098159,
"when": 1743422053327,
"tag": "0001_classy_the_stranger",
"breakpoints": true
}

1
src/server/database/repositories/user/schema.ts

@ -10,6 +10,7 @@ export const user = sqliteTable('users_table', {
email: text(),
name: text().notNull(),
role: int().$type<Role>().notNull(),
totp: text(),
enabled: int({ mode: 'boolean' }).notNull(),
createdAt: text('created_at')
.notNull()

9
src/server/utils/WireGuard.ts

@ -1,6 +1,6 @@
import fs from 'node:fs/promises';
import debug from 'debug';
import QRCode from 'qrcode';
import { encodeQR } from 'qr';
import type { InterfaceType } from '#db/repositories/interface/types';
const WG_DEBUG = debug('WireGuard');
@ -128,9 +128,10 @@ class WireGuard {
async getClientQRCodeSVG({ clientId }: { clientId: ID }) {
const config = await this.getClientConfiguration({ clientId });
return QRCode.toString(config, {
type: 'svg',
width: 512,
return encodeQR(config, 'svg', {
ecc: 'high',
scale: 4,
encoding: 'byte',
});
}

Loading…
Cancel
Save