feat: add files to setgid on folders inside user public repos
This commit is contained in:
12
setgid-watcher.service
Normal file
12
setgid-watcher.service
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Ensure setgid bit on all new directories in /mnt/private/workspaces-data/public
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/local/bin/setgid-watcher.sh
|
||||||
|
User=root
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
6
setgit-watcher.sh
Normal file
6
setgit-watcher.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
WATCH_DIR="/mnt/private/workspaces-data/public"
|
||||||
|
|
||||||
|
inotifywait -m -r -e mkdir --format '%w%f' "$WATCH_DIR" | while read -r newdir; do
|
||||||
|
chmod g+s "$newdir"
|
||||||
|
done
|
Reference in New Issue
Block a user