This commit is contained in:
2023-04-10 00:16:17 +02:00
parent 3fc0869253
commit d7c333ce04
11 changed files with 94 additions and 20 deletions

View File

@@ -27,3 +27,8 @@ ccencryptNow() {
WriteLastLog() { WriteLastLog() {
echo "$0: $(date)" > "${BackupsBase}/Last.log" echo "$0: $(date)" > "${BackupsBase}/Last.log"
} }
EchoExec() {
echo "$@"
$@
}

View File

@@ -18,7 +18,7 @@ BackPathCrypt() {
Folder="$1" Folder="$1"
Key="$2" Key="$2"
Ext="$([ -z "$3" ] && echo ".tar.xz" || echo "$3")" Ext="$([ -z "$3" ] && echo ".tar.xz" || echo "$3")"
cp "../${Folder}/Latest${Ext}" "./${Folder}${Ext}" && \ cp -v "../${Folder}/Latest${Ext}" "./${Folder}${Ext}" && \
ccencryptNow "./${Folder}${Ext}" "${Key}" ccencryptNow "./${Folder}${Ext}" "${Key}"
} }
@@ -27,16 +27,12 @@ BackPathCrypt "Invidious-User" "${BackupKey_Git_Invidious}" ".7z"
#BackPathCrypt "wallabag-data" "${BackupKey_Git_wallabag}" #BackPathCrypt "wallabag-data" "${BackupKey_Git_wallabag}"
BackPathCrypt "FreshRSS-data" "${BackupKey_Git_FreshRSS}" BackPathCrypt "FreshRSS-data" "${BackupKey_Git_FreshRSS}"
#BackPathCrypt "shiori-data" "${BackupKey_Git_Shiori}" #BackPathCrypt "shiori-data" "${BackupKey_Git_Shiori}"
#Item="Invidious-User" && cp "../${Item}/Latest.7z" "./${Item}.7z" && ccencryptNow "./${Item}.7z" "${BackupKey_Git_Invidious}"
#Item="wallabag-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_wallabag}"
#Item="FreshRSS-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_FreshRSS}"
#Item="shiori-data" && cp "../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_Shiori}"
GitPush GitPush
cd .. cd ..
cd ./Articles-Backup-Private cd ./Articles-Backup-Private
rm -rf ./shiori-data EchoExec rm -rf ./shiori-data
cp -r "../shiori-data/Latest.d" "./shiori-data" EchoExec cp -rp "../shiori-data/Latest.d" "./shiori-data"
GitPush GitPush
cd .. cd ..

View File

@@ -5,10 +5,10 @@
# Invidious personal JSON dump # Invidious personal JSON dump
Name="Invidious-User" Name="Invidious-User"
mkdir -p "./${Name}" mkdir -vp "./${Name}"
curl \ curl \
"${Invidious_Backup_URL}/subscription_manager?action_takeout=1&format=json" \ "${Invidious_Backup_URL}/subscription_manager?action_takeout=1&format=json" \
-H "${Invidious_Backup_Cookie}" \ -H "${Invidious_Backup_Cookie}" \
| 7z a -mmt1 -mx9 "./${Name}/${RunDate}.7z" -si && cp "./${Name}/${RunDate}.7z" "./${Name}/Latest.7z" | 7z a -mmt1 -mx9 "./${Name}/${RunDate}.7z" -si && cp -v "./${Name}/${RunDate}.7z" "./${Name}/Latest.7z"
WriteLastLog WriteLastLog

View File

@@ -5,17 +5,21 @@
SimpleBackup() { SimpleBackup() {
# $1: Folder # $1: Folder
# $2: Optional prefix in /Server path # $2: Optional prefix relative to path in /Server
mkdir -p "./$1" mkdir -vp "./$1"
tar cvJSf "./$1/${RunDate}.tar.xz" "/Server/$2/$1" && \ #tar cvJSf "./$1/${RunDate}.tar.xz" "/Server/$2/$1" && \
cp "./$1/${RunDate}.tar.xz" "./$1/Latest.tar.xz" #cp "./$1/${RunDate}.tar.xz" "./$1/Latest.tar.xz"
rm -rf "./$1/Latest.d" EchoExec rm -rf "./$1/Latest.d"
cp -r "/Server/$2/$1" "./$1/Latest.d" EchoExec cp -rp "/Server/$2/$1" "./$1/Latest.d"
EchoExec tar cJSf "./$1/${RunDate}.tar.xz" "./$1/Latest.d" && \
cp -v "./$1/${RunDate}.tar.xz" "./$1/Latest.tar.xz"
} }
#SimpleBackup "wallabag-data" #SimpleBackup "wallabag-data"
SimpleBackup "FreshRSS-data" SimpleBackup "FreshRSS-data"
SimpleBackup "shiori-data" "Shiori" SimpleBackup "shiori-data" "Shiori"
rm -v "./shiori-data/Latest.d/archive/*"
# GoToSocial # GoToSocial
#Name="GoToSocial" #Name="GoToSocial"

