Skip to content
Snippets Groups Projects
Commit 17bb65c3 authored by Nathan Rodet's avatar Nathan Rodet
Browse files

Cleaning template

parent f06a05d4
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,6 @@ runcmd:
- "export HOME=/root"
- "export USER=root"
#
# Install Rust
#
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/rust.sh | bash"
#
# Install Docker
#
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/docker.sh | bash"
......@@ -29,18 +25,6 @@ runcmd:
#
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/atrium.sh | bash"
#
# Install Code Server
#
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/code-server.sh | bash"
#
# Install Webtop
#
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/webtop.sh | sh"
#
# Install ttyd
#
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/ttyd.sh | bash"
#
# Install Repository
#
- "git clone https://github.com/NathanRodet/rust-axum-demo /root/rust-axum-demo"
\ No newline at end of file
- "curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/scripts/ttyd.sh | bash"
\ No newline at end of file
......@@ -5,26 +5,12 @@ letsencrypt_email: %atrium_letsencrypt_email%
tls_mode: Auto
apps: # optional : applications served by atrium
- id: 1
name: Code
icon: web_asset
color: 4292030255
is_proxy: true
host: code-%atrium_count_index%
target: localhost:8080
- id: 2
name: Desktop
icon: web_asset
color: 4292030255
is_proxy: true
host: desktop-%atrium_count_index%
target: localhost:8081
- id: 3
name: Terminal
icon: terminal
color: 4292030255
is_proxy: true
host: terminal-%atrium_count_index%
target: localhost:8082
target: localhost:8081
secured: true
login: admin
password: %user_password%
......
# The content of this file is recreated by cloud init.
bind-addr: 0.0.0.0:8080
auth: password
password: %user_password%
cert: false
\ No newline at end of file
......@@ -3,7 +3,7 @@ Description=ttyd web server to allow remote access to terminal
After=network.target
[Service]
ExecStart=/root/ttyd/ttyd.x86_64 -p 8082 -i lo -c admin:%user_password% -T xterm bash
ExecStart=/root/ttyd/ttyd.x86_64 -p 8081 -i lo -c admin:%user_password% -T xterm bash
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -4,11 +4,6 @@
# Install Atrium
#
#
# Example : Generate user_password Argon2 encoded hash for Atrium
# echo $(scw-userdata user_password) | argon2 $(echo $RANDOM | md5sum | head -c 10) -id -l 32 -e
#
export USER_PASSWORD_HASH=$(echo -n "$(scw-userdata user_password)" | argon2 "$(echo $RANDOM | md5sum | head -c 12)" -id -l 32 -e)
mkdir -p /root/atrium/data && mkdir -p /root/atrium/letsencrypt_cache
......
#!/bin/bash
#
# Install Code Server
#
mkdir -p /root/.config/code-server/
curl https://forge.grandlyon.com/systemes-dinformation/alpha/projects/labo-rust/-/raw/develop/instance-scripts/config-files/config.yaml -o root/.config/code-server/config.yaml
sed -i "s/%user_password%/$(scw-userdata user_password)/g" /root/.config/code-server/config.yaml
curl -fsSL https://code-server.dev/install.sh | sh
#
# Run Code Server
#
sudo systemctl enable --now code-server@$USER
\ No newline at end of file
#!/bin/bash
#
# Install Rust
#
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
\ No newline at end of file
#!/bin/sh
#
# 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:/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
#
# Modify default password
#
echo "$(scw-userdata user_password)\n$(scw-userdata user_password)" | docker exec -i webtop passwd abc
\ No newline at end of file
......@@ -13,7 +13,7 @@ resource "scaleway_instance_ip" "public_ip" {
resource "scaleway_domain_record" "subdomain_record" {
count = var.INSTANCES_COUNT
dns_zone = "daag.alpha.grandlyon.com"
dns_zone = var.PROJECT_DOMAIN
name = "${var.ENVIRONMENT}-${count.index}"
type = "A"
data = scaleway_instance_ip.public_ip[count.index].address
......@@ -22,7 +22,7 @@ resource "scaleway_domain_record" "subdomain_record" {
resource "scaleway_domain_record" "host_subdomain_record" {
count = var.INSTANCES_COUNT
dns_zone = "daag.alpha.grandlyon.com"
dns_zone = var.PROJECT_DOMAIN
name = "*.${var.ENVIRONMENT}-${count.index}"
type = "A"
data = scaleway_instance_ip.public_ip[count.index].address
......
......@@ -43,5 +43,5 @@ variable "INSTANCES_COUNT" {
variable "ENVIRONMENT" {
type = string
description = "The type of lab to create, ex: devrust, pentest..."
description = "Environment of the deployment, contained in domains, subdomains and resources name convention"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment