Compare commits
No commits in common. "67ed0cb9e0ae9dd3286e5757733f91119d4efd2e" and "6156a25d1b44968fe4c6505ac0451b4e4446be37" have entirely different histories.
67ed0cb9e0
...
6156a25d1b
222
build.json
222
build.json
@ -1,113 +1,117 @@
|
|||||||
{
|
{
|
||||||
"variables":{
|
"variables": {
|
||||||
"user":"root",
|
"user": "root",
|
||||||
"password":"laser",
|
"password": "laser",
|
||||||
"disk_size":"5G",
|
"disk_size": "100000",
|
||||||
"domain":""
|
"domain": ""
|
||||||
},
|
},
|
||||||
"builders":[
|
"builders": [
|
||||||
{
|
|
||||||
"type":"lxc",
|
|
||||||
"name":"teamlaser-lj-lxc",
|
{
|
||||||
"config_file":"files/lxc/config",
|
"type": "lxc",
|
||||||
"template_name":"debian",
|
"name": "teamlaser-lj-lxc",
|
||||||
"template_environment_vars":[
|
"config_file": "files/lxc/config",
|
||||||
"SUITE=buster"
|
"template_name": "debian",
|
||||||
],
|
"template_environment_vars": ["SUITE=buster"],
|
||||||
"output_directory":"output-lxc"
|
"output_directory": "output-lxc"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"headless":false,
|
|
||||||
"name":"teamlaser-lj",
|
{
|
||||||
"type":"qemu",
|
|
||||||
"format":"qcow2",
|
"headless": false,
|
||||||
"accelerator":"kvm",
|
"name": "teamlaser-lj",
|
||||||
"disk_size":"{{ user `disk_size` }}",
|
"type": "qemu",
|
||||||
"output_directory":"output",
|
"format": "qcow2",
|
||||||
"boot_key_interval":"20ms",
|
"accelerator": "kvm",
|
||||||
"iso_url":"http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso",
|
"disk_size": "{{ user `disk_size` }}",
|
||||||
"iso_checksum":"sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7",
|
"output_directory": "output",
|
||||||
"http_directory":"http",
|
"boot_key_interval": "20ms",
|
||||||
"ssh_username":"{{ user `user` }}",
|
"iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso",
|
||||||
"ssh_password":"{{ user `password` }}",
|
"iso_checksum": "sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7",
|
||||||
"shutdown_command":"echo '{{ user `password` }}' | sudo -S shutdown -h now",
|
"http_directory": "http",
|
||||||
"ssh_wait_timeout":"60m",
|
"ssh_username": "{{ user `user` }}",
|
||||||
"qemuargs":[
|
"ssh_password": "{{ user `password` }}",
|
||||||
[
|
"shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now",
|
||||||
"-m",
|
|
||||||
"2048M"
|
"ssh_wait_timeout": "60m",
|
||||||
|
"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 ",
|
|
||||||
"auto=true ",
|
"headless": false,
|
||||||
"priority=critical ",
|
"name": "teamlaser-lj-xfce",
|
||||||
"interface=auto ",
|
"type": "qemu",
|
||||||
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
|
"format": "qcow2",
|
||||||
"<enter>"
|
"accelerator": "kvm",
|
||||||
]
|
"disk_size": "{{ user `disk_size` }}",
|
||||||
},
|
"output_directory": "output-xfce",
|
||||||
{
|
"boot_key_interval": "20ms",
|
||||||
"headless":false,
|
"iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-xfce-CD-1.iso",
|
||||||
"name":"teamlaser-lj-xfce",
|
"iso_checksum": "sha256:14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2",
|
||||||
"type":"qemu",
|
"http_directory": "http",
|
||||||
"format":"qcow2",
|
"ssh_username": "{{ user `user` }}",
|
||||||
"accelerator":"kvm",
|
"ssh_password": "{{ user `password` }}",
|
||||||
"disk_size":"{{ user `disk_size` }}",
|
"shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now",
|
||||||
"output_directory":"output-xfce",
|
|
||||||
"boot_key_interval":"20ms",
|
"ssh_wait_timeout": "60m",
|
||||||
"iso_url":"http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-xfce-CD-1.iso",
|
"qemuargs": [
|
||||||
"iso_checksum":"sha256:14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2",
|
[ "-m", "2048M" ]
|
||||||
"http_directory":"http",
|
],
|
||||||
"ssh_username":"{{ user `user` }}",
|
|
||||||
"ssh_password":"{{ user `password` }}",
|
"boot_wait": "2s",
|
||||||
"shutdown_command":"echo '{{ user `password` }}' | sudo -S shutdown -h now",
|
"boot_command": [
|
||||||
"ssh_wait_timeout":"60m",
|
"<esc><wait><wait>",
|
||||||
"qemuargs":[
|
"install ",
|
||||||
[
|
"auto=true ",
|
||||||
"-m",
|
"priority=critical ",
|
||||||
"2048M"
|
"interface=auto ",
|
||||||
|
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
|
||||||
|
"<enter>"
|
||||||
]
|
]
|
||||||
],
|
}
|
||||||
"boot_wait":"2s",
|
],
|
||||||
"boot_command":[
|
|
||||||
"<esc><wait><wait>",
|
"provisioners": [
|
||||||
"install ",
|
{
|
||||||
"auto=true ",
|
"type": "shell",
|
||||||
"priority=critical ",
|
"inline": [
|
||||||
"interface=auto ",
|
"sleep 3",
|
||||||
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
|
"apt update",
|
||||||
"<enter>"
|
"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 ",
|
||||||
]
|
"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 ",
|
||||||
"provisioners":[
|
"cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . ",
|
||||||
{
|
"cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . ",
|
||||||
"type":"shell",
|
"cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ "
|
||||||
"inline":[
|
]
|
||||||
"sleep 3",
|
},
|
||||||
"apt update",
|
{
|
||||||
"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 ",
|
"type": "file",
|
||||||
"rm -f /etc/nginx/sites-enabled/default",
|
"source": "files/nginx/laser.conf",
|
||||||
"pip3 install setuptools",
|
"destination": "/etc/nginx/sites-enabled/laser.conf"
|
||||||
"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 . ",
|
"type": "file",
|
||||||
"cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . ",
|
"source": "files/root/.bashrc",
|
||||||
"cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ "
|
"destination": "/root/.bashrc"
|
||||||
]
|
}
|
||||||
},
|
]
|
||||||
{
|
|
||||||
"type":"file",
|
|
||||||
"source":"files/nginx/laser.conf",
|
|
||||||
"destination":"/etc/nginx/sites-enabled/laser.conf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type":"file",
|
|
||||||
"source":"files/root/.bashrc",
|
|
||||||
"destination":"/root/.bashrc"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,12 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
root /opt/LJ/www;
|
|
||||||
return 301 https://localhost$request_uri;
|
|
||||||
|
|
||||||
}
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
listen [::]:443 ssl;
|
listen [::]:443 ssl;
|
||||||
server_name _;
|
|
||||||
|
|
||||||
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||||
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
root /opt/LJ/www;
|
root /opt/LJ/www;
|
||||||
index index.html index.htm;
|
index index.html index.htm index.nginx-debian.html;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
cd /opt/LJ
|
|
||||||
echo -e "\n\e[1;31m"
|
|
||||||
cat << HEREDOC
|
|
||||||
\ \ / | | | |
|
|
||||||
\ \ \ / _ \ | __| _ \ __ \__ \ _ \ __| _ \ | |
|
|
||||||
\ \ \ / __/ | ( ( | | | | __/ | ( | | \ |
|
|
||||||
\_/\_/ \___| _| \___| \___/ _| _| _| \___| \__| \___/ _____| \___/
|
|
||||||
HEREDOC
|
|
||||||
echo -e "\e[0m\n"
|
|
||||||
|
|
||||||
# Check the ip address on the machine
|
|
||||||
checkNetwork(){
|
|
||||||
|
|
||||||
echo -e "\Checking network connectivity..."
|
|
||||||
ping=$( ping 1.1.1.1 -c 1 -W 2 &>/dev/null; echo $?;)
|
|
||||||
|
|
||||||
# Net is working, escape
|
|
||||||
if [[ 0 -eq $ping ]] ; then
|
|
||||||
echo -e "\n OK, Use this IP Address for GUEST_IP : $( ip address show | grep global | awk '{print $2}'|sed -e 's=/.*==' ) \n"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\nSeems you can't reach internet..."
|
|
||||||
|
|
||||||
# Get the ethernet interface
|
|
||||||
# 772 is the loopback device, cf. http://lxr.linux.no/linux+v3.0/include/linux/if_arp.h#L67
|
|
||||||
for f in /sys/class/net/* ; do
|
|
||||||
[[ 772 != $(cat "$f/type" ) ]] && interface=$(basename $f)
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ -z "$interface" ]] ; then
|
|
||||||
echo -e "\e[31mFatal Error : no network interface configured.";
|
|
||||||
# Eventually, use nm-tui for a graphical (ncurses install)
|
|
||||||
read -e -p "(Experts only) Do you want to set up network via network-manager UI? [yN]: "
|
|
||||||
[[ "${REPLY^^}" == "Y" ]] && { nmtui; return; }
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "OK, network interface '$interface' found"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure the interface is up
|
|
||||||
ip l set $interface up
|
|
||||||
|
|
||||||
ipList=$( ip address show | grep global )
|
|
||||||
ipRoute=$( ip route show | grep default )
|
|
||||||
|
|
||||||
[[ -z "$ipList" ]] && {
|
|
||||||
echo -e "\nNo IP address configured. Please set one."
|
|
||||||
read -e -i '192.168.1.90/24' -p "Which address and range do you want to use (or 'x' to skip)? " ipAddr
|
|
||||||
[[ 'x' != "$ipAddr" ]] && {
|
|
||||||
ip address add $ipAddr dev $interface
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[[ -z "$ipRoute" ]] && {
|
|
||||||
echo -e "\nNo IP route configured. Please set one."
|
|
||||||
read -e -i '192.168.1.1' -p "Which routing address do you want to use (or 'x' to skip)? " ipAddr
|
|
||||||
[[ 'x' != "$ipAddr" ]] && {
|
|
||||||
ip route add default via $ipAddr dev $interface
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
checkNetwork
|
|
||||||
[[ ! -f /tmp/.first_run ]] && {
|
|
||||||
touch /tmp/.first_run ;
|
|
||||||
echo -e "\e[1mCaution! configuring the server and lasers network is mandatory for the app to work."
|
|
||||||
echo -e "Type the "c" key immediately to start the configuration."
|
|
||||||
echo -e "\e[0m"
|
|
||||||
echo -e "Everytime you will login, the configure and documentation options will be offered to you."
|
|
||||||
echo -e "Or use the commands 'config' or 'usage' any time to access the same functions."
|
|
||||||
echo -e "\e[0m"
|
|
||||||
}
|
|
||||||
config(){ cd /opt/LJ ; /usr/bin/python3 configure.py; }
|
|
||||||
usage(){ cat /opt/LJ/README.md; }
|
|
||||||
|
|
||||||
echo -e "\e[1m"
|
|
||||||
read -e -n 1 -p "Do you want to (c)onfigure the app, (r)ead documentation, or (n)othing: "
|
|
||||||
echo -e "\e[0m"
|
|
||||||
case $REPLY in
|
|
||||||
(c):
|
|
||||||
config
|
|
||||||
;;
|
|
||||||
(r):
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
6
files/supervisor-syncthing.conf
Normal file
6
files/supervisor-syncthing.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[program:syncthing]
|
||||||
|
autorestart = True
|
||||||
|
directory = /home/teamlaser15/codesync
|
||||||
|
user = teamlaser15
|
||||||
|
command = /usr/bin/syncthing -no-browser -home="/home/teamlaser15/codesync/.config/syncthing"
|
||||||
|
environment = STNORESTART="1", HOME="/home/teamlaser15/codesync/"
|
Loading…
Reference in New Issue
Block a user