Compare commits

..

No commits in common. "3957c8f617531117e3dbf8fd2e1bf25d9d198978" and "c5e698d3d5ea6c59c649f94fb141be3b7cb36f45" have entirely different histories.

6 changed files with 3 additions and 49 deletions

View File

@ -39,7 +39,7 @@ info "Pruning repository"
/usr/local/bin/borg-linux64 prune \
--list \
--glob-archives '{hostname}-*' \
--prefix '{hostname}-' \
--show-rc \
--keep-daily 7 \
--keep-weekly 4 \

View File

@ -5,7 +5,7 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get upgrade -y
apt-get install -y ca-certificates curl gnupg lsb-release nano wget tmux htop python3 python3-pip git certbot borgbackup jq
apt-get install -y ca-certificates curl gnupg lsb-release nano wget tmux htop python3 python3-pip git certbot borgbackup
rm -rf /etc/nginx/sites-available/default
rm -rf /etc/nginx/sites-enabled/default

View File

@ -24,13 +24,6 @@ for directory in directories:
print(replacement[0].rstrip(), replacement[1].rstrip(), int(replacement[2].rstrip().rstrip("\n")))
current_setup_template = current_setup_template.replace(replacement[0].rstrip(), replacement[1].rstrip(), int(replacement[2].rstrip().rstrip("\n")))
if replacement[0] == "#service":
with open(f"{directory}/relaunch-docker.sh", "w") as f:
f.write(f"docker pull $(docker inspect {replacement[1]} | jq -r '.[0].Config.Image')\n")
f.write(f"docker stop {replacement[1]}\n")
f.write(f"docker rm {replacement[1]}\n")
f.write(f"sh launch-docker.sh\n")
if glob.glob(f"{directory}/parser.py"):
should_continue = input(f"Custom instructions found in {directory}, continue? (Y/N) ")
if should_continue == "Y":

View File

@ -1,37 +1,13 @@
#IMPORT
import os
import argparse
import warnings
#CACHE_FUNCTIONS
def get_cached_email() -> str:
with open("../email.cache", "r") as f:
email = f.read().strip()
return email
def cache_email(email: str) -> None:
try:
with open("../email.cache", "w") as f:
f.write(email)
except Exception as e:
warnings.warn(e, Warning)
#PARSE_ARGS
parser = argparse.ArgumentParser()
parser.add_argument("domain")
parser.add_argument("email", default=None) # to not recache emails retreived from cache
parser.add_argument("cache_email", default=True)
parser.add_argument("email")
args = parser.parse_args()
#CACHE
if args.cache_email is True and args.email is not None:
cache_email(args.email)
if args.email is None:
args.email = get_cached_email()
#QUICK_RECOVER
os.makedirs(os.path.dirname("/opt/quick-recover/"), exist_ok=True)
with open("/opt/quick-recover/#service.conf", "w") as f:

View File

@ -1,6 +0,0 @@
docker run -d --net main_subnet --ip 172.30.25.1 \
-e TZ=America/New_York \
-v /opt/thelounge/config:/config \
--name=thelounge \
--restart unless-stopped \
lscr.io/linuxserver/thelounge:latest

View File

@ -1,9 +0,0 @@
%
@ #ip_address
@ http://172.30.25.1:9000/
%
@ #service
@ thelounge
%
@ #ADDITIONAL_REPLACE
@ template = template.replace("proxy_set_header Host $host;", "proxy_set_header Host $host;\nproxy_set_header Upgrade $http_upgrade;\nproxy_set_header Connection \"upgrade\";")