#!/bin/bash # Create the server-side clips folder for a Syncthing gamer. Name = their Authentik/Discord username (lowercase), # because the Jellyfin plugin treats the folder as the show and looks the person up by that name. set -euo pipefail cd "$(dirname "$0")" u="${1:-}"; [[ $u =~ ^[a-z0-9_.-]{2,32}$ ]] || { echo "usage: $0 (lowercase letters, digits, _ . -)"; exit 1; } sudo install -d -o 1000 -g 1000 "/srv/media/clips/$u" sudo install -m 0644 -o 1000 -g 1000 syncthing/stignore "/srv/media/clips/$u/.stignore" [[ -e "/srv/media/clips/$u/.stlocal" ]] || sudo install -m 0644 -o 1000 -g 1000 /dev/null "/srv/media/clips/$u/.stlocal" # #include'd by .stignore echo "ready: /srv/media/clips/$u (Syncthing path: /var/syncthing/clips/$u)" echo "next: the gamer pairs at the clips host (self-service), or you accept their folder in the Syncthing UI at that path, Receive Only, min free 300 GB"