Compare commits
11 Commits
c5e698d3d5
...
3957c8f617
| Author | SHA1 | Date |
|---|---|---|
|
|
3957c8f617 | |
|
|
b6f4f1ab47 | |
|
|
7f4ddba8bb | |
|
|
c04297a3be | |
|
|
c5e32f8af4 | |
|
|
88d2ca8c9a | |
|
|
3dfc9c0d1c | |
|
|
ece934d473 | |
|
|
f70843990c | |
|
|
6da61a7be2 | |
|
|
940a4edbf5 |
|
|
@ -39,7 +39,7 @@ info "Pruning repository"
|
||||||
|
|
||||||
/usr/local/bin/borg-linux64 prune \
|
/usr/local/bin/borg-linux64 prune \
|
||||||
--list \
|
--list \
|
||||||
--prefix '{hostname}-' \
|
--glob-archives '{hostname}-*' \
|
||||||
--show-rc \
|
--show-rc \
|
||||||
--keep-daily 7 \
|
--keep-daily 7 \
|
||||||
--keep-weekly 4 \
|
--keep-weekly 4 \
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,13 @@ for directory in directories:
|
||||||
print(replacement[0].rstrip(), replacement[1].rstrip(), int(replacement[2].rstrip().rstrip("\n")))
|
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")))
|
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"):
|
if glob.glob(f"{directory}/parser.py"):
|
||||||
should_continue = input(f"Custom instructions found in {directory}, continue? (Y/N) ")
|
should_continue = input(f"Custom instructions found in {directory}, continue? (Y/N) ")
|
||||||
if should_continue == "Y":
|
if should_continue == "Y":
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,37 @@
|
||||||
#IMPORT
|
#IMPORT
|
||||||
import os
|
import os
|
||||||
import argparse
|
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
|
#PARSE_ARGS
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("domain")
|
parser.add_argument("domain")
|
||||||
parser.add_argument("email")
|
parser.add_argument("email", default=None) # to not recache emails retreived from cache
|
||||||
|
parser.add_argument("cache_email", default=True)
|
||||||
args = parser.parse_args()
|
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
|
#QUICK_RECOVER
|
||||||
os.makedirs(os.path.dirname("/opt/quick-recover/"), exist_ok=True)
|
os.makedirs(os.path.dirname("/opt/quick-recover/"), exist_ok=True)
|
||||||
with open("/opt/quick-recover/#service.conf", "w") as f:
|
with open("/opt/quick-recover/#service.conf", "w") as f:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
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
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
%
|
||||||
|
@ #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\";")
|
||||||
|
|
@ -5,7 +5,7 @@ export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
apt-get update -y
|
apt-get update -y
|
||||||
apt-get upgrade -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
|
apt-get install -y ca-certificates curl gnupg lsb-release nano wget tmux htop python3 python3-pip git certbot borgbackup jq
|
||||||
|
|
||||||
rm -rf /etc/nginx/sites-available/default
|
rm -rf /etc/nginx/sites-available/default
|
||||||
rm -rf /etc/nginx/sites-enabled/default
|
rm -rf /etc/nginx/sites-enabled/default
|
||||||
Loading…
Reference in New Issue