Skip to content

Instantly share code, notes, and snippets.

@hUwUtao
Last active July 24, 2024 16:42
Show Gist options
  • Save hUwUtao/896f925b51f0c50e100af70c671450d0 to your computer and use it in GitHub Desktop.
Save hUwUtao/896f925b51f0c50e100af70c671450d0 to your computer and use it in GitHub Desktop.
automatically deploy wings

Install

  1. sudo su
  2. install acme.sh as root
  3. open port 80 and acme.sh --issue --standalone -d <YOUR_DOMAIN>
echo "DOMAIN=<YOUR_DOMAIN>">.env
curl -LO https://gist.githubusercontent.com/hUwUtao/896f925b51f0c50e100af70c671450d0/raw/28e5e79cb9d1e49427addee286f986cc75a11c49/wings.sh
chmod +x wings.sh
./wings.sh

To update Wings

sudo su
./wings.sh
#!/bin/sudo /bin/bash
#
if [ ! -e /etc/docker ]; then
curl get.docker.com -L | bash
fi
if [ ! -e /etc/systemd/system/wings.service ]; then
echo "init systemd unit"
echo "[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" > /etc/systemd/system/wings.service
systemctl daemon-reload
fi
systemctl stop wings
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
systemctl enable --now wings
if [ -e /root/.env ]; then
source /root/.env
PTPATH=/etc/letsencrypt/live/$DOMAIN
mkdir -p $PTPATH
~/.acme.sh/acme.sh --install-cert -d $DOMAIN \
--cert-file $PTPATH/cert.pem \
--key-file $PTPATH/privkey.pem \
--fullchain-file $PTPATH/fullchain.pem \
--reloadcmd "sudo systemctl restart wings"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment