Compare commits

...

2 Commits

Author SHA1 Message Date
33b2570a98 Adding letsencrypt service files 2022-03-28 09:31:28 +00:00
91e715f5cf Checking some file creating path and some cycle end 2022-03-28 09:28:19 +00:00
4 changed files with 127 additions and 3 deletions

65
firewall-29eexhrh.json Normal file
View File

@@ -0,0 +1,65 @@
{
"main": {
"SERVICE_NAME": "firewalls",
"DOMAIN": "null"
},
"containers": [
{
"IMAGE": "registry.format.hu/firewall",
"NAME": "null",
"MEMORY": "64M",
"IP": "null",
"NETWORK": "host",
"VOLUMES": [
{
"SOURCE": "/run/",
"DEST": "/run/",
"TYPE": "rw"
},
{
"SOURCE": "/etc/user/config/services",
"DEST": "/services",
"TYPE": "ro"
}
],
"PORTS": [ ],
"READYNESS": [
{"tcp": ""},
{"HTTP": ""},
{"EXEC": "/ready.sh"}
],
"ENVS": [
{
"NAME": "CHAIN",
"VALUE": "DOCKER-USER"
},
{
"NAME": "SOURCE_IP",
"VALUE": "172.18.100.2"
},
{
"NAME": "TARGET_IP",
"VALUE": "172.18.254.254"
},
{
"NAME": "TYPE",
"VALUE": "tcp"
},
{
"NAME": "TARGET_PORT",
"VALUE": "80"
},
{
"NAME": "COMMENT",
"VALUE": "29eexhrh"
}
],
"EXTRA": "--privileged",
"DEPEND": "null",
"START_ON_BOOT": "false",
"CMD": "null",
"PRE_START": "null",
"POST_START": "null"
}
]
}

49
letsencrypt.json Normal file
View File

@@ -0,0 +1,49 @@
{
"main": {
"SERVICE_NAME": "letsencrypt",
"DOMAIN": "null"
},
"networks": [
{
"NAME": "letsencrypt",
"DRIVER": "bridge",
"SUBNET": "172.18.254.0/24",
"RANGE": "172.18.254.0/24",
"GATEWAY": "172.18.254.1"
}
],
"containers": [
{
"IMAGE": "registry.format.hu/neilpang/acme.sh",
"NAME": "letsencrypt",
"MEMORY": "64M",
"IP": "172.18.254.254",
"NETWORK": "letsencrypt",
"VOLUMES": [
{
"SOURCE": "/etc/ssl/keys/",
"DEST": "/acme.sh/",
"TYPE": "rw"
},
{
"SOURCE": "/etc/user/config/domains",
"DEST": "/domains",
"TYPE": "ro"
}
],
"PORTS": [ ],
"ENV_FILES": [ "/etc/user/config/user.json" ],
"READYNESS": [
{"tcp": ""},
{"HTTP": ""},
{"EXEC": "/ready.sh"}
],
"EXTRA": "",
"DEPEND": "null",
"START_ON_BOOT": "false",
"CMD": "null",
"PRE_START": "null",
"POST_START": [ "firewall-29eexhrh" ]
}
]
}

View File

@@ -22,14 +22,15 @@ start_letsencrypt() {
LETSENCRYPT_FILE=$(find /acme.sh/ -type f -name letsencrypt);
if [ -n "$LETSENCRYPT_FILE" ] ; then
DOMAIN=$(jq -r .DOMAIN $LETSENCRYPT_FILE) ;
start_letsencrypt;
start_letsencryp $DOMAIN;
rm $LETSENCRYPT_FILE;
touch /acme.sh/$DOMAIN/renew_certificate;
else
cd /domains
for i in `ls` ; do
DOMAIN=$(jq -r .DOMAIN $i) ;
if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then
start_letsencrypt ;
start_letsencrypt $DOMAIN;
touch /acme.sh/$DOMAIN/renew_certificate;
else
start_letsencrypt;
@@ -39,7 +40,10 @@ else
else
while [[ ! -f /acme.sh/$DOMAIN/key.pem || ! -f /acme.sh/$DOMAIN/fullchain.pem || ! -f /acme.sh/$DOMAIN/cert.pem ]] ; do
sleep 10;
start_letsencrypt ;
start_letsencrypt $DOMAIN;
if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then
touch /acme.sh/$DOMAIN/new_certificate;
fi
done
fi
fi

6
user.json Normal file
View File

@@ -0,0 +1,6 @@
{
"letsencrypt": {
"EMAIL": "postmaster@format.hu",
"DOCKER_REGISTRY_URL": "registry.format.hu"
}
}