Added optionnal online storage and cross-client sync
This commit is contained in:
@@ -31,6 +31,12 @@ http://{$SITE_ADDRESS} {
|
||||
}
|
||||
|
||||
{$SITE_ADDRESS} {
|
||||
handle /api/sync/* {
|
||||
reverse_proxy sync:3001 {
|
||||
header_up X-Pardis-Client-IP {client_ip}
|
||||
}
|
||||
}
|
||||
|
||||
root * /srv
|
||||
encode zstd gzip
|
||||
|
||||
@@ -55,6 +61,7 @@ http://{$SITE_ADDRESS} {
|
||||
header @manifest Content-Type "application/manifest+json"
|
||||
|
||||
header {
|
||||
Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'"
|
||||
X-Content-Type-Options nosniff
|
||||
X-Frame-Options DENY
|
||||
Referrer-Policy strict-origin-when-cross-origin
|
||||
@@ -62,6 +69,8 @@ http://{$SITE_ADDRESS} {
|
||||
}
|
||||
|
||||
# The app routes on the hash, so this only catches someone typing a stray path.
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
handle {
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
}
|
||||
|
||||
13
docker/Sync.Dockerfile
Normal file
13
docker/Sync.Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM node:24-slim
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
COPY server ./server
|
||||
COPY src/lib/sync/crypto.js src/lib/sync/model.js ./src/lib/sync/
|
||||
COPY src/lib/backup.js src/lib/time.js src/lib/automation-options.js ./src/lib/
|
||||
RUN mkdir /data && chown node:node /data
|
||||
USER node
|
||||
ENV PORT=3001 SYNC_HOST=0.0.0.0 SYNC_DB=/data/pardis.sqlite
|
||||
EXPOSE 3001
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD node -e "fetch('http://127.0.0.1:3001/api/sync/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
|
||||
CMD ["node", "server/index.js"]
|
||||
Reference in New Issue
Block a user