Update tuto3

This commit is contained in:
nemunaire 2020-03-29 16:12:17 +02:00
parent af88c485b6
commit 41b1d950e1
3 changed files with 113 additions and 103 deletions

View File

@ -22,12 +22,13 @@ tuto2.iso: tuto2.yml tuto2-kernel tuto2-initrd.img tuto2-cmdline
tuto2-srs.iso: tuto2.iso pkg/debian-tuto2/isolinux.cfg
$(eval TDIR := $(shell mktemp -d))
bsdtar xf $< -C $(TDIR)
cp pkg/debian-tuto2/isolinux.cfg /usr/share/syslinux/isolinux.bin /usr/share/syslinux/ldlinux.c32 /usr/share/syslinux/vesamenu.c32 /usr/share/syslinux/menu.c32 /usr/share/syslinux/libcom32.c32 /usr/share/syslinux/libutil.c32 /usr/share/syslinux/poweroff.c32 $(TDIR)/isolinux/
sudo bsdtar xf $< -C $(TDIR)
sudo cp pkg/debian-tuto2/isolinux.cfg /usr/share/syslinux/isolinux.bin /usr/share/syslinux/ldlinux.c32 /usr/share/syslinux/vesamenu.c32 /usr/share/syslinux/menu.c32 /usr/share/syslinux/libcom32.c32 /usr/share/syslinux/libutil.c32 /usr/share/syslinux/poweroff.c32 $(TDIR)/isolinux/
$(eval CMDLINE := $(shell cat tuto2-cmdline | sed 's/console=ttyS0 //;s#root=/dev/sr0 ##;s#root=/dev/sda1 ##;s#adlin.format=/dev/sda ##;'))
sed -i 's#<CMDLINE>#$(CMDLINE)#' $(TDIR)/isolinux/isolinux.cfg
mkisofs -o $@ -l -J -R -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -joliet-long -input-charset utf8 -V AdLin2 $(TDIR)
rm -rf $(TDIR)
sudo sed -i 's#<CMDLINE>#$(CMDLINE)#' $(TDIR)/isolinux/isolinux.cfg
sudo mkisofs -o $@ -l -J -R -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -joliet-long -input-charset utf8 -V AdLin2 $(TDIR)
sudo chown 1000 $@
sudo rm -rf $(TDIR)
isohybrid $@
tuto2-srs.iso.gz: tuto2-srs.iso

View File

