server/fickit-backend.yml

570 lines
19 KiB
YAML
Raw Normal View History

2018-01-21 16:03:45 +00:00
kernel:
2022-06-01 10:39:40 +00:00
#image: nemunaire/kernel:5.10.62-0b705d955f5e283f62583c4e227d64a7924c138f-amd64
image: linuxkit/kernel:6.6.13
2018-12-10 01:16:07 +00:00
cmdline: "console=ttyS0 console=tty0"
2018-01-21 16:03:45 +00:00
init:
2024-03-24 10:42:11 +00:00
- linuxkit/init:v1.0.0
2024-03-18 17:58:57 +00:00
- linuxkit/runc:6062483d748609d505f2bcde4e52ee64a3329f5f
2024-03-24 10:42:11 +00:00
- linuxkit/containerd:v1.0.0
- linuxkit/ca-certificates:v1.0.0
- linuxkit/getty:v1.0.0
2024-03-22 17:46:43 +00:00
- nemunaire/mdadm:04814350d71ba9417e1f861be1685de26adf7a67
2023-04-03 09:42:00 +00:00
- nemunaire/kexec:839b4eedfce02a56c581dec2383dc6faff120855
2018-01-21 16:03:45 +00:00
onboot:
2022-06-02 09:40:43 +00:00
- name: mod
2024-03-24 10:42:11 +00:00
image: linuxkit/modprobe:v1.0.0
2022-06-02 09:40:43 +00:00
command: ["/bin/sh", "-c", "modprobe xhci_pci ahci intel_lpss_pci i2c_i801 megaraid_sas tg3 bnxt_en"]
2018-12-10 01:16:07 +00:00
2019-01-17 08:11:13 +00:00
- name: sysctl
2024-03-24 10:42:11 +00:00
image: linuxkit/sysctl:v1.0.0
2019-01-17 08:11:13 +00:00
binds:
- /etc/sysctl.d/01-fic.conf:/etc/sysctl.d/01-fic.conf:ro
2018-01-21 16:03:45 +00:00
2023-07-24 14:14:52 +00:00
# Metadata
- name: metadata
2024-03-24 10:42:11 +00:00
image: linuxkit/metadata:v1.0.0
command: ["/usr/bin/metadata", "-v", "cdrom"]
2023-07-24 14:14:52 +00:00
2018-01-21 16:03:45 +00:00
# Filesystem
- name: swap
2024-03-24 10:42:11 +00:00
image: linuxkit/swap:v1.0.0
command: ["/sbin/swapon", "/dev/sda3"]
2020-01-30 18:03:14 +00:00
- name: dm-crypt
2024-03-18 17:58:57 +00:00
image: linuxkit/dm-crypt:d49723bc9d10c5ada9e03b0670f4e57416d5d084
command: ["/usr/bin/crypto", "-l", "crypt_fic", "/dev/sda4"]
2023-07-24 14:14:52 +00:00
binds:
- /dev:/dev
2023-07-24 14:14:52 +00:00
- /run/config/dm-crypt:/etc/dm-crypt
2018-01-21 16:03:45 +00:00
- name: mount
2024-03-24 10:42:11 +00:00
image: linuxkit/mount:v1.0.0
2020-01-30 18:03:14 +00:00
command: ["/usr/bin/mountie", "-device", "/dev/mapper/crypt_fic", "/var/lib/fic" ]
2018-01-21 16:03:45 +00:00
# Network
# - name: dhcpcd
2024-03-24 10:42:11 +00:00
# image: linuxkit/dhcpcd:v1.0.0
2018-01-21 16:03:45 +00:00
# command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
# - name: ntp
2024-03-24 10:42:11 +00:00
# image: linuxkit/openntpd:v1.0.0
2018-01-21 16:03:45 +00:00
- name: synchro-ip-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2022-06-04 16:09:33 +00:00
command: ["/bin/sh", "-c", "ip a add 10.10.10.1/29 dev eth2; ip link set eth2 up;" ]
2018-01-21 16:03:45 +00:00
net: new
runtime:
interfaces:
2022-06-04 16:09:33 +00:00
- name: eth2
2018-01-21 16:03:45 +00:00
bindNS:
net: /run/netns/synchro
2023-07-25 05:50:48 +00:00
- name: qa-ip-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
command: ["/bin/sh", "-c", "ip link show eth1 2> /dev/null && { ip a add 10.10.10.1/29 dev eth1; ip link set eth1 up; }; ip a add 172.17.0.6/24 dev vethin-qa; ip link set vethin-qa up" ]
2023-07-25 05:50:48 +00:00
net: new
runtime:
interfaces:
2024-03-23 10:28:12 +00:00
# - name: eth1 # for QA
2023-07-25 05:50:48 +00:00
- name: vethin-qa
add: veth
peer: veth-qa
bindNS:
net: /run/netns/fic-qa
2018-01-21 16:03:45 +00:00
- name: admin-ip-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2022-06-04 16:09:33 +00:00
#command: ["/bin/sh", "-c", "ip link add link eth3 name adminiface type vlan id 99; ip a add 172.16.99.219/24 dev adminiface; ip link set eth3 up; ip link set adminiface up; ip r add default via 172.16.99.1; ip a add 172.17.0.2/24 dev vethin-admin; ip link set vethin-admin up; ping -W 10 -c 1 172.16.99.1;" ]
command: ["/bin/sh", "-c", "ip link set eth3 up; while read IP; do ip a add ${IP} dev eth3; done < /run/config/ip_config/backend-admin; ip r add default via $(cat /run/config/ip_config/backend-router); ip a add 172.17.0.2/24 dev vethin-admin; ip link set vethin-admin up; echo 'Waiting for' $(cat /run/config/ip_config/backend-router); ping -W 10 -c 1 $(cat /run/config/ip_config/backend-router); ip link show eth1 2> /dev/null && { ip a add 10.0.0.1/24 dev eth1; ip link set eth1 up; };" ]
2018-01-21 16:03:45 +00:00
net: new
2024-03-22 17:56:57 +00:00
binds:
- /run/config/ip_config/:/run/config/ip_config/:ro
2018-01-21 16:03:45 +00:00
runtime:
interfaces:
2024-03-23 10:28:12 +00:00
- name: eth1 #iDRAC
2022-06-04 16:09:33 +00:00
- name: eth3
2018-01-21 16:03:45 +00:00
- name: vethin-admin
add: veth
peer: veth-admin
bindNS:
net: /run/netns/fic-admin
- name: checker-ip-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
command: ["/bin/sh", "-c", "ip a add 172.17.0.3/24 dev vethin-checker; ip link set vethin-checker up;" ]
2018-01-21 16:03:45 +00:00
net: new
runtime:
interfaces:
- name: vethin-checker
2018-01-21 16:03:45 +00:00
add: veth
peer: veth-checker
2018-01-21 16:03:45 +00:00
bindNS:
net: /run/netns/fic-checker
- name: generator-ip-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2023-07-24 18:55:02 +00:00
command: ["/bin/sh", "-c", "ip a add 172.17.0.5/24 dev vethin-generat; ip link set vethin-generat up;" ]
net: new
runtime:
interfaces:
2023-07-24 18:55:02 +00:00
- name: vethin-generat
add: veth
peer: veth-generator
bindNS:
net: /run/netns/fic-generator
2018-01-21 16:03:45 +00:00
- name: mysql-ip-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2018-01-21 16:03:45 +00:00
command: ["/bin/sh", "-c", "ip a add 172.17.0.4/24 dev vethin-db; ip link set vethin-db up;" ]
net: new
runtime:
interfaces:
- name: vethin-db
add: veth
peer: veth-db
bindNS:
net: /run/netns/db
- name: bridge-setup
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2023-07-25 05:50:48 +00:00
command: ["/bin/sh", "-c", "ip a add 172.17.0.1/24 dev br0; ip link set veth-admin master br0; ip link set veth-checker master br0; ip link set veth-generator master br0; ip link set veth-db master br0; ip link set veth-qa master br0; ip link set br0 up; ip link set veth-admin up; ip link set veth-checker up; ip link set veth-generator up; ip link set veth-db up; ip link set veth-qa up;" ]
2018-01-21 16:03:45 +00:00
runtime:
interfaces:
- name: br0
add: bridge
- name: firewall-synchro
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2018-01-21 16:03:45 +00:00
command: ["/bin/bash", "-c", "/sbin/iptables-restore < /etc/iptables/rules-synchro.v4; /sbin/ip6tables-restore < /etc/iptables/rules.v6" ]
binds:
- /etc/iptables/rules-synchro.v4:/etc/iptables/rules-synchro.v4:ro
- /etc/iptables/rules.v6:/etc/iptables/rules.v6:ro
net: /run/netns/synchro
runtime:
mkdir:
- /var/lib/fic/teams
- name: firewall-admin
2024-03-24 10:42:11 +00:00
image: linuxkit/ip:v1.0.0
2018-01-21 16:03:45 +00:00
command: ["/bin/bash", "-c", "/sbin/iptables-restore < /etc/iptables/rules-admin.v4; /sbin/ip6tables-restore < /etc/iptables/rules.v6" ]
binds:
- /etc/iptables/rules-admin.v4:/etc/iptables/rules-admin.v4:ro
- /etc/iptables/rules.v6:/etc/iptables/rules.v6:ro
net: /run/netns/fic-admin
2024-03-23 17:03:08 +00:00
- name: create-secrets
image: alpine:3.20
2024-03-23 17:03:08 +00:00
command: ["/bin/init_secrets.sh"]
binds:
- /bin/init_secrets.sh:/bin/init_secrets.sh:ro
- /var/lib/fic/secrets:/var/lib/fic/secrets
runtime:
mkdir:
- /var/lib/fic/secrets
2018-01-21 16:03:45 +00:00
services:
2018-12-10 01:16:07 +00:00
# - name: getty
2024-03-24 10:42:11 +00:00
# image: linuxkit/getty:v1.0.0
2018-12-10 01:16:07 +00:00
# env:
# - INSECURE=true
# Enable acpi to shutdown on power events
- name: acpid
2024-03-24 10:42:11 +00:00
image: linuxkit/acpid:v1.0.0
2018-01-21 16:03:45 +00:00
- name: rngd
2024-03-24 10:42:11 +00:00
image: linuxkit/rngd:v1.0.0
2018-01-21 16:03:45 +00:00
- name: db
image: mariadb:11
command: ["/bin/bash", "/usr/local/bin/docker-entrypoint.sh", "mariadbd"]
2018-01-21 16:03:45 +00:00
capabilities:
- CAP_CHOWN
- CAP_SETUID
- CAP_SETGID
- CAP_DAC_OVERRIDE
env:
- MYSQL_DATABASE=fic
- MYSQL_USER=fic
2024-03-23 17:03:08 +00:00
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
2018-01-21 16:03:45 +00:00
- MYSQL_RANDOM_ROOT_PASSWORD=yes
binds:
- /etc/hosts:/etc/hosts:ro
- /etc/mysql/conf.d:/etc/mysql/conf.d:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/mysql:/var/lib/mysql
2024-03-23 17:03:08 +00:00
- /var/lib/fic/secrets/mysql_password:/run/secrets/mysql_password:ro
2018-01-21 16:03:45 +00:00
net: /run/netns/db
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/mysql
2019-01-17 08:26:51 +00:00
- name: db-backup
2023-04-03 09:42:00 +00:00
image: nemunaire/mariadb-client:a77db996e46335c35c74ba8dbef3c65286386c6d
2019-01-17 08:26:51 +00:00
command: ["/bin/sh", "/root/mysql_backup.sh"]
env:
- MYSQL_HOST=db
- MYSQL_DATABASE=fic
- MYSQL_USER=fic
2024-03-23 17:03:08 +00:00
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
2019-01-17 08:26:51 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
- /root/mysql_backup.sh:/root/mysql_backup.sh:ro
- /var/lib/fic/backups/:/var/lib/fic/backups/
2024-03-23 17:03:08 +00:00
- /var/lib/fic/secrets/mysql_password:/run/secrets/mysql_password:ro
2019-01-17 08:26:51 +00:00
net: /run/netns/db
runtime:
mkdir:
- /var/lib/fic/backups
2018-01-21 16:03:45 +00:00
- name: fic-admin
2023-07-22 09:39:04 +00:00
image: nemunaire/fic-admin:latest
2023-07-24 19:23:01 +00:00
command: ["/srv/admin", "-4real", "-bind=127.0.0.1:8081", "-baseurl=/admin/", "-localimport=/mnt/fic", "-timestampCheck=/srv/submissions", "-git-import-remote=git@gitlab.cri.epita.fr:ing/majeures/srs/fic/2024/challenges.git"]
2018-01-21 16:03:45 +00:00
env:
2022-11-07 15:31:19 +00:00
- PATH=/usr/sbin:/usr/bin:/sbin:/bin
- MYSQL_HOST=db
2024-03-23 17:03:08 +00:00
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
- FICCA_PASS_FILE=/run/secrets/fic_ca_pass
2024-03-23 17:51:53 +00:00
- FICOIDC_ISSUER_FILE=/run/config/ip_config/domain
2024-03-23 17:03:08 +00:00
- FICOIDC_SECRET_FILE=/run/secrets/fic_oidc_secret
2018-01-21 16:03:45 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
2024-03-23 17:51:53 +00:00
- /run/config/ip_config/domain:/run/config/ip_config/domain:ro
2024-03-23 17:03:08 +00:00
- /var/lib/fic/secrets/fic_ca_pass:/run/secrets/fic_ca_pass:ro
- /var/lib/fic/secrets/fic_oidc_secret:/run/secrets/fic_oidc_secret:ro
- /var/lib/fic/secrets/mysql_password:/run/secrets/mysql_password:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/raw_files:/mnt/fic
2018-12-10 01:16:07 +00:00
- /var/lib/fic/dashboard:/srv/DASHBOARD
- /var/lib/fic/files:/srv/FILES
- /var/lib/fic/generator:/srv/GENERATOR:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/pki:/srv/PKI
2018-12-10 01:16:07 +00:00
- /var/lib/fic/settings:/srv/SETTINGS
- /var/lib/fic/submissions:/srv/submissions:ro
2023-11-05 11:40:19 +00:00
- /var/lib/fic/sync:/srv/SYNC
2023-07-24 19:23:01 +00:00
- /var/lib/fic/teams:/srv/TEAMS
2018-01-21 16:03:45 +00:00
net: /run/netns/fic-admin
pid: new
ipc: new
uts: new
runtime:
mkdir:
2018-12-10 01:16:07 +00:00
- /var/lib/fic/dashboard
2018-01-21 16:03:45 +00:00
- /var/lib/fic/files
- /var/lib/fic/generator
2018-01-21 16:03:45 +00:00
- /var/lib/fic/raw_files
- /var/lib/fic/pki
- /var/lib/fic/settings
- /var/lib/fic/submissions
- /var/lib/fic/sync
2018-01-21 16:03:45 +00:00
- /var/lib/fic/teams
- name: fic-evdist
2023-07-22 09:39:04 +00:00
image: nemunaire/fic-evdist:latest
binds:
- /etc/hosts:/etc/hosts:ro
- /var/lib/fic/dashboard:/srv/DASHBOARD
- /var/lib/fic/settings:/srv/SETTINGS
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST
net: new
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/settings
- /var/lib/fic/settingsdist
- name: fic-checker
2023-07-22 09:39:04 +00:00
image: nemunaire/fic-checker:latest
2018-01-21 16:03:45 +00:00
env:
- MYSQL_HOST=db
2024-03-23 17:03:08 +00:00
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
2018-01-21 16:03:45 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
- /var/lib/fic/generator:/srv/GENERATOR:ro
- /var/lib/fic/teams:/srv/TEAMS:ro
2024-03-23 17:03:08 +00:00
- /var/lib/fic/secrets/mysql_password:/run/secrets/mysql_password:ro
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/submissions:/srv/submissions
net: /run/netns/fic-checker
2018-01-21 16:03:45 +00:00
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/generator
- /var/lib/fic/settingsdist
2018-01-21 16:03:45 +00:00
- /var/lib/fic/submissions
- /var/lib/fic/teams
2018-12-10 01:16:07 +00:00
- name: fic-dashboard
2023-10-22 10:36:35 +00:00
image: nemunaire/fic-dashboard:latest
command: ["/srv/dashboard", "-bind=:8082", "-restrict-to-ips=/srv/DASHBOARD/restricted-ips.json"]
2018-12-10 01:16:07 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
- /var/lib/fic/dashboard:/srv/DASHBOARD:ro
2019-01-19 02:08:07 +00:00
- /var/lib/fic/files:/srv/FILES:ro
2018-12-10 01:16:07 +00:00
- /var/lib/fic/teams:/srv/TEAMS:ro
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST:ro
2018-12-10 01:16:07 +00:00
net: /run/netns/fic-admin
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/dashboard
- /var/lib/fic/teams
- /var/lib/fic/settingsdist
- name: fic-generator
2023-07-22 09:39:04 +00:00
image: nemunaire/fic-generator:latest
command: ["/srv/generator", "-bind=/srv/GENERATOR/generator.socket"]
env:
- MYSQL_HOST=db
2024-03-23 17:03:08 +00:00
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
binds:
- /etc/hosts:/etc/hosts:ro
2023-07-24 19:23:01 +00:00
- /var/lib/fic/generator:/srv/GENERATOR
- /var/lib/fic/teams:/srv/TEAMS
2024-03-23 17:03:08 +00:00
- /var/lib/fic/secrets/mysql_password:/run/secrets/mysql_password:ro
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST:ro
net: /run/netns/fic-generator
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/generator
- /var/lib/fic/settingsdist
- /var/lib/fic/teams
2023-07-25 05:50:48 +00:00
- name: fic-qa
image: nemunaire/fic-qa:latest
2023-10-23 13:15:14 +00:00
command: ["/srv/qa", "--bind=:8083", "-baseurl=/qa"]
2023-07-25 05:50:48 +00:00
env:
- MYSQL_HOST=db
2024-03-23 17:03:08 +00:00
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
2023-07-25 05:50:48 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
- /var/lib/fic/teams:/srv/TEAMS:ro
2024-03-23 17:03:08 +00:00
- /var/lib/fic/secrets/mysql_password:/run/secrets/mysql_password:ro
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST:ro
2023-07-25 05:50:48 +00:00
net: /run/netns/fic-qa
pid: new
ipc: new
uts: new
runtime:
mkdir:
- /var/lib/fic/teams
2018-01-21 16:03:45 +00:00
- name: fic-synchro
2023-04-03 09:42:00 +00:00
image: nemunaire/rsync:a3d76b2dd0a9ad73be44dc77ad765b20d96a3285
2018-01-21 16:03:45 +00:00
command: ["/bin/ash", "/root/synchro.sh"]
binds:
- /etc/hosts:/etc/hosts:ro
2019-12-16 13:47:00 +00:00
- /var/lib/fic/ssh:/etc/ssh:ro
2023-07-24 14:14:52 +00:00
- /run/config/synchro/id_ed25519:/root/.ssh/id_ed25519:ro
2018-01-21 16:03:45 +00:00
- /root/synchro.sh:/root/synchro.sh:ro
- /var/lib/fic/files:/srv/FILES:ro
2018-12-10 01:16:07 +00:00
#- /var/lib/fic/pki/ca.key:/srv/PKI/ca.key:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/pki/shared:/srv/PKI/shared:ro
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/submissions:/srv/submissions
- /var/lib/fic/teams:/srv/TEAMS:ro
- /var/log/frontend:/var/log/frontend
2018-01-21 16:03:45 +00:00
net: /run/netns/synchro
runtime:
mkdir:
- /var/lib/fic/files
- /var/lib/fic/pki/shared
- /var/lib/fic/settingsdist
2019-12-16 13:47:00 +00:00
- /var/lib/fic/ssh
2018-01-21 16:03:45 +00:00
- /var/lib/fic/submissions
- /var/lib/fic/teams
- /var/log/frontend
2018-01-21 16:03:45 +00:00
- name: sshd
2023-04-03 09:42:00 +00:00
image: nemunaire/rsync:a3d76b2dd0a9ad73be44dc77ad765b20d96a3285
2018-01-21 16:03:45 +00:00
binds:
- /etc/hosts:/etc/hosts:ro
- /var/lib/fic/ssh:/etc/ssh:ro
2023-07-24 14:14:52 +00:00
- /run/config/ssh/authorized_keys:/root/.ssh/authorized_keys:ro
- /usr/bin/iptables:/usr/bin/iptables:ro
2024-03-24 11:28:55 +00:00
- /usr/bin/mariadb:/usr/bin/mariadb:ro
- /usr/bin/mysql:/usr/bin/mysql:ro
- /usr/bin/pnsenter:/usr/bin/pnsenter:ro
- /usr/bin/status:/usr/bin/status:ro
2018-01-21 16:03:45 +00:00
- /var/lib/fic/outofsync:/var/lib/fic/outofsync
2018-12-10 01:16:07 +00:00
- /var/lib/fic/raw_files:/mnt/fic
- /var/lib/fic/secrets:/var/lib/fic/secrets:ro
- /var/log:/var/log:ro
capabilities:
- all
2018-01-21 16:03:45 +00:00
net: /run/netns/fic-admin
pid: host
2018-01-21 16:03:45 +00:00
runtime:
mkdir:
- /var/lib/fic/outofsync
2022-11-07 15:31:19 +00:00
# - name: dhcp-server
# image: joebiellik/dhcpd
# binds:
# - /etc/dhcp/dhcpd.conf:/etc/dhcp/dhcpd.conf:ro
# capabilities:
# - CAP_NET_BIND_SERVICE
# - CAP_NET_RAW
# - CAP_DAC_OVERRIDE
# net: /run/netns/fic-admin
# pid: new
# ipc: new
# uts: new
2018-01-21 16:03:45 +00:00
files:
2022-06-02 09:41:12 +00:00
- path: etc/init.d/001-hostname
contents: |
#!/bin/sh
/bin/hostname deimos
mode: "0555"
2024-03-23 17:03:08 +00:00
- path: bin/init_secrets.sh
contents: |
#!/bin/sh
SECRETS_DIR="/var/lib/fic/secrets"
[ -f "${SECRETS_DIR}/mysql_password" ] || tr -d -c "a-zA-Z0-9" < /dev/urandom | fold -w31 | head -n 1 > "${SECRETS_DIR}/mysql_password"
[ -f "${SECRETS_DIR}/fic_ca_pass" ] || tr -d -c "a-zA-Z0-9" < /dev/urandom | fold -w31 | head -n 1 > "${SECRETS_DIR}/fic_ca_pass"
[ -f "${SECRETS_DIR}/fic_oidc_secret" ] || tr -d -c "a-zA-Z0-9" < /dev/urandom | fold -w31 | head -n 1 > "${SECRETS_DIR}/fic_oidc_secret"
mode: "0755"
2022-06-02 18:11:35 +00:00
- path: etc/profile.d/color_prompt.sh
contents: |
PS1='\[\e[1;33m\]'$PS1'\[\e[0m\]'
mode: "0444"
2020-01-30 18:02:19 +00:00
- path: etc/init.d/015-setup-sshd
source: configs/sshd-setup.sh
mode: "0555"
2019-01-17 08:11:13 +00:00
- path: etc/sysctl.d/01-fic.conf
source: configs/sysctl-backend.conf
mode: "0444"
2018-01-21 16:03:45 +00:00
- path: root/synchro.sh
source: configs/synchro.sh
mode: "0755"
2019-01-17 08:26:51 +00:00
- path: root/mysql_backup.sh
source: configs/mysql_backup.sh
mode: "0755"
2018-01-21 16:03:45 +00:00
- path: etc/hosts
source: configs/hosts
mode: "0644"
- path: usr/bin/status
contents: |
#!/bin/sh
nsenter -t 1 -m ctr -n services.linuxkit t ls
mode: "0755"
- path: usr/bin/upgrade_image
contents: |
#!/bin/sh
echo "Erasing image..."
[ -d /boot/imgs ] || mount /dev/sda1 /boot || exit 1
mv /var/lib/fic/outofsync/fickit-backend-squashfs.img /boot/imgs/fickit-backend-squashfs.img || \
exit 1
if [ $(sha3sum /var/lib/fic/outofsync/fickit-metadata.iso | cut -d " " -f 1) != $(sha3sum /boot/imgs/fickit-metadata.iso | cut -d " " -f 1) ]
then
ISO=$(mktemp -d)
mount /var/lib/fic/outofsync/fickit-metadata.iso "${ISO}"
NEW_KEY=$(sed -rn 's/.*"content": "([^"]+)"$/\1/p' "${ISO}/user-data" | head -n 1)
OLD_KEY=$(cat /run/config/dm-crypt/key)
[ "${NEW_KEY}" != "${OLD_KEY}" ] && {
read -p "DM-CRYPT key changed in metadata, are you sure you want to erase it? (y/N) " V
[ "$V" != "y" ] && [ "$V" != "Y" ] && exit 1;
};
cp /boot/imgs/fickit-metadata.iso /boot/imgs/fickit-metadata.iso.bak || exit 1;
mv /var/lib/fic/outofsync/fickit-metadata.iso /boot/imgs/fickit-backend-squashfs.img || exit 1;
dd if=/boot/imgs/fickit-metadata.iso of="$2" || exit 1;
echo
echo "Metadata erased"
fi
echo
echo "Done! You can reboot now."
mode: "0755"
- path: usr/bin/iptables
source: configs/nsenter_iptables.sh
mode: "0755"
- path: usr/bin/mysql
source: configs/nsenter_mysql.sh
mode: "0755"
2024-03-24 11:28:55 +00:00
- path: usr/bin/mariadb
source: configs/nsenter_mysql.sh
mode: "0755"
- path: usr/bin/pnsenter
source: configs/nsenter_process.sh
mode: "0755"
- path: etc/mysql/conf.d/max-conn.cnf
contents: |
[mysqld]
max_connections = 99999
mode: "0444"
2019-01-17 07:46:51 +00:00
- path: etc/dhcp/dhcpd.conf
contents: |
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
2023-04-05 10:26:32 +00:00
option broadcast-address 192.168.3.255;
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.11 192.168.3.250;
2019-01-17 07:46:51 +00:00
}
mode: "0440"
2018-01-21 16:03:45 +00:00
- path: etc/iptables/rules.v6
contents: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
COMMIT
mode: "0440"
- path: etc/iptables/rules-admin.v4
contents: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
[0:0] -A INPUT -i lo -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate INVALID -j DROP
[0:0] -A INPUT -p icmp -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
2021-09-09 09:28:52 +00:00
[0:0] -A INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport ssh -j ACCEPT
2018-12-10 01:16:07 +00:00
[0:0] -A INPUT -p tcp -m conntrack --ctstate NEW -m tcp --dport 8082 -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A INPUT -i vethin-admin -s 172.17.0.0/24 -p tcp -m conntrack --ctstate NEW -j ACCEPT
[0:0] -A INPUT -j LOG
[0:0] -A FORWARD -j LOG
[0:0] -A OUTPUT -o lo -j ACCEPT
[0:0] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A OUTPUT -p icmp -j ACCEPT
[0:0] -A OUTPUT -o eth1 -d 10.0.0.0/24 -p tcp -m conntrack --ctstate NEW -m tcp --dport 443 -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A OUTPUT -o vethin-admin -d 172.17.0.0/24 -p tcp -m conntrack --ctstate NEW -j ACCEPT
[0:0] -A OUTPUT -j LOG
[0:0] -A OUTPUT -j REJECT
COMMIT
mode: "0440"
- path: etc/iptables/rules-synchro.v4
contents: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
[0:0] -A INPUT -i lo -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate INVALID -j DROP
[0:0] -A INPUT -p icmp --icmp-type 8 -j ACCEPT
[0:0] -A INPUT -p icmp --icmp-type 0 -j ACCEPT
[0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[0:0] -A INPUT -j LOG
[0:0] -A FORWARD -j LOG
[0:0] -A OUTPUT -o lo -j ACCEPT
[0:0] -A OUTPUT -p icmp --icmp-type 0 -j ACCEPT
[0:0] -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
[0:0] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
2022-06-04 16:09:33 +00:00
[0:0] -A OUTPUT -o eth2 -d 10.10.10.2 -p tcp -m conntrack --ctstate NEW -m tcp --dport ssh -j ACCEPT
2018-01-21 16:03:45 +00:00
[0:0] -A OUTPUT -j LOG
[0:0] -A OUTPUT -j REJECT
COMMIT
mode: "0440"
trust:
org:
- linuxkit
- library