From e9b9f5e97716f55c64c6c723762d74e26c3e2305 Mon Sep 17 00:00:00 2001 From: liberodark Date: Thu, 3 Jan 2019 10:12:38 +0100 Subject: [PATCH] add wings and service --- conf/wings.service | 16 ++++++++++++++++ scripts/install | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 conf/wings.service diff --git a/conf/wings.service b/conf/wings.service new file mode 100644 index 0000000..f5b11aa --- /dev/null +++ b/conf/wings.service @@ -0,0 +1,16 @@ +[Unit] +Description=Pterodactyl Wings Daemon +After=docker.service + +[Service] +User=root +#Group=some_group +WorkingDirectory=/srv/daemon +LimitNOFILE=4096 +PIDFile=/var/run/wings/daemon.pid +ExecStart=/usr/bin/node /srv/daemon/src/index.js +Restart=on-failure +StartLimitInterval=600 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/scripts/install b/scripts/install index 349de2a..9e98929 100644 --- a/scripts/install +++ b/scripts/install @@ -176,12 +176,33 @@ php artisan p:environment:setup --author=$email --url=https://$domain --timezone php artisan migrate --seed --force popd +#============================================== +# Install wings +#============================================== + +ynh_package_install apt-transport-https ca-certificates curl gnupg2 software-properties-common zip unzip tar make gcc g++ python curl gnupg +curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - +add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" +ynh_package_update +ynh_package_install docker-ce +systemctl enable docker +systemctl start docker +mkdir -p /srv/daemon /srv/daemon-data +pushd /srv/daemon +curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - +ynh_package_install nodejs make gcc g++ +curl -L https://github.com/pterodactyl/daemon/releases/download/v0.6.8/daemon.tar.gz | tar --strip-components=1 -xzv +npm install --only=production +sudo npm start +popd + #================================================= # SETUP SYSTEMD #================================================= ynh_add_systemd_config systemctl enable $app.service +systemctl enable --now wings #================================================= # ADVERTISE SERVICE IN ADMIN PANEL