This commit is contained in:
octospacc 2024-02-28 16:15:15 +01:00
parent 0f6a0a1ff0
commit 537ef4be7e
17 changed files with 107 additions and 34 deletions

View File

@ -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

View File

@ -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`;

View File

@ -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

View File

@ -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";
}
}

View File

@ -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"

View File

@ -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

View File

@ -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

View File

View File

@ -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

6
Server/Root/etc/systemd/system/Shiori.service Executable file → Normal file
View File

@ -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]

6
Server/Root/etc/systemd/system/ShioriFeed.service Executable file → Normal file
View File

@ -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]

6
Server/Root/etc/systemd/system/TelegramIndex.service Executable file → Normal file
View File

@ -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

0
Server/Root/etc/systemd/system/WebFileManager.service Executable file → Normal file
View File

5
Server/Root/etc/systemd/system/WinDog.service Executable file → Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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