- Unix-based operating system (OS X or Linux)
Docker
should be installedwget
should be installed
CTFight/web is installed by running one of the following command. Paste it to your terminal and follow installation instructions.
sh -c "$(wget https://github.com/ctfight/web/raw/master/install/remote_install.sh -O -)"
Site will run at port 4000
Admin client at port 4001
(MongoDB at standart 27017 port)
- MongoDB inside
mongo_ctfight
container - NodeJS express-based application inside
node_ctfight
container - Admin database client (mongo-express) inside
admin_ctfight
container
Use this type of installation for development
- Install node.js (
npm
will install automatically) 1.1 Or install from repository:sudo apt-get install nodejs nodejs-legacy npm
- Install mongodb:
sudo apt-get install mongodb
- Start mongodb:
sudo /etc/init.d/mongodb start
- Install git:
sudo apt-get install git-core
- Clone repository
git clone https://github.com/ctfight/web.git ctfight-web
- Go to work folder
cd ctfight-web
- Run
npm install -g gulp coffee-script nodemon
- Run
npm install
- (Optional) Configure mongo-express if you need admin database client
- Run
gulp --production
- Copy config file: `cp node_modules/mongo-express/config.default.js node_mod$
- Configure:
nano node_modules/mongo-express/config.js
- Run
npm start
- Look your site on
https://<ip>:5000
(default port)
Use gulp
for compiling stylus, yaml and coffeescript (front-end).
Use gulp watch
for development. It compile files as soon as they change and it run server at http://localhost:3000
Use gulp --production
for compiling files for production
Use npm start
for start service at http://localhost:5000
(You must compile files before)
<container>
is one of mongo_ctfight
, node_ctfight
and admin_ctfight
Use docker start
to start your containers
docker start <container>
Similarly use docker stop
docker stop <container>
Get terminal of running container
docker exec -it <container> bash
Get list of running process
docker ps
For more information use Docker documentation
Add to /etc/apt/source.list:
deb http://linux.nsu.ru/debian jessie-backports main contrib non-free
deb-src http://linux.nsu.ru/debian jessie-backports main contrib non-free
Update cache:
apt-get update
Install:
apt-get install docker.io
Note: Use Docker official documentation if you want to install without Homebrew
- Homebrew should be installed
- VirtualBox should be installed
Install docker and boot2docker:
brew install docker boot2docker
Create virtual machine:
boot2docker init
Run boot2docker:
boot2docker up
Add boot2docker initialization to your shell config (It is often .bashrc)
echo 'eval "$(boot2docker shellinit)"' >> ~/.bashrc