Browse Source

[fix] cleanup

master
alban 1 year ago
parent
commit
67ed0cb9e0
3 changed files with 121 additions and 117 deletions
  1. 109
    113
      build.json
  2. 12
    3
      files/nginx/laser.conf
  3. 0
    1
      files/root/.bashrc

+ 109
- 113
build.json View File

@@ -1,117 +1,113 @@
1 1
 {
2
-  "variables": {
3
-        "user": "root",
4
-        "password": "laser",
5
-        "disk_size": "100000",
6
-        "domain": ""
7
-    },
8
-  "builders": [
9
-
10
-
11
-    {
12
-      "type": "lxc",
13
-      "name": "teamlaser-lj-lxc",
14
-      "config_file": "files/lxc/config",
15
-      "template_name": "debian",
16
-      "template_environment_vars": ["SUITE=buster"],
17
-      "output_directory": "output-lxc"
18
-    },
19
-
20
-
21
-    {
22
-
23
-            "headless": false,
24
-            "name": "teamlaser-lj",
25
-            "type": "qemu",
26
-            "format": "qcow2",
27
-            "accelerator": "kvm",
28
-            "disk_size": "{{ user `disk_size` }}",
29
-            "output_directory": "output",
30
-            "boot_key_interval": "20ms",
31
-            "iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso",
32
-            "iso_checksum": "sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7",
33
-            "http_directory": "http",
34
-            "ssh_username": "{{ user `user` }}",
35
-            "ssh_password": "{{ user `password` }}",
36
-            "shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now",
37
-
38
-            "ssh_wait_timeout": "60m",
39
-              "qemuargs": [
40
-                  [ "-m", "2048M" ]
41
-              ],
42
-
43
-            "boot_wait": "2s",
44
-            "boot_command": [
45
-                   "<esc><wait><wait>",
46
-                   "install ",
47
-                   "auto=true ",
48
-                   "priority=critical ",
49
-                   "interface=auto ",
50
-                   "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
51
-                   "<enter>"
2
+   "variables":{
3
+      "user":"root",
4
+      "password":"laser",
5
+      "disk_size":"5G",
6
+      "domain":""
7
+   },
8
+   "builders":[
9
+      {
10
+         "type":"lxc",
11
+         "name":"teamlaser-lj-lxc",
12
+         "config_file":"files/lxc/config",
13
+         "template_name":"debian",
14
+         "template_environment_vars":[
15
+            "SUITE=buster"
16
+         ],
17
+         "output_directory":"output-lxc"
18
+      },
19
+      {
20
+         "headless":false,
21
+         "name":"teamlaser-lj",
22
+         "type":"qemu",
23
+         "format":"qcow2",
24
+         "accelerator":"kvm",
25
+         "disk_size":"{{ user `disk_size` }}",
26
+         "output_directory":"output",
27
+         "boot_key_interval":"20ms",
28
+         "iso_url":"http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-netinst.iso",
29
+         "iso_checksum":"sha256:93863e17ac24eeaa347dfb91dddac654f214c189e0379d7c28664a306e0301e7",
30
+         "http_directory":"http",
31
+         "ssh_username":"{{ user `user` }}",
32
+         "ssh_password":"{{ user `password` }}",
33
+         "shutdown_command":"echo '{{ user `password` }}' | sudo -S shutdown -h now",
34
+         "ssh_wait_timeout":"60m",
35
+         "qemuargs":[
36
+            [
37
+               "-m",
38
+               "2048M"
52 39
             ]
53
-        },
54
-
55
-
56
-    {
57
-
58
-            "headless": false,
59
-            "name": "teamlaser-lj-xfce",
60
-            "type": "qemu",
61
-            "format": "qcow2",
62
-            "accelerator": "kvm",
63
-            "disk_size": "{{ user `disk_size` }}",
64
-            "output_directory": "output-xfce",
65
-            "boot_key_interval": "20ms",
66
-            "iso_url": "http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-xfce-CD-1.iso",
67
-            "iso_checksum": "sha256:14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2",
68
-            "http_directory": "http",
69
-            "ssh_username": "{{ user `user` }}",
70
-            "ssh_password": "{{ user `password` }}",
71
-            "shutdown_command": "echo '{{ user `password` }}' | sudo -S shutdown -h now",
72
-
73
-            "ssh_wait_timeout": "60m",
74
-              "qemuargs": [
75
-                  [ "-m", "2048M" ]
76
-              ],
77
-
78
-            "boot_wait": "2s",
79
-            "boot_command": [
80
-                   "<esc><wait><wait>",
81
-                   "install ",
82
-                   "auto=true ",
83
-                   "priority=critical ",
84
-                   "interface=auto ",
85
-                   "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
86
-                   "<enter>"
40
+         ],
41
+         "boot_wait":"2s",
42
+         "boot_command":[
43
+            "<esc><wait><wait>",
44
+            "install ",
45
+            "auto=true ",
46
+            "priority=critical ",
47
+            "interface=auto ",
48
+            "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
49
+            "<enter>"
50
+         ]
51
+      },
52
+      {
53
+         "headless":false,
54
+         "name":"teamlaser-lj-xfce",
55
+         "type":"qemu",
56
+         "format":"qcow2",
57
+         "accelerator":"kvm",
58
+         "disk_size":"{{ user `disk_size` }}",
59
+         "output_directory":"output-xfce",
60
+         "boot_key_interval":"20ms",
61
+         "iso_url":"http://cdimage.debian.org/debian-cd/10.5.0/amd64/iso-cd/debian-10.5.0-amd64-xfce-CD-1.iso",
62
+         "iso_checksum":"sha256:14ca00bafcaf124ef2cab9da2f51d75044232ba9630a067d8664fabcb5e26ec2",
63
+         "http_directory":"http",
64
+         "ssh_username":"{{ user `user` }}",
65
+         "ssh_password":"{{ user `password` }}",
66
+         "shutdown_command":"echo '{{ user `password` }}' | sudo -S shutdown -h now",
67
+         "ssh_wait_timeout":"60m",
68
+         "qemuargs":[
69
+            [
70
+               "-m",
71
+               "2048M"
87 72
             ]
88
-        }
89
-  ],
90
-
91
-  "provisioners": [
92
-    {
93
-      "type": "shell",
94
-      "inline": [
95
-        "sleep 3",
96
-        "apt update",
97
-        "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  ",
98
-        "pip3 install setuptools",
99
-        "pip3 install DMXEnttecPro  mido  numpy pysimpledmx  redis scipy ",
100
-        "git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install ",
101
-        "cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . ",
102
-        "cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . ",
103
-        "cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ "
104
-      ]
105
-    },
106
-    {
107
-      "type": "file",
108
-      "source": "files/nginx/laser.conf",
109
-      "destination": "/etc/nginx/sites-enabled/laser.conf"
110
-    },
111
-    {
112
-      "type": "file",
113
-      "source": "files/root/.bashrc",
114
-      "destination": "/root/.bashrc"
115
-    }
116
-  ]
73
+         ],
74
+         "boot_wait":"2s",
75
+         "boot_command":[
76
+            "<esc><wait><wait>",
77
+            "install ",
78
+            "auto=true ",
79
+            "priority=critical ",
80
+            "interface=auto ",
81
+            "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg <wait>",
82
+            "<enter>"
83
+         ]
84
+      }
85
+   ],
86
+   "provisioners":[
87
+      {
88
+         "type":"shell",
89
+         "inline":[
90
+            "sleep 3",
91
+            "apt update",
92
+            "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  ",
93
+            "rm -f /etc/nginx/sites-enabled/default",
94
+            "pip3 install setuptools",
95
+            "pip3 install DMXEnttecPro mido numpy pysimpledmx redis scipy ",
96
+            "git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && ./setup.py install ",
97
+            "cd /tmp && git clone https://github.com/Ableton/link.git && cd link && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build . ",
98
+            "cd /tmp/ && git clone --recursive https://github.com/gonzaloflirt/link-python.git && cd link-python && mkdir build && cd build && cmake .. && cmake --build . ",
99
+            "cd /opt/ && git clone https://git.interhacker.space/teamlaser/LJ "
100
+         ]
101
+      },
102
+      {
103
+         "type":"file",
104
+         "source":"files/nginx/laser.conf",
105
+         "destination":"/etc/nginx/sites-enabled/laser.conf"
106
+      },
107
+      {
108
+         "type":"file",
109
+         "source":"files/root/.bashrc",
110
+         "destination":"/root/.bashrc"
111
+      }
112
+   ]
117 113
 }

+ 12
- 3
files/nginx/laser.conf View File

@@ -1,12 +1,21 @@
1
+server {
2
+    listen 80;
3
+    listen [::]:80;
4
+    server_name _;
5
+
6
+    root /opt/LJ/www;
7
+    return 301 https://localhost$request_uri;
8
+
9
+}
1 10
 server {
2 11
     listen 443 ssl;
3 12
     listen [::]:443 ssl;
13
+    server_name _;
14
+
4 15
     ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
5 16
     ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
6 17
 
7
-    server_name _;
8
-
9 18
     root /opt/LJ/www;
10
-    index index.html index.htm index.nginx-debian.html;
19
+    index index.html index.htm;
11 20
 
12 21
 }

+ 0
- 1
files/root/.bashrc View File

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

Loading…
Cancel
Save