Compare commits

...

37 Commits

Author SHA1 Message Date
Maxi Quoß 43ebe5f86c fix: ignore static file error 404 on build 2025-09-15 22:52:45 +02:00
Maxi Quoß 5e4664356d fix: icon sometimes gets removed 2025-09-15 22:49:22 +02:00
Maxi Quoß ef75531a6f fix: generate manifest in go backend 2025-09-15 22:45:33 +02:00
Maxi Quoß bd6038720b fix: generate manifest in go backend 2025-09-15 22:21:00 +02:00
Maxi Quoß 41cc546b81 update deps 2025-09-15 21:35:47 +02:00
Maxi Quoß 25a67af29d spelling 2025-09-15 21:32:57 +02:00
Maxi Quoß 3f3ef10fbc feat: custom manifest data from backend, close #1351 2025-09-15 21:31:58 +02:00
Maxi Quoß f9f73da80a fix: pwa website rotation #1350 2025-09-15 20:23:11 +02:00
dependabot[bot] 00d1659474 npm-dep: bump @sveltejs/kit from 2.38.1 to 2.39.1 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 2.38.1 to 2.39.1.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.39.1/packages/kit)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 10:00:48 +00:00
dependabot[bot] 36abd34f07 npm-dep: bump @inlang/paraglide-js from 2.3.0 to 2.3.2 in /frontend
Bumps [@inlang/paraglide-js](https://github.com/opral/inlang-paraglide-js) from 2.3.0 to 2.3.2.
- [Commits](https://github.com/opral/inlang-paraglide-js/commits)

---
updated-dependencies:
- dependency-name: "@inlang/paraglide-js"
  dependency-version: 2.3.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 09:59:29 +00:00
dependabot[bot] ba997ba94f npm-dep: bump daisyui from 5.1.10 to 5.1.12 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) from 5.1.10 to 5.1.12.
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.12/packages/daisyui)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-15 09:57:37 +00:00
Maxi Quoß 56b25b708e fix: gopher on welcome page for sub paths 2025-09-12 11:51:25 +02:00
Maxi Quoß 8297498902 add nginx example for sub path 2025-09-12 11:50:59 +02:00
dependabot[bot] 8e63cbe42d npm-dep: bump svelte from 5.38.8 to 5.38.10 in /frontend
Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.38.8 to 5.38.10.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.38.10/packages/svelte)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-12 09:09:02 +00:00
dependabot[bot] b0c6696c97 npm-dep: bump eslint-plugin-svelte from 3.12.2 to 3.12.3 in /frontend
Bumps [eslint-plugin-svelte](https://github.com/sveltejs/eslint-plugin-svelte/tree/HEAD/packages/eslint-plugin-svelte) from 3.12.2 to 3.12.3.
- [Release notes](https://github.com/sveltejs/eslint-plugin-svelte/releases)
- [Changelog](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/eslint-plugin-svelte/commits/eslint-plugin-svelte@3.12.3/packages/eslint-plugin-svelte)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 09:08:04 +00:00
dependabot[bot] 010e306b07 npm-dep: bump daisyui from 5.1.9 to 5.1.10 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) from 5.1.9 to 5.1.10.
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.10/packages/daisyui)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 09:07:54 +00:00
dependabot[bot] 5b755990fa npm-dep: bump @sveltejs/kit from 2.37.1 to 2.38.1 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 2.37.1 to 2.38.1.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.38.1/packages/kit)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 09:07:42 +00:00
dependabot[bot] b4c30a4eaa npm-dep: bump @inlang/paraglide-js from 2.2.0 to 2.3.0 in /frontend
Bumps [@inlang/paraglide-js](https://github.com/opral/inlang-paraglide-js) from 2.2.0 to 2.3.0.
- [Commits](https://github.com/opral/inlang-paraglide-js/commits)

---
updated-dependencies:
- dependency-name: "@inlang/paraglide-js"
  dependency-version: 2.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-11 09:07:25 +00:00
dependabot[bot] a6d582bc53 npm-dep: bump globals from 16.3.0 to 16.4.0 in /frontend
Bumps [globals](https://github.com/sindresorhus/globals) from 16.3.0 to 16.4.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v16.3.0...v16.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 09:07:46 +00:00
dependabot[bot] 24ceac63e1 npm-dep: bump svelte from 5.38.7 to 5.38.8 in /frontend
Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.38.7 to 5.38.8.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.38.8/packages/svelte)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 09:07:24 +00:00
dependabot[bot] 05c2765a3c npm-dep: bump daisyui from 5.1.8 to 5.1.9 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) from 5.1.8 to 5.1.9.
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.9/packages/daisyui)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-09 09:09:57 +00:00
dependabot[bot] 6ce67831f9 npm-dep: bump typescript-eslint from 8.42.0 to 8.43.0 in /frontend
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.42.0 to 8.43.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.43.0/packages/typescript-eslint)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-09 09:09:37 +00:00
dependabot[bot] 97774b8e70 npm-dep: bump vite from 6.3.5 to 6.3.6 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.3.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.3.6/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:19:41 +00:00
dependabot[bot] a103c62a72 npm-dep: bump eslint from 9.34.0 to 9.35.0 in /frontend
Bumps [eslint](https://github.com/eslint/eslint) from 9.34.0 to 9.35.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.34.0...v9.35.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:19:15 +00:00
dependabot[bot] 5bc4f94f3d npm-dep: bump eslint-plugin-svelte from 3.12.1 to 3.12.2 in /frontend
Bumps [eslint-plugin-svelte](https://github.com/sveltejs/eslint-plugin-svelte) from 3.12.1 to 3.12.2.
- [Release notes](https://github.com/sveltejs/eslint-plugin-svelte/releases)
- [Commits](https://github.com/sveltejs/eslint-plugin-svelte/compare/eslint-plugin-svelte@3.12.1...eslint-plugin-svelte@3.12.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:15:32 +00:00
dependabot[bot] 0724942481 npm-dep: bump @eslint/js from 9.34.0 to 9.35.0 in /frontend
Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.34.0 to 9.35.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/commits/v9.35.0/packages/js)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:14:44 +00:00
dependabot[bot] b66bb2b1ea npm-dep: bump daisyui from 5.1.7 to 5.1.8 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) from 5.1.7 to 5.1.8.
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.8/packages/daisyui)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:13:03 +00:00
dependabot[bot] 57e0285761 go-dep: bump golang.org/x/sys from 0.35.0 to 0.36.0 in /backend
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.35.0 to 0.36.0.
- [Commits](https://github.com/golang/sys/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:12:33 +00:00
dependabot[bot] a10a5bf575 npm-dep: bump @sveltejs/kit from 2.37.0 to 2.37.1 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 2.37.0 to 2.37.1.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.37.1/packages/kit)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:12:04 +00:00
dependabot[bot] 4a874f01d9 go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.29.3 to 0.30.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.29.3...v0.30.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 09:11:46 +00:00
dependabot[bot] dd8df050e3 npm-dep: bump svelte from 5.38.6 to 5.38.7 in /frontend
Bumps [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) from 5.38.6 to 5.38.7.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.38.7/packages/svelte)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-05 09:08:44 +00:00
dependabot[bot] da91bd3e53 npm-dep: bump daisyui from 5.1.6 to 5.1.7 in /frontend
Bumps [daisyui](https://github.com/saadeghi/daisyui/tree/HEAD/packages/daisyui) from 5.1.6 to 5.1.7.
- [Release notes](https://github.com/saadeghi/daisyui/releases)
- [Changelog](https://github.com/saadeghi/daisyui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/saadeghi/daisyui/commits/v5.1.7/packages/daisyui)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-05 09:06:56 +00:00
dependabot[bot] bf621749cf gh-action: bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-05 09:06:37 +00:00
Maxi Quoß 3ecec817b5 gh-action: fix goreleaser dirty state 2025-09-05 03:15:49 +02:00
Maxi Quoß 2729424b01 gh-action: fix goreleaser args 2025-09-05 03:10:04 +02:00
Maxi Quoß 03b3e67aa4 gh-action: use more caching 2025-09-05 03:06:59 +02:00
Maxi Quoß 2657a3b119 go-dep: use go 1.24.1 2025-09-04 23:36:33 +02:00
14 changed files with 582 additions and 460 deletions
+80 -30
View File
@@ -15,7 +15,9 @@ jobs:
- 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")
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"
@@ -23,22 +25,18 @@ jobs:
echo "runner-label=ubuntu-latest" >> "$GITHUB_OUTPUT"
fi
goreleaser:
frontend:
needs: check-runner
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
# pull code
- name: Checkout
uses: actions/checkout@v5
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-depth: 1
# setup pnpm
- uses: pnpm/action-setup@v4
with:
version: latest
# install latest node
- name: Set up Node.js
uses: actions/setup-node@v5
with:
@@ -46,22 +44,66 @@ jobs:
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
# build sveltekit frontend
- name: Cache frontend build
uses: actions/cache@v4
with:
path: |
frontend/node_modules
frontend/.svelte-kit
key: ${{ runner.os }}-pnpm-${{ hashFiles('frontend/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Build frontend
run: |
pnpm --prefix=./frontend i
pnpm --prefix=./frontend install --frozen-lockfile --prefer-offline
PUBLIC_VERSION=${GITHUB_REF##*/} pnpm --prefix=./frontend run build
cp -r ./frontend/build/* ./backend/pb_public/
git reset --hard
tar -czf frontend-dist.tar.gz -C frontend/build .
- name: Upload frontend artifact
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: frontend-dist.tar.gz
goreleaser:
needs:
- check-runner
- frontend
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download frontend artifact
uses: actions/download-artifact@v5
with:
name: frontend-dist
- name: Extract frontend into backend
run: |
mkdir -p backend/pb_public
tar -xzf frontend-dist.tar.gz -C backend/pb_public
git reset --hard
git clean -fd
# setup go
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: "./backend/go.mod"
cache-dependency-path: "./backend/go.sum"
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
- name: Cache Go build
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('backend/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# build
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
@@ -73,17 +115,29 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
- name: Upload backend artifact
uses: actions/upload-artifact@v4
with:
name: backend-dist
path: backend/dist
docker:
needs:
- goreleaser
- check-runner
- frontend
- goreleaser
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
# pull code
- name: Check Out Repo
uses: actions/checkout@v5
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download backend artifact
uses: actions/download-artifact@v5
with:
name: backend-dist
path: backend/dist
# image tags
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
@@ -97,33 +151,27 @@ jobs:
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
# qemu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# docker buildx
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
# ghcr.io login
- name: Log in to the Container registry
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# ducker hub login
- name: Login to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# build and push
- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
@@ -131,5 +179,7 @@ jobs:
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{github.ref_name}}
VERSION=${{ github.ref_name }}
+19
View File
@@ -129,6 +129,25 @@ http://localhost:8091 {
}
```
Or nginx:
```
http {
server {
listen 8091;
server_name localhost;
location /upsnap-sub-path/ {
proxy_pass http://localhost:8090/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
```
Paths must end with a trailing `/`.
## 🐧 Install from the [AUR](https://aur.archlinux.org/packages/upsnap-bin)
+15 -15
View File
@@ -1,14 +1,14 @@
module github.com/seriousm4x/upsnap
go 1.24.0
go 1.24.1
require (
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a
github.com/pocketbase/dbx v1.11.0
github.com/pocketbase/pocketbase v0.29.3
github.com/pocketbase/pocketbase v0.30.0
github.com/prometheus-community/pro-bing v0.7.0
github.com/robfig/cron/v3 v3.0.1
golang.org/x/sys v0.35.0
golang.org/x/sys v0.36.0
)
require (
@@ -20,7 +20,7 @@ require (
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
github.com/ganigeorgiev/fexpr v0.5.0 // indirect
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/go-sql-driver/mysql v1.9.3 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
@@ -33,17 +33,17 @@ require (
github.com/mdlayher/socket v0.5.1 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/cast v1.9.2 // indirect
github.com/spf13/cobra v1.9.1 // indirect
github.com/spf13/pflag v1.0.7 // indirect
github.com/stretchr/testify v1.8.1 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
golang.org/x/image v0.30.0 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/text v0.28.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/cobra v1.10.1 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/stretchr/testify v1.11.1 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
golang.org/x/image v0.31.0 // indirect
golang.org/x/net v0.44.0 // indirect
golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/text v0.29.0 // indirect
modernc.org/libc v1.66.3 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
+33 -38
View File
@@ -24,8 +24,8 @@ github.com/ganigeorgiev/fexpr v0.5.0/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es=
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.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -69,8 +69,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.11.0 h1:LpZezioMfT3K4tLrqA55wWFw1EtH1pM4tzSVa7kgszU=
github.com/pocketbase/dbx v1.11.0/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/pocketbase v0.29.3 h1:Mj8o5awsbVJIdIoTuQNhfC2oL/c4aImQ3RyfFZlzFVg=
github.com/pocketbase/pocketbase v0.29.3/go.mod h1:oGpT67LObxCFK4V2fSL7J9YnPbBnnshOpJ5v3zcneww=
github.com/pocketbase/pocketbase v0.30.0 h1:7v9O3hBYyHyptnnFjdP8tEJIuyHEfjhG6PC4gjf5eoE=
github.com/pocketbase/pocketbase v0.30.0/go.mod h1:gZIwampw4VqMcEdGHwBZgSa54xWIDgVJb4uINUMXLmA=
github.com/prometheus-community/pro-bing v0.7.0 h1:KFYFbxC2f2Fp6c+TyxbCOEarf7rbnzr9Gw8eIb0RfZA=
github.com/prometheus-community/pro-bing v0.7.0/go.mod h1:Moob9dvlY50Bfq6i88xIwfyw7xLFHH69LUgx9n5zqCE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
@@ -80,60 +80,55 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG
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.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11UATqWDmWuS99x26cD0=
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4=
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
golang.org/x/exp v0.0.0-20250911091902-df9299821621 h1:2id6c1/gto0kaHYyrixvknJ8tUK/Qs5IsmBtrc+FtgU=
golang.org/x/exp v0.0.0-20250911091902-df9299821621/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4=
golang.org/x/image v0.30.0/go.mod h1:SAEUTxCCMWSrJcCy/4HwavEsfZZJlYxeHLc6tTiAe/c=
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/image v0.31.0 h1:mLChjE2MV6g1S7oqbXC0/UcKijjm5fnJLUYKIYrLESA=
golang.org/x/image v0.31.0/go.mod h1:R9ec5Lcp96v9FTF+ajwaH3uGxPH4fKfHHAVbUILxghA=
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo=
golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
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.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/cc/v4 v4.26.2 h1:991HMkLjJzYBIfha6ECZdjrIYz2/1ayr+FL8GN+CNzM=
+84
View File
@@ -1,7 +1,9 @@
package pb
import (
"encoding/json"
"encoding/xml"
"fmt"
"net"
"net/http"
"os"
@@ -381,3 +383,85 @@ func asyncCall(e *core.RequestEvent, fn func() *router.ApiError) *router.ApiErro
return nil
}
func HandlerWebsiteManifest(e *core.RequestEvent) error {
scheme := "http"
if e.Request.TLS != nil {
scheme = "https"
}
baseUrl := fmt.Sprintf("%s://%s", scheme, e.Request.Host)
manifest := map[string]any{
"name": "UpSnap",
"short_name": "UpSnap",
"description": "A simple wake on lan web app written with SvelteKit, Go and PocketBase.",
"theme_color": "#55BCD9",
"background_color": "#55BCD9",
"display": "standalone",
"scope": baseUrl,
"start_url": baseUrl,
"icons": []map[string]string{
{
"src": "/icon_192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any",
},
{
"src": "/icon_512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any",
},
{
"src": "/maskable_192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable",
},
{
"src": "/maskable_512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable",
},
{
"src": "/gopher.svg",
"sizes": "any",
"type": "image/svg+xml",
},
},
}
publicSettings, err := e.App.FindFirstRecordByFilter("settings_public", "")
if err != nil {
return writeManifest(e, manifest)
}
// override title if set
if title := publicSettings.GetString("website_title"); title != "" {
manifest["name"] = title
manifest["short_name"] = title
}
// override icons if set
if favicon := publicSettings.GetString("favicon"); favicon != "" {
manifest["icons"] = []map[string]string{
{
"src": fmt.Sprintf("%s/api/files/settings_public/%s/%s", baseUrl, publicSettings.Id, favicon),
"sizes": "any",
"purpose": "any",
},
}
}
return writeManifest(e, manifest)
}
func writeManifest(e *core.RequestEvent, manifest map[string]any) error {
e.Response.Header().Set("Content-Type", "application/manifest+json")
e.Response.Header().Set("Cache-Control", "no-cache, no-store")
enc := json.NewEncoder(e.Response)
return enc.Encode(manifest)
}
+1
View File
@@ -78,6 +78,7 @@ func StartPocketBase(distDirFS fs.FS) {
se.Router.GET("/api/upsnap/scan", HandlerScan).Bind(apis.RequireSuperuserAuth())
se.Router.POST("/api/upsnap/init-superuser", HandlerInitSuperuser) // https://github.com/pocketbase/pocketbase/discussions/6198
se.Router.POST("/api/upsnap/validate-cron", HandlerValidateCron)
se.Router.GET("/api/upsnap/manifest.webmanifest", HandlerWebsiteManifest)
if err := importSettings(app); err != nil {
return err
+11 -11
View File
@@ -16,28 +16,28 @@
},
"devDependencies": {
"@eslint/compat": "^1.3.2",
"@eslint/js": "^9.34.0",
"@eslint/js": "^9.35.0",
"@inlang/cli": "^3.0.12",
"@inlang/paraglide-js": "2.2.0",
"@inlang/paraglide-js": "2.3.2",
"@sveltejs/adapter-static": "^3.0.9",
"@sveltejs/kit": "^2.37.0",
"@sveltejs/kit": "^2.39.1",
"@sveltejs/vite-plugin-svelte": "^5.1.1",
"daisyui": "^5.1.6",
"eslint": "^9.34.0",
"daisyui": "^5.1.12",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.12.1",
"globals": "^16.3.0",
"eslint-plugin-svelte": "^3.12.3",
"globals": "^16.4.0",
"husky": "^9.1.7",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"prettier-plugin-tailwindcss": "^0.6.14",
"svelte": "^5.38.6",
"svelte": "^5.38.10",
"svelte-check": "^4.3.1",
"tailwindcss": "^4.1.13",
"tslib": "^2.8.1",
"typescript": "^5.9.2",
"typescript-eslint": "^8.42.0",
"vite": "^6.3.5"
"typescript-eslint": "^8.44.0",
"vite": "^6.3.6"
},
"type": "module",
"lint-staged": {
@@ -47,7 +47,7 @@
"dependencies": {
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@tailwindcss/postcss": "^4.1.13",
"cron-parser": "^5.3.1",
"cron-parser": "^5.4.0",
"date-fns": "^4.1.0",
"pocketbase": "^0.26.2",
"postcss": "^8.5.6",
+307 -307
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -2,8 +2,7 @@
<html lang="%lang%">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
<script>
const darkTheme = 'dim';
+1
View File
@@ -86,6 +86,7 @@
</script>
<svelte:head>
<link rel="manifest" href={backendUrl + 'api/upsnap/manifest.webmanifest'} />
<link
rel="shortcut icon"
href={$settingsPub?.id && $settingsPub?.favicon
+18 -9
View File
@@ -15,10 +15,10 @@
import Fa from 'svelte-fa';
import toast from 'svelte-french-toast';
let settingsPubClone: SettingsPublic | undefined;
let settingsPrivClone: SettingsPrivate | undefined;
let faviconPreview: HTMLImageElement;
let faviconInputElement: HTMLInputElement;
let settingsPubClone: SettingsPublic | undefined = $state();
let settingsPrivClone: SettingsPrivate | undefined = $state();
let faviconPreview: HTMLImageElement | undefined = $state();
let faviconInputElement: HTMLInputElement | undefined = $state();
onMount(() => {
if (!$pocketbase.authStore.isSuperuser) {
@@ -47,10 +47,9 @@
});
function resetFavicon() {
if (settingsPubClone === undefined) return;
settingsPubClone.favicon = '';
faviconInputElement.value = '';
faviconPreview.src = '/gopher.svg';
if (settingsPubClone) settingsPubClone.favicon = '';
if (faviconInputElement) faviconInputElement.value = '';
if (faviconPreview) faviconPreview.src = '/gopher.svg';
}
async function save() {
@@ -73,9 +72,19 @@
throw new Error('ping_interval not valid');
}
// If favicon is empty and no new file is selected, don't send the favicon field at all
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const payload: any = { ...settingsPubClone };
if (
!payload.favicon &&
(!faviconInputElement.files || faviconInputElement.files.length === 0)
) {
delete payload.favicon;
}
await $pocketbase
.collection('settings_public')
.update(settingsPubClone.id, settingsPubClone)
.update(settingsPubClone.id, payload)
.then((res) => {
settingsPub.set(res as SettingsPublic);
})
+5 -5
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { resolve } from '$app/paths';
import { asset, resolve } from '$app/paths';
import { toggleVisibility } from '$lib/helpers/forms';
import { m } from '$lib/paraglide/messages.js';
import { pocketbase } from '$lib/stores/pocketbase';
@@ -72,7 +72,7 @@
<div class="my-4 flex w-screen max-w-lg flex-col gap-16">
<div class="card bg-base-200 shadow-sm">
{#if stepsCompleted === 0 && $settingsPub?.setup_completed}
<figure class="mx-auto w-72 pt-6"><img src="/gopher.svg" alt="Gopher" /></figure>
<figure class="mx-auto w-72 pt-6"><img src={asset('/gopher.svg')} alt="Gopher" /></figure>
<div class="card-body">
<h2 class="card-title">{m.welcome_not_expected_title()}</h2>
<p>{m.welcome_not_expected_desc()}</p>
@@ -83,7 +83,7 @@
</div>
</div>
{:else if stepsCompleted === 0}
<figure class="mx-auto w-44 pt-6"><img src="/gopher.svg" alt="Gopher" /></figure>
<figure class="mx-auto w-44 pt-6"><img src={asset('/gopher.svg')} alt="Gopher" /></figure>
<div class="card-body">
<h2 class="card-title">{m.welcome_step1_page_title()}</h2>
<p>{m.welcome_step1_setup_desc()}</p>
@@ -96,7 +96,7 @@
{:else if stepsCompleted === 1}
<div class="card-body">
<div class="flex flex-row gap-4">
<figure class="w-16"><img src="/gopher.svg" alt="Gopher" /></figure>
<figure class="w-16"><img src={asset('/gopher.svg')} alt="Gopher" /></figure>
<h2 class="card-title">{m.welcome_step2_page_title()}</h2>
</div>
<form
@@ -165,7 +165,7 @@
</form>
</div>
{:else if stepsCompleted === 2}
<figure class="mx-auto w-72 pt-6"><img src="/gopher.svg" alt="Gopher" /></figure>
<figure class="mx-auto w-72 pt-6"><img src={asset('/gopher.svg')} alt="Gopher" /></figure>
<div class="card-body">
<h2 class="card-title">{m.welcome_step3_page_title()}</h2>
<p>{m.welcome_step3_page_desc()}</p>
-42
View File
@@ -1,42 +0,0 @@
{
"name": "UpSnap",
"short_name": "UpSnap",
"description": "A simple wake on lan web app written with SvelteKit, Go and PocketBase.",
"theme_color": "#55BCD9",
"background_color": "#55BCD9",
"display": "standalone",
"orientation": "any",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "/icon_192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icon_512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "/maskable_192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/maskable_512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/gopher.svg",
"type": "image/svg+xml",
"sizes": "any"
}
]
}
+7 -1
View File
@@ -22,7 +22,13 @@ const config = {
'/device/new',
'/users',
'/settings'
]
],
handleHttpError: ({ path, message }) => {
if (path === '/api/upsnap/manifest.webmanifest') {
return;
}
throw message;
}
}
}
};