View File

@@ -21,7 +21,9 @@ ResetJobs() {
echo "------------------------------------------" echo "------------------------------------------"
echo "[ $(date "+%F | %T") ] diycron started." echo "[ $(date "+%F | %T") ] diycron started."
set -x # Enable command echo
ResetJobs ResetJobs
while true while true
do do
# Inside here, declaration of all cronjobs like normal shell commands, made easy thanks to integrated functions. # Inside here, declaration of all cronjobs like normal shell commands, made easy thanks to integrated functions.

View File

@@ -0,0 +1,34 @@
#server {
# listen 443 ssl;
# server_name spacccloud.octt.eu.org;
# ssl_certificate /etc/letsencrypt/live/spacccloud.octt.eu.org/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/spacccloud.octt.eu.org/privkey.pem;
# ssl_prefer_server_ciphers on;
# location / {
# proxy_http_version 1.1;
# proxy_pass http://localhost:8080;
# 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";
# }
#}
server {
listen 443 ssl;
server_name spacccloud-wfm.octt.eu.org;
ssl_certificate /etc/letsencrypt/live/spacccloud-wfm.octt.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/spacccloud-wfm.octt.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
proxy_pass http://localhost:7580;
proxy_set_header Access-Control-Allow-Origin https://spacccloud.octt.eu.org http://192.168.1.25 http://192.168.1.25:8080;
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

@@ -4,8 +4,17 @@ server {
ssl_certificate /etc/letsencrypt/live/private-analytics-not-for-public-use.octt.eu.org/fullchain.pem; ssl_certificate /etc/letsencrypt/live/private-analytics-not-for-public-use.octt.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/private-analytics-not-for-public-use.octt.eu.org/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/private-analytics-not-for-public-use.octt.eu.org/privkey.pem;
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
location /sitoctt/ {
proxy_http_version 1.1;
proxy_pass https://sitoctt.goatcounter.com/;
proxy_set_header Host "sitoctt.goatcounter.com";
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";
}
location /octtkb/ { location /octtkb/ {
#resolver 9.9.9.9;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_pass https://octtkb.goatcounter.com/; proxy_pass https://octtkb.goatcounter.com/;
proxy_set_header Host "octtkb.goatcounter.com"; proxy_set_header Host "octtkb.goatcounter.com";

View File

@@ -6,7 +6,7 @@ server {
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
location / { location / {
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_pass http://octt.ddns.net:8017; proxy_pass http://localhost:8017;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;

View File

@@ -0,0 +1,20 @@
server {
listen 443 ssl;
server_name 5e47578a-1136-4891-a526-7d5db74c1fbc.octt.eu.org;
ssl_certificate /etc/letsencrypt/live/5e47578a-1136-4891-a526-7d5db74c1fbc.octt.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/5e47578a-1136-4891-a526-7d5db74c1fbc.octt.eu.org/privkey.pem;
ssl_prefer_server_ciphers on;
location / {
proxy_http_version 1.1;
#proxy_pass https://invidious.snopyta.org/redirect?referer=;
proxy_pass https://youtube.owacon.moe;
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_hide_header Content-Security-Policy;
proxy_hide_header X-Frame-Options;
proxy_hide_header X-XSS-Protection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

View File

@@ -9,8 +9,12 @@ server {
ssl_certificate /etc/letsencrypt/live/hlb0.octt.eu.org/fullchain.pem; ssl_certificate /etc/letsencrypt/live/hlb0.octt.eu.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/hlb0.octt.eu.org/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/hlb0.octt.eu.org/privkey.pem;
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
error_page 404 = /404.html;
location / { location / {
root /Server/www/root; root /Server/www/root;
try_files $uri =404; #try_files $uri =404;
try_files $uri $uri.html $uri/index.html index.html;
autoindex off;
#error_page 404 = /404.html;
} }
} }

View File

@@ -6,8 +6,8 @@ StartLimitIntervalSec=0
Type=simple Type=simple
Restart=always Restart=always
RestartSec=5 RestartSec=5
CPUQuota=80% CPUQuota=85%
MemoryMax=350M MemoryMax=384M
User=root User=root
ExecStart=sh -c "cat /var/log/diycron.log >> /var/log/diycron.log.old; sh /etc/diycron > /var/log/diycron.log" ExecStart=sh -c "cat /var/log/diycron.log >> /var/log/diycron.log.old; sh /etc/diycron > /var/log/diycron.log"
[Install] [Install]