Compare commits

...

113 Commits

Author SHA1 Message Date
seriousm4x 8f5528584d gh-action: replace $ with quotes for private_key 2023-10-03 19:51:32 +02:00
seriousm4x b6029e1759 Revert "gh-action: replace $ with quotes for env vars"
This reverts commit 2457a6036b.
2023-10-03 19:50:36 +02:00
seriousm4x 2457a6036b gh-action: replace $ with quotes for env vars 2023-10-03 19:47:49 +02:00
seriousm4x 2639d61777 Revert "gh-action: use filepath for private_key"
This reverts commit 909702c668.
2023-10-03 19:45:25 +02:00
seriousm4x 909702c668 gh-action: use filepath for private_key 2023-10-03 19:40:00 +02:00
seriousm4x ef32a485d4 gh-action: fix env AUR_KEY 2023-10-03 17:06:21 +02:00
seriousm4x e8e64dff05 gh-action: only test if backend files changed 2023-10-03 16:45:46 +02:00
seriousm4x b32d569ee1 gh-action: auto-choose runner 2023-10-03 16:41:53 +02:00
seriousm4x 02367b5936 gh-action: add needs check-runner 2023-10-03 16:29:15 +02:00
seriousm4x 7be53745d5 gh-action: add quotes 2023-10-03 16:20:35 +02:00
seriousm4x b430d37cd1 gh-action: test auto-choose runner 2023-10-03 16:03:22 +02:00
seriousm4x 8316eae637 feat: add arch aur package 2023-10-03 15:35:47 +02:00
seriousm4x ef08c05adc go mod tidy 2023-10-03 15:31:09 +02:00
seriousm4x c593c98b33 goreleaser ignore beta tags
https://github.com/orgs/goreleaser/discussions/4336#discussioncomment-7160162
2023-10-03 13:45:53 +02:00
seriousm4x 166140173d update deps 2023-10-03 13:44:59 +02:00
seriousm4x b34c9e9463 goreleaser git ignore beta tags 2023-10-03 13:15:11 +02:00
seriousm4x 297574c189 readme: add i18n support 2023-10-03 13:14:03 +02:00
seriousm4x f2bd222009 import correct base locales 2023-10-03 12:45:42 +02:00
dependabot[bot] b065fc308f npm-dep: bump @typescript-eslint/eslint-plugin in /frontend
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.7.3 to 6.7.4.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.4/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 10:15:32 +00:00
dependabot[bot] 26a2ae7f7e npm-dep: bump @typescript-eslint/parser from 6.7.3 to 6.7.4 in /frontend
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.7.3 to 6.7.4.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.4/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 10:14:07 +00:00
seriousm4x ee1403a7b6 inherit lang variations from base language 2023-10-03 12:12:39 +02:00
seriousm4x 3590f6618d feat: i18n add portuguese
Added pt-PT language
2023-10-03 11:46:26 +02:00
seriousm4x c79dc2342e add date-fns import for pt 2023-10-03 11:43:48 +02:00
dependabot[bot] 11c4410786 npm-dep: bump daisyui from 3.8.2 to 3.8.3 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.8.2 to 3.8.3.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.8.2...v3.8.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 09:28:49 +00:00
seriousm4x 6dc6f6f2ea revert changelog structure 2023-10-02 21:51:07 +02:00
seriousm4x fe63b4d439 Update Crowdin configuration file 2023-10-02 21:49:34 +02:00
seriousm4x 2a72aa94da Update Crowdin configuration file 2023-10-02 21:48:12 +02:00
MadTiago 32914fa871 Replaced double to single quote 2023-10-02 04:28:43 +01:00
MadTiago e2ba2b45e6 Added pt-PT language 2023-10-02 04:22:13 +01:00
seriousm4x cf55c4ab2e format 2023-10-02 01:21:43 +02:00
seriousm4x f521e6dff8 add typescript type to var 2023-10-02 01:21:19 +02:00
seriousm4x 406f3cc28d feat: change location of DefaultDataDir 2023-10-02 01:20:46 +02:00
seriousm4x 6b91d15c58 fix: improve input width on small screens 2023-10-01 22:33:02 +02:00
seriousm4x d44bea5076 fix: width of group add btn on small screens 2023-10-01 22:20:06 +02:00
seriousm4x 372c054cb4 fix: spelling 2023-10-01 22:19:16 +02:00
seriousm4x d1e6b8a60c update deps 2023-10-01 21:04:24 +02:00
seriousm4x 8e86f3cf3a some i18n clean ups 2023-10-01 21:02:17 +02:00
seriousm4x d544899bde feat: i18n add missing toast #71 2023-10-01 20:25:07 +02:00
seriousm4x a1cba014e0 feat: i18n completed #71 2023-10-01 20:19:52 +02:00
seriousm4x 7168ca283f fix: make sure $settingsPub is not undefined #242 2023-10-01 13:31:03 +02:00
seriousm4x 7d2b3a7a4c feat: i18n add rest of routes #71 2023-10-01 13:04:27 +02:00
seriousm4x db6990fd5f feat: i18n home page #71 2023-09-30 03:43:41 +02:00
seriousm4x 1fbb60f14e cleanup: auto organize ts imports 2023-09-30 03:25:58 +02:00
seriousm4x 3c6c1091b1 changelog: show 'others' above depndencies 2023-09-30 03:20:33 +02:00
seriousm4x 003c202a15 feat: initial i18n support #71 2023-09-30 03:17:16 +02:00
dependabot[bot] 31dbf4d660 npm-dep: bump postcss from 8.4.30 to 8.4.31 in /frontend
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.30 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.30...8.4.31)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-29 10:03:57 +00:00
dependabot[bot] c02b912021 npm-dep: bump @typescript-eslint/eslint-plugin in /frontend
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.7.2 to 6.7.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.3/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-28 09:16:07 +00:00
dependabot[bot] 6afd6c52d4 npm-dep: bump daisyui from 3.8.0 to 3.8.1 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.8.0 to 3.8.1.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.8.0...v3.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-28 09:15:13 +00:00
dependabot[bot] ee15619905 npm-dep: bump daisyui from 3.7.7 to 3.8.0 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.7.7 to 3.8.0.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.7.7...v3.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 09:54:18 +00:00
dependabot[bot] 553bc7ebc5 npm-dep: bump @typescript-eslint/parser from 6.7.2 to 6.7.3 in /frontend
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.7.2 to 6.7.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.3/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-26 09:54:12 +00:00
dependabot[bot] 72772fd4ef go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.18.6 to 0.18.8.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.18.6...v0.18.8)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 09:53:51 +00:00
dependabot[bot] 4c0dab6193 npm-dep: bump @sveltejs/kit from 1.25.0 to 1.25.1 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 1.25.0 to 1.25.1.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@1.25.1/packages/kit)

---
updated-dependencies:
- dependency-name: "@sveltejs/kit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 09:41:45 +00:00
dependabot[bot] a36716a059 npm-dep: bump eslint from 8.49.0 to 8.50.0 in /frontend
Bumps [eslint](https://github.com/eslint/eslint) from 8.49.0 to 8.50.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/v8.49.0...v8.50.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 09:41:20 +00:00
dependabot[bot] b73eae6083 npm-dep: bump autoprefixer from 10.4.15 to 10.4.16 in /frontend
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.15 to 10.4.16.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.15...10.4.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 09:45:12 +00:00
dependabot[bot] 543b45e29d npm-dep: bump eslint-plugin-svelte from 2.33.1 to 2.33.2 in /frontend
Bumps [eslint-plugin-svelte](https://github.com/sveltejs/eslint-plugin-svelte) from 2.33.1 to 2.33.2.
- [Release notes](https://github.com/sveltejs/eslint-plugin-svelte/releases)
- [Changelog](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/eslint-plugin-svelte/compare/v2.33.1...v2.33.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-svelte
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 09:44:51 +00:00
dependabot[bot] 4e12a33c58 npm-dep: bump svelte-check from 3.5.1 to 3.5.2 in /frontend
Bumps [svelte-check](https://github.com/sveltejs/language-tools) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/sveltejs/language-tools/releases)
- [Commits](https://github.com/sveltejs/language-tools/compare/svelte-check-3.5.1...svelte-check-3.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 09:44:23 +00:00
dependabot[bot] 875111ad98 npm-dep: bump daisyui from 3.7.6 to 3.7.7 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.7.6 to 3.7.7.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.7.6...v3.7.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 09:43:00 +00:00
dependabot[bot] 0da90709a5 npm-dep: bump daisyui from 3.7.5 to 3.7.6 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.7.5 to 3.7.6.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.7.5...v3.7.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-20 10:00:07 +00:00
dependabot[bot] 57a8a88046 npm-dep: bump svelte from 4.2.0 to 4.2.1 in /frontend
Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@4.2.1/packages/svelte)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-20 09:59:38 +00:00
dependabot[bot] 39ec66c535 npm-dep: bump postcss from 8.4.29 to 8.4.30 in /frontend
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.30.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.30)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-19 09:55:48 +00:00
seriousm4x 1f6e3c146b fix link 2023-09-19 02:38:04 +02:00
seriousm4x 48780038f2 change to heading 2023-09-19 02:27:38 +02:00
seriousm4x b4bd8c7ec3 make root/non-root more clear 2023-09-19 02:14:27 +02:00
seriousm4x 8f84afaacc remove ping test 2023-09-19 01:35:13 +02:00
seriousm4x 5250d4a743 go test -exec sudo 2023-09-19 01:31:57 +02:00
seriousm4x 45067e549f run test as sudo? 2023-09-19 01:30:11 +02:00
seriousm4x b67933a651 feat: re-add non-root docker user #207 2023-09-19 01:25:40 +02:00
seriousm4x ec01f351b9 go-dep: update all 2023-09-18 23:26:46 +02:00
seriousm4x 952741e40d npm-dep: update all 2023-09-18 23:25:53 +02:00
seriousm4x 6c80ebaf80 rename workflow 2023-09-18 23:24:46 +02:00
seriousm4x e3ab652483 feat: add some go unit tests 2023-09-18 23:24:14 +02:00
dependabot[bot] fcf25c9945 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.18.5 to 0.18.6.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.18.5...v0.18.6)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 09:43:53 +00:00
dependabot[bot] 6465711c4c npm-dep: bump daisyui from 3.7.4 to 3.7.5 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.7.4 to 3.7.5.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.7.4...v3.7.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 09:37:06 +00:00
seriousm4x 9f5e253867 gh-action: bump all actions 2023-09-14 13:35:41 +02:00
dependabot[bot] 46385452f8 npm-dep: bump daisyui from 3.7.3 to 3.7.4 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.7.3 to 3.7.4.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.7.3...v3.7.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-14 09:25:16 +00:00
dependabot[bot] 7780383b1b npm-dep: bump @typescript-eslint/parser from 6.6.0 to 6.7.0 in /frontend
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.0/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:50:37 +00:00
dependabot[bot] 125c866417 npm-dep: bump @sveltejs/kit from 1.24.1 to 1.25.0 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 1.24.1 to 1.25.0.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@1.25.0/packages/kit)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:49:23 +00:00
dependabot[bot] 3d19ac7f21 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.18.4 to 0.18.5.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.18.4...v0.18.5)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 09:40:58 +00:00
dependabot[bot] b5b994a496 gh-action: bump docker/build-push-action from 4 to 5
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
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>
2023-09-12 09:21:47 +00:00
dependabot[bot] eb5e073899 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.18.3 to 0.18.4.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.18.3...v0.18.4)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 09:20:58 +00:00
dependabot[bot] c1c464e1dc npm-dep: bump @typescript-eslint/eslint-plugin in /frontend
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.7.0/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-12 09:13:30 +00:00
seriousm4x 8299f22dfd fix: temp revert of #207 2023-09-11 00:52:28 +02:00
Maxi Quoß cce6823f25 feat: optional non-root docker user #207 2023-09-10 22:45:56 +02:00
seriousm4x f5f9378dd6 bump go build version to >= 1.21.1 2023-09-10 10:44:18 +02:00
seriousm4x 21d2025c8d npm-dep: update eslint, eslint-plugin-svelte 2023-09-10 10:43:20 +02:00
seriousm4x 44b5194214 go-dep: update pocketbase 0.18.3 2023-09-10 10:41:41 +02:00
dependabot[bot] e3cf66945e npm-dep: bump daisyui from 3.6.6 to 3.7.3 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.6.6 to 3.7.3.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.6.6...v3.7.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 09:39:06 +00:00
dependabot[bot] 630a77bba9 npm-dep: bump @typescript-eslint/eslint-plugin in /frontend
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.6.0/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:33:36 +00:00
dependabot[bot] 6e8bb4a48c npm-dep: bump @sveltejs/kit from 1.24.0 to 1.24.1 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 1.24.0 to 1.24.1.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@1.24.1/packages/kit)

