mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-11-27 12:21:56 +00:00
Compare commits
172 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e6c2eb372 | |||
| 423b2cec72 | |||
| 85280034ce | |||
| 5440ab3b25 | |||
| 8ae36d61cc | |||
| 16d4b8ecb7 | |||
| 37943f8412 | |||
| c5295d5f2d | |||
| 8dcb32f8cd | |||
| ddea25d934 | |||
| c033f25309 | |||
| ecac90ecb4 | |||
| d3daeeb061 | |||
| 46bc7195d6 | |||
| 6392527d80 | |||
| dc49e87993 | |||
| 9b0e58af44 | |||
| e3e6626f9f | |||
| 4778f5e1af | |||
| cd64c270f3 | |||
| b3895dc97f | |||
| 8f2e538ce1 | |||
| c7c31fd796 | |||
| 34282ec9af | |||
| 6270ebfb51 | |||
| cb7c13bce3 | |||
| cfe488da1b | |||
| 7062a479d7 | |||
| 4ed1e44d4b | |||
| 43cc9c358f | |||
| b533c1c9d4 | |||
| 484a13f687 | |||
| 758534bd65 | |||
| 2bbaedf7f5 | |||
| cb55969cc3 | |||
| b239031834 | |||
| a6402fc6c5 | |||
| f52a9fe805 | |||
| 14dc3072de | |||
| 2db3082488 | |||
| d71fd94abd | |||
| 4ec5c7d1d5 | |||
| 33143a1de4 | |||
| c759a14160 | |||
| ec533cd47d | |||
| ed7afbead1 | |||
| c204c18be2 | |||
| 05e266dc8d | |||
| 88d1edb617 | |||
| b50951bfa3 | |||
| c57f12eb61 | |||
| 4299799be5 | |||
| 3e645d4d6a | |||
| c0668bfb3b | |||
| 02b4f2099b | |||
| 7afdc41c17 | |||
| 04b3e27d8e | |||
| 7277f39f12 | |||
| 4bfc0576ee | |||
| d18b54e7b6 | |||
| 212e1b6da6 | |||
| a85a7def6b | |||
| 61da5f5bf6 | |||
| c75679f238 | |||
| 8714f937d9 | |||
| d1c6ee5b11 | |||
| 341d6b712c | |||
| dbcdd2b56f | |||
| 3d68442ad6 | |||
| dd9a00987c | |||
| c7f15d3dcd | |||
| 326cc1507c | |||
| 1cbbe9b3d7 | |||
| c2c7b3cbcc | |||
| 258d4d6aa3 | |||
| d3c0247abe | |||
| d3a4b7c6c3 | |||
| 76cf5fb028 | |||
| aba6615adc | |||
| 9f75e42a02 | |||
| 3484bddb92 | |||
| 3c9e3e129a | |||
| 6465130d6b | |||
| 609b5e2671 | |||
| 2a738cda87 | |||
| 4f6a9020a4 | |||
| 0f290f8572 | |||
| d1715b5d18 | |||
| 98081bde9e | |||
| 51498f7ea0 | |||
| af28d0b0f9 | |||
| d6e47b1264 | |||
| 3d3a536752 | |||
| 17736369d3 | |||
| c670ff9099 | |||
| 5b6dfffc22 | |||
| 28d2db9b5e | |||
| 1a8ee6bb07 | |||
| 451dc1d566 | |||
| 178f34bfdc | |||
| 636da1998a | |||
| 3c48888964 | |||
| ed6062e8db | |||
| 12b294a900 | |||
| cc4bae80ae | |||
| c6983d8ca3 | |||
| 846a530212 | |||
| bc27081b94 | |||
| c72d63e01c | |||
| c775ca2949 | |||
| 7d6d60a227 | |||
| 9300d66b78 | |||
| e94c1012ae | |||
| b29ad9ba1b | |||
| 4583e8ae3b | |||
| 6ce4dbe76f | |||
| 8a0c2ea29a | |||
| 747859d05b | |||
| a5a22c4020 | |||
| 5cbda84c37 | |||
| 26e573a0f5 | |||
| 6357ada980 | |||
| 309813bdff | |||
| fcb5e037ac | |||
| 88db4cf158 | |||
| fc4807b7f3 | |||
| 83ae5141bc | |||
| 153fe53ac6 | |||
| 4ded3eb8ab | |||
| 1b030fb2a0 | |||
| 731266a72a | |||
| 0813faa233 | |||
| 1b684936d5 | |||
| 057f5e4770 | |||
| 583f031748 | |||
| 5157ff4f48 | |||
| ddd52f2ac0 | |||
| 284c6a83b6 | |||
| 385ca62eb3 | |||
| c273370819 | |||
| 78cad054e6 | |||
| aa3574281b | |||
| 387ff4c4c2 | |||
| 9e6ecf1ed3 | |||
| 633b08f096 | |||
| 4d20cc8ab3 | |||
| 0cf7ee5b81 | |||
| fe67763712 | |||
| 5f1f7c528e | |||
| 30c7daddf1 | |||
| 84678ed835 | |||
| 489a309bd3 | |||
| 453a352bc2 | |||
| 2c4a67413d | |||
| 934d9556d0 | |||
| 61f4616157 | |||
| f20093aaae | |||
| 97fdaa3fbb | |||
| 5bd66ff6f2 | |||
| 5f51ba02e9 | |||
| 12ff07d022 | |||
| 63417cbf01 | |||
| 354915eff2 | |||
| 85b37bf623 | |||
| b98ce71293 | |||
| 0ef1f5144d | |||
| b82614a759 | |||
| 1accda28f7 | |||
| a2e1c810a1 | |||
| d223200ac4 | |||
| 702d03bfcd | |||
| 9c6213acdc |
@@ -10,7 +10,7 @@ jobs:
|
||||
codeberg:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: pixta-dev/repository-mirroring-action@v1
|
||||
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
needs: check-runner
|
||||
runs-on: ${{ needs.check-runner.outputs.runner-label }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
needs: check-runner
|
||||
runs-on: ${{ needs.check-runner.outputs.runner-label }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
cache-dependency-path: frontend/pnpm-lock.yaml
|
||||
|
||||
- name: Cache frontend build
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
frontend/node_modules
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
tar -czf frontend-dist.tar.gz -C frontend/build .
|
||||
|
||||
- name: Upload frontend artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: frontend-dist
|
||||
path: frontend-dist.tar.gz
|
||||
@@ -72,12 +72,12 @@ jobs:
|
||||
- frontend
|
||||
runs-on: ${{ needs.check-runner.outputs.runner-label }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download frontend artifact
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: frontend-dist
|
||||
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
cache-dependency-path: backend/go.sum
|
||||
|
||||
- name: Cache Go build
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
AUR_KEY: ${{ secrets.AUR_KEY }}
|
||||
|
||||
- name: Upload backend artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: backend-dist
|
||||
path: backend/dist
|
||||
@@ -128,12 +128,12 @@ jobs:
|
||||
- goreleaser
|
||||
runs-on: ${{ needs.check-runner.outputs.runner-label }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download backend artifact
|
||||
uses: actions/download-artifact@v5
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: backend-dist
|
||||
path: backend/dist
|
||||
|
||||
+4
-2
@@ -14,11 +14,13 @@ RUN wget https://github.com/seriousm4x/UpSnap/releases/download/${VERSION}/UpSna
|
||||
setcap 'cap_net_raw=+ep' ./upsnap
|
||||
|
||||
FROM alpine:3
|
||||
ARG UPSNAP_HTTP_LISTEN=0.0.0.0:8090
|
||||
ENV UPSNAP_HTTP_LISTEN=${UPSNAP_HTTP_LISTEN}
|
||||
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=downloader /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"]
|
||||
CMD curl -fs "http://${UPSNAP_HTTP_LISTEN}/api/health" || exit 1
|
||||
ENTRYPOINT ["sh", "-c", "./upsnap serve --http ${UPSNAP_HTTP_LISTEN}"]
|
||||
|
||||
+4
-2
@@ -17,11 +17,13 @@ RUN go build -o upsnap main.go &&\
|
||||
setcap 'cap_net_raw=+ep' ./upsnap
|
||||
|
||||
FROM alpine:3
|
||||
ARG UPSNAP_HTTP_LISTEN=0.0.0.0:8090
|
||||
ENV UPSNAP_HTTP_LISTEN=${UPSNAP_HTTP_LISTEN}
|
||||
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"]
|
||||
CMD curl -fs "http://${UPSNAP_HTTP_LISTEN}/api/health" || exit 1
|
||||
ENTRYPOINT ["sh", "-c", "./upsnap serve --http ${UPSNAP_HTTP_LISTEN}"]
|
||||
|
||||
@@ -93,15 +93,14 @@ Then add `user: 1000:1000` to the docker-compose file (or whatever your $UID:$GI
|
||||
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
|
||||
environment:
|
||||
- UPSNAP_HTTP_LISTEN=0.0.0.0:5000
|
||||
```
|
||||
|
||||
### 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"
|
||||
entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve"
|
||||
```
|
||||
|
||||
You can search for your needed package [here](https://pkgs.alpinelinux.org/packages).
|
||||
|
||||
+17
-17
@@ -1,14 +1,14 @@
|
||||
module github.com/seriousm4x/upsnap
|
||||
|
||||
go 1.24.1
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a
|
||||
github.com/pocketbase/dbx v1.11.0
|
||||
github.com/pocketbase/pocketbase v0.30.4
|
||||
github.com/prometheus-community/pro-bing v0.7.0
|
||||
github.com/pocketbase/dbx v1.12.0
|
||||
github.com/pocketbase/pocketbase v0.36.2
|
||||
github.com/prometheus-community/pro-bing v0.8.0
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
golang.org/x/sys v0.37.0
|
||||
golang.org/x/sys v0.41.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -17,11 +17,11 @@ require (
|
||||
github.com/domodwyer/mailyak/v3 v3.6.2 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.13 // 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.9.3 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
@@ -34,18 +34,18 @@ require (
|
||||
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/spf13/cast v1.10.0 // indirect
|
||||
github.com/spf13/cobra v1.10.1 // indirect
|
||||
github.com/spf13/cobra v1.10.2 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/stretchr/testify v1.11.1 // indirect
|
||||
golang.org/x/crypto v0.43.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20251017212417-90e834f514db // indirect
|
||||
golang.org/x/image v0.32.0 // indirect
|
||||
golang.org/x/net v0.46.0 // indirect
|
||||
golang.org/x/oauth2 v0.32.0 // indirect
|
||||
golang.org/x/sync v0.17.0 // indirect
|
||||
golang.org/x/text v0.30.0 // indirect
|
||||
modernc.org/libc v1.66.10 // indirect
|
||||
golang.org/x/crypto v0.48.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
|
||||
golang.org/x/image v0.36.0 // indirect
|
||||
golang.org/x/net v0.50.0 // indirect
|
||||
golang.org/x/oauth2 v0.35.0 // indirect
|
||||
golang.org/x/sync v0.19.0 // indirect
|
||||
golang.org/x/text v0.34.0 // indirect
|
||||
modernc.org/libc v1.67.6 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.11.0 // indirect
|
||||
modernc.org/sqlite v1.39.1 // indirect
|
||||
modernc.org/sqlite v1.44.3 // indirect
|
||||
)
|
||||
|
||||
+47
-46
@@ -17,8 +17,8 @@ github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||
github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||
github.com/ganigeorgiev/fexpr v0.5.0 h1:XA9JxtTE/Xm+g/JFI6RfZEHSiQlk+1glLvRK1Lpv/Tk=
|
||||
github.com/ganigeorgiev/fexpr v0.5.0/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE=
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es=
|
||||
@@ -26,18 +26,20 @@ github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRi
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
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-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY=
|
||||
github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
|
||||
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc=
|
||||
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
|
||||
@@ -67,14 +69,12 @@ github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOF
|
||||
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
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.30.3 h1:exl+HAxC3cnGiqJuV9FaeIWyn5cgc0+gVMtDxav+juk=
|
||||
github.com/pocketbase/pocketbase v0.30.3/go.mod h1:qsI0S4J/3uRSGv5Z4ce8wu8FXe5dyvyGBEItFRyV7lE=
|
||||
github.com/pocketbase/pocketbase v0.30.4 h1:UT8WnRmG3b7hXFIjDPzSIKkDED/mK1CJC+LsGiJUE4w=
|
||||
github.com/pocketbase/pocketbase v0.30.4/go.mod h1:qsI0S4J/3uRSGv5Z4ce8wu8FXe5dyvyGBEItFRyV7lE=
|
||||
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/pocketbase/dbx v1.12.0 h1:/oLErM+A0b4xI0PWTGPqSDVjzix48PqI/bng2l0PzoA=
|
||||
github.com/pocketbase/dbx v1.12.0/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
|
||||
github.com/pocketbase/pocketbase v0.36.2 h1:mzrxnvXKc3yxKlvZdbwoYXkH8kfIETteD0hWdgj0VI4=
|
||||
github.com/pocketbase/pocketbase v0.36.2/go.mod h1:71vSF8whUDzC8mcLFE10+Qatf9JQdeOGIRWawOuLLKM=
|
||||
github.com/prometheus-community/pro-bing v0.8.0 h1:CEY/g1/AgERRDjxw5P32ikcOgmrSuXs7xon7ovx6mNc=
|
||||
github.com/prometheus-community/pro-bing v0.8.0/go.mod h1:Idyxz8raDO6TgkUN6ByiEGvWJNyQd40kN9ZUeho3lN0=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||
@@ -84,8 +84,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
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/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
|
||||
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
|
||||
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=
|
||||
@@ -93,60 +93,61 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
|
||||
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
|
||||
golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b h1:18qgiDvlvH7kk8Ioa8Ov+K6xCi0GMvmGfGW0sgd/SYA=
|
||||
golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70=
|
||||
golang.org/x/exp v0.0.0-20251017212417-90e834f514db h1:by6IehL4BH5k3e3SJmcoNbOobMey2SLpAF79iPOEBvw=
|
||||
golang.org/x/exp v0.0.0-20251017212417-90e834f514db/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70=
|
||||
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
|
||||
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
|
||||
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a h1:ovFr6Z0MNmU7nH8VaX5xqw+05ST2uO1exVfZPVqRC5o=
|
||||
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a/go.mod h1:K79w1Vqn7PoiZn+TkNpx3BUWUQksGO3JcVX6qIjytmA=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.32.0 h1:6lZQWq75h7L5IWNk0r+SCpUJ6tUVd3v4ZHnbRKLkUDQ=
|
||||
golang.org/x/image v0.32.0/go.mod h1:/R37rrQmKXtO6tYXAjtDLwQgFLHmhW+V6ayXlxzP2Pc=
|
||||
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
|
||||
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
|
||||
golang.org/x/image v0.36.0 h1:Iknbfm1afbgtwPTmHnS2gTM/6PPZfH+z2EFuOkSbqwc=
|
||||
golang.org/x/image v0.36.0/go.mod h1:YsWD2TyyGKiIX1kZlu9QfKIsQ4nAAK9bdgdrIsE7xy4=
|
||||
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
|
||||
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
|
||||
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.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
|
||||
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
|
||||
golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=
|
||||
golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||
golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60=
|
||||
golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM=
|
||||
golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ=
|
||||
golang.org/x/oauth2 v0.35.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.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
||||
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.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.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
||||
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
|
||||
golang.org/x/sys v0.41.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.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
|
||||
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
|
||||
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
|
||||
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
|
||||
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
|
||||
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
|
||||
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
|
||||
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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
modernc.org/cc/v4 v4.26.5 h1:xM3bX7Mve6G8K8b+T11ReenJOT+BmVqQj0FY5T4+5Y4=
|
||||
modernc.org/cc/v4 v4.26.5/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
|
||||
modernc.org/ccgo/v4 v4.28.1 h1:wPKYn5EC/mYTqBO373jKjvX2n+3+aK7+sICCv4Fjy1A=
|
||||
modernc.org/ccgo/v4 v4.28.1/go.mod h1:uD+4RnfrVgE6ec9NGguUNdhqzNIeeomeXf6CL0GTE5Q=
|
||||
modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis=
|
||||
modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0=
|
||||
modernc.org/ccgo/v4 v4.30.1 h1:4r4U1J6Fhj98NKfSjnPUN7Ze2c6MnAdL0hWw6+LrJpc=
|
||||
modernc.org/ccgo/v4 v4.30.1/go.mod h1:bIOeI1JL54Utlxn+LwrFyjCx2n2RDiYEaJVSrgdrRfM=
|
||||
modernc.org/fileutil v1.3.40 h1:ZGMswMNc9JOCrcrakF1HrvmergNLAmxOPjizirpfqBA=
|
||||
modernc.org/fileutil v1.3.40/go.mod h1:HxmghZSZVAz/LXcMNwZPA/DRrQZEVP9VX0V4LQGQFOc=
|
||||
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
||||
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
|
||||
modernc.org/gc/v3 v3.1.1 h1:k8T3gkXWY9sEiytKhcgyiZ2L0DTyCQ/nvX+LoCljoRE=
|
||||
modernc.org/gc/v3 v3.1.1/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
|
||||
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
|
||||
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
|
||||
modernc.org/libc v1.66.10 h1:yZkb3YeLx4oynyR+iUsXsybsX4Ubx7MQlSYEw4yj59A=
|
||||
modernc.org/libc v1.66.10/go.mod h1:8vGSEwvoUoltr4dlywvHqjtAqHBaw0j1jI7iFBTAr2I=
|
||||
modernc.org/libc v1.67.6 h1:eVOQvpModVLKOdT+LvBPjdQqfrZq+pC39BygcT+E7OI=
|
||||
modernc.org/libc v1.67.6/go.mod h1:JAhxUVlolfYDErnwiqaLvUqc8nfb2r6S6slAgZOnaiE=
|
||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
||||
@@ -155,8 +156,8 @@ modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
||||
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
||||
modernc.org/sqlite v1.39.1 h1:H+/wGFzuSCIEVCvXYVHX5RQglwhMOvtHSv+VtidL2r4=
|
||||
modernc.org/sqlite v1.39.1/go.mod h1:9fjQZ0mB1LLP0GYrp39oOJXx/I2sxEnZtzCmEQIKvGE=
|
||||
modernc.org/sqlite v1.44.3 h1:+39JvV/HWMcYslAwRxHb8067w+2zowvFOUrOWIy9PjY=
|
||||
modernc.org/sqlite v1.44.3/go.mod h1:CzbrU2lSB1DKUusvwGz7rqEKIq+NUd8GWuBBZDs9/nA=
|
||||
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||
|
||||
@@ -57,7 +57,7 @@ func TestCheckPort(t *testing.T) {
|
||||
// Valid case: all inputs correct
|
||||
{
|
||||
name: "Valid Case",
|
||||
host: "8.8.8.8",
|
||||
host: "0.0.0.0",
|
||||
port: "443",
|
||||
wantError: false,
|
||||
},
|
||||
@@ -71,17 +71,10 @@ func TestCheckPort(t *testing.T) {
|
||||
// Invalid port number
|
||||
{
|
||||
name: "Invalid Port",
|
||||
host: "8.8.8.8",
|
||||
host: "0.0.0.0",
|
||||
port: "70000", // invalid
|
||||
wantError: true,
|
||||
},
|
||||
// Port zero
|
||||
{
|
||||
name: "Port Zero",
|
||||
host: "8.8.8.8",
|
||||
port: "0",
|
||||
wantError: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
||||
@@ -7,6 +7,32 @@ import (
|
||||
"github.com/pocketbase/pocketbase/tools/hook"
|
||||
)
|
||||
|
||||
func RequireScanDevicesPermission() *hook.Handler[*core.RequestEvent] {
|
||||
return &hook.Handler[*core.RequestEvent]{
|
||||
Func: func(e *core.RequestEvent) error {
|
||||
if e.HasSuperuserAuth() {
|
||||
return e.Next()
|
||||
}
|
||||
|
||||
user := e.Auth
|
||||
if user == nil {
|
||||
return apis.NewUnauthorizedError("The request requires superuser or record authorization token to be set.", nil)
|
||||
}
|
||||
|
||||
res, err := e.App.FindFirstRecordByFilter(
|
||||
"permissions",
|
||||
"user.id = {:userId} && create = true",
|
||||
dbx.Params{"userId": user.Id},
|
||||
)
|
||||
if res == nil || err != nil {
|
||||
return apis.NewForbiddenError("You are not allowed to perform this request.", nil)
|
||||
}
|
||||
|
||||
return e.Next()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func RequireUpSnapPermission() *hook.Handler[*core.RequestEvent] {
|
||||
return &hook.Handler[*core.RequestEvent]{
|
||||
Func: func(e *core.RequestEvent) error {
|
||||
|
||||
+18
-3
@@ -75,7 +75,7 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
se.Router.GET("/api/upsnap/sleep/{id}", HandlerSleep).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/reboot/{id}", HandlerReboot).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/shutdown/{id}", HandlerShutdown).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/scan", HandlerScan).Bind(apis.RequireSuperuserAuth())
|
||||
se.Router.GET("/api/upsnap/scan", HandlerScan).Bind(RequireScanDevicesPermission())
|
||||
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)
|
||||
@@ -188,9 +188,24 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
return e.Next()
|
||||
})
|
||||
|
||||
if err := app.Start(); err != nil {
|
||||
logger.Error.Fatalln(err)
|
||||
// check for custom http listen address in env var, else use default
|
||||
httpListen := os.Getenv("UPSNAP_HTTP_LISTEN")
|
||||
if httpListen != "" {
|
||||
if err := app.Bootstrap(); err != nil {
|
||||
logger.Error.Fatalln(err)
|
||||
}
|
||||
if err := apis.Serve(app, apis.ServeConfig{
|
||||
HttpAddr: httpListen,
|
||||
ShowStartBanner: true,
|
||||
}); err != nil {
|
||||
logger.Error.Fatalln(err)
|
||||
}
|
||||
} else {
|
||||
if err := app.Start(); err != nil {
|
||||
logger.Error.Fatalln(err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func importSettings(app *pocketbase.PocketBase) error {
|
||||
|
||||
@@ -12,6 +12,7 @@ services:
|
||||
# user: 1000:1000
|
||||
# environment:
|
||||
# - TZ=Europe/Berlin # Set container timezone for cron schedules
|
||||
# - UPSNAP_HTTP_LISTEN=127.0.0.1:8090
|
||||
# - UPSNAP_INTERVAL=*/10 * * * * * # 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
|
||||
@@ -25,4 +26,4 @@ services:
|
||||
# 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"
|
||||
# entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve"
|
||||
|
||||
+3
-7
@@ -10,19 +10,15 @@ services:
|
||||
# user: 1000:1000
|
||||
# environment:
|
||||
# - TZ=Europe/Berlin # Set container timezone for cron schedules
|
||||
# - UPSNAP_HTTP_LISTEN=127.0.0.1:8090
|
||||
# - UPSNAP_INTERVAL=*/10 * * * * * # 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_SCAN_TIMEOUT=500ms # Scan timeout is nmap's --host-timeout value to wait for devices (https://nmap.org/book/man-performance.html)
|
||||
# - UPSNAP_PING_PRIVILEGED=true # Set to false if you don't have root user permissions
|
||||
# - UPSNAP_PING_PRIVILEGED=true # Set to false if non-root user and no NET_RAW capability *requires host setting net.ipv4.ping_group_range="0 2147483647"
|
||||
# - 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"
|
||||
# entrypoint: /bin/sh -c "apk update && apk add --no-cache <YOUR_PACKAGE> && rm -rf /var/cache/apk/* && ./upsnap serve"
|
||||
|
||||
+22
-21
@@ -15,29 +15,29 @@
|
||||
"machine-translate": "inlang machine translate --project project.inlang"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.4.0",
|
||||
"@eslint/js": "^9.38.0",
|
||||
"@inlang/cli": "^3.0.12",
|
||||
"@inlang/paraglide-js": "2.4.0",
|
||||
"@eslint/compat": "^1.4.1",
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@inlang/cli": "^3.1.6",
|
||||
"@inlang/paraglide-js": "2.11.0",
|
||||
"@sveltejs/adapter-static": "^3.0.10",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/kit": "^2.51.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.1.1",
|
||||
"daisyui": "^5.3.7",
|
||||
"eslint": "^9.38.0",
|
||||
"daisyui": "^5.5.18",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-svelte": "^3.12.5",
|
||||
"globals": "^16.4.0",
|
||||
"eslint-plugin-svelte": "^3.15.0",
|
||||
"globals": "^16.5.0",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-svelte": "^3.4.0",
|
||||
"prettier-plugin-tailwindcss": "^0.7.1",
|
||||
"svelte": "^5.41.0",
|
||||
"svelte-check": "^4.3.3",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"prettier": "^3.8.1",
|
||||
"prettier-plugin-svelte": "^3.4.1",
|
||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||
"svelte": "^5.50.3",
|
||||
"svelte-check": "^4.3.6",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.46.1",
|
||||
"vite": "^6.4.0"
|
||||
"typescript-eslint": "^8.55.0",
|
||||
"vite": "^6.4.1"
|
||||
},
|
||||
"type": "module",
|
||||
"lint-staged": {
|
||||
@@ -46,10 +46,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||
"@tailwindcss/postcss": "^4.1.14",
|
||||
"cron-parser": "^5.4.0",
|
||||
"@tailwindcss/postcss": "^4.1.18",
|
||||
"cron-parser": "^5.5.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"pocketbase": "^0.26.2",
|
||||
"pocketbase": "^0.26.8",
|
||||
"postcss": "^8.5.6",
|
||||
"svelte-fa": "^4.0.4",
|
||||
"svelte-french-toast": "github:seriousm4x/svelte-french-toast#fix-72-build",
|
||||
@@ -58,7 +58,8 @@
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@tailwindcss/oxide",
|
||||
"esbuild"
|
||||
"esbuild",
|
||||
"svelte-french-toast@2.0.0-alpha.0"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+689
-795
File diff suppressed because it is too large
Load Diff
@@ -1 +1,19 @@
|
||||
cache
|
||||
# IF GIT SHOWED THAT THIS FILE CHANGED
|
||||
#
|
||||
# 1. RUN THE FOLLOWING COMMAND
|
||||
#
|
||||
# ---
|
||||
# git rm --cached '**/*.inlang/.gitignore'
|
||||
# ---
|
||||
#
|
||||
# 2. COMMIT THE CHANGE
|
||||
#
|
||||
# ---
|
||||
# git commit -m "fix: remove tracked .gitignore from inlang project"
|
||||
# ---
|
||||
#
|
||||
# Inlang handles the gitignore itself starting with version ^2.5.
|
||||
#
|
||||
# everything is ignored except settings.json
|
||||
*
|
||||
!settings.json
|
||||
@@ -2,6 +2,7 @@
|
||||
"$schema": "https://inlang.com/schema/project-settings",
|
||||
"baseLocale": "en-US",
|
||||
"locales": [
|
||||
"ar-SA",
|
||||
"bg-BG",
|
||||
"cs-CZ",
|
||||
"de-DE",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
@plugin "daisyui" {
|
||||
@plugin 'daisyui' {
|
||||
themes: all;
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
{@html m.device_ping_desc()}
|
||||
</p>
|
||||
<fieldset class="fieldset">
|
||||
<label class="input mt-2">
|
||||
<label class="input mt-2 w-full">
|
||||
<span>$:</span>
|
||||
<input
|
||||
type="text"
|
||||
@@ -360,8 +360,8 @@
|
||||
/>
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset class="fieldset">
|
||||
<label class="input mt-2">
|
||||
<fieldset class="fieldset grow">
|
||||
<label class="input mt-2 w-full">
|
||||
<span>$:</span>
|
||||
<input
|
||||
type="text"
|
||||
@@ -457,8 +457,8 @@ second (0–59, optional)
|
||||
/>
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset class="fieldset">
|
||||
<label class="input mt-2">
|
||||
<fieldset class="fieldset grow">
|
||||
<label class="input mt-2 w-full">
|
||||
<span>$:</span>
|
||||
<input
|
||||
type="text"
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<ul
|
||||
id="mobile-menu"
|
||||
tabindex="-1"
|
||||
class="menu dropdown-content rounded-box bg-base-200 z-[1] mt-3 w-max gap-1 p-2 shadow-sm"
|
||||
class="menu dropdown-content rounded-box bg-base-200 z-1 mt-3 w-max gap-1 p-2 shadow-sm"
|
||||
>
|
||||
{#if $settingsPub?.website_title}
|
||||
<div class="menu-title">
|
||||
@@ -259,7 +259,7 @@
|
||||
</label>
|
||||
<ul
|
||||
tabindex="-1"
|
||||
class="menu dropdown-content rounded-box bg-base-200 z-[1] mt-3 w-52 p-2 shadow"
|
||||
class="menu dropdown-content rounded-box bg-base-200 z-1 mt-3 w-52 p-2 shadow"
|
||||
>
|
||||
<li class="menu-title">
|
||||
{$pocketbase.authStore.isSuperuser
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
let replaceNetmaskCheckbox = false;
|
||||
let replaceNetmask = '';
|
||||
|
||||
let loading = true;
|
||||
|
||||
onMount(() => {
|
||||
if (!$settingsPriv) {
|
||||
$pocketbase
|
||||
@@ -40,6 +42,7 @@
|
||||
} else {
|
||||
scanRange = $settingsPriv.scan_range;
|
||||
}
|
||||
loading = false;
|
||||
});
|
||||
|
||||
function saveSettings() {
|
||||
@@ -118,7 +121,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $settingsPriv}
|
||||
{#if !loading}
|
||||
<div class="card bg-base-200 mt-6 w-full shadow-sm">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">{m['device_tabs.1']()}</h2>
|
||||
@@ -126,36 +129,39 @@
|
||||
{m.device_network_scan_desc()}
|
||||
</p>
|
||||
<div class="flex flex-row flex-wrap items-end gap-4">
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault();
|
||||
saveSettings();
|
||||
}}
|
||||
>
|
||||
<fieldset class="fieldset p-0">
|
||||
<label class="floating-label mt-2">
|
||||
<span>{m.device_network_scan_ip_range()}</span>
|
||||
<div class="join max-w-xs">
|
||||
<input
|
||||
id="scan-range"
|
||||
class="input join-item w-full"
|
||||
type="text"
|
||||
placeholder="192.168.1.0/24"
|
||||
bind:value={scanRange}
|
||||
/>
|
||||
<button class="btn btn-neutral join-item" type="submit">{m.buttons_save()}</button>
|
||||
</div>
|
||||
</label>
|
||||
</fieldset>
|
||||
</form>
|
||||
{#if $settingsPriv}
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
e.preventDefault();
|
||||
saveSettings();
|
||||
}}
|
||||
>
|
||||
<fieldset class="fieldset p-0">
|
||||
<label class="floating-label mt-2">
|
||||
<span>{m.device_network_scan_ip_range()}</span>
|
||||
<div class="join max-w-xs">
|
||||
<input
|
||||
id="scan-range"
|
||||
class="input join-item w-full"
|
||||
type="text"
|
||||
placeholder="192.168.1.0/24"
|
||||
bind:value={scanRange}
|
||||
/>
|
||||
<button class="btn btn-neutral join-item" type="submit">{m.buttons_save()}</button
|
||||
>
|
||||
</div>
|
||||
</label>
|
||||
</fieldset>
|
||||
</form>
|
||||
{/if}
|
||||
<div>
|
||||
<div>
|
||||
{#if !$settingsPriv.scan_range}
|
||||
{#if $settingsPriv && !$settingsPriv.scan_range}
|
||||
<button class="btn btn-error" disabled>
|
||||
<Fa icon={faX} />
|
||||
{m.device_network_scan_no_range()}
|
||||
</button>
|
||||
{:else if scanRange !== $settingsPriv.scan_range}
|
||||
{:else if $settingsPriv && scanRange !== $settingsPriv.scan_range}
|
||||
<button class="btn btn-error" disabled>
|
||||
<Fa icon={faX} />
|
||||
{m.device_network_scan_unsaved_changes()}
|
||||
@@ -217,7 +223,8 @@
|
||||
<div class="max-w-fit">
|
||||
<label class="label cursor-pointer">
|
||||
<input type="checkbox" class="checkbox" bind:checked={replaceNetmaskCheckbox} />
|
||||
<span class="ms-2 text-wrap break-words">{m.device_network_scan_replace_netmask()}</span
|
||||
<span class="ms-2 text-wrap wrap-break-word"
|
||||
>{m.device_network_scan_replace_netmask()}</span
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
@@ -239,7 +246,7 @@
|
||||
<div class="max-w-fit">
|
||||
<label class="label cursor-pointer">
|
||||
<input type="checkbox" class="checkbox" bind:checked={addAllCheckbox} />
|
||||
<span class="ms-2 text-wrap break-words"
|
||||
<span class="ms-2 text-wrap wrap-break-word"
|
||||
>{m.device_network_scan_include_unknown()}</span
|
||||
>
|
||||
</label>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { fly } from 'svelte/transition';
|
||||
export let url: URL;
|
||||
let { url, children } = $props();
|
||||
</script>
|
||||
|
||||
{#key url}
|
||||
<div in:fly={{ y: 50, duration: 300 }}>
|
||||
<slot />
|
||||
{@render children()}
|
||||
</div>
|
||||
{/key}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { getLocale } from '$lib/paraglide/runtime';
|
||||
import type { Locale } from 'date-fns';
|
||||
import { arSA } from 'date-fns/locale/ar-SA';
|
||||
import { bg } from 'date-fns/locale/bg';
|
||||
import { cs } from 'date-fns/locale/cs';
|
||||
import { de } from 'date-fns/locale/de';
|
||||
@@ -20,7 +21,6 @@ import { uk } from 'date-fns/locale/uk';
|
||||
import { vi } from 'date-fns/locale/vi';
|
||||
import { zhCN } from 'date-fns/locale/zh-CN';
|
||||
import { zhTW } from 'date-fns/locale/zh-TW';
|
||||
|
||||
import { writable, type Writable } from 'svelte/store';
|
||||
|
||||
export const localeStore = writable(getLocale());
|
||||
@@ -28,6 +28,9 @@ export const dateFnsLocale: Writable<Locale> = writable(enUS);
|
||||
|
||||
localeStore.subscribe((l: string) => {
|
||||
switch (l) {
|
||||
case 'ar-SA':
|
||||
dateFnsLocale.set(arSA);
|
||||
break;
|
||||
case 'bg-BG':
|
||||
dateFnsLocale.set(bg);
|
||||
break;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import Navbar from '$lib/components/Navbar.svelte';
|
||||
import Transition from '$lib/components/Transition.svelte';
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
import { localeStore } from '$lib/stores/locale';
|
||||
import { backendUrl, permission, pocketbase } from '$lib/stores/pocketbase';
|
||||
import { settingsPub } from '$lib/stores/settings';
|
||||
import type { Permission } from '$lib/types/permission';
|
||||
@@ -12,11 +13,28 @@
|
||||
import { onMount } from 'svelte';
|
||||
import toast, { Toaster, type ToastOptions } from 'svelte-french-toast';
|
||||
import '../app.css';
|
||||
|
||||
let { children } = $props();
|
||||
let authIsValid = $state(false);
|
||||
|
||||
const toastOptions: ToastOptions = {
|
||||
duration: 5000
|
||||
};
|
||||
|
||||
let authIsValid = false;
|
||||
// list of RTL languages, more can be added if needed
|
||||
const RTL_LANGS = ['ar-SA'];
|
||||
|
||||
function setHTMLdir(lang: string) {
|
||||
if (RTL_LANGS.includes(lang)) {
|
||||
document.documentElement.setAttribute('dir', 'rtl');
|
||||
} else {
|
||||
document.documentElement.setAttribute('dir', 'ltr');
|
||||
}
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
setHTMLdir($localeStore);
|
||||
});
|
||||
|
||||
onMount(async () => {
|
||||
$pocketbase.authStore.onChange(() => {
|
||||
@@ -86,7 +104,11 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<link rel="manifest" href={backendUrl + 'api/upsnap/manifest.webmanifest'} />
|
||||
<link
|
||||
rel="manifest"
|
||||
href={backendUrl + 'api/upsnap/manifest.webmanifest'}
|
||||
crossorigin="use-credentials"
|
||||
/>
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
href={$settingsPub?.id && $settingsPub?.favicon
|
||||
@@ -108,6 +130,6 @@
|
||||
|
||||
<Transition url={page.url}>
|
||||
<div class="container mx-auto mb-4 p-2">
|
||||
<slot />
|
||||
{@render children()}
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
devices: Device[];
|
||||
}[] = $derived([]);
|
||||
|
||||
const isMac = /Mac|iPhone|iPad/.test(navigator.userAgent);
|
||||
const isMac = browser && /Mac|iPhone|iPad/.test(navigator.userAgent);
|
||||
const gridClass = 'grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4';
|
||||
|
||||
if (browser) {
|
||||
@@ -150,12 +150,12 @@
|
||||
</label>
|
||||
<div class="join ms-auto">
|
||||
{#if orderExpanded}
|
||||
<button class="btn join-item !outline-0" onclick={() => (orderByGroups = !orderByGroups)}>
|
||||
<button class="btn join-item outline-0!" onclick={() => (orderByGroups = !orderByGroups)}>
|
||||
{m.home_order_groups()}
|
||||
<input type="checkbox" class="checkbox" checked={orderByGroups} />
|
||||
</button>
|
||||
<input
|
||||
class="btn join-item !outline-0"
|
||||
class="btn join-item outline-0!"
|
||||
type="radio"
|
||||
name="order"
|
||||
aria-label={m.home_order_name()}
|
||||
@@ -163,7 +163,7 @@
|
||||
value="name"
|
||||
/>
|
||||
<input
|
||||
class="btn join-item !outline-0"
|
||||
class="btn join-item outline-0!"
|
||||
type="radio"
|
||||
name="order"
|
||||
aria-label={m.home_order_ip()}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
// locales
|
||||
const languageEmojis = {
|
||||
'ar-SA': '🇸🇦',
|
||||
'bg-BG': '🇧🇬',
|
||||
'cs-CZ': '🇨🇿',
|
||||
'de-DE': '🇩🇪',
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
name: 'scan',
|
||||
ll_name: m['device_tabs.1'](),
|
||||
icon: faBinoculars,
|
||||
show: $pocketbase.authStore.isSuperuser
|
||||
show: true
|
||||
}
|
||||
];
|
||||
</script>
|
||||
|
||||
@@ -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';
|
||||
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
|
||||
@@ -68,7 +68,7 @@
|
||||
<img
|
||||
src={$settingsPub?.id && $settingsPub?.favicon
|
||||
? `${backendUrl}api/files/settings_public/${$settingsPub?.id}/${$settingsPub?.favicon}`
|
||||
: '/gopher.svg'}
|
||||
: asset('/gopher.svg')}
|
||||
alt={$settingsPub?.website_title ? $settingsPub?.website_title : 'Gopher'}
|
||||
/>
|
||||
</figure>
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<div class="font-bold">{m.users_delete()}</div>
|
||||
<div class="font-bold">{m.users_power()}</div>
|
||||
{#each devices as device (device.id)}
|
||||
<hr class="border-neutral col-span-full w-full border-b-1 opacity-30" />
|
||||
<hr class="border-neutral col-span-full w-full border-b opacity-30" />
|
||||
{#each permissions.filter((perm) => perm.user === user.id) as permission (permission.id)}
|
||||
<div
|
||||
class="col-span-full flex flex-row flex-wrap gap-2 place-self-start break-all md:col-span-1"
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
{
|
||||
"$schema": "https://inlang.com/schema/inlang-message-format",
|
||||
"account_account_type_admin": "مسؤول",
|
||||
"account_account_type_user": "مستخدم",
|
||||
"account_avatar_title": "صورة",
|
||||
"account_change_password_body": "بعد تعديل كلمة المرور، يجب عليك تسجيل الدخول مرة أخرى",
|
||||
"account_change_password_confirm": "تأكيد كلمة المرور",
|
||||
"account_change_password_label": "كلمة المرور القديمة",
|
||||
"account_change_password_new": "كلمة المرور الجديدة",
|
||||
"account_change_password_title": "تغيير كلمة المرور",
|
||||
"account_language_title": "اللغة",
|
||||
"account_page_title": "الحساب",
|
||||
"buttons_add": "إضافة",
|
||||
"buttons_cancel": "إلغاء",
|
||||
"buttons_change": "تغيير",
|
||||
"buttons_confirm": "تأكيد",
|
||||
"buttons_delete": "حذف",
|
||||
"buttons_reset": "إعادة تعيين",
|
||||
"buttons_save": "حفظ",
|
||||
"device_card_btn_more_edit": "تعديل",
|
||||
"device_card_btn_more_reboot": "إعادة تشغيل",
|
||||
"device_card_btn_more_sleep": "سكون",
|
||||
"device_card_btn_more": "المزيد",
|
||||
"device_card_nic_tooltip_pending": "قيد الانتظار",
|
||||
"device_card_nic_tooltip_power_no_permission": "لا توجد صلاحية لتشغيل هذا الجهاز",
|
||||
"device_card_nic_tooltip_power": "تشغيل",
|
||||
"device_card_nic_tooltip_shutdown_no_cmd": "لم يتم تعيين أمر الإيقاف",
|
||||
"device_card_nic_tooltip_shutdown_no_permission": "لا توجد صلاحية لإيقاف هذا الجهاز",
|
||||
"device_card_nic_tooltip_shutdown": "إيقاف التشغيل",
|
||||
"device_card_password": "كلمة المرور",
|
||||
"device_card_tooltip_last_status_change": "آخر تغيير في الحالة",
|
||||
"device_card_tooltip_shutdown_cron": "جدولة الإيقاف",
|
||||
"device_card_tooltip_wake_cron": "جدولة التشغيل",
|
||||
"device_card_tooltip_wake_password": "كلمة مرور التشغيل",
|
||||
"device_general_description_placeholder": "وصف للجهاز",
|
||||
"device_general_description": "الوصف",
|
||||
"device_general_ip": "عنوان IP",
|
||||
"device_general_mac": "عنوان Mac",
|
||||
"device_general_name": "الاسم",
|
||||
"device_general_netmask": "قناع الشبكة",
|
||||
"device_general_required_field": "حقل مطلوب",
|
||||
"device_general": "عام",
|
||||
"device_groups_desc": "يمكنك إضافة الأجهزة إلى مجموعة لفرزها حسب المجموعة في لوحة التحكم.",
|
||||
"device_groups_placeholder": "مثلاً 'القبو' أو 'المكتب'",
|
||||
"device_groups": "المجموعات",
|
||||
"device_link_desc": "يجعل اسم جهازك رابطاً قابلاً للنقر، مثالي للربط بلوحة تحكم على سبيل المثال.",
|
||||
"device_link_open_new_tab": "تبويب جديد",
|
||||
"device_link_open_no": "لا",
|
||||
"device_link_open_same_tab": "نفس التبويب",
|
||||
"device_link_open": "فتح الرابط تلقائياً",
|
||||
"device_link": "الرابط",
|
||||
"device_modal_confirm_shutdown_desc": "يرجى التأكيد لإيقاف {device}.",
|
||||
"device_modal_confirm_shutdown_title": "إيقاف {device}؟",
|
||||
"device_modal_confirm_wake_desc": "يرجى التأكيد لتشغيل {device}.",
|
||||
"device_modal_confirm_wake_title": "تشغيل {device}؟",
|
||||
"device_network_scan_add_all": "إضافة جميع الأجهزة",
|
||||
"device_network_scan_desc": "فحص شبكتك تلقائياً للعثور على الأجهزة. لكي يعمل هذا، تحتاج إلى تشغيل UpSnap كمسؤول وتثبيت nmap وإتاحته في $PATH (بالنسبة لمستخدمي Docker، هذا متوفر بالفعل ولا تحتاج لفعل أي شيء). قد يستغرق الفحص بضع ثوانٍ.",
|
||||
"device_network_scan_include_unknown": "تضمين الأجهزة التي اسمها \"Unknown\"",
|
||||
"device_network_scan_ip_range": "نطاق IP",
|
||||
"device_network_scan_ip": "IP:",
|
||||
"device_network_scan_mac_vendor": "جهة تصنيع الـ Mac:",
|
||||
"device_network_scan_mac": "Mac:",
|
||||
"device_network_scan_netmask": "قناع الشبكة:",
|
||||
"device_network_scan_new_netmask": "قناع شبكة جديد",
|
||||
"device_network_scan_no_range": "لا يوجد نطاق فحص",
|
||||
"device_network_scan_range_saved": "تم حفظ نطاق الفحص",
|
||||
"device_network_scan_replace_netmask": "استبدال قناع الشبكة لجميع الأجهزة؟",
|
||||
"device_network_scan_running": "الفحص قيد التشغيل",
|
||||
"device_network_scan_unsaved_changes": "تغييرات غير محفوظة",
|
||||
"device_network_scan": "فحص",
|
||||
"device_page_title": "جهاز جديد",
|
||||
"device_password_desc": "بعض بطاقات الشبكة لديها خيار تعيين كلمة مرور لـ Magic Packets، تسمى أيضاً <span class=\"badge\">SecureON</span>. يمكن أن تكون كلمة المرور 0 أو 4 أو 6 أحرف فقط.",
|
||||
"device_password": "كلمة المرور",
|
||||
"device_ping_cmd": "أمر ping مخصص",
|
||||
"device_ping_desc": "يمكنك استخدام أمر shell مخصص لمعرفة ما إذا كان الجهاز قيد التشغيل. يجب أن يُرجع الأمر رمز خروج <span class=\"badge\">0</span> للإشارة إلى أن الجهاز قيد التشغيل، أي رمز خروج آخر سيحدد الجهاز على أنه متوقف.",
|
||||
"device_ping": "Ping",
|
||||
"device_ports_add_new": "إضافة منفذ جديد",
|
||||
"device_ports_desc": "يمكن لـ UpSnap أيضاً التحقق مما إذا كانت المنافذ المحددة مفتوحة.",
|
||||
"device_ports_name": "الاسم",
|
||||
"device_ports_number": "الرقم",
|
||||
"device_ports": "المنافذ",
|
||||
"device_require_confirmation": "يتطلب تأكيد",
|
||||
"device_shutdown_cmd": "أمر الإيقاف",
|
||||
"device_shutdown_cron_desc": "تماماً مثل تعيين جدولة لتشغيل الجهاز، يمكنك أيضاً جدولة مهمة لإيقاف هذا الجهاز.",
|
||||
"device_shutdown_cron_enable": "تفعيل جدولة الإيقاف",
|
||||
"device_shutdown_cron": "جدولة الإيقاف",
|
||||
"device_shutdown_desc": "سيتم تشغيل <strong>أمر shell</strong> هذا داخل الحاوية الخاصة بك (إذا كنت تستخدم Docker) أو على المضيف الخاص بك (إذا كنت تستخدم الملف الثنائي). للتحقق من أنه يعمل، يمكنك تشغيل الأمر داخل الحاوية أو على shell المضيف أولاً. الأوامر الشائعة هي <span class=\"badge\">net rpc</span> لـ Windows، <span class=\"badge\">sshpass</span> لـ Linux أو <span class=\"badge\">curl</span> بشكل عام لإجراء طلبات الويب.",
|
||||
"device_shutdown_examples_linux": "إيقاف جهاز Linux عن بُعد:",
|
||||
"device_shutdown_examples_windows": "إيقاف جهاز Windows عن بُعد:",
|
||||
"device_shutdown_examples": "أمثلة:",
|
||||
"device_shutdown_timeout": "مهلة الإيقاف (بالثواني)",
|
||||
"device_shutdown": "الإيقاف",
|
||||
"device_sol_authorization": "التفويض",
|
||||
"device_sol_desc1": "يمكنك وضع الأجهزة في وضع السكون باستخدام أداة <a class=\"link\" href=\"https://github.com/SR-G/sleep-on-lan\" target=\"_blank\">Sleep-On-LAN</a>. وهي أداة خارجية تعمل على الأجهزة التي تريد التحكم بها وتوفر نقطة نهاية REST. للمزيد، راجع قسم <a href=\"https://github.com/SR-G/sleep-on-lan#usage\" class=\"link\" target=\"_blank\">الاستخدام</a>.",
|
||||
"device_sol_desc2": "تم تكوين SOL لإرسال الطلبات عبر HTTP بدلاً من UDP لتمكين التفويض وجعل الطلبات أكثر موثوقية.",
|
||||
"device_sol_desc3": "لذلك، يرجى التأكد من تضمين <span class=\"badge\">HTTP:<YOURPORT></span> في قسم <span class=\"badge\">Listeners</span> من <a href=\"https://github.com/SR-G/sleep-on-lan#configuration\" class=\"link\" target=\"_blank\">تكوين SOL</a>.",
|
||||
"device_sol_enable": "تفعيل Sleep-On-LAN",
|
||||
"device_sol_password": "كلمة مرور SOL",
|
||||
"device_sol_port": "منفذ SOL",
|
||||
"device_sol_user": "مستخدم SOL",
|
||||
"device_sol": "Sleep-On-LAN",
|
||||
"device_tabs.0": "يدوي",
|
||||
"device_tabs.1": "فحص الشبكة",
|
||||
"device_wake_cmd": "أمر تشغيل مخصص",
|
||||
"device_wake_cron_enable": "تفعيل جدولة التشغيل",
|
||||
"device_wake_cron": "جدولة التشغيل",
|
||||
"device_wake_desc": "يمكنك تشغيل هذا الجهاز باستخدام مهمة مجدولة.",
|
||||
"device_wake_timeout": "مهلة التشغيل (بالثواني)",
|
||||
"device_wake": "التشغيل",
|
||||
"home_add_first_device": "أضف جهازك الأول",
|
||||
"home_grant_permissions": "يرجى الطلب من المسؤول منحك صلاحيات للأجهزة الموجودة أو لإنشاء أجهزة جديدة.",
|
||||
"home_no_devices": "لا توجد أجهزة هنا.",
|
||||
"home_order_groups": "المجموعات",
|
||||
"home_order_ip": "IP",
|
||||
"home_order_name": "الاسم",
|
||||
"home_order_tooltip": "الترتيب",
|
||||
"home_page_title": "الرئيسية",
|
||||
"home_search_placeholder": "البحث عن الأجهزة",
|
||||
"home_wake_group": "تشغيل المجموعة",
|
||||
"login_btn_login": "تسجيل الدخول",
|
||||
"login_btn_more": "المزيد",
|
||||
"login_email_label": "البريد الإلكتروني أو اسم المستخدم:",
|
||||
"login_menu_title_auth_providers": "موفرو مصادقة آخرون",
|
||||
"login_password_label": "كلمة المرور:",
|
||||
"login_welcome": "مرحباً",
|
||||
"navbar_edit_account": "تعديل الحساب",
|
||||
"navbar_logout": "تسجيل الخروج",
|
||||
"navbar_new": "جديد",
|
||||
"navbar_theme": "المظهر",
|
||||
"settings_icon_desc": "تعيين أيقونة مفضلة مخصصة. أنواع الملفات المدعومة هي:",
|
||||
"settings_icon_title": "الأيقونة",
|
||||
"settings_invalid_cron": "❌ صيغة cron غير صالحة",
|
||||
"settings_lazy_ping_desc": "عندما يتم تشغيل الـ ping خامل سيقوم UpSnap بفحص الأجهزة فقط إذا كان هناك مستخدم نشط يزور الموقع. إذا تم إيقاف تشغيله، سيقوم UpSnap دائماً بفحص الأجهزة.",
|
||||
"settings_lazy_ping_enable": "تفعيل",
|
||||
"settings_lazy_ping_title": "Ping خامل",
|
||||
"settings_page_title": "الإعدادات",
|
||||
"settings_ping_interval_desc1": "يعين الفاصل الزمني الذي يتم فيه فحص الأجهزة. اتركه فارغاً لاستخدام القيمة الافتراضية <span class=\"badge\">*/3 * * * * *</span>.",
|
||||
"settings_ping_interval_desc2": "تعرف على المزيد حول الصيغة الصحيحة لـ cron على <a class=\"link\" href=\"https://en.wikipedia.org/wiki/Cron\" target=\"_blank\">ويكيبيديا</a> أو راجع <a class=\"link\" href=\"https://github.com/harrisiirak/cron-parser\" target=\"_blank\">توثيق الحزمة</a>.",
|
||||
"settings_ping_interval_title": "فاصل زمني للـ Ping",
|
||||
"settings_upsnap_version": "إصدار UpSnap",
|
||||
"settings_website_title_desc": "يعين عنوان الموقع وفي تبويب المتصفح.",
|
||||
"settings_website_title_title": "عنوان الموقع",
|
||||
"toasts_admin_saved": "تم حفظ المسؤول",
|
||||
"toasts_device_created": "تم إنشاء {device}",
|
||||
"toasts_device_deleted": "تم حذف {device}",
|
||||
"toasts_device_updated": "تم تحديث {device}",
|
||||
"toasts_devices_created_multiple": "تم إنشاء {count} جهاز",
|
||||
"toasts_group_created": "تم إنشاء المجموعة {group}",
|
||||
"toasts_group_deleted": "تم حذف المجموعة {group}",
|
||||
"toasts_no_permission": "ليس لديك صلاحية لزيارة {url}",
|
||||
"toasts_password_changed": "تم تغيير كلمة المرور. يرجى تسجيل الدخول مرة أخرى.",
|
||||
"toasts_passwords_missmatch": "كلمات المرور غير متطابقة",
|
||||
"toasts_permissions_created": "تم إنشاء صلاحيات لـ {username}",
|
||||
"toasts_permissions_deleted": "تم حذف صلاحيات {username}",
|
||||
"toasts_permissions_updated_personal": "تم تحديث صلاحياتك",
|
||||
"toasts_permissions_updated": "تم تحديث صلاحيات {username}",
|
||||
"toasts_settings_saved": "تم حفظ الإعدادات",
|
||||
"toasts_user_created": "تم إنشاء المستخدم {username}",
|
||||
"toasts_user_deleted": "تم حذف المستخدم {username}",
|
||||
"toasts_user_saved": "تم حفظ المستخدم",
|
||||
"users_allow_create_devices": "السماح لـ {username} بإنشاء أجهزة جديدة وتعديل مجموعات الأجهزة",
|
||||
"users_confirm_delete_desc": "هل أنت متأكد من حذف {username}؟",
|
||||
"users_confirm_delete_title": "تأكيد الحذف",
|
||||
"users_create_new_device": "إنشاء جهاز جديد",
|
||||
"users_create_new_user": "إنشاء مستخدم جديد",
|
||||
"users_delete": "حذف",
|
||||
"users_device_permissions": "صلاحيات الأجهزة",
|
||||
"users_page_title": "المستخدمون",
|
||||
"users_password_confirm": "تأكيد كلمة المرور",
|
||||
"users_password": "كلمة المرور",
|
||||
"users_power": "التشغيل",
|
||||
"users_read": "قراءة",
|
||||
"users_required_field": "حقل مطلوب",
|
||||
"users_toggle": "تبديل",
|
||||
"users_update": "تحديث",
|
||||
"users_username": "اسم المستخدم",
|
||||
"welcome_not_expected_back": "العودة",
|
||||
"welcome_not_expected_desc": "لقد انتهيت بالفعل من الإعداد! لا يوجد شيء للقيام به.",
|
||||
"welcome_not_expected_title": "لم أتوقع رؤيتك هنا! 🧐",
|
||||
"welcome_progress_step1": "مرحباً",
|
||||
"welcome_progress_step2": "إنشاء حساب",
|
||||
"welcome_progress_step3": "تم",
|
||||
"welcome_step1_page_title": "مرحباً بك في UpSnap 🥳",
|
||||
"welcome_step1_setup_btn_next": "التالي",
|
||||
"welcome_step1_setup_desc": "يرجى إكمال الخطوات التالية لإنهاء الإعداد.",
|
||||
"welcome_step2_btn_create": "إنشاء",
|
||||
"welcome_step2_label_email": "البريد الإلكتروني:",
|
||||
"welcome_step2_label_min_chars": "10 أحرف كحد أدنى",
|
||||
"welcome_step2_label_password_confirm": "تأكيد كلمة المرور:",
|
||||
"welcome_step2_label_password": "كلمة المرور:",
|
||||
"welcome_step2_page_title": "إنشاء حساب مسؤول",
|
||||
"welcome_step3_btn_done": "لنبدأ!",
|
||||
"welcome_step3_page_desc": "تابع وأضف بعض الأجهزة إلى لوحة التحكم الخاصة بك.",
|
||||
"welcome_step3_page_title": "كل شيء جاهز! 🎉"
|
||||
}
|
||||
Reference in New Issue
Block a user