Skip to content

Commit

Permalink
made init easier
Browse files Browse the repository at this point in the history
  • Loading branch information
ValorNaram committed Aug 5, 2022
1 parent 3d43b2b commit 833cdba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
trufi-server-modules
trufi-*-modules
modules
data/nginx/interweb
data/nginx/intraweb
Expand All @@ -11,3 +11,4 @@ data/www
data/certbot
.vscode
test
.directory
27 changes: 12 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
version: '3'
services:

chief-nginx:
image: nginx #:1.15-alpine
image: nginx
ports:
- "8290:80" # HTTP
- "8300:443" # HTTPS
- "127.0.0.1:8090:8090" # intraweb port.
- 8290:80
- 8300:443
- 127.0.0.1:8090:8090
volumes:
- ./data/nginx/interweb:/etc/nginx/interweb:ro
- ./data/nginx/intraweb:/etc/nginx/intraweb:ro
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./data/nginx/inc:/etc/nginx/inc:ro
- ./data/logs/nginx:/var/log/nginx/
- ./data/letsencrypt/config:/etc/letsencrypt
#- ./data/certbot/www:/var/www/certbot
- ./data/nginx/www:/var/www/html:ro
command: "nginx -g \"daemon off;\""
- ./data/nginx/interweb:/etc/nginx/interweb:ro
- ./data/nginx/intraweb:/etc/nginx/intraweb:ro
- ./data/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./data/nginx/inc:/etc/nginx/inc:ro
- ./data/logs/nginx:/var/log/nginx/
- ./data/letsencrypt/config:/etc/letsencrypt
- ./data/nginx/www:/var/www/html:ro
command: nginx -g "daemon off;"
restart: unless-stopped

networks:
default:
name: trufi-server-multi
12 changes: 10 additions & 2 deletions modifyComposes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def orangeprint(text):
sfile = open(composefile, "r")
dockercompose = yaml.safe_load(sfile.read())
sfile.close()
os.remove(composefile)

servicesToRename = []
for service in dockercompose["services"]:
Expand Down Expand Up @@ -67,6 +66,16 @@ def orangeprint(text):
sfile.write(yaml.dump(dockercompose, sort_keys=False, default_flow_style=False))
sfile.close()

orangeprint("patching chief")
sfile = open("docker-compose.yml", "r")
dockercompose = yaml.safe_load(sfile.read())
sfile.close()
dockercompose["networks"]["default"]["name"] = os.path.basename(os.getcwd())
sfile = open("docker-compose.yml", "w")
sfile.write(yaml.dump(dockercompose, sort_keys=False, default_flow_style=False))
sfile.close()


orangeprint("patching chief plugins")
pluginsChiefDir = os.path.join("plugins", "chief")
for chief in os.listdir(pluginsChiefDir):
Expand All @@ -76,7 +85,6 @@ def orangeprint(text):
sfile = open(chiefPath, "r")
dockercompose = yaml.safe_load(sfile.read())
sfile.close()
os.remove(chiefPath)

servicesToRename = []
for service in dockercompose["services"]:
Expand Down

0 comments on commit 833cdba

Please sign in to comment.