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 echo no ssh key, generate: rsa without password
exit 1 exit 1
fi fi
@ -13,6 +18,7 @@ read
apt update apt update
apt install -y python3 rclone fuse apt install -y python3 rclone fuse
mkdir -p /root/.config/rclone
cp -n rclone.conf /root/.config/rclone/rclone.conf cp -n rclone.conf /root/.config/rclone/rclone.conf
cp nman.service /etc/systemd/system/ cp nman.service /etc/systemd/system/
cp nman.timer /etc/systemd/system/ cp nman.timer /etc/systemd/system/
@ -27,9 +33,15 @@ systemctl stop nginx
rm -rf /etc/nginx rm -rf /etc/nginx
mkdir /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 mnt-files.mount
systemctl enable --now var-www-html.mount
/opt/nman.sh /opt/nman.sh
systemctl enable nman.timer systemctl enable --now nman.timer
systemctl start nginx systemctl start nginx

View file

@ -5,4 +5,7 @@ Description=mount
Type=rclone Type=rclone
What=files: What=files:
Where=/mnt/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