This commit is contained in:
Minecon724 2023-11-05 17:47:06 +01:00
parent 0a593d1009
commit 12e7b5a250
3 changed files with 29 additions and 3 deletions

View File

@ -1,4 +1,9 @@
if [ ! -f /root/.ssh/id_rsa.pub ] then
if [ "$EUID" -ne 0 ]; then
echo not root
exit 1
fi
if [ ! -f /root/.ssh/id_rsa.pub ]; then
echo no ssh key, generate: rsa without password
exit 1
fi
@ -13,6 +18,7 @@ read
apt update
apt install -y python3 rclone fuse
mkdir -p /root/.config/rclone
cp -n rclone.conf /root/.config/rclone/rclone.conf
cp nman.service /etc/systemd/system/
cp nman.timer /etc/systemd/system/
@ -27,9 +33,15 @@ systemctl stop nginx
rm -rf /etc/nginx
mkdir /etc/nginx
mkdir -p /var/www/html
mkdir -p /opt/cache/var-www-html
systemctl daemon-reload
systemctl enable --now mnt-files.mount
systemctl enable --now var-www-html.mount
/opt/nman.sh
systemctl enable nman.timer
systemctl enable --now nman.timer
systemctl start nginx

View File

@ -5,4 +5,7 @@ Description=mount
Type=rclone
What=files:
Where=/mnt/files
Options=ro,_netdev,allow_other,args2env,config=/root/.config/rclone/rclone.conf,read-only
Options=ro,_netdev,allow_other,args2env,config=/root/.config/rclone/rclone.conf,read-only
[Install]
WantedBy=multi-user.target

11
var-www-html.mount Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=mount
[Mount]
Type=rclone
What=files:html
Where=/var/www/html
Options=ro,_netdev,allow_other,args2env,config=/root/.config/rclone/rclone.conf,read-only,vfs-cache-mode=full,vfs-cache-max-age=6h,vfs-cache-poll-interval=10m,cache-dir=/opt/cache/var-www-html,no-modtime,transfers=16
[Install]
WantedBy=multi-user.target