Feat: lab0 done
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM docker.io/library/ubuntu:24.04
|
||||
|
||||
ENV container=docker \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY ./root /
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
sudo systemd findutils \
|
||||
iproute2 iputils-ping wireguard wireguard-tools \
|
||||
openssh-server #&& \
|
||||
# apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
# as the spec says
|
||||
|
||||
RUN find /etc/systemd/system /lib/systemd/system \
|
||||
-path '*.wants/*' \
|
||||
-not -name '*journald*' \
|
||||
-not -name '*systemd-tmpfiles*' \
|
||||
-not -name '*systemd-user-sessions*' \
|
||||
-print0 | xargs -0 rm -vf
|
||||
|
||||
RUN systemctl enable \
|
||||
wg-quick@wg0.service \
|
||||
ssh.socket
|
||||
|
||||
RUN useradd -m judge -s /bin/bash
|
||||
|
||||
VOLUME ["/sys/fs/cgroup"]
|
||||
ENTRYPOINT ["/lib/systemd/systemd"]
|
||||
CMD []
|
||||
8
docker-compose.yaml
Normal file
8
docker-compose.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
services:
|
||||
run:
|
||||
build:
|
||||
context: .
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
1
root/.gitignore
vendored
Normal file
1
root/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
etc/wireguard/wg0.conf
|
||||
11
root/etc/apt/sources.list.d/ubuntu.sources
Normal file
11
root/etc/apt/sources.list.d/ubuntu.sources
Normal file
@@ -0,0 +1,11 @@
|
||||
Types: deb
|
||||
URIs: http://ubuntu.cs.nycu.edu.tw/ubuntu/
|
||||
Suites: noble noble-updates noble-backports
|
||||
Components: main universe restricted multiverse
|
||||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||
|
||||
Types: deb
|
||||
URIs: http://ubuntu.cs.nycu.edu.tw/ubuntu/
|
||||
Suites: noble-security
|
||||
Components: main universe restricted multiverse
|
||||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||
8
root/etc/wireguard/wg0.conf.example
Normal file
8
root/etc/wireguard/wg0.conf.example
Normal file
@@ -0,0 +1,8 @@
|
||||
[Interface]
|
||||
Address = 192.168.0.17/28
|
||||
PrivateKey =
|
||||
[Peer]
|
||||
PublicKey =
|
||||
PresharedKey =
|
||||
AllowedIPs = 192.168.0.0/16
|
||||
Endpoint = 140.113.17.2:5000
|
||||
1
root/home/judge/.ssh/authorized_keys
Normal file
1
root/home/judge/.ssh/authorized_keys
Normal file
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILti+rM2UdvYTUgBKihp0b/9o2W+KvJVmA2ex0/u8pCV judge@sa-2025
|
||||
Reference in New Issue
Block a user