Skip to content

Commit

Permalink
Merge pull request #25 from ferrumgate/24-dns-deployment
Browse files Browse the repository at this point in the history
24 dns deployment
  • Loading branch information
ferrumgate authored Feb 12, 2023
2 parents 6b68fec + cbde0d7 commit e48d320
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
26 changes: 12 additions & 14 deletions docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ volumes:
ferrum:
lmdb:


services:

prepare:
image: alpine:3.17
command:
Expand Down Expand Up @@ -104,7 +102,7 @@ services:
image: "??PRIVATE_REGISTRY/ferrumgate/secure.server.ssh:1.0.0"
restart: always
ports:
- '9999:9999'
- "9999:9999"
environment:
- REDIS_HOST=redis#6379
- REDIS_PASS=??REDIS_PASS
Expand All @@ -115,7 +113,7 @@ services:
depends_on:
- redis
extra_hosts:
- "registry.ferrumgate.local:192.168.88.40"
- "registry.ferrumgate.zero:192.168.88.40"
deploy:
mode: global
restart_policy:
Expand All @@ -130,7 +128,7 @@ services:
driver: local

admin:
image: "??PRIVATE_REGISTRY/ferrumgate/job.admin:1.1.0"
image: "??PRIVATE_REGISTRY/ferrumgate/job.admin:1.2.0"
restart: always
privileged: true
#cap_add:
Expand All @@ -141,7 +139,7 @@ services:
- REDIS_PASS=??REDIS_PASS
- REDIS_SLAVE_HOST=redis:6379
- REDIS_SLAVE_PASS=??REDIS_PASS
- FERRUM_IO_IMAGE=??PRIVATE_REGISTRY/ferrumgate/ferrum.io:1.1.0
- FERRUM_IO_IMAGE=??PRIVATE_REGISTRY/ferrumgate/ferrum.io:1.2.0
- ENCRYPT_KEY=??ENCRYPT_KEY
- GATEWAY_ID=??GATEWAY_ID
- LOG_LEVEL=??LOG_LEVEL
Expand All @@ -163,7 +161,7 @@ services:
driver: local

ui:
image: "??PRIVATE_REGISTRY/ferrumgate/ui.portal:1.1.0"
image: "??PRIVATE_REGISTRY/ferrumgate/ui.portal:1.2.0"
restart: always
deploy:
mode: global
Expand All @@ -175,7 +173,7 @@ services:
driver: local

rest:
image: "??PRIVATE_REGISTRY/ferrumgate/rest.portal:1.1.0"
image: "??PRIVATE_REGISTRY/ferrumgate/rest.portal:1.2.0"
restart: always
environment:
- PORT=8181
Expand Down Expand Up @@ -205,7 +203,7 @@ services:
driver: local

log:
image: "??PRIVATE_REGISTRY/ferrumgate/job.log:1.0.0"
image: "??PRIVATE_REGISTRY/ferrumgate/job.log:1.1.0"
restart: always
environment:
- REDIS_HOST=redis:6379
Expand Down Expand Up @@ -243,8 +241,8 @@ services:
- |
SSL_PUB=??SSL_PUB
SSL_KEY=??SSL_KEY
echo $$SSL_PUB|base64 -d > /etc/ssl/secure.ferrumgate.local.crt
echo $$SSL_KEY|base64 -d > /etc/ssl/secure.ferrumgate.local.key
echo $$SSL_PUB|base64 -d > /etc/ssl/secure.ferrumgate.zero.crt
echo $$SSL_KEY|base64 -d > /etc/ssl/secure.ferrumgate.zero.key
CONF_FILE=/etc/nginx/nginx.conf
cat > $$CONF_FILE << EOF
Expand Down Expand Up @@ -311,9 +309,9 @@ services:
}
server {
listen 443 ssl;
server_name secure.ferrumgate.local;
ssl_certificate /etc/ssl/secure.ferrumgate.local.crt;
ssl_certificate_key /etc/ssl/secure.ferrumgate.local.key;
server_name secure.ferrumgate.zero;
ssl_certificate /etc/ssl/secure.ferrumgate.zero.crt;
ssl_certificate_key /etc/ssl/secure.ferrumgate.zero.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
Expand Down
40 changes: 21 additions & 19 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ fatal() {
}

ENV_FOR=${ENV_FOR:="PROD"}
URL="https://raw.githubusercontent.com/ferrumgate/secure.install/master"
#URL="https://raw.githubusercontent.com/ferrumgate/secure.install/master"

#### ensures $URL is empty or begins with https://, exiting fatally otherwise
verify_install_url() {
URL=$0
case "${URL}" in
"") ;;

https://*) ;;

*)
fatal "Only https:// URLs are supported "
;;
esac
}
#verify_install_url() {
# URL=$0
# case "${URL}" in
# "") ;;
#
# https://*) ;;
#
# *)
# fatal "Only https:// URLs are supported "
# ;;
# esac
#}

#### set arch and suffix, fatal if architecture not supported
setup_verify_arch() {
Expand Down Expand Up @@ -94,7 +94,7 @@ download() {
# Abort if download command failed
[ $? -eq 0 ] || fatal 'Download failed'
}
VERSION=1.1.0
VERSION=1.2.0
download_and_verify() {
[ "$ENV_FOR" != "PROD" ] && return 0
verify_downloader curl || verify_downloader wget || fatal 'can not find curl or wget for downloading files'
Expand Down Expand Up @@ -144,7 +144,7 @@ ensure_root() {

}
create_certificates() {
domain=secure.ferrumgate.local
domain=secure.ferrumgate.zero
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout ${domain}.key -out ${domain}.crt -subj "/CN=${domain}/O=${domain}" 2>/dev/null
echo ${domain}
}
Expand Down Expand Up @@ -200,9 +200,11 @@ main() {

if [ "$INSTALL" = "docker" ]; then

prerequities
docker_install
docker_network_bridge_configure ferrum
if [ $ENV_FOR = "PROD" ]; then
prerequities
docker_install
docker_network_bridge_configure ferrum
fi

# prepare folder permission to only root
chmod -R 600 $(pwd)
Expand All @@ -212,7 +214,7 @@ main() {

if [ $ENV_FOR != "PROD" ]; then # for test use local private registry

sed -i 's#??PRIVATE_REGISTRY/#registry.ferrumgate.local/#g' $DOCKER_FILE
sed -i 's#??PRIVATE_REGISTRY/#registry.ferrumgate.zero/#g' $DOCKER_FILE
else
sed -i 's#??PRIVATE_REGISTRY/##g' $DOCKER_FILE

Expand Down

0 comments on commit e48d320

Please sign in to comment.