---
updated-dependencies:
- dependency-name: "@sveltejs/kit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:30:35 +00:00
dependabot[bot] c1bbdcb9c3 npm-dep: bump pocketbase from 0.17.3 to 0.18.0 in /frontend
Bumps [pocketbase](https://github.com/pocketbase/js-sdk) from 0.17.3 to 0.18.0.
- [Release notes](https://github.com/pocketbase/js-sdk/releases)
- [Changelog](https://github.com/pocketbase/js-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/js-sdk/compare/v0.17.3...v0.18.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:29:32 +00:00
dependabot[bot] b4ea1af7e9 npm-dep: bump @typescript-eslint/parser from 6.5.0 to 6.6.0 in /frontend
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.6.0/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:29:13 +00:00
dependabot[bot] 32e02a7ff1 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.18.0 to 0.18.1.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.18.0...v0.18.1)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:28:54 +00:00
dependabot[bot] 9962bae913 npm-dep: bump daisyui from 3.6.5 to 3.6.6 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.6.5 to 3.6.6.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.6.5...v3.6.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 09:27:59 +00:00
dependabot[bot] 253b368622 npm-dep: bump daisyui from 3.6.4 to 3.6.5 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui) from 3.6.4 to 3.6.5.
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/compare/v3.6.4...v3.6.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 10:04:15 +00:00
dependabot[bot] a3ee9ec884 gh-action: bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 09:58:24 +00:00
dependabot[bot] ad8f53051a go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.17.7 to 0.18.0.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.17.7...v0.18.0)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 09:38:38 +00:00
seriousm4x 3a294726a8 feat: use native pocketbase isAdmin helper 2023-09-02 21:24:13 +02:00
seriousm4x b8a990f078 npm-dep: pnpm update 2023-09-02 21:07:23 +02:00
seriousm4x 085936a018 add workflow_dispatch 2023-09-02 20:50:34 +02:00
seriousm4x 488619f9fe Auto merge minor patches 2023-09-02 16:28:23 +02:00
dependabot[bot] b45a0dca3c npm-dep: bump svelte-check from 3.5.0 to 3.5.1 in /frontend
Bumps [svelte-check](https://github.com/sveltejs/language-tools) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/sveltejs/language-tools/releases)
- [Commits](https://github.com/sveltejs/language-tools/compare/svelte-check-3.5.0...svelte-check-3.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 09:29:58 +00:00
dependabot[bot] 5ed24e8e40 npm-dep: bump prettier from 3.0.2 to 3.0.3 in /frontend
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.2...3.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 09:27:20 +00:00
dependabot[bot] 811d91b6f4 npm-dep: bump postcss from 8.4.28 to 8.4.29 in /frontend
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.28 to 8.4.29.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.28...8.4.29)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 09:26:20 +00:00
dependabot[bot] fc95133c6b go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.17.6 to 0.17.7.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.17.6...v0.17.7)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 09:35:23 +00:00
dependabot[bot] 8514ea379f go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.17.5 to 0.17.6.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.17.5...v0.17.6)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 09:41:37 +00:00
dependabot[bot] 8102da5a7e npm-dep: bump @typescript-eslint/eslint-plugin in /frontend
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.4.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 09:40:44 +00:00
Maxi Quoß 5e6d7761aa run codeberg sync on tag push 2023-08-22 00:52:26 +02:00
Maxi Quoß 60837d2dd7 fix: remove btn margin 2023-08-21 20:21:06 +02:00
Maxi Quoß 59f1bf3f9c fix: re-add forgotten oidc login #103 2023-08-21 20:17:54 +02:00
Maxi Quoß 448dcbd16c fix: put more buttons into array 2023-08-21 17:35:16 +02:00
dependabot[bot] 88d8a4b952 npm-dep: bump tslib from 2.6.1 to 2.6.2 in /frontend
Bumps [tslib](https://github.com/Microsoft/tslib) from 2.6.1 to 2.6.2.
- [Release notes](https://github.com/Microsoft/tslib/releases)
- [Commits](https://github.com/Microsoft/tslib/compare/v2.6.1...v2.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 09:44:39 +00:00
seriousm4x d7b4ef75de remove tailing dots on toast messages 2023-08-19 00:23:07 +02:00
seriousm4x 84deb379e7 fix: break device name line on small screens 2023-08-19 00:17:37 +02:00
49 changed files with 4716 additions and 877 deletions
+2
View File
@@ -2,6 +2,8 @@
.gitignore
.dockerignore
Dockerfile
Dockerfile.dev
data
README.md
frontend/.svelte-kit
+4 -2
View File
@@ -1,14 +1,16 @@
# Sync repo to the Codeberg mirror
name: Mirror Sync
name: codeberg mirror
on:
push:
branches: ["master"]
tags:
- "*"
workflow_dispatch:
jobs:
codeberg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
+5 -3
View File
@@ -1,5 +1,7 @@
name: Dependabot auto-merge
on: pull_request
name: dependabot automerge
on:
pull_request:
workflow_dispatch:
permissions:
contents: write
@@ -16,7 +18,7 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} || ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
+36
View File
@@ -0,0 +1,36 @@
name: go test
on:
push:
paths: backend/**
jobs:
check-runner:
runs-on: ubuntu-latest
outputs:
runner-label: ${{ steps.set-runner.outputs.runner-label }}
steps:
- name: Set runner
id: set-runner
run: |
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
available=$(echo "$runners" | jq '.runners[] | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
if [ -n "$available" ]; then
echo "runner-label=self-hosted" >> "$GITHUB_OUTPUT"
else
echo "runner-label=ubuntu-latest" >> "$GITHUB_OUTPUT"
fi
build:
needs: check-runner
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ">=1.21"
- name: Test
run: |
cd backend
go test -exec sudo -v ./...
+32 -12
View File
@@ -7,12 +7,29 @@ on:
workflow_dispatch:
jobs:
goreleaser:
check-runner:
runs-on: ubuntu-latest
outputs:
runner-label: ${{ steps.set-runner.outputs.runner-label }}
steps:
- name: Set runner
id: set-runner
run: |
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
available=$(echo "$runners" | jq '.runners[] | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
if [ -n "$available" ]; then
echo "runner-label=self-hosted" >> "$GITHUB_OUTPUT"
else
echo "runner-label=ubuntu-latest" >> "$GITHUB_OUTPUT"
fi
goreleaser:
needs: check-runner
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
# pull code
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -34,11 +51,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ">=1.20"
go-version: ">=1.21.1"
# build
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
@@ -46,19 +63,22 @@ jobs:
workdir: backend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
docker:
needs: goreleaser
runs-on: ubuntu-latest
needs:
- goreleaser
- check-runner
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
# pull code
- name: Check Out Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
# image tags
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/seriousm4x/UpSnap
@@ -70,16 +90,16 @@ jobs:
# qemu
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
# docker buildx
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
# ghcr.io login
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -88,7 +108,7 @@ jobs:
# build and push
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
+1
View File
@@ -193,6 +193,7 @@ package
# End of https://www.toptal.com/developers/gitignore/api/go,visualstudiocode,svelte,node
build
data
backend/pb_data
backend/pb_public/*
+4 -1
View File
@@ -8,7 +8,10 @@ WORKDIR /app
RUN wget https://github.com/seriousm4x/UpSnap/releases/download/${VERSION}/UpSnap_${VERSION}_${BUILDX_ARCH}.zip &&\
unzip UpSnap_${VERSION}_${BUILDX_ARCH}.zip &&\
rm -f UpSnap_${VERSION}_${BUILDX_ARCH}.zip &&\
chmod +x upsnap
chmod +x upsnap &&\
apk update &&\
apk add --no-cache libcap &&\
setcap 'cap_net_raw=+ep' ./upsnap
FROM alpine:3
RUN apk update &&\
+27
View File
@@ -0,0 +1,27 @@
FROM node:alpine as node
WORKDIR /app
COPY frontend/ .
RUN npm i -g pnpm &&\
pnpm i &&\
pnpm run build
FROM golang:alpine as go
WORKDIR /app
COPY backend/ .
COPY --from=node /app/build ./pb_public
ENV CGO_ENABLED=0
RUN go build -o upsnap main.go &&\
chmod +x upsnap &&\
apk update &&\
apk add --no-cache libcap &&\
setcap 'cap_net_raw=+ep' ./upsnap
FROM alpine:3
RUN apk update &&\
apk add --no-cache tzdata ca-certificates nmap samba samba-common-tools openssh sshpass curl &&\
rm -rf /var/cache/apk/*
WORKDIR /app
COPY --from=go /app/upsnap upsnap
HEALTHCHECK --interval=10s \
CMD curl -fs "http://localhost:8090/api/health" || exit 1
ENTRYPOINT ["./upsnap", "serve", "--http=0.0.0.0:8090"]
+30 -5
View File
@@ -20,6 +20,7 @@
- 🔌 Ping Any Port You Choose
- 🔍 Discover Devices with Network Scanning (nmap required)
- 👤 Secured User Management
- 🌐 i18n support for [these](https://github.com/seriousm4x/UpSnap/tree/master/frontend/src/lib/i18n) languages
- 🎨 29 Themes
- 🐳 [Docker images](https://github.com/seriousm4x/UpSnap/pkgs/container/upsnap) for amd64, arm64, arm/v7, arm/v6
- 🏠 Self-Hostable, No Cloud Bullshit!
@@ -37,7 +38,20 @@
## 🚀 Run the binary
Just download the latest binary from the [release page](https://github.com/seriousm4x/UpSnap/releases) and run it `./upsnap serve --http=0.0.0.0:8090`.
Just download the latest binary from the [release page](https://github.com/seriousm4x/UpSnap/releases) and run it.
### Root:
```bash
sudo ./upsnap serve --http=0.0.0.0:8090
```
### Non-root:
```bash
sudo setcap cap_net_raw=+ep ./upsnap # only once after downloading
./upsnap serve --http=0.0.0.0:8090
```
For more options check `./upsnap --help` or visit [PocketBase documentation](https://pocketbase.io/docs).
@@ -47,16 +61,27 @@ If you want to use network discovery, make sure to have `nmap` installed and run
You can use the [docker-compose](docker-compose.yml) example. See the comments in the file for customization.
If you want to change the port, change the following (5000 in this case):
### Non-root docker user:
Create the mount point first:
```bash
mkdir data
```
Then add `user: 1000:1000` to the docker-compose file (or whatever your $UID:$GID is).
### Change port
If you want to change the port from 8090 to something else, change the following (5000 in this case):
```yml
entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000"
healthcheck:
test: curl -fs "http://localhost:5000/api/health" || exit 1
interval: 10s
```
And if you need additional packages inside the container, do this:
### Install additional packages for shutdown cmd
```yml
entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090"
@@ -76,7 +101,7 @@ upsnap.example.com {
## 🔒 User permissions
UpSnap offers unique access for each user, per device. While admins have all permissions, they can assign specific rights to users such as displaying/hiding a device, accessing device editing, deleting and powering devices on/off.
UpSnap offers unique access for each user, per device. While admins have all permissions, they can assign specific rights to users such as displaying/hiding a device, accessing device editing, deleting and powering devices on/off. See the last screenshot in the [📸 Screenshots section](#-screenshots).
## 🌍 Exposing to the open web
Regular → Executable
+29 -4
View File
@@ -44,12 +44,37 @@ changelog:
order: 1
- title: "Go dependencies"
regexp: '^.*?go-dep(\([[:word:]]+\))??!?:.+$'
order: 2
order: 3
- title: "Npm dependencies"
regexp: '^.*?npm-dep(\([[:word:]]+\))??!?:.+$'
order: 3
order: 4
- title: "Github Actions"
regexp: '^.*?gh-action(\([[:word:]]+\))??!?:.+$'
order: 4
order: 5
- title: Others
order: 999
order: 2
git:
ignore_tags:
- "{{ if not .Prerelease}}beta{{ end }}"
aurs:
- name: upsnap-bin
homepage: https://github.com/seriousm4x/UpSnap
description: "A simple wake on lan web app written with SvelteKit, Go and PocketBase."
maintainers:
- "SeriousM4x <maxi at quoss dot org>"
license: "MIT"
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://aur@aur.archlinux.org/upsnap-bin.git"
package: |-
# bin
install -Dm755 "./upsnap" "${pkgdir}/usr/bin/upsnap"
sudo setcap cap_net_raw=+ep "${pkgdir}/usr/bin/upsnap"
skip_upload: auto
depends:
- sudo
- libcap
optdepends:
- "nmap: to scan for network devices"
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
+43 -41
View File
@@ -1,12 +1,14 @@
module github.com/seriousm4x/upsnap
go 1.19
go 1.21
toolchain go1.21.1
require (
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a
github.com/pocketbase/dbx v1.10.1
github.com/pocketbase/pocketbase v0.17.5
github.com/pocketbase/pocketbase v0.18.9
github.com/prometheus-community/pro-bing v0.3.0
github.com/robfig/cron/v3 v3.0.1
)
@@ -14,26 +16,26 @@ require (
require (
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go v1.44.318 // indirect
github.com/aws/aws-sdk-go-v2 v1.20.1 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.33 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.32 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.77 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.13.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.21.2 // indirect
github.com/aws/smithy-go v1.14.1 // indirect
github.com/aws/aws-sdk-go v1.45.20 // indirect
github.com/aws/aws-sdk-go-v2 v1.21.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.43 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.41 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.88 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.14 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.15.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.23.0 // indirect
github.com/aws/smithy-go v1.14.2 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/domodwyer/mailyak/v3 v3.6.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
@@ -44,7 +46,7 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/wire v0.5.0 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -56,7 +58,7 @@ require (
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect
github.com/mdlayher/packet v1.1.2 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/mdlayher/socket v0.5.0 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/cast v1.5.1 // indirect
@@ -65,32 +67,32 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
go.opencensus.io v0.24.0 // indirect
gocloud.dev v0.32.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/image v0.11.0 // indirect
gocloud.dev v0.34.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/image v0.12.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.135.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/api v0.143.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
lukechampine.com/uint128 v1.3.0 // indirect
modernc.org/cc/v3 v3.41.0 // indirect
modernc.org/ccgo/v3 v3.16.14 // indirect
modernc.org/ccgo/v3 v3.16.15 // indirect
modernc.org/libc v1.24.1 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/sqlite v1.25.0 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/sqlite v1.26.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
)
+113 -87
View File
@@ -1,9 +1,14 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q=
cloud.google.com/go/compute v1.22.0 h1:cB8R6FtUtT1TYGl5R3xuxnW6OUIc/DrT2aiR16TTG7Y=
cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o=
cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY=
cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y=
cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU=
cloud.google.com/go/storage v1.31.0 h1:+S3LjjEN2zZ+L5hOwj4+1OkGCsLVe0NzpXKQ1pSdTCI=
cloud.google.com/go/storage v1.31.0/go.mod h1:81ams1PrhW16L4kF7qg+4mTq7SRs5HsbDTM0bWvrwJ0=
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -12,46 +17,46 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDe
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.44.318 h1:Yl66rpbQHFUbxe9JBKLcvOvRivhVgP6+zH0b9KzARX8=
github.com/aws/aws-sdk-go v1.44.318/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.20.1 h1:rZBf5DWr7YGrnlTK4kgDQGn1ltqOg5orCYb/UhOFZkg=
github.com/aws/aws-sdk-go-v2 v1.20.1/go.mod h1:NU06lETsFm8fUC6ZjhgDpVBcGZTFQ6XM+LZWZxMI4ac=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12 h1:lN6L3LrYHeZ6xCxaIYtoWCx4GMLk4nRknsh29OMSqHY=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.12/go.mod h1:TDCkEAkMTXxTs0oLBGBKpBZbk3NLh8EvAfF0Q3x8/0c=
github.com/aws/aws-sdk-go-v2/config v1.18.33 h1:JKcw5SFxFW/rpM4mOPjv0VQ11E2kxW13F3exWOy7VZU=
github.com/aws/aws-sdk-go-v2/config v1.18.33/go.mod h1:hXO/l9pgY3K5oZJldamP0pbZHdPqqk+4/maa7DSD3cA=
github.com/aws/aws-sdk-go-v2/credentials v1.13.32 h1:lIH1eKPcCY1ylR4B6PkBGRWMHO3aVenOKJHWiS4/G2w=
github.com/aws/aws-sdk-go-v2/credentials v1.13.32/go.mod h1:lL8U3v/Y79YRG69WlAho0OHIKUXCyFvSXaIvfo81sls=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8 h1:DK/9C+UN/X+1+Wm8pqaDksQr2tSLzq+8X1/rI/ZxKEQ=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8/go.mod h1:ce7BgLQfYr5hQFdy67oX2svto3ufGtm6oBvmsHScI1Q=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.77 h1:oWSNL9oQy+do911sXpJyIc2J7RiUrbm9BecyaGy1wHo=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.77/go.mod h1:xvOdc97VpScJqB10YAI8r/cKuU7d9Ls/as03KROO2qY=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 h1:c8ed/T9T2K5I+h/JzmF5tpI46+OODQ74dzmdo+QnaMg=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38/go.mod h1:qggunOChCMu9ZF/UkAfhTz25+U2rLVb3ya0Ua6TTfCA=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 h1:hNeAAymUY5gu11WrrmFb3CVIp9Dar9hbo44yzzcQpzA=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32/go.mod h1:0ZXSqrty4FtQ7p8TEuRde/SZm9X05KT18LAUlR40Ln0=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 h1:fc0ukRAiP1syoSGZYu+DaE+FulSYhTiJ8WpVu5jElU4=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39/go.mod h1:WLAW8PT7+JhjZfLSWe7WEJaJu0GNo0cKc2Zyo003RBs=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1 h1:vUh7dBFNS3oFCtVv6CiYKh5hP9ls8+kIpKLeFruIBLk=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.1/go.mod h1:sFMeinkhj/SZKQM8BxtvNtSPjJEo0Xrz+w3g2e4FSKI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13 h1:iV/W5OMBys+66OeXJi/7xIRrKZNsu0ylsLGu+6nbmQE=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.13/go.mod h1:ReJb6xYmtGyu9KoFtRreWegbN9dZqvZIIv4vWnhcsyI=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33 h1:QviNkc+vGSuEHx8P+pVNKOdWLXBPIwMFv7p0fphgE4U=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.33/go.mod h1:fABTUmOrAgAalG2i9WJpjBvlnk7UK8YmnYaxN+Q2CwE=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 h1:dGAseBFEYxth10V23b5e2mAS+tX7oVbfYHD6dnDdAsg=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32/go.mod h1:4jwAWKEkCR0anWk5+1RbfSg1R5Gzld7NLiuaq5bTR/Y=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1 h1:PT6PBCycRwhpEW5hJnRiceCeoWJ+r3bdgXtV+VKG7Pk=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.1/go.mod h1:TqoxCLwT2nrxrBGA+z7t6OWM7LBkgRckK3gOjYE+7JA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2 h1:v346f1h8sUBKXnEbrv43L37MTBlFHyKXQPIZHNAaghA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.38.2/go.mod h1:cwCATiyNrXK9P2FsWdZ89g9mpsYv2rhk0UA/KByl5fY=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.2 h1:A2RlEMo4SJSwbNoUUgkxTAEMduAy/8wG3eB2b2lP4gY=
github.com/aws/aws-sdk-go-v2/service/sso v1.13.2/go.mod h1:ju+nNXUunfIFamXUIZQiICjnO/TPlOmWcYhZcSy7xaE=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2 h1:OJELEgyaT2kmaBGZ+myyZbTTLobfe3ox3FSh5eYK9Qs=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2/go.mod h1:ubDBBaDFs1GHijSOTi8ljppML15GLG0HxhILtbjNNYQ=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.2 h1:ympg1+Lnq33XLhcK/xTG4yZHPs1Oyxu+6DEWbl7qOzA=
github.com/aws/aws-sdk-go-v2/service/sts v1.21.2/go.mod h1:FQ/DQcOfESELfJi5ED+IPPAjI5xC6nxtSolVVB773jM=
github.com/aws/smithy-go v1.14.1 h1:EFKMUmH/iHMqLiwoEDx2rRjRQpI1YCn5jTysoaDujFs=
github.com/aws/smithy-go v1.14.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/aws/aws-sdk-go v1.45.20 h1:U/wLZEwqVB6o2XlcJ7um8kczx+A1X2MgO2y4wdKDQTs=
github.com/aws/aws-sdk-go v1.45.20/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc=
github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13 h1:OPLEkmhXf6xFPiz0bLeDArZIDx1NNS4oJyG4nv3Gct0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.13/go.mod h1:gpAbvyDGQFozTEmlTFO8XcQKHzubdq0LzRyJpG6MiXM=
github.com/aws/aws-sdk-go-v2/config v1.18.43 h1:IgdUtTRvUDC6eiJBqU6vh7bHFNAEBjQ8S+qJ7zVhDOs=
github.com/aws/aws-sdk-go-v2/config v1.18.43/go.mod h1:NiFev8qlgg8MPzw3fO/EwzMZeZwlJEKGwfpjRPA9Nvw=
github.com/aws/aws-sdk-go-v2/credentials v1.13.41 h1:dgbKq1tamtboYAKSXWbqL0lKO9rmEzEhbZFh9JQW/Bg=
github.com/aws/aws-sdk-go-v2/credentials v1.13.41/go.mod h1:cc3Fn7DkKbJalPtQnudHGZZ8ml9+hwtbc1CJONsYYqk=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.88 h1:AxcMcV1uTY15jysvTiXC6Mgpb5nU1rnqH0PmgJ7ig80=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.88/go.mod h1:C6Kvpm4g92So11JEAHMK0trT6EEEe5g5uG5JrneR6zQ=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43 h1:g+qlObJH4Kn4n21g69DjspU0hKTjWtq7naZ9OLCv0ew=
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.43/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4 h1:6lJvvkQ9HmbHZ4h/IEwclwv2mrTW8Uq1SOB/kXy0mfw=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.4/go.mod h1:1PrKYwxTM+zjpw9Y41KFtoJCQrJ34Z47Y4VgVbfndjo=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.14 h1:m0QTSI6pZYJTk5WSKx3fm5cNW/DCicVzULBgU/6IyD0=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.14/go.mod h1:dDilntgHy9WnHXsh7dDtUPgHKEfTJIBUTHM8OWm0f/0=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36 h1:eev2yZX7esGRjqRbnVk1UxMLw4CyVZDpZXRCcy75oQk=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.36/go.mod h1:lGnOkH9NJATw0XEPcAknFBj3zzNTEGRHtSw+CwC1YTg=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4 h1:v0jkRigbSD6uOdwcaUQmgEwG1BkPfAPDqaeNt/29ghg=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.4/go.mod h1:LhTyt8J04LL+9cIt7pYJ5lbS/U98ZmXovLOR/4LUsk8=
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.0 h1:wl5dxN1NONhTDQD9uaEvNsDRX29cBmGED/nl0jkWlt4=
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.0/go.mod h1:rDGMZA7f4pbmTtPOk5v5UM2lmX6UAbRnMDJeDvnH7AM=
github.com/aws/aws-sdk-go-v2/service/sso v1.15.0 h1:vuGK1vHNP9zx0PfOrtPumbwR2af0ATQ1Z2H6p75AgRQ=
github.com/aws/aws-sdk-go-v2/service/sso v1.15.0/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1 h1:8lKOidPkmSmfUtiTgtdXWgaKItCZ/g75/jEk6Ql6GsA=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4=
github.com/aws/aws-sdk-go-v2/service/sts v1.23.0 h1:pyvfUqkNLMipdKNAtu7OVbRxUrR2BMaKccIPpk/Hkak=
github.com/aws/aws-sdk-go-v2/service/sts v1.23.0/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU=
github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ=
github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
@@ -74,6 +79,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
github.com/ganigeorgiev/fexpr v0.3.0 h1:RwSyJBME+g/XdzlUW0paH/4VXhLHPg+rErtLeC7K8Ew=
@@ -82,6 +88,7 @@ github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead5
github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -100,6 +107,7 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -113,18 +121,25 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE=
github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk=
github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk=
github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA=
github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc=
github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8 h1:gpptm606MZYGaMHMsB4Srmb6EbW/IVHnt04rcMXnkBQ=
github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8=
github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM=
github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ=
github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
@@ -141,7 +156,9 @@ github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2C
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 h1:FwuzbVh87iLiUQj1+uQUsuw9x5t9m5n5g7rG7o4svW4=
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61/go.mod h1:paQfF1YtHe+GrGg5fOgjsjoCX/UKDr9bc1DoWpZfns8=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
@@ -161,8 +178,8 @@ github.com/mdlayher/packet v1.1.2 h1:3Up1NG6LZrsgDVn6X4L9Ge/iyRyxFEFD9o6Pr3Q1nQY
github.com/mdlayher/packet v1.1.2/go.mod h1:GEu1+n9sG5VtiRE4SydOmX5GTwyyYlteZiFU+x0kew4=
github.com/mdlayher/raw v0.0.0-20190313224157-43dbcdd7739d/go.mod h1:r1fbeITl2xL/zLbVnNHFyOzQJTgr/3fpf1lJX/cjzR8=
github.com/mdlayher/socket v0.2.1/go.mod h1:QLlNPkFR88mRUNQIzRBMfXxwKal8H7u1h3bL1CV+f0E=
github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U=
github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA=
github.com/mdlayher/socket v0.5.0 h1:ilICZmJcQz70vrWVes1MFera4jGiWNocSkykwwoy3XI=
github.com/mdlayher/socket v0.5.0/go.mod h1:WkcBFfvyG8QENs5+hfQPl1X6Jpd2yeLIYgrGFmJiJxI=
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a h1:fpQi42PM6HzbHwNg6a7OvLbh5l49Rgr7GCARozjHwio=
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a/go.mod h1:XX6nvyQpGc8E4KaQm62FyexOYd36ilpyfYf8wjgMDV8=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
@@ -173,8 +190,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pocketbase/dbx v1.10.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA=
github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/pocketbase v0.17.5 h1:3KwMrlSMt1rcwZK2Z1/wFa5p/rkDHpcyeCRvUDXMb+Y=
github.com/pocketbase/pocketbase v0.17.5/go.mod h1:IqsgywiDX5ewaUdeG+0NNckBLWp5mFhJSca1PH9zSp4=
github.com/pocketbase/pocketbase v0.18.9 h1:1i0Lg/vlXJe7DGgHqwIRGBxkpGgZ+0z9m3HNVumb/FM=
github.com/pocketbase/pocketbase v0.18.9/go.mod h1:uXjdxN7w0gpVISqbFvX9xXhg9YhRoQ4hYlKEe27yTJ8=
github.com/prometheus-community/pro-bing v0.3.0 h1:SFT6gHqXwbItEDJhTkzPWVqU6CLEtqEfNAPp47RUON4=
github.com/prometheus-community/pro-bing v0.3.0/go.mod h1:p9dLb9zdmv+eLxWfCT6jESWuDrS+YzpPkQBgysQF8a0=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -183,6 +200,7 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
@@ -199,6 +217,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
@@ -206,17 +225,17 @@ github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
gocloud.dev v0.32.0 h1:jHf8WSkByuAuXcvFt04OiiQH+N0zaRtxI6iEph8Bq8Y=
gocloud.dev v0.32.0/go.mod h1:m/x/N9cRjDF5MD0i5TLFbKbqkGffl/qayXA9FcMT5Oc=
gocloud.dev v0.34.0 h1:LzlQY+4l2cMtuNfwT2ht4+fiXwWf/NmPTnXUlLmGif4=
gocloud.dev v0.34.0/go.mod h1:psKOachbnvY3DAOPbsFVmLIErwsbWPUG2H5i65D38vE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo=
golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8=
golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ=
golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -238,11 +257,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -267,22 +286,23 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -294,33 +314,35 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/api v0.135.0 h1:6Vgfj6uPMXcyy66waYWBwmkeNB+9GmUlJDOzkukPQYQ=
google.golang.org/api v0.135.0/go.mod h1:Bp77uRFgwsSKI0BWH573F5Q6wSlznwI2NFayLOp/7mQ=
google.golang.org/api v0.143.0 h1:o8cekTkqhywkbZT6p1UHJPZ9+9uuCAJs/KYomxZB8fA=
google.golang.org/api v0.143.0/go.mod h1:FoX9DO9hT7DLNn97OuoZAGSDuNAXdJRuGK98rSUgurk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g=
google.golang.org/genproto/googleapis/api v0.0.0-20230717213848-3f92550aa753 h1:lCbbUxUDD+DiXx9Q6F/ttL0aAu7N2pz8XnmMm8ZW4NE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0=
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:CCviP9RmpZ1mxVr8MUjCnSiY09IbAXZxhLE6EhHIdPU=
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI=
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I=
google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -347,23 +369,27 @@ lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo=
lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q=
modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y=
modernc.org/ccgo/v3 v3.16.14 h1:af6KNtFgsVmnDYrWk3PQCS9XT6BXe7o3ZFJKkIKvXNQ=
modernc.org/ccgo/v3 v3.16.14/go.mod h1:mPDSujUIaTNWQSG4eqKw+atqLOEbma6Ncsa94WbC9zo=
modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0=
modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI=
modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=
modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ=
modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM=
modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak=
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o=
modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E=
modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E=
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA=
modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU=
modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY=
modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw=
modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw=
modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU=
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY=
modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY=
modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE=
+164
View File
@@ -0,0 +1,164 @@
package networking
import (
"fmt"
"net"
"testing"
"github.com/pocketbase/pocketbase/models"
)
type Device struct {
IP string
MAC string
Netmask string
Password string
ExpectFailPassword bool
}
func TestSendMagicPacket(t *testing.T) {
collection := &models.Collection{}
devices_success := []Device{
{
IP: "8.8.8.8",
MAC: "aa:aa:aa:aa:aa:aa",
Netmask: "255.0.0.0",
Password: "",
},
{
IP: "1.1.1.1",
MAC: "bb:bb:bb:bb:bb:bb",
Netmask: "255.255.0.0",
Password: "abcd",
},
}
devices_fail := []Device{
{
IP: "1.1.1.1",
MAC: "aa",
Netmask: "255.255.0.0",
Password: "abcd",
},
{
IP: "1.1.1.1",
MAC: "cc:cc:cc:cc:cc:cc",
Netmask: "255.255.0.0",
Password: "abcdefg",
},
}
for _, v := range devices_success {
device := models.NewRecord(collection)
device.Set("ip", v.IP)
device.Set("mac", v.MAC)
device.Set("netmask", v.Netmask)
device.Set("password", v.Password)
if err := SendMagicPacket(device); err != nil {
t.Fatal(err)
}
}
for _, v := range devices_fail {
device := models.NewRecord(collection)
device.Set("ip", v.IP)
device.Set("mac", v.MAC)
device.Set("netmask", v.Netmask)
device.Set("password", v.Password)
if err := SendMagicPacket(device); err == nil {
t.Fatal("should have cause an error")
}
}
}
func TestWakeUDP(t *testing.T) {
devices := []Device{
{
IP: "8.8.8.8",
MAC: "aa:aa:aa:aa:aa:aa",
Netmask: "255.0.0.0",
Password: "",
ExpectFailPassword: false,
},
{
IP: "1.1.1.1",
MAC: "bb:bb:bb:bb:bb:bb",
Netmask: "255.255.0.0",
Password: "abcd",
ExpectFailPassword: false,
},
{
IP: "10.10.10.1",
MAC: "cc:cc:cc:cc:cc:cc",
Netmask: "255.255.0.0",
Password: "abcd",
ExpectFailPassword: false,
},
{
IP: "1.1.1.1",
MAC: "dd:dd:dd:dd:dd:dd",
Netmask: "255.255.0.0",
Password: "abcdefg",
ExpectFailPassword: true,
},
}
for _, v := range devices {
parsedMac, err := net.ParseMAC(v.MAC)
if err != nil {
t.Fatalf(`%v (parsedMac "%v")`, err, parsedMac)
}
var bytePassword []byte
if len(v.Password) == 0 || len(v.Password) == 4 || len(v.Password) == 6 {
bytePassword = []byte(v.Password)
} else if !v.ExpectFailPassword {
t.Fatal("password must be 0, 4 or 6 characters long")
}
broadcastIp, err := getBroadcastIp(v.IP, v.Netmask)
if err != nil {
t.Fatal(err)
}
targetAddr := fmt.Sprintf("%s:%d", broadcastIp, 9)
if err := wakeUDP(targetAddr, parsedMac, bytePassword); err != nil {
t.Fatalf(`%v (targetAddr "%v", parsedMac "%v", bytePassword "%v")`, err, targetAddr, parsedMac, bytePassword)
}
}
}
func TestGetBroadcastIp(t *testing.T) {
type address struct {
IP string
Netmask string
BroadcastResult string
}
addresses := []address{
{
IP: "192.168.0.1",
Netmask: "255.255.255.0",
BroadcastResult: "192.168.0.255",
}, {
IP: "10.1.1.1",
Netmask: "255.255.0.0",
BroadcastResult: "10.1.255.255",
}, {
IP: "10.2.3.4",
Netmask: "255.0.0.0",
BroadcastResult: "10.255.255.255",
},
}
for _, v := range addresses {
broadcast, err := getBroadcastIp(v.IP, v.Netmask)
if err != nil {
t.Fatal(err)
}
if broadcast != v.BroadcastResult {
t.Fatalf(`getBroadcastIp("%v, %v"), want %v, got %v`, v.IP, v.Netmask, v.BroadcastResult, broadcast)
}
}
}
+31 -1
View File
@@ -5,6 +5,7 @@ import (
"io/fs"
"net/http"
"os"
"path"
"github.com/labstack/echo/v5"
"github.com/pocketbase/pocketbase"
@@ -21,7 +22,36 @@ var App *pocketbase.PocketBase
var Version = "(untracked)"
func StartPocketBase(distDirFS fs.FS) {
App = pocketbase.New()
// set data dir
// use "./pb_data" if it's in the same dir as upsnap binary
// else use os.UserConfigDir() / upsnap
var dataDir string
baseDir, err := os.Getwd()
if err != nil {
logger.Error.Fatalln(err)
}
pb_data := path.Join(baseDir, "pb_data")
if _, err = os.Stat(pb_data); err == nil {
dataDir = pb_data
} else if os.IsNotExist(err) {
userConfigDir, err := os.UserConfigDir()
if err != nil {
logger.Error.Fatalln(err)
}
upsnap_data := path.Join(userConfigDir, "upsnap")
if _, err = os.Stat(upsnap_data); err == nil {
dataDir = upsnap_data
} else if os.IsNotExist(err) {
if err := os.MkdirAll(upsnap_data, 0700); err != nil {
logger.Error.Fatalln(err)
}
}
}
// create app
App = pocketbase.NewWithConfig(pocketbase.Config{
DefaultDataDir: dataDir,
})
App.RootCmd.Short = "UpSnap CLI"
App.RootCmd.Version = Version
+3
View File
@@ -0,0 +1,3 @@
files:
- source: /frontend/src/lib/i18n/*/index.ts
translation: /frontend/src/lib/i18n/%locale%/index.ts
+29
View File
@@ -0,0 +1,29 @@
version: "3"
services:
upsnap:
container_name: upsnap
build:
dockerfile: Dockerfile.dev
network_mode: host
restart: unless-stopped
volumes:
- ./data:/app/pb_data
# # To use a non-root user, create the mountpoint first before starting
# # the container (mkdir data) so that it has the right permissions.
# user: 1000:1000
# environment:
# - TZ=Europe/Berlin # Set container timezone for cron schedules
# - UPSNAP_INTERVAL=@every 10s # Sets the interval in which the devices are pinged
# - UPSNAP_SCAN_RANGE=192.168.1.0/24 # Scan range is used for device discovery on local network
# - UPSNAP_WEBSITE_TITLE=Custom name # Custom website title
# # dns is used for name resolution during network scan
# dns:
# - 192.18.0.1
# - 192.18.0.2
# # you can change the listen ip:port inside the container like this:
# entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000"
# healthcheck:
# test: curl -fs "http://localhost:5000/api/health" || exit 1
# interval: 10s
# # or install custom packages for shutdown
# entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve --http 0.0.0.0:8090"
+2
View File
@@ -7,6 +7,8 @@ services:
restart: unless-stopped
volumes:
- ./data:/app/pb_data
# # To use a non-root user, create the mountpoint first (mkdir data) so that it has the right permission.
# user: 1000:1000
# environment:
# - TZ=Europe/Berlin # Set container timezone for cron schedules
# - UPSNAP_INTERVAL=@every 10s # Sets the interval in which the devices are pinged
+6
View File
@@ -0,0 +1,6 @@
{
"adapter": "svelte",
"$schema": "https://unpkg.com/typesafe-i18n@5.26.2/schema/typesafe-i18n.json",
"baseLocale": "en-US",
"outputPath": "./src/lib/i18n/"
}
+21 -17
View File
@@ -3,34 +3,36 @@
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"dev": "npm-run-all --parallel vite typesafe-i18n",
"vite": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint --fix --cache --ignore-path ../.gitignore .",
"format": "prettier --write --cache --cache-strategy content --ignore-path ../.gitignore .",
"prepare": "cd .. && husky install frontend/.husky"
"prepare": "cd .. && husky install frontend/.husky",
"typesafe-i18n": "typesafe-i18n"
},
"devDependencies": {
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.22.6",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"autoprefixer": "^10.4.15",
"daisyui": "^3.5.1",
"eslint": "^8.47.0",
"@sveltejs/kit": "^1.25.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"autoprefixer": "^10.4.16",
"daisyui": "^3.8.3",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.32.4",
"eslint-plugin-svelte": "^2.33.2",
"husky": "^8.0.3",
"postcss": "^8.4.28",
"prettier": "^3.0.2",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"prettier-plugin-svelte": "^3.0.3",
"svelte": "^4.2.0",
"svelte-check": "^3.5.0",
"svelte": "^4.2.1",
"svelte-check": "^3.5.2",
"tailwindcss": "^3.3.3",
"tslib": "^2.6.1",
"typescript": "^5.1.6",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^4.4.9"
},
"type": "module",
@@ -41,9 +43,11 @@
"dependencies": {
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"date-fns": "^2.30.0",
"pocketbase": "^0.16.0",
"npm-run-all": "^4.1.5",
"pocketbase": "^0.18.0",
"svelte-fa": "^3.0.4",
"svelte-french-toast": "^1.2.0",
"theme-change": "^2.5.0"
"theme-change": "^2.5.0",
"typesafe-i18n": "^5.26.2"
}
}
+1270 -293
View File
File diff suppressed because it is too large Load Diff
+81 -28
View File
@@ -1,7 +1,8 @@
<script lang="ts">
import { pocketbase, isAdmin, backendUrl, permission } from '$lib/stores/pocketbase';
import DeviceCardNic from './DeviceCardNic.svelte';
import Fa from 'svelte-fa';
import { goto } from '$app/navigation';
import LL, { locale } from '$lib/i18n/i18n-svelte';
import { backendUrl, permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device } from '$lib/types/device';
import {
faBed,
faCircleArrowDown,
@@ -10,13 +11,42 @@
faPen,
faRotateLeft
} from '@fortawesome/free-solid-svg-icons';
import { scale } from 'svelte/transition';
import type { Locale } from 'date-fns';
import { formatDistance, parseISO } from 'date-fns';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
import type { Device } from '$lib/types/device';
import { scale } from 'svelte/transition';
import DeviceCardNic from './DeviceCardNic.svelte';
export let device: Device;
let moreButtons = [
{
text: $LL.device.card_btn_more_edit(),
icon: faPen,
onClick: () => goto(`/device/${device.id}`),
requires: $pocketbase.authStore.isAdmin || $permission.update?.includes(device.id)
},
{
text: $LL.device.card_btn_more_sleep(),
icon: faBed,
onClick: () => sleep(),
requires:
($pocketbase.authStore.isAdmin || $permission.power?.includes(device.id)) &&
device.status === 'online' &&
device.sol_enabled
},
{
text: $LL.device.card_btn_more_reboot(),
icon: faRotateLeft,
onClick: () => reboot(),
requires:
($pocketbase.authStore.isAdmin || $permission.power?.includes(device.id)) &&
device.status === 'online' &&
device.shutdown_cmd !== ''
}
];
// update device status change
let now = Date.now();
let interval: number;
@@ -27,6 +57,25 @@
}, 1000);
}
// dynamically import locales
// it's ugly but the only working solution i found in ~ 3 hours
var dateFnsLocale: Locale;
$: if ($locale !== undefined) {
(async () => {
switch ($locale) {
case 'de' || 'de-DE':
dateFnsLocale = (await import('date-fns/locale/de/index.js')).default;
break;
case 'en' || 'en-US':
dateFnsLocale = (await import('date-fns/locale/en-US/index.js')).default;
break;
case 'pt' || 'pt-PT':
dateFnsLocale = (await import('date-fns/locale/pt/index.js')).default;
break;
}
})();
}
function sleep() {
fetch(`${backendUrl}api/upsnap/sleep/${device.id}`, {
headers: {
@@ -64,54 +113,58 @@
{#if device.wake_cron_enabled || device.shutdown_cron_enabled || device.password}
<div class="flex flex-row flex-wrap gap-2">
{#if device.wake_cron_enabled}
<div class="tooltip" data-tip="Wake cron">
<div class="tooltip" data-tip={$LL.device.card_tooltip_wake_cron()}>
<span class="badge badge-success gap-1 p-3"
><Fa icon={faCircleArrowUp} />{device.wake_cron}</span
>
</div>
{/if}
{#if device.shutdown_cron_enabled}
<div class="tooltip" data-tip="Shutdown cron">
<div class="tooltip" data-tip={$LL.device.card_tooltip_shutdown_cron()}>
<span class="badge badge-error gap-1 p-3"
><Fa icon={faCircleArrowDown} />{device.shutdown_cron}</span
>
</div>
{/if}
{#if device.password}
<div class="tooltip" data-tip="Wake password">
<span class="badge gap-1 p-3"><Fa icon={faLock} />Password</span>
<div class="tooltip" data-tip={$LL.device.card_tooltip_wake_password()}>
<span class="badge gap-1 p-3"><Fa icon={faLock} />{$LL.device.card_password()}</span>
</div>
{/if}
</div>
{/if}
<div class="card-actions mt-auto items-center">
<span class="tooltip" data-tip="Last status change: {device.updated}">
{formatDistance(parseISO(device.updated), now, {
includeSeconds: true,
addSuffix: true
})}
<span
class="tooltip"
data-tip="{$LL.device.card_tooltip_last_status_change()}: {device.updated}"
>
{#if dateFnsLocale !== undefined}
{formatDistance(parseISO(device.updated), now, {
includeSeconds: true,
addSuffix: true,
locale: dateFnsLocale
})}
{/if}
</span>
{#if $isAdmin || $permission.update?.includes(device.id) || $permission.power?.includes(device.id)}
{#if moreButtons.filter((btn) => btn.requires).length > 0}
<div class="dropdown dropdown-top dropdown-end bg-base-300 ms-auto">
<label tabindex="-1" class="btn btn-sm m-1" for="more-{device.id}">More</label>
<label tabindex="-1" class="btn btn-sm m-1" for="more-{device.id}"
>{$LL.device.card_btn_more()}</label
>
<ul
id="more-{device.id}"
tabindex="-1"
class="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-fit"
>
{#if ($isAdmin || $permission.power?.includes(device.id)) && device.status === 'online'}
{#if device.shutdown_cmd !== ''}
<li><button on:click={() => reboot()}><Fa icon={faRotateLeft} />Reboot</button></li>
{#each moreButtons as btn}
{#if btn.requires}
<li>
<button on:click={btn.onClick}>
<Fa icon={btn.icon} />{btn.text}
</button>
</li>
{/if}
{#if device.sol_enabled}
<li><button on:click={() => sleep()}><Fa icon={faBed} />Sleep</button></li>
{/if}
{/if}
{#if $isAdmin || $permission.update?.includes(device.id)}
<li>
<a href="/device/{device.id}"><Fa icon={faPen} />Edit</a>
</li>
{/if}
{/each}
</ul>
</div>
{/if}
@@ -1,9 +1,10 @@
<script lang="ts">
import { pocketbase, backendUrl, permission, isAdmin } from '$lib/stores/pocketbase';
import Fa from 'svelte-fa';
import { faCircle, faPowerOff } from '@fortawesome/free-solid-svg-icons';
import toast from 'svelte-french-toast';
import LL from '$lib/i18n/i18n-svelte';
import { backendUrl, permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device } from '$lib/types/device';
import { faCircle, faPowerOff } from '@fortawesome/free-solid-svg-icons';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
export let device: Device;
@@ -19,25 +20,25 @@
$: seconds = timeout % 60;
$: if (device.status === 'pending' || device.status === '') {
disabled = true;
hoverText = 'Pending';
hoverText = $LL.device.card_nic_tooltip_pending();
} else if (device.status === 'online') {
if (device.shutdown_cmd === '') {
disabled = true;
hoverText = 'No shutdown command set';
} else if (!$isAdmin && !$permission.power?.includes(device.id)) {
hoverText = $LL.device.card_nic_tooltip_shutdown_no_cmd();
} else if (!$pocketbase.authStore.isAdmin && !$permission.power?.includes(device.id)) {
disabled = true;
hoverText = 'No permission to shut down this device';
hoverText = $LL.device.card_nic_tooltip_shutdown_no_permission();
} else {
disabled = false;
hoverText = 'Shut down';
hoverText = $LL.device.card_nic_tooltip_shutdown();
}
} else if (device.status === 'offline') {
if (!$isAdmin && !$permission.power?.includes(device.id)) {
if (!$pocketbase.authStore.isAdmin && !$permission.power?.includes(device.id)) {
disabled = true;
hoverText = 'No permission to power on this device';
hoverText = $LL.device.card_nic_tooltip_power_no_permission();
} else {
disabled = false;
hoverText = 'Power on';
hoverText = $LL.device.card_nic_tooltip_power();
}
}
+78 -101
View File
@@ -1,12 +1,13 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { pocketbase, permission, isAdmin } from '$lib/stores/pocketbase';
import DeviceFormPort from '$lib/components/DeviceFormPort.svelte';
import toast from 'svelte-french-toast';
import Fa from 'svelte-fa';
import LL from '$lib/i18n/i18n-svelte';
import { permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device, Group, Port } from '$lib/types/device';
import { faSave, faTrash, faX } from '@fortawesome/free-solid-svg-icons';
import type { Device, Port, Group } from '$lib/types/device';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
export let device: Device;
@@ -22,7 +23,7 @@
// create/update all ports
let portIds: string[] = [];
await Promise.all(
device.expand.ports.map(async (port) => {
device.expand.ports.map(async (port: Port) => {
if (port.id === undefined) {
const data = await createPort(port as Port);
if (data === undefined) return;
@@ -43,7 +44,7 @@
.collection('devices')
.update(device.id, device)
.then(() => {
toast.success(`Updated ${device.name}`);
toast.success($LL.toasts.device_updated({ device: device.name }));
goto('/');
})
.catch((err) => {
@@ -52,12 +53,12 @@
}
async function createDevice(device: Device) {
device.created_by = $isAdmin ? '' : $pocketbase.authStore.model?.id ?? '';
device.created_by = $pocketbase.authStore.isAdmin ? '' : $pocketbase.authStore.model?.id ?? '';
$pocketbase
.collection('devices')
.create(device)
.then(() => {
toast.success(`Created ${device.name}`);
toast.success($LL.toasts.device_created({ device: device.name }));
goto('/');
})
.catch((err) => {
@@ -75,7 +76,6 @@
})
.catch((err) => {
toast.error(err.message);
newport = undefined;
});
return newport;
@@ -91,7 +91,6 @@
})
.catch((err) => {
toast.error(err.message);
newport = undefined;
});
return newport;
@@ -102,7 +101,7 @@
.collection('devices')
.delete(device.id)
.then(() => {
toast.success(`Deleted ${device.name}`);
toast.success($LL.toasts.device_deleted({ device: device.name }));
goto('/');
})
.catch((err) => {
@@ -133,7 +132,7 @@
})
.then((res) => {
deviceGroups = [...deviceGroups, res as Group];
toast.success(`Created group ${newGroup}`);
toast.success($LL.toasts.group_created({ group: newGroup }));
})
.catch((err) => {
toast.error(err.message);
@@ -151,7 +150,7 @@
.delete(group.id)
.then(async () => {
await getGroups();
toast.success(`Deleted group ${group.name}`);
toast.success($LL.toasts.group_deleted({ group: group.name }));
})
.catch((err) => {
toast.error(err.message);
@@ -172,19 +171,19 @@
<form on:submit|preventDefault={save}>
<div class="card w-full bg-base-300 shadow-xl">
<div class="card-body">
<h2 class="card-title">General</h2>
<h2 class="card-title">{$LL.device.general()}</h2>
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4">
<div class="form-control w-full max-w-xs">
<label class="label" for="device-name">
<div class="label-text">
<span>Name</span>
<span>{$LL.device.general_name()}</span>
<span class="text-error">*</span>
</div>
</label>
<input
id="device-name"
type="text"
placeholder="Device name"
placeholder={$LL.device.general_name_placeholder()}
class="input w-full max-w-xs"
bind:value={device.name}
required
@@ -193,7 +192,7 @@
<div class="form-control w-full max-w-xs">
<label class="label" for="device-ip">
<div class="label-text">
<span>IP</span>
<span>{$LL.device.general_ip()}</span>
<span class="text-error">*</span>
</div>
</label>
@@ -209,7 +208,7 @@
<div class="form-control w-full max-w-xs">
<label class="label" for="device-mac">
<div class="label-text">
<span>Mac</span>
<span>{$LL.device.general_mac()}</span>
<span class="text-error">*</span>
</div>
</label>
@@ -225,7 +224,7 @@
<div class="form-control w-full max-w-xs">
<label class="label" for="device-netmask">
<div class="label-text">
<span>Netmask</span>
<span>{$LL.device.general_netmask()}</span>
<span class="text-error">*</span>
</div>
</label>
@@ -238,14 +237,14 @@
required
/>
</div>
<span class="badge text-error self-center">* required field</span>
<span class="badge text-error self-center">* {$LL.device.general_required_field()}</span>
</div>
</div>
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Ports</h2>
<p class="my-2">UpSnap can also check if given ports are open. You can define them below.</p>
<h2 class="card-title">{$LL.device.ports()}</h2>
<p class="my-2">{$LL.device.ports_desc()}</p>
<div class="form-control w-full">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
<!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
@@ -254,18 +253,18 @@
{/each}
</div>
<button
class="btn btn-wide btn-primary mt-4"
class="btn max-w-xs btn-primary mt-4"
on:click={() => createEmptyPort()}
type="button">Add new port</button
type="button">{$LL.device.ports_add_new()}</button
>
</div>
</div>
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Link</h2>
<h2 class="card-title">{$LL.device.link()}</h2>
<p class="my-2">
Makes your device name a clickable link, perfect for linking a dashboard for example.
{$LL.device.link_desc()}
</p>
<div class="form-control w-full">
<input
@@ -279,23 +278,17 @@
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Wake</h2>
<h2 class="card-title">{$LL.device.wake()}</h2>
<p class="my-2">
You can power this device using a scheduled cron job. If you are not familiar with cron, you
can read about it <a class="link" href="https://en.wikipedia.org/wiki/Cron" target="_blank"
>here</a
>
or refer to the
<a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank"
>package documentation</a
>
for more information.
{$LL.device.wake_desc()}
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.settings.ping_interval_desc2()}
</p>
<div class="form-control flex flex-row flex-wrap gap-4">
<div>
<div class="w-full max-w-xs">
<label class="label" for="wake-cron">
<span class="label-text"
>Wake cron
>{$LL.device.wake_cron()}
{#if device.wake_cron_enabled}
<span class="text-error">*</span>
{/if}
@@ -305,7 +298,7 @@
id="wake-cron"
type="text"
placeholder="M H DoM M DoW"
class="input w-80"
class="input w-full max-w-xs"
bind:value={device.wake_cron}
disabled={!device.wake_cron_enabled}
required={device.wake_cron_enabled}
@@ -313,7 +306,7 @@
</div>
<div class="flex flex-col">
<label class="label cursor-pointer" for="wake-cron-enable">
<span class="label-text">Enable wake cron</span>
<span class="label-text">{$LL.device.wake_cron_enable()}</span>
</label>
<input
id="wake-cron-enable"
@@ -330,26 +323,15 @@
<div class="card-body">
<h2 class="card-title">Sleep-On-LAN</h2>
<p class="mt-2">
You can put computers to sleep using the <a
class="link"
href="https://github.com/SR-G/sleep-on-lan"
target="_blank">Sleep-On-LAN</a
>
tool. Sleep-On-LAN (SOL) is an external tool/daemon that operates on the PCs you want to put
to sleep, providing a REST endpoint. For instructions on setting up Sleep-On-LAN, please refer
to the
<a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Usage</a> section.
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.device.sol_desc1()}
</p>
<p>
SOL is confiugred to send requests over HTTP instead of UDP to enable authorization and make
requests more reliable.
{$LL.device.sol_desc2()}
</p>
<p class="font-bold">
Therefore, please ensure that you include <span class="badge">HTTP:&lt;YOURPORT&gt;</span>
in the <span class="badge">Listeners</span> section of the
<a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank"
>SOL configuration</a
>.
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.device.sol_desc3()}
</p>
<div class="flex flex-row flex-wrap gap-4 items-end mt-4">
<div>
@@ -362,14 +344,14 @@
bind:checked={device.sol_enabled}
/>
<label class="label cursor-pointer" for="sol-enable">
<span class="label-text">Enable Sleep-On-LAN</span>
<span class="label-text">{$LL.device.sol_enable()}</span>
</label>
</div>
</div>
<div class="form-control flex flex-col">
<label class="label" for="sol-port">
<span class="label-text"
>SOL Port
>{$LL.device.sol_port()}
{#if device.sol_enabled}
<span class="text-error">*</span>
{/if}
@@ -380,8 +362,7 @@
type="number"
min="1"
max="65535"
placeholder="Default: 8009"
class="input w-80"
class="input"
bind:value={device.sol_port}
disabled={!device.sol_enabled}
required={device.sol_enabled}
@@ -399,14 +380,14 @@
bind:checked={device.sol_auth}
/>
<label class="label cursor-pointer" for="sol-auth">
<span class="label-text">Authorization</span>
<span class="label-text">{$LL.device.sol_authorization()}</span>
</label>
</div>
</div>
<div class="form-control flex flex-col">
<label class="label" for="sol-user">
<span class="label-text"
>SOL User
>{$LL.device.sol_user()}
{#if device.sol_auth}
<span class="text-error">*</span>
{/if}
@@ -415,8 +396,8 @@
<input
id="sol-user"
type="text"
placeholder="username"
class="input w-80"
placeholder={$LL.device.sol_user()}
class="input"
bind:value={device.sol_user}
disabled={!device.sol_auth}
required={device.sol_auth}
@@ -426,7 +407,7 @@
<div class="form-control flex flex-col">
<label class="label" for="sol-password">
<span class="label-text"
>SOL Password
>{$LL.device.sol_password()}
{#if device.sol_auth}
<span class="text-error">*</span>
{/if}
@@ -435,8 +416,8 @@
<input
id="sol-password"
type="password"
placeholder="password"
class="input w-80"
placeholder={$LL.device.sol_password()}
class="input"
bind:value={device.sol_password}
disabled={!device.sol_auth}
required={device.sol_auth}
@@ -449,31 +430,27 @@
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Shutdown</h2>
<h2 class="card-title">{$LL.device.shutdown()}</h2>
<p class="my-2">
This <strong>shell command</strong> will run inside your container (if you use docker) or on
your host (if you use the binary). To verify that works you can run the command inside the
container or on your host shell first. Common commands are
<span class="badge">net rpc</span> for windows, <span class="badge">sshpass</span> for linux
or
<span class="badge">curl</span> in general to make web requests.
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.device.shutdown_desc()}
</p>
<p class="my-2 font-bold">Examples:</p>
<p class="my-2 font-bold">{$LL.device.shutdown_examples()}</p>
<div class="mockup-code text-sm max-w-fit">
<pre data-prefix="#"><code>Shutdown remote windows machine:</code></pre>
<pre data-prefix="#"><code>{$LL.device.shutdown_examples_windows()}</code></pre>
<pre data-prefix="$" class="text-warning"><code
>net rpc shutdown -I 192.168.1.13 -U "user%password"</code
></pre>
</div>
<div class="mockup-code text-sm max-w-fit">
<pre data-prefix="#"><code>Shutdown remote linux machine:</code></pre>
<pre data-prefix="#"><code>{$LL.device.shutdown_examples_linux()}</code></pre>
<pre data-prefix="$" class="text-warning"><code
>sshpass -p password ssh -o "StrictHostKeyChecking=no" user@192.168.1.13 "sudo poweroff"</code
></pre>
</div>
<div class="form-control w-full">
<label class="label cursor-pointer" for="shutdown-cmd">
<span class="label-text">Shutdown command</span>
<span class="label-text">{$LL.device.shutdown_cmd()}</span>
</label>
<input
id="shutdown-cmd"
@@ -484,14 +461,13 @@
/>
</div>
<p class="my-2">
Just like setting a cron to wake the device, you can also schedule a cron job to shut down
this device.
{$LL.device.shutdown_cron_desc()}
</p>
<div class="form-control flex flex-row flex-wrap gap-4">
<div>
<div class="w-full max-w-xs">
<label class="label" for="shutdown-cron">
<span class="label-text"
>Shutdown cron
>{$LL.device.shutdown_cron()}
{#if device.shutdown_cron_enabled}
<span class="text-error">*</span>
{/if}
@@ -501,7 +477,7 @@
id="shutdown-cron"
type="text"
placeholder="M H DoM M DoW"
class="input w-80"
class="input w-full max-w-xs"
bind:value={device.shutdown_cron}
disabled={!device.shutdown_cron_enabled}
required={device.shutdown_cron_enabled}
@@ -509,7 +485,7 @@
</div>
<div class="flex flex-col">
<label class="label cursor-pointer" for="shutdown-cron-enable">
<span class="label-text">Enable shutdown cron</span>
<span class="label-text">{$LL.device.shutdown_cron_enable()}</span>
</label>
<input
id="shutdown-cron-enable"
@@ -523,11 +499,10 @@
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Password</h2>
<h2 class="card-title">{$LL.device.password()}</h2>
<p class="my-2">
Some network cards have the option to set a password for magic packets, also called <span
class="badge">SecureON</span
>. Password can only be 0, 4 or 6 characters in length.
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.device.password_desc()}
</p>
<div class="form-control w-full">
<input
@@ -542,9 +517,9 @@
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Groups</h2>
<h2 class="card-title">{$LL.device.groups()}</h2>
<p class="my-2">
You can add devices to a group to have them sorted by group on the dashboard.
{$LL.device.groups_desc()}
</p>
<div class="flex flex-row flex-wrap gap-2">
{#each deviceGroups as group}
@@ -571,35 +546,37 @@
</div>
{/each}
</div>
<div class="join">
<div class="join max-w-xs">
<input
class="input input-bordered join-item"
placeholder="e.g. 'Basement' or 'Office'"
class="input input-bordered join-item w-full"
placeholder={$LL.device.groups_placeholder()}
type="text"
bind:value={newGroup}
/>
<button class="btn btn-primary join-item" type="button" on:click={() => addGroup()}
>Create</button
>{$LL.buttons.add()}</button
>
</div>
</div>
</div>
<div class="card-actions mt-6 justify-end gap-4">
{#if $isAdmin || $permission.delete?.includes(device.id)}
{#if $pocketbase.authStore.isAdmin || $permission.delete?.includes(device.id)}
<button class="btn btn-error" type="button" on:click={() => deleteModal.showModal()}
><Fa icon={faTrash} />Delete</button
><Fa icon={faTrash} />{$LL.buttons.delete()}</button
>
<dialog class="modal" bind:this={deleteModal}>
<form method="dialog" class="modal-box">
<h3 class="font-bold text-lg">Confirm delete</h3>
<p class="py-4">Are you sure you want to delete <strong>{device.name}</strong>?</p>
<h3 class="font-bold text-lg">{$LL.users.confirm_delete_title()}</h3>
<p class="py-4">{$LL.users.confirm_delete_desc({ username: device.name })}</p>
<div class="modal-action">
<button class="btn">Cancle</button>
<button class="btn btn-error" on:click={() => deleteDevice()}>Delete</button>
<button class="btn">{$LL.buttons.cancle()}</button>
<button class="btn btn-error" on:click={() => deleteDevice()}
>{$LL.buttons.delete()}</button
>
</div>
</form>
</dialog>
{/if}
<button class="btn btn-success" type="submit"><Fa icon={faSave} />Save</button>
<button class="btn btn-success" type="submit"><Fa icon={faSave} />{$LL.buttons.save()}</button>
</div>
</form>
@@ -1,11 +1,12 @@
<script lang="ts">
import LL from '$lib/i18n/i18n-svelte';
import { pocketbase } from '$lib/stores/pocketbase';
import { scale } from 'svelte/transition';
import Fa from 'svelte-fa';
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import toast from 'svelte-french-toast';
import type { Device, Port } from '$lib/types/device';
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import type { Record } from 'pocketbase';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
import { scale } from 'svelte/transition';
export let device: Device;
export let index: number;
@@ -32,7 +33,7 @@
<div class="flex flex-row gap-2">
<div>
<label class="label p-0" for="port-name-{index}">
<span class="label-text">Name</span>
<span class="label-text">{$LL.device.ports_name()}</span>
</label>
<input
id="port-name-{index}"
@@ -45,7 +46,7 @@
</div>
<div>
<label class="label p-0" for="port-number-{index}">
<span class="label-text">Number</span>
<span class="label-text">{$LL.device.ports_number()}</span>
</label>
<input
id="port-number-{index}"
@@ -63,7 +64,7 @@
<button
class="btn btn-xs btn-outline btn-error"
on:click={() => deletePort(device.expand.ports[index])}
type="button"><Fa icon={faTrash} />Delete</button
type="button"><Fa icon={faTrash} />{$LL.buttons.delete()}</button
>
</div>
</div>
+24 -21
View File
@@ -1,22 +1,23 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { pocketbase, backendUrl, permission, isAdmin } from '$lib/stores/pocketbase';
import LL from '$lib/i18n/i18n-svelte';
import { backendUrl, permission, pocketbase } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import Fa from 'svelte-fa';
import {
faCheck,
faChevronDown,
faCog,
faDoorOpen,
faHome,
faPlus,
faSwatchbook,
faChevronDown,
faCheck,
faUsersGear,
faUserGear,
faDoorOpen
faUsersGear
} from '@fortawesome/free-solid-svg-icons';
import { themeChange } from 'theme-change';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import { themeChange } from 'theme-change';
let availableThemes = [
'light',
@@ -100,16 +101,16 @@
{/if}
<li>
<a href="/" class="px-4 py-2" class:active={$page.url.pathname === '/'}
><Fa icon={faHome} />Home</a
><Fa icon={faHome} />{$LL.home.page_title()}</a
>
</li>
{#if $isAdmin}
{#if $pocketbase.authStore.isAdmin}
<li>
<a
href="/users"
class="px-4 py-2"
class:active={$page.url.pathname.startsWith('/users')}
><Fa icon={faUsersGear} />Users</a
><Fa icon={faUsersGear} />{$LL.users.page_title()}</a
>
</li>
<li>
@@ -117,7 +118,7 @@
href="/settings/"
class="px-4 py-2"
class:active={$page.url.pathname.startsWith('/settings')}
><Fa icon={faCog} />Settings</a
><Fa icon={faCog} />{$LL.settings.page_title()}</a
>
</li>
{/if}
@@ -141,18 +142,18 @@
<ul class="menu menu-horizontal px-1 gap-1">
<li>
<a href="/" class="p-2" class:active={$page.url.pathname === '/'}
><Fa icon={faHome} />Home</a
><Fa icon={faHome} />{$LL.home.page_title()}</a
>
</li>
{#if $isAdmin}
{#if $pocketbase.authStore.isAdmin}
<li>
<a href="/users" class="p-2" class:active={$page.url.pathname.startsWith('/users')}
><Fa icon={faUsersGear} />Users</a
><Fa icon={faUsersGear} />{$LL.users.page_title()}</a
>
</li>
<li>
<a href="/settings/" class="p-2" class:active={$page.url.pathname.startsWith('/settings')}
><Fa icon={faCog} />Settings</a
><Fa icon={faCog} />{$LL.settings.page_title()}</a
>
</li>
{/if}
@@ -161,7 +162,7 @@
<div class="dropdown md:dropdown-end">
<div tabindex="-1" class="btn normal-case btn-ghost">
<Fa icon={faSwatchbook} />
<span class="hidden font-normal md:inline">Theme</span>
<span class="hidden font-normal md:inline">{$LL.navbar.theme()}</span>
<Fa icon={faChevronDown} />
</div>
<div
@@ -199,10 +200,10 @@
</div>
<div class="justify-end ms-auto">
{#if $pocketbase.authStore?.model !== null}
{#if $isAdmin || $permission.create}
{#if $pocketbase.authStore.isAdmin || $permission.create}
<a class="btn btn-success me-4" href="/device/new">
<Fa icon={faPlus} />
New
{$LL.navbar.new()}
</a>
{/if}
<div class="dropdown dropdown-end">
@@ -216,14 +217,16 @@
class="menu dropdown-content mt-3 z-[1] p-2 shadow bg-base-300 rounded-box"
>
<li class="menu-title">
{$isAdmin ? $pocketbase.authStore.model.email : $pocketbase.authStore.model.username}
{$pocketbase.authStore.isAdmin
? $pocketbase.authStore.model.email
: $pocketbase.authStore.model.username}
</li>
<li>
<a href="/account"><Fa icon={faUserGear} />Edit account</a>
<a href="/account"><Fa icon={faUserGear} />{$LL.navbar.edit_account()}</a>
</li>
<li>
<div on:click={async () => logout()} on:keydown={async () => logout()} role="none">
<Fa icon={faDoorOpen} />Logout
<Fa icon={faDoorOpen} />{$LL.navbar.logout()}
</div>
</li>
</ul>
+38 -33
View File
@@ -1,15 +1,16 @@
<script lang="ts">
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { pocketbase, backendUrl } from '$lib/stores/pocketbase';
import { settingsPriv } from '$lib/stores/settings';
import PageLoading from '$lib/components/PageLoading.svelte';
import Fa from 'svelte-fa';
import { faMagnifyingGlass, faPlus, faX } from '@fortawesome/free-solid-svg-icons';
import toast from 'svelte-french-toast';
import type { SettingsPrivate } from '$lib/types/settings';
import type { ScanResponse, ScannedDevice } from '$lib/types/scan';
import LL from '$lib/i18n/i18n-svelte';
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
import { settingsPriv } from '$lib/stores/settings';
import type { Device } from '$lib/types/device';
import type { ScanResponse, ScannedDevice } from '$lib/types/scan';
import type { SettingsPrivate } from '$lib/types/settings';
import { faMagnifyingGlass, faPlus, faX } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let scanRange = '';
let scanRunning = false;
@@ -46,7 +47,7 @@
})
.then((res) => {
settingsPriv.set(res as SettingsPrivate);
toast.success('Scan range saved');
toast.success($LL.device.network_scan_range_saved());
})
.catch((err) => {
toast.error(err.message);
@@ -88,7 +89,7 @@
async function addSingle(device: ScannedDevice) {
await createDevice(device)
.then(() => {
toast.success(`Added ${device.name}`);
toast.success($LL.toasts.device_created({ device: device.name }));
})
.catch((err) => {
toast.error(err.message);
@@ -109,7 +110,7 @@
});
})
);
toast.success(`Added ${count} devices`);
toast.success($LL.toasts.devices_created_multiple({ count: count }));
goto('/');
}
</script>
@@ -117,16 +118,14 @@
{#if $settingsPriv}
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Network scan</h2>
<h2 class="card-title">{$LL.device.tabs[1]()}</h2>
<p class="my-2">
Automatically scan your network for devices. For this to work, you need to run UpSnap as
root/admin and have nmap installed and available in your $PATH (For docker users, thats
already the case and you don't need to do anything). Scanning might take some seconds.
{$LL.device.network_scan_desc()}
</p>
<div class="flex flex-row flex-wrap gap-4 items-end">
<form on:submit|preventDefault={saveSettings}>
<label class="label" for="scan-range">
<span class="label-text">IP range</span>
<span class="label-text">{$LL.device.network_scan_ip_range()}</span>
</label>
<div class="join">
<input
@@ -136,27 +135,30 @@
placeholder="192.168.1.0/24"
bind:value={scanRange}
/>
<button class="btn btn-primary join-item" type="submit">Save</button>
<button class="btn btn-primary join-item" type="submit">{$LL.buttons.save()}</button>
</div>
</form>
<div>
<div>
{#if !$settingsPriv.scan_range}
<button class="btn btn-error" disabled>
<Fa icon={faX} /> No scan range
<Fa icon={faX} />
{$LL.device.network_scan_no_range()}
</button>
{:else if scanRange !== $settingsPriv.scan_range}
<button class="btn btn-error" disabled>
<Fa icon={faX} /> Unsaved changes
<Fa icon={faX} />
{$LL.device.network_scan_unsaved_changes()}
</button>
{:else if scanRunning}
<button class="btn no-animation">
<span class="loading loading-spinner" />
Scan running
{$LL.device.network_scan_running()}
</button>
{:else}
<button class="btn btn-success" on:click={() => scan()}>
<Fa icon={faMagnifyingGlass} /> Scan
<Fa icon={faMagnifyingGlass} />
{$LL.device.network_scan()}
</button>
{/if}
</div>
@@ -172,20 +174,20 @@
<div class="collapse-content">
<div class="flex flex-row flex-wrap gap-4">
<div>
<strong>IP:</strong><br />
<strong>{$LL.device.network_scan_ip()}</strong><br />
{device.ip}
</div>
<div>
<strong>Mac:</strong><br />
<strong>{$LL.device.network_scan_mac()}</strong><br />
{device.mac}
</div>
<div>
<strong>Mac vendor:</strong><br />
<strong>{$LL.device.network_scan_mac_vendor()}</strong><br />
{device.mac_vendor}
</div>
<div>
<strong>Netmask:</strong><br />
<strong>{$LL.device.network_scan_netmask()}</strong><br />
{scanResponse.netmask}
</div>
<div class="ms-auto">
@@ -194,24 +196,24 @@
on:click={(e) => {
addSingle(device);
e.currentTarget.disabled = true;
}}><Fa icon={faPlus} />Add</button
}}><Fa icon={faPlus} />{$LL.buttons.add()}</button
>
</div>
</div>
</div>
</div>
{/each}
<h2 class="card-title mt-4">Add all devices</h2>
<h2 class="card-title mt-4">{$LL.device.network_scan_add_all()}</h2>
<div class="form-control max-w-fit">
<label class="label cursor-pointer">
<input type="checkbox" class="checkbox" bind:checked={replaceNetmaskCheckbox} />
<span class="label-text ms-2">Replace netmask for all devices?</span>
<span class="label-text ms-2">{$LL.device.network_scan_replace_netmask()}</span>
</label>
</div>
{#if replaceNetmaskCheckbox}
<div class="form-control max-w-fit">
<label class="label cursor-pointer" for="replaceNetmaskInput">
<span class="label-text ms-2">New netmask</span>
<span class="label-text ms-2">{$LL.device.network_scan_new_netmask()}</span>
</label>
<input
id="replaceNetmaskInput"
@@ -226,7 +228,7 @@
<div class="form-control max-w-fit">
<label class="label cursor-pointer">
<input type="checkbox" class="checkbox" bind:checked={addAllCheckbox} />
<span class="label-text ms-2">Include devices where name is "Unknown"</span>
<span class="label-text ms-2">{$LL.device.network_scan_include_unknown()}</span>
</label>
{#if addAllCheckbox}
<button
@@ -234,7 +236,8 @@
on:click={() => addAll()}
disabled={scanResponse.devices.length === 0}
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.length})
<Fa icon={faPlus} />
{$LL.device.network_scan_add_all()} ({scanResponse.devices.length})
</button>
{:else}
<button
@@ -242,7 +245,8 @@
on:click={() => addAll()}
disabled={scanResponse.devices.filter((dev) => dev.name !== 'Unknown').length === 0}
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.filter(
<Fa icon={faPlus} />
{$LL.device.network_scan_add_all()} ({scanResponse.devices.filter(
(dev) => dev.name !== 'Unknown'
).length})
</button>
@@ -255,7 +259,8 @@
on:click={() => addAll()}
disabled={scanResponse.devices.length === 0}
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.length})
<Fa icon={faPlus} />
{$LL.device.network_scan_add_all()} ({scanResponse.devices.length})
</button>
</div>
{/if}
+8
View File
@@ -0,0 +1,8 @@
import de from '../de';
import type { Translation } from '../i18n-types';
const de_DE = {
...(de as unknown as Translation)
} satisfies Translation;
export default de_DE;
+215
View File
@@ -0,0 +1,215 @@
import en from '../en';
import type { Translation } from '../i18n-types';
const de = {
...(en as unknown as Translation),
home: {
page_title: 'Home',
order_groups: 'Gruppen',
order_name: 'Name',
order_ip: 'IP',
order_tooltip: 'Sortieren',
no_devices: 'Keine Geräte.',
add_first_device: 'Füge dein erstes Gerät hinzu',
grant_permissions:
'Bitte frag den Administrator, dir Berechtigungen für bestehende Geräte zu erteilen oder neue Geräte zu erstellen.'
},
account: {
page_title: 'Account',
account_type_admin: 'Admin',
account_type_user: 'Benutzer',
avatar_title: 'Avatar',
language_title: 'Sprache',
language_option_auto: 'Automatisch',
change_password_title: 'Passwort ändern',
change_password_body: 'Nachdem das Passwort geändert wurde, musst du dich neu einloggen.',
change_password_label: 'Altes Passwort',
change_password_new: 'Neues Password',
change_password_confirm: 'Password bestätigen'
},
device: {
page_title: 'Neues Gerät',
tabs: ['Manuell', 'Netzwerkscan'],
card_btn_more: 'Mehr',
card_btn_more_edit: 'Bearbeiten',
card_btn_more_sleep: 'Ruhezustand',
card_btn_more_reboot: 'Neustart',
card_tooltip_wake_cron: 'Einschalten Cron',
card_tooltip_shutdown_cron: 'Ausschalten Cron',
card_tooltip_wake_password: 'Einschalten Passwort',
card_tooltip_last_status_change: 'Letzte Statusänderung',
card_password: 'Passwort',
card_nic_tooltip_pending: 'Warten',
card_nic_tooltip_shutdown: 'Ausschalten',
card_nic_tooltip_shutdown_no_cmd: 'Kein Ausschaltbefehl gesetzt',
card_nic_tooltip_shutdown_no_permission: 'Keine Berechtigung zum ausschalten',
card_nic_tooltip_power: 'Einschalten',
card_nic_tooltip_power_no_permission: 'Keine Berechtigung zum einschalten',
general: 'Allgemein',
general_name: 'Name',
general_name_placeholder: 'Gerätename',
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Netmask',
general_required_field: 'Pflichtfeld',
ports: 'Ports',
ports_desc: 'UpSnap kann auch prüfen, ob bestimmte Ports offen sind.',
ports_add_new: 'Port hinzufügen',
ports_name: 'Name',
ports_number: 'Nummer',
link: 'Link',
link_desc:
'Macht Ihren Gerätenamen zu einem anklickbaren Link, ideal zum Beispiel für die Verknüpfung eines Dashboards.',
wake: 'Einschalten',
wake_desc: 'Du kannst das Gerät mit einem Cron-Job einschalten.',
wake_cron: 'Cron',
wake_cron_enable: 'Aktivieren',
sol: 'Sleep-On-LAN',
sol_desc1:
'Du kannst Computer mithilfe des Tools <a class="link" href="https://github.com/SR-G/sleep-on-lan" target="_blank">Sleep-On-LAN</a> in den Ruhezustand versetzen. Sleep-On-LAN (SOL) ist ein externes Tool/Daemon, das auf den PCs arbeitet, die du in den Ruhezustand versetzen möchtest, und stellt einen REST-Endpunkt bereit. Für Anweisungen zur Einrichtung von Sleep-On-LAN verweise bitte auf den Abschnitt <a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Usage</a>.',
sol_desc2:
'SOL ist so konfiguriert, dass es Anfragen über HTTP statt über UDP sendet, um eine Autorisierung zu ermöglichen und die Zuverlässigkeit der Anfragen zu erhöhen.',
sol_desc3:
'Daher stellen Sie bitte sicher, dass Sie <span class="badge">HTTP:&lt;DEINPORT&gt;</span> im Abschnitt <span class="badge">Listener</span> der <a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank">SOL-Konfiguration</a> hinzufügen.',
sol_enable: 'Sleep-On-LAN aktivieren',
sol_port: 'SOL Port',
sol_authorization: 'Authorisierung',
sol_user: 'SOL Benutzer',
sol_password: 'SOL Passwort',
shutdown: 'Ausschalten',
shutdown_desc:
'Dieser <strong>Shell-Befehl</strong> wird in deinem Container ausgeführt (wenn du Docker verwendest) oder auf deinem Host (wenn du die Binärdatei verwendest). Um zu überprüfen, ob das funktioniert, kannst du den Befehl zuerst im Container oder auf deiner Host-Shell ausführen. Übliche Befehle sind <span class="badge">net rpc</span> für Windows, <span class="badge">sshpass</span> für Linux oder <span class="badge">curl</span> im Allgemeinen, um Webanfragen durchzuführen.',
shutdown_examples: 'Beispiele:',
shutdown_examples_windows: 'Entfernten Windows PC ausschalten:',
shutdown_examples_linux: 'Entfernten Linux PC ausschalten:',
shutdown_cmd: 'Befehl zum ausschalten',
shutdown_cron_desc:
'Genau wie das Einrichten eines Cron-Jobs, um das Gerät aufzuwecken, kannst du auch einen Cron-Job planen, um dieses Gerät herunterzufahren.',
shutdown_cron: 'Cron',
shutdown_cron_enable: 'Aktivieren',
password: 'Password',
password_desc:
'Einige Netzwerkkarten bieten die Möglichkeit, ein Passwort für Magic Packets zu setzen, auch <span class="badge">SecureON</span> genannt. Das Passwort kann nur 0, 4 oder 6 Zeichen lang sein.',
groups: 'Gruppen',
groups_desc:
'Du kannst Geräte einer Gruppe hinzufügen, um sie auf dem Dashboard nach Gruppen sortiert anzuzeigen.',
groups_placeholder: "z.B. 'Keller' or 'Büro'",
network_scan_range_saved: 'Scan-Bereich gespeichert',
network_scan_desc:
'Automatisches Scannen deines Netzwerks nach Geräten. Damit dies funktioniert, musst du UpSnap als Administrator/root ausführen und nmap installiert und im $PATH verfügbar haben (Für Docker-Benutzer ist das bereits der Fall, und du musst nichts weiter tun). Das Scannen kann einige Sekunden dauern.',
network_scan_ip_range: 'IP-Bereich',
network_scan_no_range: 'Kein Scan-Bereich',
network_scan_unsaved_changes: 'Ungespeicherte Änderungen',
network_scan_running: 'Scan läuft',
network_scan: 'Scan',
network_scan_ip: 'IP:',
network_scan_mac: 'Mac:',
network_scan_mac_vendor: 'Mac Hersteller:',
network_scan_netmask: 'Netmask:',
network_scan_add_all: 'Alle Geräte hinzufügen',
network_scan_replace_netmask: 'Netmask für alle Geräte ändern?',
network_scan_new_netmask: 'Neue Netmask',
network_scan_include_unknown: 'Schließe Geräte ein, bei denen der Name "Unknown" ist.'
},
login: {
welcome: 'Willkommen',
email_label: 'Email oder Nutzername:',
password_label: 'Passwort:',
btn_more: 'Mehr',
menu_title_auth_providers: 'Andere Login Provider',
btn_login: 'Login'
},
settings: {
page_title: 'Einstellungen',
ping_interval_title: 'Ping Intervall',
ping_interval_desc1:
'Legt den Intervall fest, in dem Geräte gepingt werden. Leer lassen um den Standardwert von <span class="badge">@every 3s</span> zu verwenden.',
ping_interval_desc2:
'Lerne mehr über die korrekte Cron Syntax auf <a class="link" href="https://de.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> oder sieh dir die <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">Paketdokumentation</a> an.',
lazy_ping_title: 'Lazy Ping',
lazy_ping_desc:
'Wenn Lazy Ping aktiviert ist, pingt UpSnap die Geräte nur an, wenn ein aktiver Benutzer die Website besucht. Wenn es ausgeschaltet ist, pingt UpSnap die Geräte immer an.',
lazy_ping_enable: 'Aktivieren',
website_title_title: 'Seitentitel',
website_title_desc: 'Setzt den Seiten- und den Tabtitel.',
icon_title: 'Icon',
icon_desc: 'Eigenes Favicon nutzen. Unterstützte Dateitypen sind:',
upsnap_version: 'UpSnap Version'
},
users: {
page_title: 'Benutzer',
allow_create_devices:
'{username} erlauben neue Geräte zu erstellen und Gerätegruppen zu bearbeiten',
device_permissions: 'Geräteberechtigungen',
create_new_device: 'Neues Gerät erstellen',
read: 'Lesen',
update: 'Ändern',
delete: 'Löschen',
power: 'Power',
toggle: 'Toggle',
confirm_delete_title: 'Löschen bestätigen',
confirm_delete_desc: 'Soll {username} wirklich gelöscht werden?',
create_new_user: 'Neuen Benutzer erstellen',
username: 'Benutzername',
password: 'Passwort',
password_confirm: 'Passwort bestätigen',
required_field: 'Pflichtfeld'
},
buttons: {
save: 'Speichern',
delete: 'Löschen',
change: 'Ändern',
reset: 'Zurücksetzen',
cancle: 'Abbrechen',
add: 'Hinzufügen'
},
welcome: {
step1_page_title: 'Willkommen bei UpSnap 🥳',
step1_setup_desc:
'Bitte schließe die nachfolgenden Schritte ab, um die Einrichtung abzuschließen.',
step1_setup_btn_next: 'Weiter',
step2_page_title: 'Erstelle einen Admin Account',
step2_label_email: 'Email:',
step2_label_password: 'Passwort:',
step2_label_min_chars: 'min. 10 Zeichen',
step2_label_password_confirm: 'Passwort bestätigen:',
step2_btn_create: 'Erstellen',
step3_page_title: 'Du bist fertig! 🎉',
step3_page_desc: 'Füge Geräte zu deinem Dashboard hinzu.',
step3_btn_done: 'Lets go!',
not_expected_title: 'Ich hab dich hier nicht erwartet! 🧐',
not_expected_desc: 'Du hast die Einrichtung bereits abgeschlossen! Hier gibts nichts zu tun.',
not_expected_back: 'Bring mich zurück',
progress_step1: 'Willkommen',
progress_step2: 'Account erstellen',
progress_step3: 'Fertig'
},
toasts: {
admin_saved: 'Admin gespeichert',
user_saved: 'Benutzer gespeichert',
user_created: 'Benutzer {username} erstellt',
user_deleted: 'Benutzer {username} gelöscht',
settings_saved: 'Einstellungen gespeichert',
password_changed: 'Passwort geändert. Bitte neu einloggen.',
passwords_missmatch: 'Passwörter stimmen nicht überein',
permissions_created: 'Berechtigungen für {username} erstellt',
permissions_deleted: 'Berechtigungen für {username} gelöscht',
permissions_updated: 'Berechtigungen für {username} geändert',
permissions_updated_personal: 'Deine Berechtigungen wurden geupdated',
no_permission: 'Du hast keine Berechtigung für {url}',
device_created: '{device} erstellt',
devices_created_multiple: '{count|int} Geräte erstellt',
device_updated: '{device} geändert',
device_deleted: '{device} gelöscht',
group_created: 'Gruppe {group} erstellt',
group_deleted: 'Gruppe {group} gelöscht'
},
navbar: {
theme: 'Theme',
new: 'Neu',
edit_account: 'Account bearbeiten',
logout: 'Abmelden'
}
} satisfies Translation;
export default de;
+8
View File
@@ -0,0 +1,8 @@
import en from '../en';
import type { Translation } from '../i18n-types';
const en_US = {
...(en as unknown as Translation)
} satisfies Translation;
export default en_US;
+210
View File
@@ -0,0 +1,210 @@
import type { BaseTranslation } from '../i18n-types';
const en = {
home: {
page_title: 'Home',
order_groups: 'Groups',
order_name: 'Name',
order_ip: 'IP',
order_tooltip: 'Order',
no_devices: 'No devices here.',
add_first_device: 'Add your first device',
grant_permissions:
'Please ask the admin to grant you permissions to existing devices or to create new ones.'
},
account: {
page_title: 'Account',
account_type_admin: 'Admin',
account_type_user: 'User',
avatar_title: 'Avatar',
language_title: 'Language',
language_option_auto: 'Automatic',
change_password_title: 'Change password',
change_password_body: 'After the password has been changed, you will need to log in again.',
change_password_label: 'Old password',
change_password_new: 'New password',
change_password_confirm: 'Confirm password'
},
device: {
page_title: 'New device',
tabs: ['Manual', 'Network Scan'],
card_btn_more: 'More',
card_btn_more_edit: 'Edit',
card_btn_more_sleep: 'Sleep',
card_btn_more_reboot: 'Reboot',
card_tooltip_wake_cron: 'Wake cron',
card_tooltip_shutdown_cron: 'Shutdown cron',
card_tooltip_wake_password: 'Wake password',
card_tooltip_last_status_change: 'Last status change',
card_password: 'Password',
card_nic_tooltip_pending: 'Pending',
card_nic_tooltip_shutdown: 'Shut down',
card_nic_tooltip_shutdown_no_cmd: 'No shutdown command set',
card_nic_tooltip_shutdown_no_permission: 'No permission to shut down this device',
card_nic_tooltip_power: 'Power on',
card_nic_tooltip_power_no_permission: 'No permission to power on this device',
general: 'General',
general_name: 'Name',
general_name_placeholder: 'Device name',
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Netmask',
general_required_field: 'required field',
ports: 'Ports',
ports_desc: 'UpSnap can also check if given ports are open.',
ports_add_new: 'Add new port',
ports_name: 'Name',
ports_number: 'Number',
link: 'Link',
link_desc:
'Makes your device name a clickable link, perfect for linking a dashboard for example.',
wake: 'Wake',
wake_desc: 'You can power this device using a scheduled cron job.',
wake_cron: 'Wake cron',
wake_cron_enable: 'Enable wake cron',
sol: 'Sleep-On-LAN',
sol_desc1:
'You can put computers to sleep using the <a class="link" href="https://github.com/SR-G/sleep-on-lan" target="_blank">Sleep-On-LAN</a> tool. Sleep-On-LAN (SOL) is an external tool/daemon that operates on the PCs you want to put to sleep, providing a REST endpoint. For instructions on setting up Sleep-On-LAN, please refer to the <a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Usage</a> section.',
sol_desc2:
'SOL is configured to send requests over HTTP instead of UDP to enable authorization and make requests more reliable.',
sol_desc3:
'Therefore, please ensure that you include <span class="badge">HTTP:&lt;YOURPORT&gt;</span> in the <span class="badge">Listeners</span> section of the <a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank">SOL configuration</a>.',
sol_enable: 'Enable Sleep-On-LAN',
sol_port: 'SOL Port',
sol_authorization: 'Authorization',
sol_user: 'SOL User',
sol_password: 'SOL Password',
shutdown: 'Shutdown',
shutdown_desc:
'This <strong>shell command</strong> will run inside your container (if you use docker) or on your host (if you use the binary). To verify that works you can run the command inside the container or on your host shell first. Common commands are <span class="badge">net rpc</span> for windows, <span class="badge">sshpass</span> for linux or <span class="badge">curl</span> in general to make web requests.',
shutdown_examples: 'Examples:',
shutdown_examples_windows: 'Shutdown remote windows machine:',
shutdown_examples_linux: 'Shutdown remote linux machine:',
shutdown_cmd: 'Shutdown command',
shutdown_cron_desc:
'Just like setting a cron to wake the device, you can also schedule a cron job to shut down this device.',
shutdown_cron: 'Shutdown cron',
shutdown_cron_enable: 'Enable shutdown cron',
password: 'Password',
password_desc:
'Some network cards have the option to set a password for magic packets, also called <span class="badge">SecureON</span>. Password can only be 0, 4 or 6 characters in length.',
groups: 'Groups',
groups_desc: 'You can add devices to a group to have them sorted by group on the dashboard.',
groups_placeholder: "e.g. 'Basement' or 'Office'",
network_scan_range_saved: 'Scan range saved',
network_scan_desc:
"Automatically scan your network for devices. For this to work, you need to run UpSnap as root/admin and have nmap installed and available in your $PATH (For docker users, thats already the case and you don't need to do anything). Scanning might take some seconds.",
network_scan_ip_range: 'IP range',
network_scan_no_range: 'No scan range',
network_scan_unsaved_changes: 'Unsaved changes',
network_scan_running: 'Scan running',
network_scan: 'Scan',
network_scan_ip: 'IP:',
network_scan_mac: 'Mac:',
network_scan_mac_vendor: 'Mac vendor:',
network_scan_netmask: 'Netmask:',
network_scan_add_all: 'Add all devices',
network_scan_replace_netmask: 'Replace netmask for all devices?',
network_scan_new_netmask: 'New netmask',
network_scan_include_unknown: 'Include devices where name is "Unknown"'
},
login: {
welcome: 'Welcome',
email_label: 'Email or Username:',
password_label: 'Password:',
btn_more: 'More',
menu_title_auth_providers: 'Other Auth Providers',
btn_login: 'Login'
},
settings: {
page_title: 'Settings',
ping_interval_title: 'Ping interval',
ping_interval_desc1:
'Sets the interval in which the devices are pinged. Leave blank to use default value of <span class="badge">@every 3s</span>.',
ping_interval_desc2:
'Learn more about the correct syntax for cron on <a class="link" href="https://en.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> or refer to the <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">package documentation</a>.',
lazy_ping_title: 'Lazy ping',
lazy_ping_desc:
"When lazy ping is turned on, UpSnap will only ping devices if there is an active user visiting the website. If it's turned off, UpSnap will always ping devices.",
lazy_ping_enable: 'Enable',
website_title_title: 'Website title',
website_title_desc: 'Sets the title of the website and in the browser tab.',
icon_title: 'Icon',
icon_desc: 'Set a custom favicon. Supported file types are:',
upsnap_version: 'UpSnap version'
},
users: {
page_title: 'Users',
allow_create_devices: 'Allow {username} to create new devices and edit device groups',
device_permissions: 'Device permissions',
create_new_device: 'Create new device',
read: 'Read',
update: 'Update',
delete: 'Delete',
power: 'Power',
toggle: 'Toggle',
confirm_delete_title: 'Confirm delete',
confirm_delete_desc: 'Are you sure you want to delete {username}?',
create_new_user: 'Create new user',
username: 'Username',
password: 'Password',
password_confirm: 'Password confirm',
required_field: 'required field'
},
buttons: {
save: 'Save',
delete: 'Delete',
change: 'Change',
reset: 'Reset',
cancle: 'Cancle',
add: 'Add'
},
welcome: {
step1_page_title: 'Welcome to UpSnap 🥳',
step1_setup_desc: 'Please complete the following steps to finish the setup.',
step1_setup_btn_next: 'Next',
step2_page_title: 'Create an admin account',
step2_label_email: 'Email:',
step2_label_password: 'Password:',
step2_label_min_chars: 'min. 10 characters',
step2_label_password_confirm: 'Password confirm:',
step2_btn_create: 'Create',
step3_page_title: 'You are all set! 🎉',
step3_page_desc: 'Go ahead and add some devices to your dashboard.',
step3_btn_done: 'Lets go!',
not_expected_title: "I didn't expect you here! 🧐",
not_expected_desc: 'You are already done with the setup! Nothing to do.',
not_expected_back: 'Take me back',
progress_step1: 'Welcome',
progress_step2: 'Create account',
progress_step3: 'Done'
},
toasts: {
admin_saved: 'Admin saved',
user_saved: 'User saved',
user_created: 'User {username} created',
user_deleted: 'User {username} deleted',
settings_saved: 'Saved settings',
password_changed: 'Password changed. Please login again.',
passwords_missmatch: "Passwords don't match",
permissions_created: 'Permissions for {username} created',
permissions_deleted: 'Permissions for {username} deleted',
permissions_updated: 'Permissions for {username} updated',
permissions_updated_personal: 'Your permissions have been updated',
no_permission: "You don't have permission to visit {url}",
device_created: 'Created {device}',
devices_created_multiple: 'Created {count|int} devices',
device_updated: 'Updated {device}',
device_deleted: 'Deleted {device}',
group_created: 'Created group {group}',
group_deleted: 'Deleted group {group}'
},
navbar: {
theme: 'Theme',
new: 'New',
edit_account: 'Edit account',
logout: 'Logout'
}
} satisfies BaseTranslation;
export default en;
+11
View File
@@ -0,0 +1,11 @@
import type { FormattersInitializer } from 'typesafe-i18n';
import type { Locales, Formatters } from './i18n-types';
// export const initFormatters: FormattersInitializer<Locales, Formatters> = (locale: Locales) => {
export const initFormatters: FormattersInitializer<Locales, Formatters> = () => {
const formatters: Formatters = {
// add your formatter functions here
};
return formatters;
};
+17
View File
@@ -0,0 +1,17 @@
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
/* eslint-disable */
import { initI18nSvelte } from 'typesafe-i18n/svelte';
import type { Formatters, Locales, TranslationFunctions, Translations } from './i18n-types';
import { loadedFormatters, loadedLocales } from './i18n-util';
const { locale, LL, setLocale } = initI18nSvelte<
Locales,
Translations,
TranslationFunctions,
Formatters
>(loadedLocales, loadedFormatters);
export { locale, LL, setLocale };
export default LL;
File diff suppressed because it is too large Load Diff
+31
View File
@@ -0,0 +1,31 @@
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
/* eslint-disable */
import { initFormatters } from './formatters';
import type { Locales, Translations } from './i18n-types';
import { loadedFormatters, loadedLocales, locales } from './i18n-util';
const localeTranslationLoaders = {
de: () => import('./de'),
'de-DE': () => import('./de-DE'),
en: () => import('./en'),
'en-US': () => import('./en-US'),
pt: () => import('./pt'),
'pt-PT': () => import('./pt-PT')
};
const updateDictionary = (locale: Locales, dictionary: Partial<Translations>): Translations =>
(loadedLocales[locale] = { ...loadedLocales[locale], ...dictionary });
export const importLocaleAsync = async (locale: Locales): Promise<Translations> =>
(await localeTranslationLoaders[locale]()).default as unknown as Translations;
export const loadLocaleAsync = async (locale: Locales): Promise<void> => {
updateDictionary(locale, await importLocaleAsync(locale));
loadFormatters(locale);
};
export const loadAllLocalesAsync = (): Promise<void[]> => Promise.all(locales.map(loadLocaleAsync));
export const loadFormatters = (locale: Locales): void =>
void (loadedFormatters[locale] = initFormatters(locale));
+34
View File
@@ -0,0 +1,34 @@
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
/* eslint-disable */
import { initFormatters } from './formatters';
import type { Locales, Translations } from './i18n-types';
import { loadedFormatters, loadedLocales, locales } from './i18n-util';
import de from './de';
import de_DE from './de-DE';
import en from './en';
import en_US from './en-US';
import pt from './pt';
import pt_PT from './pt-PT';
const localeTranslations = {
de,
'de-DE': de_DE,
en,
'en-US': en_US,
pt,
'pt-PT': pt_PT
};
export const loadLocale = (locale: Locales): void => {
if (loadedLocales[locale]) return;
loadedLocales[locale] = localeTranslations[locale] as unknown as Translations;
loadFormatters(locale);
};
export const loadAllLocales = (): void => locales.forEach(loadLocale);
export const loadFormatters = (locale: Locales): void =>
void (loadedFormatters[locale] = initFormatters(locale));
+44
View File
@@ -0,0 +1,44 @@
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
/* eslint-disable */
import {
i18n as initI18n,
i18nObject as initI18nObject,
i18nString as initI18nString
} from 'typesafe-i18n';
import type { LocaleDetector } from 'typesafe-i18n/detectors';
import type { LocaleTranslationFunctions, TranslateByString } from 'typesafe-i18n';
import { detectLocale as detectLocaleFn } from 'typesafe-i18n/detectors';
import { initExtendDictionary } from 'typesafe-i18n/utils';
import type { Formatters, Locales, Translations, TranslationFunctions } from './i18n-types';
export const baseLocale: Locales = 'en-US';
export const locales: Locales[] = ['de', 'de-DE', 'en', 'en-US', 'pt', 'pt-PT'];
export const isLocale = (locale: string): locale is Locales => locales.includes(locale as Locales);
export const loadedLocales: Record<Locales, Translations> = {} as Record<Locales, Translations>;
export const loadedFormatters: Record<Locales, Formatters> = {} as Record<Locales, Formatters>;
export const extendDictionary = initExtendDictionary<Translations>();
export const i18nString = (locale: Locales): TranslateByString =>
initI18nString<Locales, Formatters>(locale, loadedFormatters[locale]);
export const i18nObject = (locale: Locales): TranslationFunctions =>
initI18nObject<Locales, Translations, TranslationFunctions, Formatters>(
locale,
loadedLocales[locale],
loadedFormatters[locale]
);
export const i18n = (): LocaleTranslationFunctions<Locales, Translations, TranslationFunctions> =>
initI18n<Locales, Translations, TranslationFunctions, Formatters>(
loadedLocales,
loadedFormatters
);
export const detectLocale = (...detectors: LocaleDetector[]): Locales =>
detectLocaleFn<Locales>(baseLocale, locales, ...detectors);
+8
View File
@@ -0,0 +1,8 @@
import pt from '../pt';
import type { Translation } from '../i18n-types';
const pt_PT = {
...(pt as unknown as Translation)
} satisfies Translation;
export default pt_PT;
+213
View File
@@ -0,0 +1,213 @@
import en from '../en';
import type { Translation } from '../i18n-types';
const pt = {
...(en as unknown as Translation),
home: {
page_title: 'Início',
order_groups: 'Grupos',
order_name: 'Nome',
order_ip: 'IP',
order_tooltip: 'Ordem',
no_devices: 'Sem dispositivos.',
add_first_device: 'Adicione o seu primeiro dispositivo',
grant_permissions:
'Peça ao administrador para alterar as suas permissões para dispositivos existentes ou para criar novos.'
},
account: {
page_title: 'Conta',
account_type_admin: 'Admin',
account_type_user: 'Utilizador',
avatar_title: 'Avatar',
language_title: 'Idioma',
language_option_auto: 'Automático',
change_password_title: 'Alterar password',
change_password_body: 'Terá de voltar a entrar após alterar a sua password.',
change_password_label: 'Antiga password',
change_password_new: 'Nova password',
change_password_confirm: 'Confirmar password'
},
device: {
page_title: 'Novo dispositivo',
tabs: ['Manual', 'Pesquisa de rede'],
card_btn_more: 'Mais',
card_btn_more_edit: 'Editar',
card_btn_more_sleep: 'Suspender',
card_btn_more_reboot: 'Reiniciar',
card_tooltip_wake_cron: 'Wake cron',
card_tooltip_shutdown_cron: 'Shutdown cron',
card_tooltip_wake_password: 'Wake password',
card_tooltip_last_status_change: 'Última alteração de estado',
card_password: 'Password',
card_nic_tooltip_pending: 'Pendente',
card_nic_tooltip_shutdown: 'Desligar',
card_nic_tooltip_shutdown_no_cmd: 'Comando para desligar não está definido',
card_nic_tooltip_shutdown_no_permission: 'Não tem permissão para desligar este dispositivo',
card_nic_tooltip_power: 'Ligar',
card_nic_tooltip_power_no_permission: 'Não tem permissão para ligar este dispositivo',
general: 'Geral',
general_name: 'Nome',
general_name_placeholder: 'Nome do dispositivo',
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Máscara de rede',
general_required_field: 'campo obrigatório',
ports: 'Portos',
ports_desc: 'UpSnap pode verificar se certos portos estão abertos.',
ports_add_new: 'Adicionar novo porto',
ports_name: 'Nome',
ports_number: 'Número',
link: 'Link',
link_desc:
'Permite que o nome do seu dispositivo seja um link. Perfeito para dashboard, por exemplo.',
wake: 'Ligar',
wake_desc: 'Poderá ligar este dispositivo através dum cron job agendado.',
wake_cron: 'Wake cron',
wake_cron_enable: 'Ativar wake cron',
sol: 'Sleep-On-LAN',
sol_desc1:
'Poderá suspender o seu dispositivo usando a ferramenta <a class="link" href="https://github.com/SR-G/sleep-on-lan" target="_blank">Sleep-On-LAN</a>. Sleep-On-LAN (SOL) é uma ferramenta externa que terá de ser executada no dispositivo que quer suspender, facilitando um REST endpoint. Para instruções em como configurar Sleep-On-LAN, veja a secção <a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Usage</a>.',
sol_desc2:
'SOL envia pedidos através de HTTP em vez de UDP para permitir autenticação e tornar os pedidos mais seguros.',
sol_desc3:
'Portanto, tenha a certeza que inclui <span class="badge">HTTP:&lt;SEU_PORTO&gt;</span> na secção <span class="badge">Listeners</span> de <a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank">configuração SOL</a>.',
sol_enable: 'Ativar Sleep-On-LAN',
sol_port: 'Porto SOL',
sol_authorization: 'Autenticação',
sol_user: 'Utilizador SOL',
sol_password: 'Password SOL',
shutdown: 'Desligar',
shutdown_desc:
'Este <strong>comando shell</strong> irá correr dentro do teu container (no caso de usar docker) ou no seu host (na versão standalone). Para verificar que funciona, pode executar o comando primeiro no seu container/host. Comandos comuns são <span class="badge">net rpc</span> para windows, <span class="badge">sshpass</span> para linux ou <span class="badge">curl</span> em geral para enviar pedidos web.',
shutdown_examples: 'Exemplos:',
shutdown_examples_windows: 'Desligar dispositivo windows remoto:',
shutdown_examples_linux: 'Desligar dispositivo linux remoto:',
shutdown_cmd: 'Comando para desligar',
shutdown_cron_desc:
'Assim como pode ter um cron job para ligar o seu dispositivo, pode também usar para desligar.',
shutdown_cron: 'Shutdown cron',
shutdown_cron_enable: 'Ativar shutdown cron',
password: 'Password',
password_desc:
'Alguns adaptadores de rede têm a opção de definir uma password para magic packets, também conhecido como <span class="badge">SecureON</span>. A password só poderá conter 0, 4 ou 6 caracteres.',
groups: 'Grupos',
groups_desc: 'Pode adicionar dispositivos a grupos para ordenar na dashboard.',
groups_placeholder: "e.g. 'Cave' ou 'Escritório'",
network_scan_range_saved: 'Intervalo de pesquisa guardado',
network_scan_desc:
'Procurar automaticamente na sua rede por dispositivos. Terá de executar o UpSnap como root/admin e ter o nmap instalado e disponível no seu $PATH (No caso de usar docker, não tem de fazer nada). Poderá demorar alguns segundos.',
network_scan_ip_range: 'Intervalo IP',
network_scan_no_range: 'Sem intervalo de IP',
network_scan_unsaved_changes: 'Alterações por guardar',
network_scan_running: 'Pesquisa em curso',
network_scan: 'Pesquisar',
network_scan_ip: 'IP:',
network_scan_mac: 'Mac:',
network_scan_mac_vendor: 'Fornecedor Mac:',
network_scan_netmask: 'Máscara de rede:',
network_scan_add_all: 'Adicionar todos os dispositivos',
network_scan_replace_netmask: 'Substituir máscara de rede para todos os dispositivos?',
network_scan_new_netmask: 'Nova máscara de rede',
network_scan_include_unknown: 'Incluir dispositivos em que o nome é "Unknown"'
},
login: {
welcome: 'Bem-vindo',
email_label: 'Email ou Utilizador:',
password_label: 'Password:',
btn_more: 'Mais',
menu_title_auth_providers: 'Outros provedores de autenticação',
btn_login: 'Entrar'
},
settings: {
page_title: 'Definições',
ping_interval_title: 'Intervalo ping',
ping_interval_desc1:
'Define o intervalo em que o ping é executado. Deixe em branco para usar o valor por defeito de <span class="badge">@every 3s</span>.',
ping_interval_desc2:
'Poderá ver a sintaxe correta para cron em <a class="link" href="https://en.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> ou em <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">documentação cron</a>.',
lazy_ping_title: 'Lazy ping',
lazy_ping_desc:
'Quando o lazy ping está activo, o UpSnap irá apenas executar o ping se existir um utilizador ativo no website. Se desligado, o UpSnap irá executar sempre o ping.',
lazy_ping_enable: 'Activar',
website_title_title: 'Título do website',
website_title_desc: 'Define o título do website.',
icon_title: 'Ícone',
icon_desc: 'Define um favicon personalizado. Tipos de ficheiros suportados são:',
upsnap_version: 'Versão UpSnap'
},
users: {
page_title: 'Utilizadores',
allow_create_devices:
'Permitir a {username} adicionar novos dispositivos e editar grupos de dispositivos',
device_permissions: 'Permissões de dispositivos',
create_new_device: 'Adicionar dispositivo',
read: 'Ver',
update: 'Editar',
delete: 'Apagar',
power: 'Ligar/desligar',
toggle: 'Alternar',
confirm_delete_title: 'Confirmar',
confirm_delete_desc: 'Tem a certeza que quer apagar {username}?',
create_new_user: 'Criar novo utilizador',
username: 'Utilizador',
password: 'Password',
password_confirm: 'Confirmar password',
required_field: 'campo obrigatório'
},
buttons: {
save: 'Guardar',
delete: 'Apagar',
change: 'Alterar',
reset: 'Repor',
cancle: 'Cancelar',
add: 'Adicionar'
},
welcome: {
step1_page_title: 'Bem-vindo ao UpSnap 🥳',
step1_setup_desc: 'Complete os próximos passos para terminar a configuração.',
step1_setup_btn_next: 'Seguinte',
step2_page_title: 'Criar conta de administrador',
step2_label_email: 'Email:',
step2_label_password: 'Password:',
step2_label_min_chars: 'min. 10 caracteres',
step2_label_password_confirm: 'Confirmar password:',
step2_btn_create: 'Criar',
step3_page_title: 'Concluído! 🎉',
step3_page_desc: 'Adicione alguns dispositivos à sua dashboard.',
step3_btn_done: 'Vamos!',
not_expected_title: 'Não esperava ver aqui alguém! 🧐',
not_expected_desc: 'A configuração está concluída. Nada a fazer aqui.',
not_expected_back: 'Voltar',
progress_step1: 'Bem-vindo',
progress_step2: 'Criar conta',
progress_step3: 'Concluído'
},
toasts: {
admin_saved: 'Administrador atualizado',
user_saved: 'Utilizador atualizado',
user_created: 'Utilizador {username} criado',
user_deleted: 'Utilizador {username} apagado',
settings_saved: 'Definições guardadas',
password_changed: 'Password alterada. Terá de entrar novamente.',
passwords_missmatch: 'As passwords não correspondem',
permissions_created: 'Permissões criadas para {username}',
permissions_deleted: 'Permissões apagadas para {username}',
permissions_updated: 'Permissões atualizadas para {username}',
permissions_updated_personal: 'As suas permissões foram atualizadas',
no_permission: 'Não tem permissão para visitar {url}',
device_created: 'Adicionado dispositivo {device}',
devices_created_multiple: 'Adicionados {count|int} dispositivos',
device_updated: '{device} atualizado',
device_deleted: '{device} apagado',
group_created: 'Grupo {group} criado',
group_deleted: 'Grupo {group} apagado'
},
navbar: {
theme: 'Tema',
new: 'Novo',
edit_account: 'Editar conta',
logout: 'Sair'
}
} satisfies Translation;
export default pt;
+2 -3
View File
@@ -1,6 +1,6 @@
import { writable } from 'svelte/store';
import PocketBase from 'pocketbase';
import type { Permission } from '$lib/types/permission';
import PocketBase from 'pocketbase';
import { writable } from 'svelte/store';
// set backend url based on environment
export const backendUrl = import.meta.env.DEV ? 'http://127.0.0.1:8090/' : '/';
@@ -12,4 +12,3 @@ pb.autoCancellation(false);
// export stores
export const pocketbase = writable(pb);
export const permission = writable({} as Permission);
export const isAdmin = writable(false);
+1 -1
View File
@@ -1,5 +1,5 @@
import type { SettingsPrivate, SettingsPublic } from '$lib/types/settings';
import { writable } from 'svelte/store';
import type { SettingsPublic, SettingsPrivate } from '$lib/types/settings';
export const settingsPub = writable<SettingsPublic>();
export const settingsPriv = writable<SettingsPrivate>();
+27 -15
View File
@@ -1,23 +1,35 @@
<script lang="ts">
import '../app.css';
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { pocketbase, backendUrl, permission, isAdmin } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import Navbar from '$lib/components/Navbar.svelte';
import Transition from '$lib/components/Transition.svelte';
import toast, { Toaster, type ToastOptions } from 'svelte-french-toast';
import type { SettingsPublic } from '$lib/types/settings';
import LL, { setLocale } from '$lib/i18n/i18n-svelte';
import { baseLocale, locales } from '$lib/i18n/i18n-util';
import { loadLocaleAsync } from '$lib/i18n/i18n-util.async';
import { backendUrl, permission, pocketbase } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import type { Permission } from '$lib/types/permission';
import type { SettingsPublic } from '$lib/types/settings';
import { onMount } from 'svelte';
import toast, { Toaster, type ToastOptions } from 'svelte-french-toast';
import { detectLocale, localStorageDetector, navigatorDetector } from 'typesafe-i18n/detectors';
import '../app.css';
const toastOptions: ToastOptions = {
duration: 5000
};
$: isAdmin.set($pocketbase.authStore.isValid && !$pocketbase.authStore.model?.collectionName);
onMount(async () => {
// load locale
const detectedLocale = detectLocale(
baseLocale,
locales,
localStorageDetector,
navigatorDetector
);
await loadLocaleAsync(detectedLocale);
setLocale(detectedLocale);
$pocketbase.authStore.onChange(() => {
// load user permissions
if ($pocketbase.authStore.model?.collectionName === 'users') {
@@ -33,7 +45,7 @@
$pocketbase.collection('permissions').subscribe('*', (event) => {
permission.set(event.record as Permission);
toast.success('Your permissions have been updated.');
toast.success($LL.toasts.permissions_updated_personal());
});
}
});
@@ -45,7 +57,7 @@
}
// redirect to welcome page if setup is not completed
if (!$settingsPub.setup_completed && $page.url.pathname !== '/welcome') {
if ($settingsPub.setup_completed === false && $page.url.pathname !== '/welcome') {
goto('/welcome');
return;
}
@@ -69,17 +81,17 @@
return;
}
if ($pocketbase.authStore.model?.collectionName === 'users') {
if ($pocketbase.authStore.isAdmin) {
await $pocketbase.admins.authRefresh().catch(() => {
goto('/login');
});
} else {
await $pocketbase
.collection('users')
.authRefresh()
.catch(() => {
goto('/login');
});
} else {
await $pocketbase.admins.authRefresh().catch(() => {
goto('/login');
});
}
});
+16 -15
View File
@@ -1,17 +1,18 @@
<script lang="ts">
import { onMount } from 'svelte';
import { pocketbase, permission, isAdmin } from '$lib/stores/pocketbase';
import { browser } from '$app/environment';
import DeviceCard from '$lib/components/DeviceCard.svelte';
import PageLoading from '$lib/components/PageLoading.svelte';
import toast from 'svelte-french-toast';
import Fa from 'svelte-fa';
import LL from '$lib/i18n/i18n-svelte';
import { permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device, Group } from '$lib/types/device';
import {
faChevronCircleLeft,
faChevronCircleRight,
faPlus
} from '@fortawesome/free-solid-svg-icons';
import { browser } from '$app/environment';
import type { Device } from '$lib/types/device';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let loading = true;
let devices = [] as Device[];
@@ -33,7 +34,7 @@
$: {
devicesWithGroup = {};
devices.forEach((dev) => {
dev?.expand?.groups?.forEach((group) => {
dev?.expand?.groups?.forEach((group: Group) => {
if (!devicesWithGroup[group.name]) {
devicesWithGroup[group.name] = [];
}
@@ -107,7 +108,7 @@
class="join-item btn"
type="button"
on:click={() => (orderByGroups = !orderByGroups)}
>Groups
>{$LL.home.order_groups()}
<input
type="checkbox"
class="checkbox checked:checkbox-primary"
@@ -120,7 +121,7 @@
class="join-item btn"
type="radio"
name="order"
aria-label="Name"
aria-label={$LL.home.order_name()}
bind:group={orderBy}
value="name"
/>
@@ -128,12 +129,12 @@
class="join-item btn"
type="radio"
name="order"
aria-label="IP"
aria-label={$LL.home.order_ip()}
bind:group={orderBy}
value="ip"
/>
{/if}
<div class="tooltip" data-tip="Order">
<div class="tooltip" data-tip={$LL.home.order_tooltip()}>
<button class="join-item btn" on:click={() => (orderExpanded = !orderExpanded)}>
{#if orderExpanded}
<Fa icon={faChevronCircleRight} size="lg" />
@@ -175,16 +176,16 @@
{/if}
{:else}
<div class="container text-center">
<p>No devices here.</p>
{#if $isAdmin || $permission.create}
<p>{$LL.home.no_devices()}</p>
{#if $pocketbase.authStore.isAdmin || $permission.create}
<p>
<a href="/device/new" class="btn btn-ghost"
><Fa icon={faPlus} class="ms-2" />Add your first device
><Fa icon={faPlus} class="ms-2" />{$LL.home.add_first_device()}
</a>
</p>
{:else}
<p>
Please ask the admin to grant you permissions to existing devices or to create new ones.
{$LL.home.grant_permissions()}
</p>
{/if}
</div>
+99 -30
View File
@@ -1,11 +1,32 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { isAdmin, pocketbase, backendUrl } from '$lib/stores/pocketbase';
import toast from 'svelte-french-toast';
import Fa from 'svelte-fa';
import LL, { setLocale } from '$lib/i18n/i18n-svelte';
import type { Locales } from '$lib/i18n/i18n-types';
import { baseLocale, locales } from '$lib/i18n/i18n-util';
import { loadLocaleAsync } from '$lib/i18n/i18n-util.async';
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
import { faSave } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
import { detectLocale, navigatorDetector } from 'typesafe-i18n/detectors';
let newAvatar: number;
// locales
const languageEmojis = {
en: '🇺🇸',
'en-US': '🇺🇸',
de: '🇩🇪',
'de-DE': '🇩🇪',
pt: '🇵🇹',
'pt-PT': '🇵🇹'
};
let localStorageLang: Locales | 'auto' = 'auto';
let selectedLanguage: Locales | 'auto' = localStorageLang;
$: selectedLanguage = localStorageLang as Locales;
// password change
let newPassword = {
old: '',
password: '',
@@ -21,13 +42,27 @@
passwordConfirm: newPassword.confirm
});
function changeAvatar() {
if ($isAdmin) {
onMount(() => {
localStorageLang = (localStorage.getItem('lang') as Locales) || 'auto';
});
async function saveUser() {
let newLang = selectedLanguage;
if (newLang === 'auto') {
localStorage.removeItem('lang');
newLang = detectLocale(baseLocale, locales, navigatorDetector);
} else {
localStorage.setItem('lang', newLang);
}
await loadLocaleAsync(newLang);
setLocale(newLang);
if ($pocketbase.authStore.isAdmin) {
if (!$pocketbase.authStore.model?.id) return;
$pocketbase.admins
.update($pocketbase.authStore.model.id, { avatar: newAvatar })
.then(() => {
toast.success('Avatar saved.');
toast.success($LL.toasts.admin_saved());
})
.catch((err) => {
toast.error(err.message);
@@ -38,7 +73,7 @@
.collection('users')
.update($pocketbase.authStore.model.id, { avatar: newAvatar })
.then(() => {
toast.success('Avatar saved.');
toast.success($LL.toasts.user_saved());
})
.catch((err) => {
toast.error(err.message);
@@ -48,7 +83,7 @@
function changePassword() {
fetch(
`${backendUrl}api/${$isAdmin ? 'admins' : `collections/users/records`}/${
`${backendUrl}api/${$pocketbase.authStore.isAdmin ? 'admins' : `collections/users/records`}/${
$pocketbase.authStore.model?.id
}`,
{
@@ -57,12 +92,12 @@
Authorization: $pocketbase.authStore.token,
'Content-Type': 'application/json'
},
body: $isAdmin ? adminBody : userBody
body: $pocketbase.authStore.isAdmin ? adminBody : userBody
}
)
.then(async (data) => {
if (data.ok) {
toast.success('Password changed. Please login again.');
toast.success($LL.toasts.password_changed());
$pocketbase.authStore.clear();
goto('/login');
} else {
@@ -70,7 +105,7 @@
if (j?.data?.password?.message) {
toast.error(j?.data?.password?.message);
} else if (j?.data?.passwordConfirm?.message) {
toast.error("Passwords don't match.");
toast.error($LL.toasts.passwords_missmatch());
} else if (j.data?.oldPassword?.message) {
toast.error(j.data.oldPassword.message);
} else {
@@ -82,9 +117,14 @@
toast.error(err.message);
});
}
function localeToFullName(lang: Locales) {
const languageNames = new Intl.DisplayNames([lang], { type: 'language' });
return languageNames.of(lang) ?? '';
}
</script>
<h1 class="text-3xl font-bold mb-8">Account</h1>
<h1 class="text-3xl font-bold mb-8">{$LL.account.page_title()}</h1>
<div class="card w-full bg-base-300 shadow-xl">
<div class="card-body">
<div class="flex flex-row gap-4 items-center">
@@ -103,13 +143,19 @@
</div>
<div>
<h2 class="card-title">
{$isAdmin ? $pocketbase.authStore.model?.email : $pocketbase.authStore.model?.username}
{$pocketbase.authStore.isAdmin
? $pocketbase.authStore.model?.email
: $pocketbase.authStore.model?.username}
</h2>
<h3>{$isAdmin ? 'Admin' : 'User'}</h3>
<h3>
{$pocketbase.authStore.isAdmin
? $LL.account.account_type_admin()
: $LL.account.account_type_user()}
</h3>
</div>
</div>
<h2 class="card-title mt-4">Avatar</h2>
<form on:submit|preventDefault={changeAvatar}>
<form on:submit|preventDefault={saveUser}>
<h2 class="card-title mt-4 mb-2">{$LL.account.avatar_title()}</h2>
<div class="flex flex-row flex-wrap gap-4">
{#each [...Array(10).keys()] as i}
<div class="avatar btn btn-ghost btn-circle">
@@ -133,30 +179,49 @@
<!-- svelte static build will fail, because the image gets served from pocketbase
and is not a local static file -->
{#if $pocketbase.authStore.model?.id}
<img src="{backendUrl}_/images/avatars/avatar{i}.svg" alt="Avatar {i}" />
<img
src="{backendUrl}_/images/avatars/avatar{i}.svg"
alt="{$LL.account.avatar_title()} {i}"
/>
{/if}
</div>
</div>
{/each}
</div>
<button type="submit" class="btn btn-success mt-2"><Fa icon={faSave} />Save</button>
<h2 class="card-title mt-4 mb-2">{$LL.account.language_title()}</h2>
<select class="select select-bordered w-full max-w-xs" bind:value={selectedLanguage}>
<option value="auto" selected={localStorageLang === null}
>🌐 {$LL.account.language_option_auto()}</option
>
{#each locales.sort( (a, b) => a.localeCompare( b, undefined, { sensitivity: 'base' } ) ) as lang}
<option value={lang} selected={localStorageLang === lang}>
{languageEmojis[lang]}
{localeToFullName(lang)} [{lang}]
</option>
{/each}
</select>
<div class="mt-2">
<button type="submit" class="btn btn-success mt-2"
><Fa icon={faSave} />{$LL.buttons.save()}</button
>
</div>
</form>
</div>
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Change password</h2>
<p>After the password has been changed, you will need to log in again.</p>
<h2 class="card-title">{$LL.account.change_password_title()}</h2>
<p>{$LL.account.change_password_body()}</p>
<form on:submit|preventDefault={changePassword}>
<div class="form-control w-full max-w-xs">
{#if !$isAdmin}
{#if !$pocketbase.authStore.isAdmin}
<label class="label" for="password-old">
<span class="label-text">Old password</span>
<span class="label-text">{$LL.account.change_password_label()}</span>
</label>
<input
id="password-old"
type="password"
placeholder="Old password"
placeholder={$LL.account.change_password_label()}
class="input input-bordered w-full max-w-xs"
minlength="5"
maxlength="72"
@@ -165,14 +230,14 @@
/>
{/if}
<label class="label" for="password-new">
<span class="label-text">New password</span>
<span class="label-text">{$LL.account.change_password_new()}</span>
</label>
<input
id="password-new"
type="password"
placeholder="New password"
placeholder={$LL.account.change_password_new()}
class="input input-bordered w-full max-w-xs"
minlength={$isAdmin ? 10 : 5}
minlength={$pocketbase.authStore.isAdmin ? 10 : 5}
maxlength="72"
bind:value={newPassword.password}
required
@@ -180,20 +245,24 @@
</div>
<div class="form-control w-full max-w-xs">
<label class="label" for="password-confirm">
<span class="label-text">Confirm password</span>
<span class="label-text">{$LL.account.change_password_confirm()}</span>
</label>
<input
id="password-confirm"
type="password"
placeholder="New password"
placeholder={$LL.account.change_password_confirm()}
class="input input-bordered w-full max-w-xs"
minlength={$isAdmin ? 10 : 5}
minlength={$pocketbase.authStore.isAdmin ? 10 : 5}
maxlength="72"
bind:value={newPassword.confirm}
required
/>
</div>
<button type="submit" class="btn btn-success mt-2"><Fa icon={faSave} />Save</button>
<div class="mt-2">
<button type="submit" class="btn btn-success mt-2"
><Fa icon={faSave} />{$LL.buttons.change()}</button
>
</div>
</form>
</div>
</div>
+11 -7
View File
@@ -1,15 +1,16 @@
<script lang="ts">
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { pocketbase, permission, isAdmin } from '$lib/stores/pocketbase';
import PageLoading from '$lib/components/PageLoading.svelte';
import { page } from '$app/stores';
import DeviceForm from '$lib/components/DeviceForm.svelte';
import toast from 'svelte-french-toast';
import PageLoading from '$lib/components/PageLoading.svelte';
import LL from '$lib/i18n/i18n-svelte';
import { permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device, Port } from '$lib/types/device';
import toast from 'svelte-french-toast';
$: if (Object.hasOwn($permission, 'update')) {
if (!$isAdmin && !$permission.update.includes($page.params.id)) {
toast(`You don't have permission to visit ${$page.url.pathname}`, {
if (!$pocketbase.authStore.isAdmin && !$permission.update.includes($page.params.id)) {
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
icon: '⛔'
});
goto('/');
@@ -22,6 +23,9 @@
.getOne($page.params.id, { expand: 'ports,groups' });
let device = resp as Device;
if (!device.expand) device.expand = {};
if (!device.expand.ports) {
device.expand.ports = [] as Port[];
}
@@ -33,7 +37,7 @@
{#await getDevice()}
<PageLoading />
{:then device}
<h1 class="text-3xl font-bold mb-8">{device.name}</h1>
<h1 class="text-3xl font-bold mb-8 sm:break-all">{device.name}</h1>
<DeviceForm {device} />
{:catch err}
<div class="container max-w-lg mx-auto">
+13 -13
View File
@@ -1,13 +1,14 @@
<script lang="ts">
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import DeviceForm from '$lib/components/DeviceForm.svelte';
import NetworkScan from '$lib/components/NetworkScan.svelte';
import { permission, isAdmin } from '$lib/stores/pocketbase';
import LL from '$lib/i18n/i18n-svelte';
import { permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device, Port } from '$lib/types/device';
import { faBinoculars, faWrench } from '@fortawesome/free-solid-svg-icons';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
import type { Device, Port } from '$lib/types/device';
let device: Device = {
expand: {
@@ -17,8 +18,8 @@
} as Device;
$: if (Object.hasOwn($permission, 'create')) {
if (!$isAdmin && !$permission.create) {
toast(`You don't have permission to visit ${$page.url.pathname}`, {
if (!$pocketbase.authStore.isAdmin && !$permission.create) {
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
icon: '⛔'
});
goto('/');
@@ -28,29 +29,28 @@
let tabs = [
{
name: 'manual',
ll_name: $LL.device.tabs[0](),
icon: faWrench,
show: true
},
{
name: 'network scan',
name: 'scan',
ll_name: $LL.device.tabs[1](),
icon: faBinoculars,
show: $isAdmin
show: $pocketbase.authStore.isAdmin
}
];
let activeTab = 'manual';
</script>
<h1 class="text-3xl font-bold mb-8">New device</h1>
<h1 class="text-3xl font-bold mb-8">{$LL.device.page_title()}</h1>
<div class="flex justify-center mb-6">
<ul class="menu menu-horizontal bg-base-300 rounded-box gap-1">
{#each tabs as tab}
{#if tab.show}
<li>
<button
class="capitalize"
class:active={activeTab === tab.name}
on:click={() => (activeTab = tab.name)}
>{tab.name} <Fa icon={tab.icon} class="ms-2" /></button
<button class:active={activeTab === tab.name} on:click={() => (activeTab = tab.name)}
>{tab.ll_name} <Fa icon={tab.icon} class="ms-2" /></button
>
</li>
{/if}
+47 -12
View File
@@ -1,12 +1,13 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { pocketbase, isAdmin } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import Fa from 'svelte-fa';
import { faLockOpen, faEye } from '@fortawesome/free-solid-svg-icons';
import { toggleVisibility } from '$lib/helpers/forms';
import toast from 'svelte-french-toast';
import LL from '$lib/i18n/i18n-svelte';
import { pocketbase } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import { faEye, faLockOpen, faQuestionCircle } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let inputPassword: HTMLInputElement;
let form = {
@@ -24,7 +25,6 @@
$pocketbase.admins
.authWithPassword(form.email, form.password)
.then(() => {
isAdmin.set(true);
goto('/');
})
.catch(() => {
@@ -32,7 +32,6 @@
.collection('users')
.authWithPassword(form.email, form.password)
.then(() => {
isAdmin.set(false);
goto('/');
})
.catch((err) => {
@@ -40,6 +39,20 @@
});
});
}
function loginOIDC() {
$pocketbase
.collection('users')
.authWithOAuth2({ provider: 'oidc' })
.then(() => {
goto('/');
})
.catch((err) => {
console.log(err);
toast.error(err.message);
});
}
</script>
<div class="mt-10 flex items-center justify-center">
@@ -50,11 +63,11 @@
{/if}
<div class="flex flex-row gap-4">
<figure class="w-16"><img src="/gopher.svg" alt="Gopher" /></figure>
<h2 class="card-title">Welcome</h2>
<h2 class="card-title">{$LL.login.welcome()}</h2>
</div>
<form class="form-control w-full" on:submit|preventDefault={tryAdminThenUser}>
<label class="label" for="email">
<span class="label-text">Email or Username:</span>
<span class="label-text">{$LL.login.email_label()}</span>
</label>
<input
id="email"
@@ -64,7 +77,7 @@
bind:value={form.email}
/>
<label class="label" for="password">
<span class="label-text">Password:</span>
<span class="label-text">{$LL.login.password_label()}</span>
</label>
<label class="relative block">
<div
@@ -85,8 +98,30 @@
bind:this={inputPassword}
/>
</label>
<div class="card-actions justify-end mt-4">
<button class="btn btn-primary" type="submit">Login <Fa icon={faLockOpen} /></button>
<div class="card-actions mt-4">
<div class="dropdown">
<label tabindex="-1" class="btn btn-neutral" for="other-providers"
>{$LL.login.btn_more()}</label
>
<ul
id="other-providers"
tabindex="-1"
class="dropdown-content z-[1] menu p-2 shadow bg-base-200 rounded-box w-56"
>
<li class="menu-title flex flex-row gap-2 items-center">
{$LL.login.menu_title_auth_providers()}
<a href="https://github.com/seriousm4x/UpSnap/wiki/Auth-providers" target="_blank"
><Fa icon={faQuestionCircle} /></a
>
</li>
<li>
<button type="button" on:click={loginOIDC}>OIDC 1</button>
</li>
</ul>
</div>
<button class="btn btn-primary ms-auto" type="submit"
>{$LL.login.btn_login()} <Fa icon={faLockOpen} /></button
>
</div>
</form>
</div>
+38 -39
View File
@@ -1,15 +1,16 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { settingsPub, settingsPriv } from '$lib/stores/settings';
import { pocketbase, backendUrl, isAdmin } from '$lib/stores/pocketbase';
import PageLoading from '$lib/components/PageLoading.svelte';
import toast from 'svelte-french-toast';
import Fa from 'svelte-fa';
import { faSave } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import { page } from '$app/stores';
import { PUBLIC_VERSION } from '$env/static/public';
import type { SettingsPublic, SettingsPrivate } from '$lib/types/settings';
import PageLoading from '$lib/components/PageLoading.svelte';
import LL from '$lib/i18n/i18n-svelte';
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
import { settingsPriv, settingsPub } from '$lib/stores/settings';
import type { SettingsPrivate, SettingsPublic } from '$lib/types/settings';
import { faSave } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let settingsPubClone: SettingsPublic | undefined;
let settingsPrivClone: SettingsPrivate | undefined;
@@ -17,8 +18,8 @@
let faviconInputElement: HTMLInputElement;
onMount(() => {
if (!$isAdmin) {
toast(`You don't have permission to visit ${$page.url.pathname}`, {
if (!$pocketbase.authStore.isAdmin) {
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
icon: '⛔'
});
goto('/');
@@ -76,7 +77,7 @@
.collection('settings_private')
.update(settingsPrivClone.id, settingsPrivClone)
.then((res) => {
toast.success('Saved settings');
toast.success($LL.toasts.settings_saved());
settingsPriv.set(res as SettingsPrivate);
goto('/');
})
@@ -89,23 +90,21 @@
{#if settingsPubClone === undefined || settingsPrivClone === undefined}
<PageLoading />
{:else}
<h1 class="text-3xl font-bold mb-8">Settings</h1>
<h1 class="text-3xl font-bold mb-8">{$LL.settings.page_title()}</h1>
<form on:submit|preventDefault={save}>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Ping interval</h2>
<h2 class="card-title">{$LL.settings.ping_interval_title()}</h2>
<p class="mt-2">
Sets the interval in which the devices are pinged. Leave blank to use default value of <span
class="badge">@every 3s</span
>.
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.settings.ping_interval_desc1()}
</p>
<p>
Learn more about the correct syntax for cron on
<a target="_blank" class="link" href="https://en.wikipedia.org/wiki/Cron">Wikipedia</a>
or refer to the
<a target="_blank" class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3"
>package documentation</a
>.
<!-- Usage of @html is not a nice way to do this, but it's safe in this case. If someones finds
a good solution to avoid @html but still be able to use multiple links in a single sentence,
please create a pr/issue. -->
<!-- eslint-disable svelte/no-at-html-tags -->
{@html $LL.settings.ping_interval_desc2()}
</p>
<div class="form-control w-full mt-2">
<input
@@ -115,10 +114,9 @@
bind:value={settingsPrivClone.interval}
/>
</div>
<h2 class="card-title mt-2">Lazy ping</h2>
<h2 class="card-title mt-2">{$LL.settings.lazy_ping_title()}</h2>
<p class="mt-2">
When lazy ping is turned on, UpSnap will only ping devices if there is an active user
visiting the website. If it's turned off, UpSnap will always ping devices.
{$LL.settings.lazy_ping_desc()}
</p>
<div class="form-control w-fit">
<label class="label cursor-pointer gap-2">
@@ -127,15 +125,15 @@
class="checkbox checkbox-primary"
bind:checked={settingsPrivClone.lazy_ping}
/>
<span class="label-text">Enable</span>
<span class="label-text">{$LL.settings.lazy_ping_enable()}</span>
</label>
</div>
</div>
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Website title</h2>
<p class="my-2">Sets the title of the website and in the browser tab.</p>
<h2 class="card-title">{$LL.settings.website_title_title()}</h2>
<p class="my-2">{$LL.settings.website_title_desc()}</p>
<div class="form-control w-full">
<input
type="text"
@@ -148,12 +146,12 @@
</div>
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Icon</h2>
<h2 class="card-title">{$LL.settings.icon_title()}</h2>
<p class="my-2">
Set a custom favicon. Supported file types are
<span class="badge">.ico</span>, <span class="badge">.png</span>,
<span class="badge">.svg</span>, <span class="badge">.gif</span> and
<span class="badge">.jpg/.jpeg</span>.
{$LL.settings.icon_desc()}
<span class="badge">.ico</span> <span class="badge">.png</span>
<span class="badge">.svg</span> <span class="badge">.gif</span>
<span class="badge">.jpg/.jpeg</span>
</p>
<div>
<img
@@ -175,22 +173,23 @@
<button
class="btn btn-outline btn-error"
on:click={() => resetFavicon()}
on:keydown={() => resetFavicon()}>Reset</button
on:keydown={() => resetFavicon()}>{$LL.buttons.reset()}</button
>
</div>
</div>
</div>
<div class="card-actions justify-end mt-6">
<button class="btn btn-success" type="submit"><Fa icon={faSave} />Save</button>
<button class="btn btn-success" type="submit"><Fa icon={faSave} />{$LL.buttons.save()}</button
>
</div>
</form>
<div class="container mx-auto text-center mt-6">
{#if PUBLIC_VERSION === ''}
UpSnap version: (untracked)
{$LL.settings.upsnap_version()}: (untracked)
{:else}
UpSnap version: <a
href="https://github.com/seriousm4x/UpSnap/releases/tag/{PUBLIC_VERSION}"
class="link">{PUBLIC_VERSION}</a
{$LL.settings.upsnap_version()}:
<a href="https://github.com/seriousm4x/UpSnap/releases/tag/{PUBLIC_VERSION}" class="link"
>{PUBLIC_VERSION}</a
>
{/if}
</div>
+72 -49
View File
@@ -1,15 +1,16 @@
<script lang="ts">
import { onMount } from 'svelte';
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { pocketbase, isAdmin, backendUrl } from '$lib/stores/pocketbase';
import { page } from '$app/stores';
import PageLoading from '$lib/components/PageLoading.svelte';
import toast from 'svelte-french-toast';
import Fa from 'svelte-fa';
import { faPlus, faSave, faTrash } from '@fortawesome/free-solid-svg-icons';
import type { User } from '$lib/types/user';
import LL from '$lib/i18n/i18n-svelte';
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
import type { Device } from '$lib/types/device';
import type { Permission } from '$lib/types/permission';
import type { User } from '$lib/types/user';
import { faPlus, faRetweet, faSave, faTrash } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let getUsersPromise = getUsers();
let getPermissionsPromise = getPermissions();
@@ -32,8 +33,8 @@
});
onMount(() => {
if (!$isAdmin) {
toast(`You don't have permission to visit ${$page.url.pathname}`, {
if (!$pocketbase.authStore.isAdmin) {
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
icon: '⛔'
});
goto('/');
@@ -58,7 +59,7 @@
.collection('users')
.create(newUser)
.then((data) => {
toast.success(`User ${data.username} created.`);
toast.success($LL.toasts.user_created({ username: data.username }));
newUser.username = '';
newUser.password = '';
newUser.passwordConfirm = '';
@@ -74,14 +75,14 @@
.collection('users')
.delete(user.id)
.then(async () => {
toast.success(`User ${user.username} deleted.`);
toast.success($LL.toasts.user_deleted({ username: user.username }));
let permission = permissions.find((perm) => perm.user === user.id);
if (permission?.id !== undefined) {
await $pocketbase
.collection('permissions')
.delete(permission.id)
.then(() => {
toast.success(`Permissions for ${user.username} deleted.`);
toast.success($LL.toasts.permissions_deleted({ username: user.username }));
})
.catch((err) => {
toast.error(err.message);
@@ -130,7 +131,7 @@
// if (i > -1) {
// permissions[i] = data as Permission;
// }
toast.success(`Permissions for ${user.username} created.`);
toast.success($LL.toasts.permissions_created({ username: user.username }));
reload();
})
.catch((err) => {
@@ -142,7 +143,7 @@
.collection('permissions')
.update(permission.id, permission)
.then(() => {
toast.success(`Permissions for ${user.username} updated.`);
toast.success($LL.toasts.permissions_updated({ username: user.username }));
reload();
})
.catch((err) => {
@@ -179,7 +180,7 @@
{#await Promise.all([getUsersPromise, getPermissionsPromise, getDevicesPromise])}
<PageLoading />
{:then}
<h1 class="text-3xl font-bold mb-8">Users</h1>
<h1 class="text-3xl font-bold mb-8">{$LL.users.page_title()}</h1>
{#each users as user, index}
<form on:submit|preventDefault={() => save(user)}>
<div class="card w-full bg-base-300 shadow-xl mt-6">
@@ -203,37 +204,37 @@
bind:checked={permission.create}
class="checkbox checked:checkbox-primary"
/>
<span class="label-text font-bold"
>Allow {user.username} to create new devices and edit device groups?</span
>
{$LL.users.allow_create_devices({ username: user.username })}
</label>
</div>
{/each}
<div class="collapse collapse-arrow bg-base-200">
<input type="checkbox" />
<div class="collapse-title text-xl font-medium">Device permissions</div>
<div class="collapse-title text-xl font-medium">{$LL.users.device_permissions()}</div>
<div class="collapse-content">
{#if devices.length === 0}
<p>No devices here. <a href="/device/new" class="link">Create new device</a></p>
<p>
{$LL.home.no_devices()}
<a href="/device/new" class="link">{$LL.users.create_new_device()}</a>
</p>
{:else}
<div class="grid grid-cols-5 gap-4 justify-items-center">
<div class="font-bold" />
<div class="font-bold">Read</div>
<div class="font-bold">Update</div>
<div class="font-bold">Delete</div>
<div class="font-bold">Power</div>
<div class="grid grid-cols-4 md:grid-cols-5 gap-4 justify-items-center">
<div class="font-bold md:col-start-2">{$LL.users.read()}</div>
<div class="font-bold">{$LL.users.update()}</div>
<div class="font-bold">{$LL.users.delete()}</div>
<div class="font-bold">{$LL.users.power()}</div>
{#each devices as device}
<hr class="col-span-full w-full border-b-1 opacity-30 border-neutral" />
{#each permissions.filter((perm) => perm.user === user.id) as permission}
<div
class="flex flex-row flex-wrap gap-2 place-self-start break-all col-span-full sm:col-span-1"
class="flex flex-row flex-wrap gap-2 place-self-start break-all col-span-full md:col-span-1"
>
<span class="font-bold">{device.name}</span>
<span class="badge hidden sm:block">{device.ip}</span>
<span class="badge hidden md:block">{device.ip}</span>
</div>
<input
type="checkbox"
class="checkbox checked:checkbox-primary col-start-2"
class="checkbox checked:checkbox-primary md:col-start-2"
bind:group={permission.read}
value={device.id}
/>
@@ -258,32 +259,48 @@
{/each}
{/each}
<button
class="btn btn-sm btn-neutral col-start-2"
class="btn btn-sm btn-neutral md:col-start-2"
type="button"
on:click={() => {
toggleAllPermissions(user, 'read');
}}>Toggle</button
}}
><span class="hidden md:block">{$LL.users.toggle()}</span><Fa
icon={faRetweet}
size="1.5x"
/></button
>
<button
class=" btn btn-sm btn-neutral"
type="button"
on:click={() => {
toggleAllPermissions(user, 'update');
}}>Toggle</button
}}
><span class="hidden md:block">{$LL.users.toggle()}</span><Fa
icon={faRetweet}
size="1.5x"
/></button
>
<button
class=" btn btn-sm btn-neutral"
type="button"
on:click={() => {
toggleAllPermissions(user, 'delete');
}}>Toggle</button
}}
><span class="hidden md:block">{$LL.users.toggle()}</span><Fa
icon={faRetweet}
size="1.5x"
/></button
>
<button
class=" btn btn-sm btn-neutral"
type="button"
on:click={() => {
toggleAllPermissions(user, 'power');
}}>Toggle</button
}}
><span class="hidden md:block">{$LL.users.toggle()}</span><Fa
icon={faRetweet}
size="1.5x"
/></button
>
</div>
<div class="mt-4 flex flex-row flex-wrap gap-4 justify-end"></div>
@@ -294,9 +311,11 @@
<button
class="join-item btn btn-error"
type="button"
on:click={() => deleteModal.showModal()}><Fa icon={faTrash} />Delete</button
on:click={() => deleteModal.showModal()}
><Fa icon={faTrash} />{$LL.buttons.delete()}</button
>
<button class="join-item btn btn-success" type="submit"><Fa icon={faSave} />Save</button
<button class="join-item btn btn-success" type="submit"
><Fa icon={faSave} />{$LL.buttons.save()}</button
>
</div>
</div>
@@ -304,31 +323,33 @@
</form>
<dialog class="modal" bind:this={deleteModal}>
<form method="dialog" class="modal-box">
<h3 class="font-bold text-lg">Confirm delete</h3>
<p class="py-4">Are you sure you want to delete <strong>{user.username}</strong>?</p>
<h3 class="font-bold text-lg">{$LL.users.confirm_delete_title()}</h3>
<p class="py-4">{$LL.users.confirm_delete_desc({ username: user.username })}</p>
<div class="modal-action">
<button class="btn">Cancle</button>
<button class="btn btn-error" on:click={() => deleteUser(user)}>Delete</button>
<button class="btn">{$LL.buttons.cancle()}</button>
<button class="btn btn-error" on:click={() => deleteUser(user)}
>{$LL.buttons.delete()}</button
>
</div>
</form>
</dialog>
{/each}
<div class="card w-full bg-base-300 shadow-xl mt-6">
<div class="card-body">
<h2 class="card-title">Create new user</h2>
<h2 class="card-title">{$LL.users.create_new_user()}</h2>
<form on:submit|preventDefault={createUser}>
<div class="flex flex-row flex-wrap gap-4">
<div class="form-control w-full max-w-xs">
<label class="label" for="username">
<div class="label-text">
<span>Username</span>
<span>{$LL.users.username()}</span>
<span class="text-error">*</span>
</div>
</label>
<input
id="username"
type="text"
placeholder="Username"
placeholder={$LL.users.username()}
class="input input-bordered w-full max-w-xs"
required
bind:value={newUser.username}
@@ -337,14 +358,14 @@
<div class="form-control w-full max-w-xs">
<label class="label" for="password">
<div class="label-text">
<span>Password</span>
<span>{$LL.users.password()}</span>
<span class="text-error">*</span>
</div>
</label>
<input
id="password"
type="password"
placeholder="Password"
placeholder={$LL.users.password()}
class="input input-bordered w-full max-w-xs"
minlength="5"
maxlength="72"
@@ -355,14 +376,14 @@
<div class="form-control w-full max-w-xs">
<label class="label" for="passwordConfirm">
<div class="label-text">
<span>Password confirm</span>
<span>{$LL.users.password_confirm()}</span>
<span class="text-error">*</span>
</div>
</label>
<input
id="passwordConfirm"
type="password"
placeholder="Password"
placeholder={$LL.users.password_confirm()}
class="input input-bordered w-full max-w-xs"
minlength="5"
maxlength="72"
@@ -371,9 +392,11 @@
/>
</div>
</div>
<span class="badge text-error mt-4 self-center">* required field</span>
<span class="badge text-error mt-4 self-center">* {$LL.users.required_field()}</span>
<div class="card-actions justify-end">
<button type="submit" class="btn btn-success mt-2"><Fa icon={faPlus} />Add</button>
<button type="submit" class="btn btn-success mt-2"
><Fa icon={faPlus} />{$LL.buttons.add()}</button
>
</div>
</form>
</div>
+29 -25
View File
@@ -1,12 +1,13 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { pocketbase, isAdmin } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import { toggleVisibility } from '$lib/helpers/forms';
import toast from 'svelte-french-toast';
import Fa from 'svelte-fa';
import LL from '$lib/i18n/i18n-svelte';
import { pocketbase } from '$lib/stores/pocketbase';
import { settingsPub } from '$lib/stores/settings';
import { faArrowRight, faEye } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let stepsCompleted = 0;
let inputPassword: HTMLInputElement;
@@ -18,7 +19,7 @@
};
onMount(() => {
if (!$settingsPub.setup_completed && $pocketbase.authStore.isValid) {
if ($settingsPub && $settingsPub.setup_completed === false && $pocketbase.authStore.isValid) {
$pocketbase.authStore.clear();
}
});
@@ -35,7 +36,6 @@
.authWithPassword(form.email, form.password)
.then(() => {
stepsCompleted = 2;
isAdmin.set(true);
})
.catch((err) => {
if (err.data?.data?.identity?.message) {
@@ -46,7 +46,7 @@
})
.catch((err) => {
if (err.data?.data?.passwordConfirm?.message) {
toast.error("Passwords don't match.");
toast.error($LL.toasts.passwords_missmatch());
} else if (err.data?.data?.email?.message) {
toast.error(err.data.data.email.message);
} else {
@@ -62,20 +62,22 @@
{#if $settingsPub?.setup_completed}
<figure class="w-72 mx-auto pt-6"><img src="/gopher.svg" alt="Gopher" /></figure>
<div class="card-body">
<h2 class="card-title">I didn't expect you here! 🧐</h2>
<p>You are already done with the setup! Nothing to do.</p>
<h2 class="card-title">{$LL.welcome.not_expected_title()}</h2>
<p>{$LL.welcome.not_expected_desc()}</p>
<div class="card-actions justify-end">
<button class="btn btn-primary" on:click={() => goto('/')}>Take me back</button>
<button class="btn btn-primary" on:click={() => goto('/')}
>{$LL.welcome.not_expected_back()}</button
>
</div>
</div>
{:else if stepsCompleted === 0}
<figure class="w-44 mx-auto pt-6"><img src="/gopher.svg" alt="Gopher" /></figure>
<div class="card-body">
<h2 class="card-title">Welcome to UpSnap 🥳</h2>
<p>Please complete the following steps to finish the setup.</p>
<h2 class="card-title">{$LL.welcome.step1_page_title()}</h2>
<p>{$LL.welcome.step1_setup_desc()}</p>
<div class="card-actions justify-end">
<button class="btn btn-primary" on:click={() => (stepsCompleted = 1)}
>Next <Fa icon={faArrowRight} /></button
>{$LL.welcome.step1_setup_btn_next()} <Fa icon={faArrowRight} /></button
>
</div>
</div>
@@ -83,11 +85,11 @@
<div class="card-body">
<div class="flex flex-row gap-4">
<figure class="w-16"><img src="/gopher.svg" alt="Gopher" /></figure>
<h2 class="card-title">Create an admin account</h2>
<h2 class="card-title">{$LL.welcome.step2_page_title()}</h2>
</div>
<form class="form-control w-full" on:submit|preventDefault={register}>
<label class="label" for="email">
<span class="label-text">Email:</span>
<span class="label-text">{$LL.welcome.step2_label_email()}</span>
</label>
<input
id="email"
@@ -97,8 +99,8 @@
bind:value={form.email}
/>
<label class="label" for="password">
<span class="label-text">Password:</span>
<span class="label-text-alt">min. 10 characters</span>
<span class="label-text">{$LL.welcome.step2_label_password()}</span>
<span class="label-text-alt">{$LL.welcome.step2_label_min_chars()}</span>
</label>
<label class="relative block">
<div
@@ -121,7 +123,7 @@
/>
</label>
<label class="label" for="passwordConfirm">
<span class="label-text">Password confirm:</span>
<span class="label-text">{$LL.welcome.step2_label_password_confirm()}</span>
</label>
<label class="relative block">
<div
@@ -145,7 +147,7 @@
</label>
<div class="card-actions justify-end mt-4">
<button class="btn btn-primary" type="submit"
>Create <Fa icon={faArrowRight} /></button
>{$LL.welcome.step2_btn_create()} <Fa icon={faArrowRight} /></button
>
</div>
</form>
@@ -153,19 +155,21 @@
{:else if stepsCompleted === 2}
<figure class="w-72 mx-auto pt-6"><img src="/gopher.svg" alt="Gopher" /></figure>
<div class="card-body">
<h2 class="card-title">You are all set! 🎉</h2>
<p>Go ahead and add some devices to your dashboard.</p>
<h2 class="card-title">{$LL.welcome.step3_page_title()}</h2>
<p>{$LL.welcome.step3_page_desc()}</p>
<div class="card-actions justify-end">
<button class="btn btn-success" on:click={() => goto('/')}>Lets go!</button>
<button class="btn btn-success" on:click={() => goto('/')}
>{$LL.welcome.step3_btn_done()}</button
>
</div>
</div>
{/if}
</div>
{#if !$settingsPub?.setup_completed}
<ul class="steps steps-horizontal">
<li class="step step-primary">Welcome</li>
<li class="step" class:step-primary={stepsCompleted > 0}>Create account</li>
<li class="step" class:step-primary={stepsCompleted > 1}>Done</li>
<li class="step step-primary">{$LL.welcome.progress_step1()}</li>
<li class="step" class:step-primary={stepsCompleted > 0}>{$LL.welcome.progress_step2()}</li>
<li class="step" class:step-primary={stepsCompleted > 1}>{$LL.welcome.progress_step3()}</li>
</ul>
{/if}
</div>