From 537ef4be7e3b637dcac1785ef09d3bcabcbd6c76 Mon Sep 17 00:00:00 2001 From: octospacc Date: Wed, 28 Feb 2024 16:15:15 +0100 Subject: [PATCH] . --- Server/Repo.Update.sh | 17 ++++++++++++----- .../Root/Main/Server/Scripts/BackupAll.zx.mjs | 11 +++++++++-- .../etc/nginx/sites-available/liminalgici.conf | 7 +++++++ .../Root/etc/nginx/sites-available/private.conf | 13 ------------- .../Root/etc/systemd/system/BackupAll.service | 7 +++++++ Server/Root/etc/systemd/system/BackupAll.timer | 9 +++++++++ .../systemd/system/FreshRSS-actualize.service | 2 +- .../etc/systemd/system/FreshRSS-actualize.timer | 0 .../etc/systemd/system/RssToTelegramBot.service | 11 +++++++++++ Server/Root/etc/systemd/system/Shiori.service | 6 +++--- .../Root/etc/systemd/system/ShioriFeed.service | 6 +++--- .../etc/systemd/system/TelegramIndex.service | 6 ++---- .../etc/systemd/system/WebFileManager.service | 0 Server/Root/etc/systemd/system/WinDog.service | 5 ++--- .../Root/etc/systemd/system/WuppiMini.service | 11 +++++++++++ .../etc/systemd/system/matterbridge.service | 13 +++++++++++++ .../systemd/system/pixelfed_liminalgici.service | 17 +++++++++++++++++ 17 files changed, 107 insertions(+), 34 deletions(-) delete mode 100644 Server/Root/etc/nginx/sites-available/private.conf create mode 100644 Server/Root/etc/systemd/system/BackupAll.service create mode 100644 Server/Root/etc/systemd/system/BackupAll.timer mode change 100755 => 100644 Server/Root/etc/systemd/system/FreshRSS-actualize.service mode change 100755 => 100644 Server/Root/etc/systemd/system/FreshRSS-actualize.timer create mode 100644 Server/Root/etc/systemd/system/RssToTelegramBot.service mode change 100755 => 100644 Server/Root/etc/systemd/system/Shiori.service mode change 100755 => 100644 Server/Root/etc/systemd/system/ShioriFeed.service mode change 100755 => 100644 Server/Root/etc/systemd/system/TelegramIndex.service mode change 100755 => 100644 Server/Root/etc/systemd/system/WebFileManager.service mode change 100755 => 100644 Server/Root/etc/systemd/system/WinDog.service create mode 100644 Server/Root/etc/systemd/system/WuppiMini.service create mode 100644 Server/Root/etc/systemd/system/matterbridge.service create mode 100644 Server/Root/etc/systemd/system/pixelfed_liminalgici.service diff --git a/Server/Repo.Update.sh b/Server/Repo.Update.sh index 7bea3af..05d0999 100755 --- a/Server/Repo.Update.sh +++ b/Server/Repo.Update.sh @@ -9,11 +9,9 @@ mkcd ./Root CpSufx etc/ diycron diycron.zx.mjs for f in \ - diycron ncshell OneShot.AfterBoot bittorrentd SocatIpProxies \ - Shiori ShioriFeed \ - CringeInoltro WinDog \ - TelegramIndex WebFileManager \ - SpaccCraft FreshRSS-actualize \ + diycron BackupAll \ + ncshell OneShot.AfterBoot SocatIpProxies \ + CringeInoltro SpaccCraft \ ; do CpItem "etc/systemd/system/${f}.service" CpItem "etc/systemd/system/${f}.timer" @@ -40,6 +38,15 @@ mkcd ./Root CpItem etc/nginx/nginx.conf CpSufx "etc/nginx/sites-available/*." conf old CpItem etc/tor/torrc + for f in \ + matterbridge pixelfed_liminalgici FreshRSS-actualize \ + Shiori ShioriFeed \ + RssToTelegramBot WinDog \ + TelegramIndex WebFileManager WuppiMini \ + ; do + CpItem "etc/systemd/system/${f}.service" + CpItem "etc/systemd/system/${f}.timer" + done ScopePath=/var/lib/lxc/Ubuntu2023-SpaccCraft/rootfs/ CpItem etc/systemd/system/SpaccCraft.service diff --git a/Server/Root/Main/Server/Scripts/BackupAll.zx.mjs b/Server/Root/Main/Server/Scripts/BackupAll.zx.mjs index f34f779..8c41654 100755 --- a/Server/Root/Main/Server/Scripts/BackupAll.zx.mjs +++ b/Server/Root/Main/Server/Scripts/BackupAll.zx.mjs @@ -45,7 +45,7 @@ const BackPathCrypt = async (Folder, Key, Ext) => { await ccencryptNow(`./${File}`, Key); }; -const SimpleCompress = async (dst, src) => await $`rm ${dst}.tar.xz || true; tar cJSf "${dst}.tar.xz" ${dst || src}`; +const SimpleCompress = async (dst, src) => await $`rm ${dst}.tar.xz || true; tar cJSf "${dst}.tar.xz" ${src || dst}`; const SimpleBackup = async (Folder, Prefix) => { await $`mkdir -vp ./${Folder}`; @@ -103,6 +103,11 @@ Jobs.Local_liminalgici = async()=>{ Jobs.Mixed_OctospaccAltervista = async()=>{ await AltervistaFullBackup('octospacc.altervista.org'); + $`rm -rf ./microblog-mirror/assets/uploads/*`; + cd('./octospacc.altervista.org-Git/www/wp-content/uploads'); + $`cp -r $(seq 2020 $(date +%Y)) ../../../../microblog-mirror/assets/uploads/`; + cd('../../../../microblog-mirror'); + await GitPullPush(); }; // TODO: setup FTP access and Cookie @@ -175,6 +180,8 @@ Jobs.Cloud_Private = async()=> await $`sudo -u tux rclone sync /Main/Clouds/octt //////////////////////////////////////////////////////////////////////////////// +$`echo Begin ${Time.Stamp} > ${BackupsBase}/Last.log`; + await Work('Local_MiscSimpleBackups'); await Work('Local_Shiori'); await Work('Local_SpaccBBS'); @@ -193,4 +200,4 @@ await Work('Cloud_liminalgici'); await Work('Cloud_SpaccCraft'); await Work('Cloud_Private'); -$`echo ${Time.Stamp} > ${BackupsBase}/Last.log`; +$`echo End ${Time.Stamp} > ${BackupsBase}/Last.log`; diff --git a/Server/Root/etc/nginx/sites-available/liminalgici.conf b/Server/Root/etc/nginx/sites-available/liminalgici.conf index 306f1eb..19e2e76 100755 --- a/Server/Root/etc/nginx/sites-available/liminalgici.conf +++ b/Server/Root/etc/nginx/sites-available/liminalgici.conf @@ -57,6 +57,13 @@ server { location ~ /\.(?!well-known).* { deny all; } + + #location /api/pixelfed/v1/accounts/664033260845064193 { + # sub_filter '"is_admin":true' '"is_admin":false'; + #} + #location ~ /api/pixelfed/v1/accounts/664532712418222892 { + # sub_filter '"is_admin":false' '"is_admin":true'; + #} } server { # Redirect http to https diff --git a/Server/Root/etc/nginx/sites-available/private.conf b/Server/Root/etc/nginx/sites-available/private.conf deleted file mode 100644 index 8f0c827..0000000 --- a/Server/Root/etc/nginx/sites-available/private.conf +++ /dev/null @@ -1,13 +0,0 @@ -server { - listen 8083; - location / { - #proxy_http_version 1.1; - proxy_pass http://127.0.0.1:5283; - #proxy_set_header Host www.ecosia.org; - #proxy_set_header X-Real-IP $remote_addr; - #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - #proxy_set_header X-Forwarded-Proto $scheme; - #proxy_set_header Upgrade $http_upgrade; - #proxy_set_header Connection "upgrade"; - } -} diff --git a/Server/Root/etc/systemd/system/BackupAll.service b/Server/Root/etc/systemd/system/BackupAll.service new file mode 100644 index 0000000..c914f10 --- /dev/null +++ b/Server/Root/etc/systemd/system/BackupAll.service @@ -0,0 +1,7 @@ +[Unit] +Description=BackupAll.service +After=network.target + +[Service] +User=root +ExecStart=/usr/bin/bash -c "zx /Main/Server/Scripts/BackupAll.zx.mjs" diff --git a/Server/Root/etc/systemd/system/BackupAll.timer b/Server/Root/etc/systemd/system/BackupAll.timer new file mode 100644 index 0000000..5b73624 --- /dev/null +++ b/Server/Root/etc/systemd/system/BackupAll.timer @@ -0,0 +1,9 @@ +[Install] +WantedBy=default.target + +[Unit] +Description=BackupAll.timer + +[Timer] +OnCalendar=*-*-2,5,8,11,14,17,20,23,26,29 00:03:00 +Unit=BackupAll.service diff --git a/Server/Root/etc/systemd/system/FreshRSS-actualize.service b/Server/Root/etc/systemd/system/FreshRSS-actualize.service old mode 100755 new mode 100644 index 351c197..8362f28 --- a/Server/Root/etc/systemd/system/FreshRSS-actualize.service +++ b/Server/Root/etc/systemd/system/FreshRSS-actualize.service @@ -5,4 +5,4 @@ Wants=freshrss.timer [Service] User=www-data Type=simple -ExecStart=/usr/bin/php /Server/www/FreshRSS/app/actualize_script.php +ExecStart=/usr/bin/php /Main/Server/www/FreshRSS/app/actualize_script.php diff --git a/Server/Root/etc/systemd/system/FreshRSS-actualize.timer b/Server/Root/etc/systemd/system/FreshRSS-actualize.timer old mode 100755 new mode 100644 diff --git a/Server/Root/etc/systemd/system/RssToTelegramBot.service b/Server/Root/etc/systemd/system/RssToTelegramBot.service new file mode 100644 index 0000000..06ae432 --- /dev/null +++ b/Server/Root/etc/systemd/system/RssToTelegramBot.service @@ -0,0 +1,11 @@ +[Unit] +Description=RssToTelegramBot +After=network.target +[Service] +Type=simple +Restart=always +RestartSec=15 +User=tux +ExecStart=/bin/sh /Main/Server/Bots/RSS-to-Telegram-Bot-Fork/StartRssToTelegramBot.sh +[Install] +WantedBy=multi-user.target diff --git a/Server/Root/etc/systemd/system/Shiori.service b/Server/Root/etc/systemd/system/Shiori.service old mode 100755 new mode 100644 index cb1b30a..c1c9963 --- a/Server/Root/etc/systemd/system/Shiori.service +++ b/Server/Root/etc/systemd/system/Shiori.service @@ -2,10 +2,10 @@ Description=Shiori After=network.target [Service] -User=pi +User=tux Type=exec -ExecStart=/Server/Shiori/shiori --portable serve -p 8076 -WorkingDirectory=/Server/Shiori/ +ExecStart=/Main/Server/Shiori/shiori --portable serve -p 8076 +WorkingDirectory=/Main/Server/Shiori/ Restart=always RestartSec=10 [Install] diff --git a/Server/Root/etc/systemd/system/ShioriFeed.service b/Server/Root/etc/systemd/system/ShioriFeed.service old mode 100755 new mode 100644 index 0087b36..8541d04 --- a/Server/Root/etc/systemd/system/ShioriFeed.service +++ b/Server/Root/etc/systemd/system/ShioriFeed.service @@ -2,10 +2,10 @@ Description=ShioriFeed After=network.target [Service] -User=pi +User=tux Type=exec -ExecStart=/Server/Shiori/ShioriFeed.py -WorkingDirectory=/Server/Shiori/ +ExecStart=/Main/Server/Shiori/ShioriFeed.py +WorkingDirectory=/Main/Server/Shiori/ Restart=always RestartSec=10 [Install] diff --git a/Server/Root/etc/systemd/system/TelegramIndex.service b/Server/Root/etc/systemd/system/TelegramIndex.service old mode 100755 new mode 100644 index 7939d05..3d86b40 --- a/Server/Root/etc/systemd/system/TelegramIndex.service +++ b/Server/Root/etc/systemd/system/TelegramIndex.service @@ -1,13 +1,11 @@ [Unit] Description=TelegramIndex After=network.target -StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=15 -User=pi -WorkingDirectory=/Server/TelegramIndex-Fork -ExecStart=/usr/bin/bash -c "set -a; source .env; python3 -m app" +User=root +ExecStart=/usr/bin/bash /Main/Server/TelegramIndex-Fork/StartTelegramIndex.sh [Install] WantedBy=multi-user.target diff --git a/Server/Root/etc/systemd/system/WebFileManager.service b/Server/Root/etc/systemd/system/WebFileManager.service old mode 100755 new mode 100644 diff --git a/Server/Root/etc/systemd/system/WinDog.service b/Server/Root/etc/systemd/system/WinDog.service old mode 100755 new mode 100644 index e377534..b199fe1 --- a/Server/Root/etc/systemd/system/WinDog.service +++ b/Server/Root/etc/systemd/system/WinDog.service @@ -1,12 +1,11 @@ [Unit] Description=windog After=network.target -StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=10 -User=pi -ExecStart=/Server/Bots/WinDog/StartWinDog +User=tux +ExecStart=/Main/Server/Bots/WinDog/StartWinDog.sh [Install] WantedBy=multi-user.target diff --git a/Server/Root/etc/systemd/system/WuppiMini.service b/Server/Root/etc/systemd/system/WuppiMini.service new file mode 100644 index 0000000..4fe890b --- /dev/null +++ b/Server/Root/etc/systemd/system/WuppiMini.service @@ -0,0 +1,11 @@ +[Unit] +Description=WuppiMini +After=network.target +[Service] +User=tux +Type=exec +ExecStart=/usr/bin/env node /Main/Server/WuppiMini/index.js +Restart=always +RestartSec=5 +[Install] +WantedBy=default.target diff --git a/Server/Root/etc/systemd/system/matterbridge.service b/Server/Root/etc/systemd/system/matterbridge.service new file mode 100644 index 0000000..9c6ce4c --- /dev/null +++ b/Server/Root/etc/systemd/system/matterbridge.service @@ -0,0 +1,13 @@ +[Unit] +Description=Matterbridge daemon +After=network-online.target + +[Service] +Type=simple +ExecStart=/Main/Server/matterbridge/matterbridge.run -conf /Main/Server/matterbridge/matterbridge.toml +Restart=always +RestartSec=5s +User=tux + +[Install] +WantedBy=multi-user.target diff --git a/Server/Root/etc/systemd/system/pixelfed_liminalgici.service b/Server/Root/etc/systemd/system/pixelfed_liminalgici.service new file mode 100644 index 0000000..bc48214 --- /dev/null +++ b/Server/Root/etc/systemd/system/pixelfed_liminalgici.service @@ -0,0 +1,17 @@ +[Unit] +Description=Pixelfed task queueing via Laravel Horizon +After=network.target +#Requires=mariadb +#Requires=php-fpm +#Requires=redis +#Requires=nginx + +[Service] +Type=simple +#ExecStart=/bin/sh -c "/usr/bin/php /Main/Server/www/pixelfed/artisan queue:work" +ExecStart=/usr/bin/php /Main/Server/www/pixelfed_liminalgici/artisan horizon +User=www-data +Restart=on-failure + +[Install] +WantedBy=multi-user.target