@ -7,6 +7,9 @@
 o88o o8888o `Y8bod88P" o888ooooood8 o888o o888o o888o

Debian GNU/Linux \n \l
Bienvenue au TP 3 !
IPv4: \4
Vous venez de démarrer avec succès votre système d'information.
N'utilisez pas la ligne de commande de cette machine virtuelle, elle est ici uniquement à des fins de debug.
Voici les informations dont vous avez besoin pour vous connecter en SSH :

198
tuto3.yml
View File

@ -1,36 +1,36 @@
kernel:
image: linuxkit/kernel:4.9.165
# cmdline: "console=ttyS0 adlin.token=AlFnv.8pLQ"
cmdline: "console=tty0"
image: linuxkit/kernel:4.19.104
cmdline: "console=ttyS0 root=/dev/sda1 root=/dev/sr0 adlin.token=LqCdJDfniA"
# cmdline: "console=tty0"
init:
- linuxkit/init:629fdad56e62ae72bf8becf0c8a668241480d3ff
- linuxkit/runc:606971451ea29b4238029804ca638f9f85caf5af
- linuxkit/containerd:39ac21278cfcc10dbcc32ad7f5abbe820852c5bd
- linuxkit/ca-certificates:906c46a26fd2df271bf64c0259bf2267f7593213
- linuxkit/getty:01993189b8c583dc91cbbc7d4be131832c0fc205
- linuxkit/init:a4fcf333298f644dfac6adf680b83140927aa85e
- linuxkit/runc:69b4a35eaa22eba4990ee52cccc8f48f6c08ed03
- linuxkit/containerd:09553963ed9da626c25cf8acdf6d62ec37645412
- linuxkit/ca-certificates:v0.7
- linuxkit/getty:v0.7
onboot:
- name: format
image: linuxkit/format:ada5fd97592c33399140f5f93f517c02f55edb14
image: linuxkit/format:65b9e0a76d0b9fb8ac5c5f3bc8d3131109290f56
command: ["/usr/bin/format", "/dev/sda"]
- name: mount
image: linuxkit/mount:019bc551972cf2d136b443d70b4bf94c54d0d1fe
image: linuxkit/mount:v0.7
command: ["/usr/bin/mountie", "/dev/sda1", "/var/lib/adlin"]
- name: sysctl
image: linuxkit/sysctl:713e535f2d4e4c74aba50cc7f73e3826b2dd3857
image: linuxkit/sysctl:v0.7
binds:
- /etc/sysctl.d/:/etc/sysctl.d/:ro
- name: rngd1
image: linuxkit/rngd:dc49cff2c835b196610a3f2efb585bb276658bce
image: linuxkit/rngd:02c555b50cd1887aa628836662d2eec54c0d7e81
command: ["/sbin/rngd", "-1"]
# Network: external
- name: dhcpcd
image: linuxkit/dhcpcd:85738d3d2f152a7879e17a61444f7714b858c2ee
image: linuxkit/dhcpcd:v0.7
command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
net: new
runtime:
@ -40,10 +40,20 @@ onboot:
net: /run/netns/router
- name: wg
image: nemunaire/wg:9d34420193aee27109e118f27e30e4a197c5f69e
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
net: /run/netns/router
binds:
- /etc/ssl:/etc/ssl:ro
- /etc/mresolv.conf:/etc/resolv.conf
- /usr/bin/ask.sh:/usr/bin/ask.sh:ro
- /usr/bin/ssl_client:/usr/bin/ssl_client:ro
- /lib/libcrypto.so.1.1:/lib/libcrypto.so.1.1:ro
- /lib/libssl.so.1.1:/lib/libssl.so.1.1:ro
- /usr/lib/libcrypto.so.1.1:/usr/lib/libcrypto.so.1.1:ro
- /usr/lib/libssl.so.1.1:/usr/lib/libssl.so.1.1:ro
- /usr/lib/libtls-standalone.so.1:/usr/lib/libtls-standalone.so.1:ro
- /usr/lib/libtls-standalone.so.1.0.0:/usr/lib/libtls-standalone.so.1.0.0:ro
- /usr/share/ca-certificates:/usr/share/ca-certificates:ro
- /var/lib/adlin/wireguard:/etc/wireguard
command: ["/bin/ash", "-c", "/usr/bin/ask.sh"]
runtime:
@ -52,11 +62,9 @@ onboot:
# Network: workstations
- name: net-wks-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 192.168.6.254/24 dev ethwks; ip link set ethwks up; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#1::1/96#\") dev ethwks;" ]
net: /run/netns/router
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: ethwks
@ -65,22 +73,18 @@ onboot:
# # Network: servers
- name: net-srv-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 172.23.42.1/24 dev ethsrv; ip link set ethsrv up; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1/96#\") dev ethsrv;" ]
net: /run/netns/router
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: ethsrv
add: veth
peer: veth-srv
- name: net-srvns-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 172.23.42.2/24 dev vethin-ns; ip link set vethin-ns up; ip route add default via 172.23.42.1; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && { ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:2/96#\") dev vethin-ns; ip route add default via $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1#\"); }" ]
net: new
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: vethin-ns
@ -89,11 +93,9 @@ onboot:
bindNS:
net: /run/netns/ns
- name: net-srvnsauth-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 172.23.42.3/24 dev vethin-nsauth; ip link set vethin-nsauth up; ip route add default via 172.23.42.1; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && { ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:3/96#\") dev vethin-nsauth; ip route add default via $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1#\"); }" ]
net: new
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: vethin-nsauth
@ -102,11 +104,9 @@ onboot:
bindNS:
net: /run/netns/ns-auth
- name: net-srvdb-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 172.23.42.4/24 dev vethin-db; ip link set vethin-db up; ip route add default via 172.23.42.1; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && { ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:4/96#\") dev vethin-db; ip route add default via $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1#\"); }" ]
net: new
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: vethin-db
@ -115,11 +115,9 @@ onboot:
bindNS:
net: /run/netns/db
- name: net-srvchat-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 172.23.42.5/24 dev vethin-chat; ip link set vethin-chat up; ip route add default via 172.23.42.1; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && { ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:5/96#\") dev vethin-chat; ip route add default via $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1#\"); }" ]
net: new
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: vethin-chat
@ -128,35 +126,20 @@ onboot:
bindNS:
net: /run/netns/chat
- name: net-srvttrss-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip a add 172.23.42.6/24 dev vethin-ttrss; ip link set vethin-ttrss up; ip route add default via 172.23.42.1; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && { ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:6/96#\") dev vethin-ttrss; ip route add default via $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1#\"); }" ]
net: new
binds:
- /var/lib/adlin/wireguard:/etc/wireguard
runtime:
interfaces:
- name: vethin-ttrss
add: veth
peer: veth-ttrss
bindNS:
net: /run/netns/ttrss
# - name: net-srvmail-setup
# image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
# command: ["/bin/sh", "-c", "ip a add 172.23.42.7/24 dev vethin-mail; ip link set vethin-mail up; ip route add default via 172.23.42.1; grep MyIPv6= /etc/wireguard/adlin.conf > /dev/null && { ip a add $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:7/96#\") dev vethin-mail; ip route add default via $(sed 's/^.*MyIPv6=//p;d' /etc/wireguard/adlin.conf | sed \"s#:[^:/]*/.*\\$#:1#\"); }" ]
# net: new
# binds:
# - /var/lib/adlin/wireguard:/etc/wireguard
# runtime:
# interfaces:
# - name: vethin-mail
# add: veth
# peer: veth-mail
# bindNS:
# net: /run/netns/mail
net: /run/netns/miniflux
# Network: bridges
- name: bridges-setup
image: linuxkit/ip:4787413a729748bcf7560c73e0b46d38b8a8df2b
image: linuxkit/ip:7b1cf3150bf5d9a0df7ef07572e2d81fe3c0c3d3
command: ["/bin/sh", "-c", "ip link set veth-srv master brsrv; ip link set veth-ns master brsrv; ip link set veth-nsauth master brsrv; ip link set veth-db master brsrv; ip link set veth-chat master brsrv; ip link set veth-ttrss master brsrv; ip link set veth-srv up; ip link set veth-ns up; ip link set veth-nsauth up; ip link set veth-db up; ip link set veth-chat up; ip link set veth-ttrss up; ip link set brsrv up; ip link set veth-wks master brwks; ip link set veth-wks1 master brwks; ip link set veth-wks2 master brwks; ip link set veth-wks up; ip link set veth-wks1 up; ip link set veth-wks2 up; ip link set brwks up; ip l | grep eth2 > /dev/null && { ip link set eth2 up; ip link set eth2 master brwks; }" ]
runtime:
interfaces:
@ -173,7 +156,7 @@ onboot:
services:
- name: dhcpcd-wks1
image: linuxkit/dhcpcd:85738d3d2f152a7879e17a61444f7714b858c2ee
image: linuxkit/dhcpcd:v0.7
net: new
runtime:
interfaces:
@ -183,7 +166,7 @@ services:
net: /run/netns/wks1
- name: dhcpcd-wks2
image: linuxkit/dhcpcd:85738d3d2f152a7879e17a61444f7714b858c2ee
image: linuxkit/dhcpcd:v0.7
net: new
runtime:
interfaces:
@ -192,7 +175,7 @@ services:
net: /run/netns/wks2
- name: sshd-wks1
image: linuxkit/sshd:6e4740bee64bf44e9913a1db4a38b5c3a5fb6ab1
image: linuxkit/sshd:v0.7
net: /run/netns/wks1
binds:
- /etc/ssh/sshd_config:/etc/ssh/sshd_config
@ -200,7 +183,7 @@ services:
- /etc/wshadow:/etc/shadow
- name: sshd-wks2
image: linuxkit/sshd:6e4740bee64bf44e9913a1db4a38b5c3a5fb6ab1
image: linuxkit/sshd:v0.7
net: /run/netns/wks2
binds:
- /etc/ssh/sshd_config:/etc/ssh/sshd_config
@ -208,7 +191,7 @@ services:
- /etc/wshadow:/etc/shadow
- name: mainrouter
image: nemunaire/adlin-tuto3:3b205f57d9d79733fb65e5a23fbf933334680083
image: nemunaire/adlin-tuto3:a8593e91cb830dede2ad25a205ef47141a5a3c22
net: /run/netns/router
command: ["/sbin/init"]
capabilities:
@ -218,12 +201,10 @@ services:
options: ["rw","nosuid","noexec","nodev","relatime"]
binds:
- /etc/dresolv.conf:/etc/resolv.conf
#- /dev/console:/dev/console
- name: matrix
image: nemunaire/tinydeb:509f15959572986936eb429a2d9ba40dc33162a2
image: nemunaire/tinydeb:eaa617bf726fb4cadfa22b3947709579e6001212
net: /run/netns/chat
command: ["/sbin/init"]
#command: ["/bin/sh", "-c", "mkdir -p /run/sshd && exec /usr/sbin/sshd -D"]
capabilities:
- all
mounts:
@ -232,7 +213,7 @@ services:
binds:
- /etc/dresolv.conf:/etc/resolv.conf
- name: ns-resolv
image: nemunaire/unbound:7fa2ef501be79db472de64f451b250173ace5ecf
image: nemunaire/unbound:ed3ccbb5340aefd48c53a97743fdc6edc7011103
net: /run/netns/ns
capabilities:
- all
@ -240,7 +221,7 @@ services:
- /etc/unbound:/etc/unbound:ro
- /etc/services:/etc/services:ro
- name: ns-auth
image: nemunaire/nsd:bb9f485c239116be60f62ee73592d8bc4bacf6c7
image: nemunaire/nsd:8d1277be1eb28748ed7441ac82ac04edbacc3b5d
net: /run/netns/ns-auth
capabilities:
- all
@ -262,16 +243,18 @@ services:
net: /run/netns/db
capabilities:
- all
command: ["/docker-entrypoint.sh", "postgres"]
env:
- LANG=en_US.utf8
- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/"
- PGDATA=/var/lib/postgresql/data
- POSTGRES_PASSWORD=adlin2020
- POSTGRES_PASSWORD=adlin2021
binds:
- /etc/services:/etc/services:ro
- /initdb/init-ttrss.sh:/docker-entrypoint-initdb.d/init-ttrss.sh:ro
- /initdb/init-matrix.sh:/docker-entrypoint-initdb.d/init-matrix.sh:ro
- /initdb/:/docker-entrypoint-initdb.d/:ro
- /var/lib/adlin/postgres:/var/lib/postgresql/data
runtime:
mkdir:
- /var/lib/adlin/postgres
# - name: chat
# image: nemunaire/mattermost:ecb81e668c64d07b4453f9b465a6998fc6ceb067-dirty
# net: /run/netns/chat
@ -281,25 +264,23 @@ services:
# env:
# - MM_USERNAME=mattermost
# - MM_DBNAME=mattermost
# - MM_PASSWORD=adlin2020
# - MM_PASSWORD=adlin2021
# binds:
# - /etc/services:/etc/services:ro
# - /etc/hosts:/etc/hosts:ro
- name: ttrss
image: nemunaire/ttrss:89149d186daf3ebf752a764807dee3180f46b93d-dirty
net: /run/netns/ttrss
- name: miniflux
image: miniflux/miniflux:latest
net: /run/netns/miniflux
capabilities:
- all
command: ["/usr/bin/ttrss_entrypoint.sh", "/sbin/start_ttrss"]
command: ["/bin/sh", "-c", "sleep 5; /usr/bin/miniflux"]
env:
- TTRSS_PORT=80
- TTRSS_DB_TYPE=pgsql
- TTRSS_DB_HOST=db
- TTRSS_DB_PORT=5432
- TTRSS_DB_NAME=ttrss
- TTRSS_DB_USER=ttrss
- TTRSS_DB_PASS=adlin2020
- TTRSS_SELF_URL_PATH=http://localhost/
- DATABASE_URL=postgres://miniflux:adlin2021@db/miniflux?sslmode=disable
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=adeline
- ADMIN_PASSWORD=adlin2021
- LISTEN_ADDR=0.0.0.0:8080
binds:
- /etc/hosts:/etc/hosts:ro
- /etc/services:/etc/services:ro
@ -312,6 +293,10 @@ files:
172.23.42.4 db
mode: "0444"
- path: usr/bin/ask.sh
source: pkg/wg/ask.sh
mode: "0755"
- path: etc/ssh/sshd_config
source: pkg/nsd/sshd_config
mode: "0644"
@ -327,45 +312,56 @@ files:
nsenter -t "${PS}" -a iptables -t nat -F
mode: "0755"
- path: /initdb/init-ttrss.sh
- path: /usr/sbin/wg
contents: |
nsenter -n/run/netns/router /usr/bin/wg $@
mode: "0755"
- path: /initdb/init-miniflux.sh
contents: |
#!/bin/sh
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER ttrss WITH PASSWORD 'adlin2020';
CREATE DATABASE ttrss;
GRANT ALL PRIVILEGES ON DATABASE ttrss TO ttrss;
CREATE USER miniflux WITH PASSWORD 'adlin2021';
CREATE DATABASE miniflux;
GRANT ALL PRIVILEGES ON DATABASE miniflux TO miniflux;
EOSQL
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname miniflux <<-EOSQL
CREATE EXTENSION hstore;
EOSQL
mode: "0555"
- path: /initdb/init-matrix.sh
- path: /initdb/init-matrix.sql
contents: |
#!/bin/sh
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER matrix WITH PASSWORD 'adlin2020';
CREATE DATABASE matrix;
GRANT ALL PRIVILEGES ON DATABASE matrix TO matrix;
EOSQL
mode: "0555"
CREATE USER matrix WITH PASSWORD 'adlin2021';
CREATE DATABASE matrix;
GRANT ALL PRIVILEGES ON DATABASE matrix TO matrix;
mode: "0444"
- path: /etc/init.d/999-rw-passwd.sh
contents: |
#!/bin/sh
sed -ri '/^root/s@^.*$@root:$6$B0qzwsEh$vfWGpIFUrKGrkT0PVtGhhomBwc.60IBIxjMLyG8mz.NJLFRryjqLK9sA/mzxNSaQViiHsYYrsgmcWVHblfdHg1:17968:0:99999:7:::@' /containers/services/mainrouter/rootfs/etc/shadow
sed -ri '/^root/s@^.*$@root:$6$QNuPvO59Xk4UO3le$3P0V2ef6dHlKgO1FHsKcPPgOvL.YeCOPFqfIVTtpYn5eEn3xkgGYeM1RMCQ9l/eTc6rRc.l.WeRe1iJVznVGj/:17968:0:99999:7:::@' /containers/services/mainrouter/rootfs/etc/shadow
cp /etc/services /containers/services/mainrouter/rootfs/etc/services
sed -ri '/^root/s@^.*$@root:$6$B0qzwsEh$vfWGpIFUrKGrkT0PVtGhhomBwc.60IBIxjMLyG8mz.NJLFRryjqLK9sA/mzxNSaQViiHsYYrsgmcWVHblfdHg1:17968:0:99999:7:::@' /containers/services/matrix/rootfs/etc/shadow
sed -ri '/^root/s@^.*$@root:$6$QNuPvO59Xk4UO3le$3P0V2ef6dHlKgO1FHsKcPPgOvL.YeCOPFqfIVTtpYn5eEn3xkgGYeM1RMCQ9l/eTc6rRc.l.WeRe1iJVznVGj/:17968:0:99999:7:::@' /containers/services/matrix/rootfs/etc/shadow
cp /etc/services /containers/services/matrix/rootfs/etc/services
sed -ri '/^root/s@^.*$@root:$6$B0qzwsEh$vfWGpIFUrKGrkT0PVtGhhomBwc.60IBIxjMLyG8mz.NJLFRryjqLK9sA/mzxNSaQViiHsYYrsgmcWVHblfdHg1:17968:0:99999:7:::@' /containers/services/ns-auth/rootfs/etc/shadow
sed -ri '/^root/s@^.*$@root:$6$QNuPvO59Xk4UO3le$3P0V2ef6dHlKgO1FHsKcPPgOvL.YeCOPFqfIVTtpYn5eEn3xkgGYeM1RMCQ9l/eTc6rRc.l.WeRe1iJVznVGj/:17968:0:99999:7:::@' /containers/services/ns-auth/rootfs/etc/shadow
exit 0
mode: "0555"
- path: etc/issue.adlin
source: pkg/debian-tuto3/issue
mode: "0444"
- path: /etc/init.d/500-showip.sh
contents: |
#!/bin/sh
nsenter -n/run/netns/router ip -c a show dev wg0
echo
cat /etc/issue.adlin
echo
nsenter -n/run/netns/router ip -c a show dev wg0 2> /dev/null || echo "You didn't define your token to connect the network. Please run here `join-p0m` and then reboot."
nsenter -n/run/netns/router ip -c a show dev eth0
nsenter -n/run/netns/wks1 ip -c a show dev eth1
nsenter -n/run/netns/wks1 ip -c a show dev eth1 2> /dev/null || echo "Attachez une seconde carte ethernet à la VM pour pouvoir vous connecter à un poste de travail."
exit 0
mode: "0555"
@ -379,6 +375,16 @@ files:
# done &
# mode: "0555"
- path: /usr/sbin/join-p0m
contents: |
[ -f "/var/lib/adlin/wireguard/adlin.token" ] && echo "A token is already defined. You'll erase it it you continue."
echo -n "Please copy your token here: "
read WGTOKEN
mkdir -p /var/lib/adlin/wireguard/
echo $WGTOKEN > /var/lib/adlin/wireguard/adlin.token
echo "Token saved. You need to reboot now."
mode: "0755"
- path: etc/network/interfaces
contents: |
@ -395,7 +401,7 @@ files:
- path: etc/nsd/login-x.srs.p0m.fr.zone
contents: |
login-x.srs.p0m.fr. 900 SOA ns.login-x.srs.p0m.fr. root.login-x.srs.p0m.fr. 2019032900 172800 3600 2419200 86400
login-x.srs.p0m.fr. 900 SOA ns.login-x.srs.p0m.fr. root.login-x.srs.p0m.fr. 2020032900 172800 3600 2419200 86400
login-x.srs.p0m.fr. 900 NS ns.login-x.srs.p0m.fr.
ns.login-x.srs.p0m.fr. 900 AAAA 2a01:e0a:2b:2252:4242::3
mode: "0644"