Skip to content

Installation

Ilya Ageev edited this page Apr 18, 2018 · 3 revisions
  1. To make it easy we've based everything on docker. So in order to start working with codeisok you need to install docker first. Read here what steps you should perform to install it.

  2. Next step is cloning the repository. Choose appropriate folder on your server and clone codeisok.git repo into there:

uyga@greybox ~/dev  $ git clone https://github.com/badoo/codeisok
Cloning into 'codeisok'...
remote: Counting objects: 2231, done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 2231 (delta 11), reused 23 (delta 6), pack-reused 2173
Receiving objects: 100% (2231/2231), 2.72 MiB | 784.00 KiB/s, done.
Resolving deltas: 100% (1299/1299), done.
Checking connectivity... done.
uyga@greybox ~/dev  $ cd codeisok/
uyga@greybox ~/dev/codeisok (master) $
  1. All docker things are based on Dockerfile scenario file which is located in .setup directory inside repo (.setup/Dockerfile). Those who experienced enough to install all required things without docker may find there required steps to be performed as well as scripts to be launched (for instance .setup/local/init.sh).

  2. Change mysql root password in Dockerfile to be more secure. The password is in Dockerfile

ENV MYSQL_ROOT_PASSWORD root

Don't forget to change the password in .setup/local/init.sh script as it applies db schema updates from .setup/local/schema.sql file. Also to make tool working you'll need to specify new DB password in .config/gitphp.conf.php configuration file, see \GitPHP_Config::DB_PASSWORD section.

  1. Run docker build command in the repository root to make the image:
docker build -t codeisok .setup
  1. Run ./start.sh script in repository root to start your image.
uyga@greybox ~/dev/codeisok (master) $ ./start.sh
 * Starting MySQL database server mysqld                                                                                                                                                   No directory, logging in with HOME=/
                                                                                                                                                                                    [ OK ]
 * Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
 * Starting OpenBSD Secure Shell server sshd                                                                                                                                        [ OK ]
Warning: Using a password on the command line interface can be insecure.
 * Starting Mail Transport Agent (MTA) sendmail                                                                                                                                     [ OK ]
root@7b7cd848dcc9:/#
  1. All done! Now you can navigate to http://localhost/ url (or another one if you reconfigured configs manually) and start working with the tool.

NOTES

  • Everything related to the tool inside container is located in /local/ dir. Directory structure:
    • /local/codeisok/ - your repository root is reflected here.
    • /local/codeisok/.setup/storage/database/ - mysql database files.
    • /local/codeisok/.setup/storage/git/ - git home where keys are stored in .ssh folder to allow ssh access to repositories you manage. Authorisation and permissions management is fully based on /home/git/.ssh/authorized_keys rules with /home/git/ssh_serve.php forced command.
    • /local/codeisok/repositories/ - this is default location for all repositories you manage. You can change this in .setup/local/init.sh file. In this case do not forget to change \GitPHP_Config::PROJECT_ROOT => '/local/codeisok/repositories/', option in the tool config file .config/gitphp.conf.php
    • /local/logs/ - directory with error and access logs.
  • Docker image exposes two ports: 80 and 22. First one is for http connections, second one is for ssh work with repos trough /home/git/ssh_serve.php forced ssh command. Ports on you server for this can be changed in start.sh file according to docker run command syntax.
Clone this wiki locally