2024-11-23 15:16:41 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
# Copyright (c) 2024 Interstellar Development
|
|
|
|
|
2024-11-21 16:14:12 +01:00
|
|
|
APP=jet-search
|
|
|
|
DOMAIN=jetsearch.com
|
2024-11-21 16:20:59 +01:00
|
|
|
PORT=5000
|
2024-11-21 16:17:06 +01:00
|
|
|
DNS="
|
|
|
|
zone \"$DOMAIN\" {
|
|
|
|
type master;
|
|
|
|
file \"/etc/bind/db.$DOMAIN\";
|
|
|
|
};"
|
2024-11-21 16:14:12 +01:00
|
|
|
|
|
|
|
docker build -t $APP .
|
2024-11-21 16:26:57 +01:00
|
|
|
cd dist
|
2024-11-21 16:14:12 +01:00
|
|
|
openssl genrsa -out /etc/ssl/private/$APP.key 2048
|
|
|
|
openssl req -new -key /etc/ssl/private/$APP.key -out /etc/ssl/certs/$APP.csr -config openssl.cnf
|
|
|
|
openssl x509 -req -in /etc/ssl/certs/$APP.csr -CA /root/ca.crt -CAkey /root/ca.key -CAcreateserial -out /etc/ssl/certs/$APP.crt -extfile openssl.cnf -extensions req_ext -days 500 -sha256
|
|
|
|
cp nginx.cnf /etc/nginx/sites-enabled/$APP
|
2024-11-22 17:17:34 +01:00
|
|
|
grep -qF "$DNS" /etc/bind/named.conf.local
|
2024-11-22 17:20:08 +01:00
|
|
|
if [ $? -eq 0 ]; then
|
2024-11-22 17:12:49 +01:00
|
|
|
echo "$DNS" | tee -a /etc/bind/named.conf.local
|
|
|
|
else
|
|
|
|
echo "Entry already exists in named.conf.local"
|
|
|
|
fi
|
2024-11-21 16:14:12 +01:00
|
|
|
cp zonefile.cnf /etc/bind/db.$DOMAIN
|
2024-11-21 16:20:59 +01:00
|
|
|
docker run -p $PORT:5000 --name $APP --restart always -d $APP
|