- 1. Necessary Commands before building the game
- 2. Building and Setting up PacMacro
- 3. Running PacMacro
- Links to Version 2
This game was built on Ubuntu 16.04 due to a dependency that exists on an old websockets library. This also potentially makes this code open to being taken advantage of as it is commonly used in botnet attacks such as one case being part of a brute-force password dictionary attack against a remote server. Because of this vulernability, it is strongly recommended to run this program behind a firewall and allow connections only from specific IPs, this can be done at a software level with ufw
or using DigitalOcean firewalls. To get your IP, you can go to Find-IP-Address.
Unless otherwise specified, all commands are run as root
Recommend to run
apt-get update
before anything else
Adapted from Compiling and Installing Jansson
apt-get install -y make gcc
wget http://www.digip.org/jansson/releases/jansson-2.11.tar.bz2
bunzip2 -c jansson-2.11.tar.bz2 | tar xf -
cd jansson-2.11
./configure
make
make check
make install
cd -
1.2.1. commands to install before installing libwebsockets
apt-get install -y zlib1g-dev libssl-dev automake libtool
1.2.2. install libwebsockets [instructions can also be found in README.install
in libwebsockets-1.22-chrome26-firefox18
folder]
Building and installing libwebsockets can become a pain in the ass real quick. So be patient and practice google-fu.
Follow instructions in the README.install file. The ./configure method is recommended over others
wget https://github.com/warmcat/libwebsockets/archive/v1.22-chrome26-firefox18.tar.gz
tar -xzf v1.22-chrome26-firefox18.tar.gz
cd libwebsockets-1.22-chrome26-firefox18/
./autogen.sh
./configure
make
make install
cd -
1.2.3. To test if it was succesful, run libwebsockets-test-server
. If error arise, run /sbin/ldconfig -v
to get rid of them
apt-get install -y git g++ cmake
Adapted from this StackOverFlow Answer
useradd -m -d /home/pacmacro -s /bin/bash pacmacro
mkdir /home/pacmacro/.ssh
touch /home/pacmacro/.ssh/authorized_keys
chown -R pacmacro:pacmacro /home/pacmacro
chmod 700 /home/pacmacro/.ssh
chmod 0600 /home/pacmacro/.ssh/authorized_keys
echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
#place any pertinent public keys inside of /home/pacmacro/.ssh/authorized_keys
git clone https://github.com/CSSS/PacMacro.git
cd PacMacro
mkdir build
cd build
cmake ..
make
apt-get update
2.3.1 Method 1
Adapted from How To Install Node.js on Ubuntu 16.04: How To Install Using NVM
apt-get install -y build-essential libssl-dev
su - pacmacro
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash -
source .profile
nvm install 10.9.0
npm install -g pm2
exit
2.3.2 Method 2
Acquired from Installing Node.js via package manager on Debian and Ubuntu based Linux distributions
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get install -y nodejs
npm install -g pm2
Adapted from Allow PM2 to bind applications on ports 80/443 without root
echo 'alias pm2="authbind --deep pm2"' >> /home/pacmacro/.bashrc
apt-get install authbind
touch /etc/authbind/byport/80
chown pacmacro /etc/authbind/byport/80
chmod 755 /etc/authbind/byport/80
- Choose a password needed to access the control panel and run:
export PASSWORD='password'
Where password is your chosen password. - By default the server will use
port: 80
. If you want to use another port, do so by running the following:export PORT=port
Whereport
is your chosen port.
- Running the Server
Its recommended that you read the basics about pm2. Home page is enough for basic usage.
pm2 start server.js
- Running PacMacro
./pacmacro &