[fix] cleanup

This commit is contained in:
alban 2020-09-24 15:45:34 +02:00
parent 3422f8b467
commit 67ed0cb9e0
3 changed files with 124 additions and 120 deletions

View File

@ -1,117 +1,113 @@
{ {
"variables": { "variables":{
"user": "root", "user":"root",
"password": "laser", "password":"laser",
"disk_size": "100000", "disk_size":"5G",
"domain": "" "domain":""
}, },
"builders": [ "builders":[
{
"type":"lxc",
{ "name":"teamlaser-lj-lxc",
"type": "lxc", "config_file":"files/lxc/config",
"name": "teamlaser-lj-lxc", "template_name":"debian",
"config_file": "files/lxc/config", "template_environment_vars":[
"template_name": "debian", "SUITE=buster"
"template_environment_vars": ["SUITE=buster"], ],
"output_directory": "output-lxc" "output_directory":"output-lxc"
}, },
{
"headless":false,
{ "name":"teamlaser-lj",
"type":"qemu",
"headless": false, "format":"qcow2",
"name": "teamlaser-lj", "accelerator":"kvm",
"type": "qemu", "disk_size":"{{ user `disk_size` }}",
"format": "qcow2", "output_directory":"output",
"accelerator": "kvm", "boot_key_interval":"20ms",
"disk_size": "{{ user `disk_size` }}", "iso_url":"http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso",
"output_directory": "output", "iso_checksum":"sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7",
"boot_key_interval": "20ms", "http_directory":"http",
"iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso", "ssh_username":"{{ user `user` }}",
"iso_checksum": "sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7", "ssh_password":"{{ user `password` }}",
"http_directory": "http", "shutdown_command":"echo '{{ user `password` }}' | sudo -S shutdown -h now",
"ssh_username": "{{ user `user` }}", "ssh_wait_timeout":"60m",
"ssh_password": "{{ user `password` }}", "qemuargs":[
"shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now", [
"-m",
"ssh_wait_timeout": "60m", "2048M"
"qemuargs": [
[ "-m", "2048M" ]
],
"boot_wait": "2s",
"boot_command": [
"<esc><wait><wait>",
"install ",
"auto=true ",
"priority=critical ",
"interface=auto ",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"<enter>"
] ]
}, ],
"boot_wait":"2s",
"boot_command":[
{ "<esc><wait><wait>",
"install ",
"headless": false, "auto=true ",
"name": "teamlaser-lj-xfce", "priority=critical ",
"type": "qemu", "interface=auto ",
"format": "qcow2", "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"accelerator": "kvm", "<enter>"
"disk_size": "{{ user `disk_size` }}", ]
"output_directory": "output-xfce", },
"boot_key_interval": "20ms", {
"iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-xfce-CD-1.iso", "headless":false,
"iso_checksum": "sha256:14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2", "name":"teamlaser-lj-xfce",
"http_directory": "http", "type":"qemu",
"ssh_username": "{{ user `user` }}", "format":"qcow2",
"ssh_password": "{{ user `password` }}", "accelerator":"kvm",
"shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now", "disk_size":"{{ user `disk_size` }}",
"output_directory":"output-xfce",
"ssh_wait_timeout": "60m", "boot_key_interval":"20ms",
"qemuargs": [ "iso_url":"http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-xfce-CD-1.iso",
[ "-m", "2048M" ] "iso_checksum":"sha256:14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2",
], "http_directory":"http",
"ssh_username":"{{ user `user` }}",
"boot_wait": "2s", "ssh_password":"{{ user `password` }}",
"boot_command": [ "shutdown_command":"echo '{{ user `password` }}' | sudo -S shutdown -h now",
"<esc><wait><wait>", "ssh_wait_timeout":"60m",
"install ", "qemuargs":[
"auto=true ", [
"priority=critical ", "-m",
"interface=auto ", "2048M"
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"<enter>"
] ]
} ],
], "boot_wait":"2s",
"boot_command":[
"provisioners": [ "<esc><wait><wait>",
{ "install ",
"type": "shell", "auto=true ",
"inline": [ "priority=critical ",
"sleep 3", "interface=auto ",
"apt update", "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
"apt install -y --no-install-recommends cmake git libasound2-dev libjack-dev libsdl1.2-dev network-manager nginx portaudio19-dev python3-dev python3-pip python3-rtmidi redis-server screen ssh ssl-cert ", "<enter>"
"pip3 install setuptools", ]
"pip3 install DMXEnttecPro mido numpy pysimpledmx redis scipy ", }
"git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install ", ],
"cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . ", "provisioners":[
"cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . ", {
"cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ " "type":"shell",
] "inline":[
}, "sleep 3",
{ "apt update",
"type": "file", "apt install -y --no-install-recommends cmake git libasound2-dev libjack-dev libsdl1.2-dev network-manager nginx portaudio19-dev python3-dev python3-pip python3-rtmidi redis-server screen ssh ssl-cert ",
"source": "files/nginx/laser.conf", "rm -f /etc/nginx/sites-enabled/default",
"destination": "/etc/nginx/sites-enabled/laser.conf" "pip3 install setuptools",
}, "pip3 install DMXEnttecPro mido numpy pysimpledmx redis scipy ",
{ "git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install ",
"type": "file", "cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . ",
"source": "files/root/.bashrc", "cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . ",
"destination": "/root/.bashrc" "cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ "
} ]
] },
{
"type":"file",
"source":"files/nginx/laser.conf",
"destination":"/etc/nginx/sites-enabled/laser.conf"
},
{
"type":"file",
"source":"files/root/.bashrc",
"destination":"/root/.bashrc"
}
]
} }

View File

@ -1,12 +1,21 @@
server { server {
listen 443 ssl; listen 80;
listen [::]:443 ssl; listen [::]:80;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
server_name _; server_name _;
root /opt/LJ/www; root /opt/LJ/www;
index index.html index.htm index.nginx-debian.html; return 301 https://localhost$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
root /opt/LJ/www;
index index.html index.htm;
} }

View File

@ -11,7 +11,6 @@ echo -e "\e[0m\n"
# Check the ip address on the machine # Check the ip address on the machine
checkNetwork(){ checkNetwork(){
echo -e "\Checking network connectivity..." echo -e "\Checking network connectivity..."
ping=$( ping 1.1.1.1 -c 1 -W 2 &>/dev/null; echo $?;) ping=$( ping 1.1.1.1 -c 1 -W 2 &>/dev/null; echo $?;)