/getsky.org

getsky.org

Primary LanguageJavaScript

BuySKY

Build Status

An online Skycoin advert platform, part of the getsky.org

Installation

Manual installation

Required software

  1. Nginx
  2. Go
  3. MySql

DB configuration

  1. Create database getskytrade
  2. Follow the instructions to apply migrations.

Backend configuration

  1. Run backend using following command
$ go run ./trade.go -binding=127.0.0.1:8081 -mysql=localhost:3306 -recaptchaSecret=RECAPTCHA_SECRET -mailUsername=MAIL_USERNAME -mailPassword=MAIL_PASSWORD -mailHost=MAIL_HOST

Client app configuration

  1. Copy content of the repo_root/.nginx/nginx.conf file to the /etc/nginx/nginx.conf
  2. Create /etc/nginx/vhost.d folder
  3. Create proxy.conf in the /etc/nginx/vhost.d folder
  4. Copy content of the repo_root/.nginx/vhost.d/proxy.conf file to the /etc/nginx/vhost.d/proxy.conf
  5. Find the line proxy_pass http://backend:8081 and change it to proxy_pass http://127.0.0.1:8081
  6. Run systemctl restart nginx
  7. Copy built client to the /usr/share/nginx/html folder (Instructions on how to build the client app)

Deployment via docker

Required software

  1. Docker
  2. Nodejs
  3. Yarn

Deployment

To set up the system run following commands:

$ make run-docker
$ docker exec backend sh -c "cd /usr/local/go/src/github.com/skycoin/getsky.org/db/ && bash ./migrate.sh"

SSL configuration

  1. Follow these instructions to install certbot;
  2. Stop docker containers using following command docker kill $(docker ps -q) (optional, only if docker-compose is used)
  3. Run certbot: sudo certbot certonly --webroot -w repo_root/.nginx/certs -d domain.name --register-unsafely-without-email -n --agree-tos
  4. Copy issued certificates to the repo_root/.nginx/certs directory (fullchain.pem and privkey.pem)
  5. Start docker containers: docker start $(docker ps -aq)

Please note: ./.nginx/vhost.d/proxy.test.conf and ./.nginx/vhost.d/cert.test.conf Nginx configuration files must be used instead of proxy.conf for manual installation to support SSL. Also, the path to the certificates issued by certbot must be specified in the proxy.test.conf configuration file.