inserite activities e mappe 3d le mappe 3d non funzionano ancora bene con activities
Find a file
2026-08-11 08:45:04 +02:00
api_v1 first commit 2026-08-11 08:45:04 +02:00
b first commit 2026-08-11 08:45:04 +02:00
db first commit 2026-08-11 08:45:04 +02:00
helpers first commit 2026-08-11 08:45:04 +02:00
middleware first commit 2026-08-11 08:45:04 +02:00
public first commit 2026-08-11 08:45:04 +02:00
routes first commit 2026-08-11 08:45:04 +02:00
urbino first commit 2026-08-11 08:45:04 +02:00
urbino1 first commit 2026-08-11 08:45:04 +02:00
utils first commit 2026-08-11 08:45:04 +02:00
watcher first commit 2026-08-11 08:45:04 +02:00
ws-server first commit 2026-08-11 08:45:04 +02:00
.env first commit 2026-08-11 08:45:04 +02:00
.Fabio.last_event first commit 2026-08-11 08:45:04 +02:00
.gitignore first commit 2026-08-11 08:45:04 +02:00
a.jpg first commit 2026-08-11 08:45:04 +02:00
aves.db first commit 2026-08-11 08:45:04 +02:00
cast.sh first commit 2026-08-11 08:45:04 +02:00
cast1.sh first commit 2026-08-11 08:45:04 +02:00
come funziona.md first commit 2026-08-11 08:45:04 +02:00
file_lungo.md first commit 2026-08-11 08:45:04 +02:00
find-esm.js first commit 2026-08-11 08:45:04 +02:00
generate_token.js first commit 2026-08-11 08:45:04 +02:00
IMG_0124.JPG first commit 2026-08-11 08:45:04 +02:00
IMG_0125.JPG first commit 2026-08-11 08:45:04 +02:00
IMG_20210602_100637.jpg first commit 2026-08-11 08:45:04 +02:00
map.md first commit 2026-08-11 08:45:04 +02:00
package-lock.json first commit 2026-08-11 08:45:04 +02:00
package.json first commit 2026-08-11 08:45:04 +02:00
part.bin first commit 2026-08-11 08:45:04 +02:00
PIPPO.JPG first commit 2026-08-11 08:45:04 +02:00
print_function.sh first commit 2026-08-11 08:45:04 +02:00
q.sh first commit 2026-08-11 08:45:04 +02:00
README.md first commit 2026-08-11 08:45:04 +02:00
README_WS.md first commit 2026-08-11 08:45:04 +02:00
scan.sh first commit 2026-08-11 08:45:04 +02:00
scan_Funzionamento.md first commit 2026-08-11 08:45:04 +02:00
scanPhoto_how_works.md first commit 2026-08-11 08:45:04 +02:00
server.js first commit 2026-08-11 08:45:04 +02:00
server.js.ok first commit 2026-08-11 08:45:04 +02:00
showfunc.sh first commit 2026-08-11 08:45:04 +02:00
t.js first commit 2026-08-11 08:45:04 +02:00
test.jpg first commit 2026-08-11 08:45:04 +02:00
w.zip first commit 2026-08-11 08:45:04 +02:00
ws-server.js first commit 2026-08-11 08:45:04 +02:00
ws-server.js.ok first commit 2026-08-11 08:45:04 +02:00
ws-server.js.old first commit 2026-08-11 08:45:04 +02:00
ws-test.js first commit 2026-08-11 08:45:04 +02:00

Galleria con json-server e protetto con JWT S6J

Installazione

clonare questa repo e installare tutte le dipendenze con npm ci

Start/Stop servers

Description Script
Start server senza auth npm start-no-auth
Start server con auth npm run start

Tools

Description Script
Generate user hashed passwords npm run hash

json-server api reference

Come usarlo

clonare e poi installare con

npm ci

nel file .env ci sono tutti i dati da modificare

poi inserire in user.json user e password utilizzati per fare il login

la password da inserire è criptata e viene generata con npm run hash

il nome viene utilizzato come cartella da scansionare, si trova dentro photos

es:

name: Fabio

public/photos
└── Fabio
    └── original
        └── 2017Irlanda19-29ago
            ├── IMG_0092.JPG
            ├── IMG_0099.JPG
            ├── IMG_0100.JPG

poi dentro Fabio genererà thumbs con tutti i thumbs

  • npm run start
  • su IP:4000 ci sarà la galleria e andando su impostazioni si potrà fare lo scan di tutte le foto

dopo aver fatto lo scan è possibile richiedere il json al server con tutte le informazioni anche senza autorizzazione

basta farlo partire con npm run start-no-auth e le info si possono vedere con

ip:4000/photos

  • npm start

FIT parse (utilizzo di python)

Per avere il parse dei fit installare python, pipx e i seguenyi packages

sudo apt install pipx
pipx ensurepath
pipx install fitdecode

usa per sapere dove è installato python

pipx list

in api_v1/scanner/parsers/parseFit.js va inserito il riferimento

in questo caso

async function parseFit(absPath) {
  const frames = await new Promise((resolve, reject) => {
    execFile(
      "/home/orangepi/.local/pipx/venvs/fitdecode/bin/python",
      ["api_v1/scanner/parsers/parse_fit.py", absPath],
      { maxBuffer: 1024 * 1024 * 50 }, // 50 MB

Inspired in this post by Techiediaries

Interrogazioni manuali

per vedere il token

curl -s -X POST https://prova.patachina.it/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"fabio@gmail.com","password":"master66"}'

per salvare il token

TOKEN=$(curl -s -X POST https://prova.patachina.it/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"fabio@gmail.com","password":"master66"}' \
  | jq -r '.token')

per interrogare le foto

curl -s "https://prova.patachina.it/photos/" \
  -H "Authorization: Bearer $TOKEN"

per interrogare le attività

curl -s "https://prova.patachina.it/activities/" \
  -H "Authorization: Bearer $TOKEN"