feat: got wings configured

This commit is contained in:
silver 2024-01-24 22:47:46 +00:00
parent beffe4d39c
commit caa36e9fba
4 changed files with 149 additions and 0 deletions

View file

@ -83,10 +83,21 @@ packages:
update: true update: true
cleanup: true cleanup: true
sets: sets:
# dependencies for otehr stuff
- packages: - packages:
- openssh-client - openssh-client
- openssh-server - openssh-server
- sudo - sudo
- gnupg
- ca-certificates
action: install
# useful programs
- packages:
- nano
- tree
- curl
- ncdu
action: install action: install
# for the sshd/login # for the sshd/login

118
configs/games_wing.yaml Normal file
View file

@ -0,0 +1,118 @@
image:
name: debian-disco-x86_64
distribution: debian
release: bookworm
description: |-
Debian {{ image.release }}
architecture: amd64
source:
downloader: rootfs-http
url: file://SKYNET_ROOT_DIR/images/base_trainee/rootfs.tar.xz
targets:
lxc:
create_message: |-
You just created an {{ image.description }} container.
To enable SSH, run: apt install openssh-server
No default root or user password are set by LXC.
config:
- type: all
before: 5
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/debian.common.conf
- type: user
before: 5
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/debian.userns.conf
- type: all
after: 4
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/common.conf
- type: user
after: 4
content: |-
lxc.include = LXC_TEMPLATE_CONFIG/userns.conf
- type: all
content: |-
lxc.arch = {{ image.architecture_personality }}
files:
- path: /skynet/wings.service
generator: copy
source: ./files/wings.service
packages:
manager: apt
update: true
cleanup: true
repositories:
- name: docker.list
url: |-
deb [arch={{ image.architecture }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ image.release }} stable
sets:
- packages:
- docker.io
- docker-doc
- docker-compose
- podman-docker
- containerd
- runc
action: remove
- packages:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
action: install
actions:
# this runs before packages are installed.
- trigger: post-unpack
action: |-
#!/bin/sh
set -eux
# for dns
cp /etc/resolv.conf /etc/resolv.conf.bak
echo -e "\nnameserver 9.9.9.9" >> /etc/resolv.conf
# get and set teh key for docker
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
# reset dns
cp /etc/resolv.conf.bak /etc/resolv.conf
- trigger: post-files
action: |-
#!/bin/sh
set -eux
# for dns
cp /etc/resolv.conf /etc/resolv.conf.bak
echo -e "\nnameserver 9.9.9.9" >> /etc/resolv.conf
# install the wings
mkdir -p /etc/pterodactyl
curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")"
chmod u+x /usr/local/bin/wings
# setup config file
cp /skynet/wings.service /etc/systemd/system
# make sure they run on boot
systemctl enable docker
systemctl enable wings
# reset dns
cp /etc/resolv.conf.bak /etc/resolv.conf

19
files/wings.service Normal file
View file

@ -0,0 +1,19 @@
[Unit]
Description=Pterodactyl Wings Daemon
After=docker.service
Requires=docker.service
PartOf=docker.service
[Service]
User=root
WorkingDirectory=/etc/pterodactyl
LimitNOFILE=4096
PIDFile=/var/run/wings/daemon.pid
ExecStart=/usr/local/bin/wings
Restart=on-failure
StartLimitInterval=180
StartLimitBurst=30
RestartSec=5s
[Install]
WantedBy=multi-user.target

1
run.sh
View file

@ -49,6 +49,7 @@ function main(){
build base build base
build base_trainee build base_trainee
build games_wing
cleanup cleanup
} }