From 891e1e0903c8692c1e62e84310725953e032d828 Mon Sep 17 00:00:00 2001 From: Nathan Rodet <nrodet@grandlyon.com> Date: Thu, 22 Dec 2022 17:17:09 +0100 Subject: [PATCH] Added configuration --- server-scripts/cloud-init.yml | 11 +++++------ terraform/main.tf | 6 +++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/server-scripts/cloud-init.yml b/server-scripts/cloud-init.yml index af4d43e..325bea8 100644 --- a/server-scripts/cloud-init.yml +++ b/server-scripts/cloud-init.yml @@ -22,20 +22,20 @@ write_files: color: 4292030255 is_proxy: true host: code-%atrium_count_index% - target: %atrium_private_ip%:8080 + target: localhost:8080 - id: 2 name: Desktop %atrium_count_index% icon: web_asset color: 4292030255 is_proxy: true host: desktop-%atrium_count_index% - target: %atrium_private_ip%:8081 + target: localhost:8081 path: /root/atrium.yaml # Code-server config file - content: | bind-addr: 0.0.0.0:8080 auth: password - password %user_password% + password: %user_password% cert: false path: /root/config.yaml @@ -54,12 +54,11 @@ runcmd: # Install Atrium # - "mkdir -p /root/atrium/data && mkdir -p /root/atrium/letsencrypt_cache" - - "chown -Rf 1000:1000 /root/atrium" - - 'sed -i "s/%atrium_hostname%/$(scw-userdata atrium_hostname)/g" /root/atrium.yaml' - 'sed -i "s/%atrium_letsencrypt_email%/$(scw-userdata atrium_letsencrypt_email)/g" /root/atrium.yaml' - 'sed -i "s/%atrium_count_index%/$(scw-userdata atrium_count_index)/g" /root/atrium.yaml' - 'sed -i "s/%atrium_private_ip%/$(scw-userdata atrium_private_ip)/g" /root/atrium.yaml' - "mv /root/atrium.yaml /root/atrium/atrium.yaml" + - "chown -Rf 1000:1000 /root/atrium" # # Run Atrium Container # @@ -78,4 +77,4 @@ runcmd: # # Run Webtop Container # - - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 8081:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce" \ No newline at end of file + - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PIAUSER=user -e PIAPASS=$(scw-userdata user_password) -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 8081:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce" diff --git a/terraform/main.tf b/terraform/main.tf index 53c69b7..ad099b6 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -63,6 +63,11 @@ resource "scaleway_instance_security_group" "www" { port = "8080" } + inbound_rule { + action = "accept" + port = "8081" + } + inbound_rule { action = "accept" port = "443" @@ -83,7 +88,6 @@ resource "scaleway_instance_server" "user_instance_server" { security_group_id = scaleway_instance_security_group.www.id user_data = { - atrium_private_ip = scaleway_instance_ip.public_ip[count.index].address atrium_count_index = count.index atrium_hostname = scaleway_domain_record.subdomain_record[count.index].name atrium_letsencrypt_email = var.LETSENCRYPT_EMAIL -- GitLab