6029dbf8824f6e9a7a302a78c0b0abbeb5460822
[fic/server.git] / fickit-frontend.yml
1 kernel:
2   image: nemunaire/kernel:4.9.77
3   cmdline: "console=tty0"
4
5 init:
6   - linuxkit/init:be8756f0a6005279d2409a8790b4dd8b2ac11df9
7   - linuxkit/runc:7b15b00b4e3507d62e3ed8d44dfe650561cd35ff
8   - linuxkit/containerd:78706a05d00a7385ff2b6b7db280041338e4b34a
9   - linuxkit/ca-certificates:de21b84d9b055ad9dcecc57965b654a7a24ef8e0
10   - linuxkit/getty:22e27189b6b354e1d5d38fc0536a5af3f2adb79f
11   - nemunaire/mdadm:0ac2a0d3e7be84f1aad852c906d54cbff4d1668f
12
13 onboot:
14   - name: sysctl
15     image: linuxkit/sysctl:4c1ef93bb5eb1a877318db4b2daa6768ed002e21
16
17     # Filesystem
18   - name: swap
19     image: linuxkit/swap:b3d5db11b14168874a01b5ea4398186321be836f
20     command: ["/sbin/swapon", "/dev/sda3", "/dev/sdb3"]
21   - name: mount
22     image: linuxkit/mount:b346ec277b7074e5c9986128a879c10a1d18742b
23     command: ["/usr/bin/mountie", "-device", "/dev/md127", "/var/lib/fic" ]
24
25     # Network
26 #  - name: dhcpcd
27 #    image: linuxkit/dhcpcd:0d59a6cc03412289ef4313f2491ec666c1715cc9
28 #    command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
29 #  - name: ntp
30 #    image: linuxkit/openntpd:536e5947607c9e6a6771957c2ff817230cba0d3c
31   - name: nginx-ip-setup
32     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
33     command: ["/bin/sh", "-c", "ip a add 172.17.1.2/24 dev vethin-nginx; ip link set vethin-nginx up;" ]
34     net: new
35     runtime:
36       interfaces:
37         - name: vethin-nginx
38           add: veth
39           peer: veth-nginx
40       bindNS:
41         net: /run/netns/nginx
42   - name: frontal-ip-setup
43     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
44     command: ["/bin/sh", "-c", "ip link set bond-frontal up; ifenslave bond-frontal eth1 eth2 eth3; ip a add 172.23.42.1/24 dev bond-frontal; ip a add 163.5.55.58/32 dev bond-frontal;" ]
45     net: /run/netns/nginx
46     runtime:
47       interfaces:
48         - name: eth1
49         - name: eth2
50         - name: eth3
51         - name: bond-frontal
52           add: bond
53   - name: frontend-ip-setup
54     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
55     command: ["/bin/sh", "-c", "ip a add 172.17.1.3/24 dev vethin-frontend; ip link set vethin-frontend up;" ]
56     net: new
57     runtime:
58       interfaces:
59         - name: vethin-frontend
60           add: veth
61           peer: veth-frontend
62       bindNS:
63         net: /run/netns/fic-frontend
64   - name: sshd-ip-setup
65     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
66     command: ["/bin/sh", "-c", "ip a add 10.10.10.2/29 dev eth0; ip link set eth0 up;" ]
67     net: new
68     runtime:
69       interfaces:
70         - name: eth0
71       bindNS:
72         net: /run/netns/sshd
73   - name: bridge-setup
74     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
75     command: ["/bin/sh", "-c", "ip a add 172.17.1.1/24 dev br0; ip link set veth-nginx master br0; ip link set veth-frontend master br0; ip link set br0 up; ip link set veth-nginx up; ip link set veth-frontend up;" ]
76     runtime:
77       interfaces:
78         - name: br0
79           add: bridge
80
81   - name: firewall-frontal
82     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
83     command: ["/bin/bash", "-c", "/sbin/iptables-restore < /etc/iptables/rules-frontal.v4; /sbin/ip6tables-restore < /etc/iptables/rules.v6" ]
84     binds:
85       - /etc/iptables/rules-frontal.v4:/etc/iptables/rules-frontal.v4:ro
86       - /etc/iptables/rules.v6:/etc/iptables/rules.v6:ro
87     net: /run/netns/nginx
88   - name: firewall-sshd
89     image: linuxkit/ip:284c21791d8c05c49eccbd8e8cc2fb97bbd61842
90     command: ["/bin/bash", "-c", "/sbin/iptables-restore < /etc/iptables/rules-sshd.v4; /sbin/ip6tables-restore < /etc/iptables/rules.v6" ]
91     binds:
92       - /etc/iptables/rules-sshd.v4:/etc/iptables/rules-sshd.v4:ro
93       - /etc/iptables/rules.v6:/etc/iptables/rules.v6:ro
94     net: /run/netns/sshd
95
96 services:
97   - name: rngd
98     image: linuxkit/rngd:94e01a4b16fadb053455cdc2269c4eb0b39199cd
99   - name: nginx
100     image: nginx:alpine
101     capabilities:
102      - CAP_NET_BIND_SERVICE
103      - CAP_CHOWN
104      - CAP_SETUID
105      - CAP_SETGID
106      - CAP_DAC_OVERRIDE
107     binds:
108       - /etc/hosts:/etc/hosts:ro
109       - /etc/resolv.conf:/etc/resolv.conf:ro
110       - /etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro
111       - /etc/nginx/ssl/:/etc/nginx/ssl/:ro
112       - /etc/nginx/fic-auth.conf:/etc/nginx/fic-auth.conf:ro
113       - /www/htdocs-frontend:/srv/htdocs-frontend:ro
114       - /var/lib/fic/files:/srv/FILES:ro
115       - /var/lib/fic/pki:/srv/PKI:ro
116       - /var/lib/fic/settings:/srv/SETTINGS:ro
117       - /var/lib/fic/startingblock:/srv/startingblock:ro
118       - /var/lib/fic/teams:/srv/TEAMS:ro
119     net: /run/netns/nginx
120     pid: new
121     ipc: new
122     uts: new
123     runtime:
124       mkdir:
125         - /var/lib/fic/files
126         - /var/lib/fic/pki
127         - /var/lib/fic/startingblock
128         - /var/lib/fic/teams
129   - name: fic-frontend
130     image: nemunaire/fic-frontend:latest
131     command: ["/srv/frontend", "-bind=:8080", "-startedFile=/srv/startingblock/started"]
132     binds:
133       - /etc/hosts:/etc/hosts:ro
134       - /var/lib/fic/files:/srv/FILES:ro
135       - /var/lib/fic/settings:/srv/SETTINGS:ro
136       - /var/lib/fic/startingblock:/srv/startingblock
137       - /var/lib/fic/submissions:/srv/submissions
138       - /var/lib/fic/teams:/srv/TEAMS:ro
139     net: /run/netns/fic-frontend
140     runtime:
141       mkdir:
142         - /var/lib/fic/files
143         - /var/lib/fic/settings
144         - /var/lib/fic/startingblock
145         - /var/lib/fic/submissions
146         - /var/lib/fic/teams
147   - name: sshd
148     image: nemunaire/rsync:f66273f042b8a2976fe4af2425943df913b18088
149     binds:
150       - /etc/hosts:/etc/hosts:ro
151       - /root/.ssh/id_synchro.pub:/root/.ssh/authorized_keys:ro
152       - /var/lib/fic/files:/srv/FILES
153       - /var/lib/fic/pki:/srv/PKI
154       - /var/lib/fic/settings:/srv/SETTINGS
155       - /var/lib/fic/submissions:/srv/submissions
156       - /var/lib/fic/teams:/srv/TEAMS
157     net: /run/netns/sshd
158     pid: new
159     ipc: new
160     uts: new
161     runtime:
162       mkdir:
163         - /var/lib/fic/files
164         - /var/lib/fic/pki
165         - /var/lib/fic/settings
166         - /var/lib/fic/submissions
167         - /var/lib/fic/teams
168
169   - name: dhcp-server
170     image: joebiellik/dhcpd
171     binds:
172       - /etc/dhcp/dhcpd.conf:/etc/dhcp/dhcpd.conf:ro
173     capabilities:
174      - CAP_NET_BIND_SERVICE
175      - CAP_NET_RAW
176      - CAP_DAC_OVERRIDE
177     net: /run/netns/nginx
178     pid: new
179     ipc: new
180     uts: new
181   - name: dns-server
182     image: sapcc/unbound
183     binds:
184       - /etc/unbound/unbound.conf:/etc/unbound/unbound.conf:ro
185     capabilities:
186      - CAP_NET_BIND_SERVICE
187     net: /run/netns/nginx
188     pid: new
189     ipc: new
190     uts: new
191
192
193 files:
194   - path: etc/nginx/ssl/dhparams-4096.pem
195     source: configs/dhparams-4096.pem
196     mode: "0444"
197   - path: etc/nginx/ssl/fullchain.pem
198     source: configs/fic.srs.epita.fr/fullchain.pem
199     mode: "0444"
200   - path: etc/nginx/ssl/privkey.pem
201     source: configs/fic.srs.epita.fr/privkey.pem
202     mode: "0440"
203
204   - path: etc/hosts
205     source: configs/hosts
206     mode: "0644"
207   - path: root/.ssh/authorized_keys
208     source: configs/authorized_keys
209     mode: "0400"
210   - path: root/.ssh/id_synchro.pub
211     source: configs/id_ed25519.pub
212     mode: "0400"
213
214   - path: etc/dhcp/dhcpd.conf
215     source: configs/dhcpd.conf
216     mode: "0400"
217   - path: etc/nginx/conf.d/default.conf
218     source: configs/nginx-prod.conf
219     mode: "0400"
220   - path: etc/nginx/fic-auth.conf
221     source: configs/fic-auth.conf
222     mode: "0400"
223
224   - path: www/htdocs-frontend
225     directory: true
226     mode: "0755"
227   - path: www/htdocs-frontend/e500.html
228     source: frontend/static/e500.html
229     mode: "0644"
230   - path: www/htdocs-frontend/img/srs.png
231     source: frontend/static/img/srs.png
232     mode: "0644"
233   - path: www/htdocs-frontend/img/fic.png
234     source: frontend/static/img/fic.png
235     mode: "0644"
236   - path: www/htdocs-frontend/img/logo-epita-bw.png
237     source: frontend/static/img/logo-epita-bw.png
238     mode: "0644"
239   - path: www/htdocs-frontend/img/epita.png
240     source: frontend/static/img/epita.png
241     mode: "0644"
242   - path: www/htdocs-frontend/img/rcc.png
243     source: frontend/static/img/rcc.png
244     mode: "0644"
245   - path: www/htdocs-frontend/favicon.ico
246     source: frontend/static/favicon.ico
247     mode: "0644"
248   - path: www/htdocs-frontend/e404.html
249     source: frontend/static/e404.html
250     mode: "0644"
251   - path: www/htdocs-frontend/css/bootstrap.min.css
252     source: frontend/static/css/bootstrap.min.css
253     mode: "0644"
254   - path: www/htdocs-frontend/css/fic.css
255     source: frontend/static/css/fic.css
256     mode: "0644"
257   - path: www/htdocs-frontend/css/glyphicon.css
258     source: frontend/static/css/glyphicon.css
259     mode: "0644"
260   - path: www/htdocs-frontend/js/i18n/angular-locale_fr-fr.js
261     source: frontend/static/js/i18n/angular-locale_fr-fr.js
262     mode: "0644"
263   - path: www/htdocs-frontend/js/angular-sanitize.min.js
264     source: frontend/static/js/angular-sanitize.min.js
265     mode: "0644"
266   - path: www/htdocs-frontend/js/d3.v3.min.js
267     source: frontend/static/js/d3.v3.min.js
268     mode: "0644"
269   - path: www/htdocs-frontend/js/common.js
270     source: frontend/static/js/common.js
271     mode: "0644"
272   - path: www/htdocs-frontend/js/angular.min.js
273     source: frontend/static/js/angular.min.js
274     mode: "0644"
275   - path: www/htdocs-frontend/js/challenge.js
276     source: frontend/static/js/challenge.js
277     mode: "0644"
278   - path: www/htdocs-frontend/js/public.js
279     source: frontend/static/js/public.js
280     mode: "0644"
281   - path: www/htdocs-frontend/js/bootstrap.min.js
282     source: frontend/static/js/bootstrap.min.js
283     mode: "0644"
284   - path: www/htdocs-frontend/js/popper.min.js
285     source: frontend/static/js/popper.min.js
286     mode: "0644"
287   - path: www/htdocs-frontend/js/jquery.min.js
288     source: frontend/static/js/jquery.min.js
289     mode: "0644"
290   - path: www/htdocs-frontend/js/angular-animate.min.js
291     source: frontend/static/js/angular-animate.min.js
292     mode: "0644"
293   - path: www/htdocs-frontend/js/angular-route.min.js
294     source: frontend/static/js/angular-route.min.js
295     mode: "0644"
296   - path: www/htdocs-frontend/e413.html
297     source: frontend/static/e413.html
298     mode: "0644"
299   - path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.woff2
300     source: frontend/static/fonts/glyphicons-halflings-regular.woff2
301     mode: "0644"
302   - path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.woff
303     source: frontend/static/fonts/glyphicons-halflings-regular.woff
304     mode: "0644"
305   - path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.eot
306     source: frontend/static/fonts/glyphicons-halflings-regular.eot
307     mode: "0644"
308   - path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.ttf
309     source: frontend/static/fonts/glyphicons-halflings-regular.ttf
310     mode: "0644"
311   - path: www/htdocs-frontend/fonts/glyphicons-halflings-regular.svg
312     source: frontend/static/fonts/glyphicons-halflings-regular.svg
313     mode: "0644"
314   - path: www/htdocs-frontend/welcome.html
315     source: frontend/static/welcome.html
316     mode: "0644"
317   - path: www/htdocs-frontend/public.html
318     source: frontend/static/public.html
319     mode: "0644"
320   - path: www/htdocs-frontend/index.html
321     source: frontend/static/index.html
322     mode: "0644"
323   - path: www/htdocs-frontend/views/videos.html
324     source: frontend/static/views/videos.html
325     mode: "0644"
326   - path: www/htdocs-frontend/views/home.html
327     source: frontend/static/views/home.html
328     mode: "0644"
329   - path: www/htdocs-frontend/views/theme.html
330     source: frontend/static/views/theme.html
331     mode: "0644"
332   - path: www/htdocs-frontend/views/rank.html
333     source: frontend/static/views/rank.html
334     mode: "0644"
335   - path: www/htdocs-frontend/views/register.html
336     source: frontend/static/views/register.html
337     mode: "0644"
338   - path: www/htdocs-frontend/views/rules.html
339     source: frontend/static/views/rules.html
340     mode: "0644"
341   - path: www/htdocs-frontend/views/team-edit.html
342     source: frontend/static/views/team-edit.html
343     mode: "0644"
344   - path: www/htdocs-frontend/robots.txt
345     source: frontend/static/robots.txt
346     mode: "0644"
347
348   - path: etc/iptables/rules.v6
349     contents: |
350       *filter
351       :INPUT DROP [0:0]
352       :FORWARD DROP [0:0]
353       :OUTPUT DROP [0:0]
354       COMMIT
355     mode: "0440"
356   - path: etc/iptables/rules-sshd.v4
357     contents: |
358       *filter
359       :INPUT DROP [0:0]
360       :FORWARD DROP [0:0]
361       :OUTPUT DROP [0:0]
362       [0:0] -A INPUT -i lo -j ACCEPT
363       [0:0] -A INPUT -m conntrack --ctstate INVALID -j DROP
364       [0:0] -A INPUT -p icmp -j ACCEPT
365       [0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
366       [0:0] -A INPUT -i eth0 -s 10.10.10.0/29 -p tcp -m conntrack --ctstate NEW -m tcp --dport ssh -j ACCEPT
367       [0:0] -A INPUT -j LOG
368       [0:0] -A FORWARD -j LOG
369       [0:0] -A OUTPUT -o lo -j ACCEPT
370       [0:0] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
371       [0:0] -A OUTPUT -j LOG
372       [0:0] -A OUTPUT -j REJECT
373       COMMIT
374     mode: "0440"
375   - path: etc/iptables/rules-frontal.v4
376     contents: |
377       *filter
378       :INPUT DROP [0:0]
379       :FORWARD DROP [0:0]
380       :OUTPUT DROP [0:0]
381       [0:0] -A INPUT -i lo -j ACCEPT
382       [0:0] -A INPUT -m conntrack --ctstate INVALID -j DROP
383       [0:0] -A INPUT -p icmp --icmp-type 8 -j ACCEPT
384       [0:0] -A INPUT -p icmp --icmp-type 0 -j ACCEPT
385       [0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
386       [0:0] -A INPUT -i bond-frontal -p tcp -m conntrack --ctstate NEW -m tcp --dport http -j ACCEPT
387       [0:0] -A INPUT -i bond-frontal -p tcp -m conntrack --ctstate NEW -m tcp --dport https -j ACCEPT
388       [0:0] -A INPUT -j LOG
389       [0:0] -A FORWARD -j LOG
390       [0:0] -A OUTPUT -o lo -j ACCEPT
391       [0:0] -A OUTPUT -p icmp --icmp-type 0 -j ACCEPT
392       [0:0] -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
393       [0:0] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
394       [0:0] -A OUTPUT -i vethin-nginx -d 172.17.1.3 -p tcp -m conntrack --ctstate NEW -m tcp --dport 8080 -j ACCEPT
395       [0:0] -A OUTPUT -j LOG
396       [0:0] -A OUTPUT -j REJECT
397       COMMIT
398     mode: "0440"
399
400 trust:
401   org:
402     - linuxkit
403     - library