diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile index 4374db2..2a4bf7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:vivid MAINTAINER uggla@free.fr +LABEL PAServer +LABEL version="1.0" description="PAServer in docker. Port used 20545" EXPOSE 20545 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && \ @@ -14,9 +16,11 @@ RUN useradd -k /etc/skel -m pa COPY auth_papatcher.sh /home/pa/auth_papatcher.sh COPY NodePAMaster_conf.json /home/pa/NodePAMaster_conf.json COPY update_conf_file.sh /home/pa/update_conf_file.sh +COPY runServer.sh /home/pa/runServer.sh COPY *.sed /home/pa/ RUN chown pa:pa /home/pa/auth_papatcher.sh && \ chown pa:pa /home/pa/update_conf_file.sh && \ +chown pa:pa /home/pa/runServer.sh && \ chown pa:pa /home/pa/NodePAMaster_conf.json && \ chown pa:pa /home/pa/*.sed USER pa @@ -27,5 +31,9 @@ wget https://dl.dropboxusercontent.com/u/28565393/Planetary%20Annihilation/colou RUN chmod +x /home/pa/auth_papatcher.sh && \ chmod +x /home/pa/papatcher.go && \ unzip /home/pa/NodePAMaster.zip && \ -/home/pa/auth_papatcher.sh && \ -cp color_table.js ./.local/Uber\ Entertainment/Planetary\ Annihilation/stable/media/server-script/lobby/color_table.js +/home/pa/auth_papatcher.sh +RUN cp color_table.js ./.local/Uber\ Entertainment/Planetary\ Annihilation/stable/media/server-script/lobby/color_table.js && \ +chmod +x /home/pa/update_conf_file.sh && \ +/home/pa/update_conf_file.sh +RUN cp /home/pa/NodePAMaster_conf.json /home/pa/NodePAMaster/src/conf.json +ENTRYPOINT ["node.js", "./NodePAMaster/src/control.js"] diff --git a/NodePAMaster_conf.json b/NodePAMaster_conf.json index 600ddd0..888488f 100644 --- a/NodePAMaster_conf.json +++ b/NodePAMaster_conf.json @@ -1,7 +1,7 @@ { - "server": "./.local/Uber\ Entertainment/Planetary\ Annihilation/stable/server", - "serverversion": "./.local/Uber\ Entertainment/Planetary\ Annihilation/stable/version.txt", - "serverparams": ["--headless", "--game-mode", "Config", "--allow-lan","--server-name", "DedicatedServerByPAStats"], + "server": "./.local/Uber Entertainment/Planetary Annihilation/stable/server", + "serverversion": "./.local/Uber Entertainment/Planetary Annihilation/stable/version.txt", + "serverparams": ["--headless", "--game-mode", "Config", "--allow-lan","--server-name", "DedicatedPAServers"], "pastats": "176.31.115.99", "pastatsport": 80, "listonpastats": true, diff --git a/TODO b/TODO new file mode 100644 index 0000000..38892df --- /dev/null +++ b/TODO @@ -0,0 +1,6 @@ +TODO List : + +- Remove auth_papatcher.sh from image +- Request credentials and ip at build startup +- Request also region and server name +- Request listen on pastat diff --git a/auth_papatcher.sh b/auth_papatcher.sh deleted file mode 100644 index 537daa3..0000000 --- a/auth_papatcher.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Provide credentials to papatcher -# Enter your pa credentials below -PA_USER="pauser" -PA_PASSWORD="papassword" - -(echo "$PA_USER"; sleep 1s; echo $PA_PASSWORD) | go run papatcher.go - -echo "Do not care of previous error message !" -exit 0 diff --git a/runServer.sh b/runServer.sh new file mode 100644 index 0000000..e87a1e1 --- /dev/null +++ b/runServer.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Run PA Server + +nodejs ./NodePAMaster/src/control.js