From 513916995f28cf7944919943075f8ca7d9d2b844 Mon Sep 17 00:00:00 2001
From: piccihud <piccihud@email>
Date: Wed, 1 Jan 2025 17:45:15 +0100
Subject: [PATCH] aggiunto fmd

---
 caddy/Caddyfile        |  6 ++++++
 fmd/config.yml         | 29 +++++++++++++++++++++++++++++
 fmd/docker-compose.yml | 15 +++++++++++++++
 3 files changed, 50 insertions(+)
 create mode 100644 fmd/config.yml
 create mode 100644 fmd/docker-compose.yml

diff --git a/caddy/Caddyfile b/caddy/Caddyfile
index f540697..06616aa 100644
--- a/caddy/Caddyfile
+++ b/caddy/Caddyfile
@@ -111,6 +111,12 @@ https://social.ilnostropianetaselvaggio.it {
     }
 }
 
+# FMD
+
+https://fmd.ilnostropianetaselvaggio.it {
+    reverse_proxy localhost:3015
+}
+
 # MOLLY
 
 https://molly.ilnostropianetaselvaggio.it {
diff --git a/fmd/config.yml b/fmd/config.yml
new file mode 100644
index 0000000..b188ffd
--- /dev/null
+++ b/fmd/config.yml
@@ -0,0 +1,29 @@
+# This is an example config file for FMD Server
+
+# Listening precedence: socket > HTTPS > HTTP
+
+# Path to listening UNIX socket. If empty, no unix sockets will be used.
+UnixSocketPath: "" # /tmp/fmd.sock
+# Permissions to set on the socket after it is created. If < 0, no
+# modifications are made. This considered insecure practice, if you
+# do it, consider setting a umask for the daemon user before starting it.
+# Must start with a leading 0.
+UnixSocketChmod: 0660
+
+# The ports FMD Server should listen on.
+# Set the port value to -1 to disable it.
+# The secure port is only used if the cert and key are set (see below).
+PortSecure: 8443
+PortInsecure: 8080
+
+# The length for the user IDs that are generated
+UserIdLength: 5
+
+# How many location points or pictures FMD Server should save per account
+MaxSavedLoc: 1000
+MaxSavedPic: 10
+
+# If RegistrationToken is non-empty, FMD Server will require the FMD app to provide this token during registration.
+# Set this to a long random string if you want your instance to be private and not open to registrations by anyone.
+# You can e.g. generate a 32 character string with your password manager.
+RegistrationToken: ""
\ No newline at end of file
diff --git a/fmd/docker-compose.yml b/fmd/docker-compose.yml
new file mode 100644
index 0000000..18fc9bb
--- /dev/null
+++ b/fmd/docker-compose.yml
@@ -0,0 +1,15 @@
+# https://gitlab.com/Nulide/findmydeviceserver
+# https://gitlab.com/Nulide/findmydevice/-/wikis/PERMISSION-WRITE_SECURE_SETTINGS
+
+services:
+  fmd:
+    image: registry.gitlab.com/nulide/findmydeviceserver:latest
+    container_name: fmd
+    user: 1000:1000
+    mem_limit: 128m
+    ports:
+      - 127.0.0.1:3015:8080
+    volumes:
+      - './fmddata/db/:/fmd/db/'
+      - './config.yml:/fmd/config.yml:ro'
+    restart: unless-stopped
\ No newline at end of file