Skip to content

Latest commit

 

History

History
234 lines (138 loc) · 3.21 KB

06.install.md

File metadata and controls

234 lines (138 loc) · 3.21 KB

get the source

$ git clone git@github.com:stellar-fox/shambhala.git
Cloning into 'shambhala'...

install dependencies

$ cd shambhala
$ npm i

configure http server (nginx example)

enable ssl

  • self-signed certificate generation example:

    $ openssl req \
        -newkey rsa:2048 \
        -new -nodes -x509 -days 365 \
        -keyout ssl.key -out ssl.cert
  • nginx.conf:

    http {
    
        # ...
    
        server {
    
            listen               443 ssl;
    
            # ...
    
            ssl                  on;
            ssl_certificate      /path/to/ssl.cert;
            ssl_certificate_key  /path/to/ssl.key;
    
            # ...
    
        }
    
    }
    

enable reverse proxying

http {

    # ...

    server {

        # ...

        location /shambhala/ {
            proxy_pass http://127.0.0.1:8080/shambhala/;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-NginX-Proxy true;
            proxy_ssl_session_reuse off;
            proxy_set_header Host $http_host;
            proxy_redirect off;
        }

        location /shambhala/api/ {
            proxy_pass http://127.0.0.1:8081/api/;

            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-NginX-Proxy true;
            proxy_ssl_session_reuse off;
            proxy_set_header Host $http_host;
            proxy_redirect off;
        }

    }

}

configure PostgreSQL

In all snippets below replace user with some value of your choice.

create user

$ sudo -i
# su - postgres
$ createuser user -P
$ ^D
# ^D
$

create database

$ sudo -i
# su - postgres
$ dropdb shambhala
$ createdb shambhala --owner user
$ ^D
# ^D
$

create tables


configure shambhala

client

$ cd src/config
$ cp client.example.json client.json
$ vi client.json

Edit domain for live deployment or non-localhost-only development.

host

$ cd src/config
$ cp host.example.json host.json
$ vi host.json

Here, instead of "official friendbot", you can configure to use protostar.

server

$ cd src/config
$ cp server.example.json server.json
$ vi server.json

Put an appropriate values to user, pass, host, port and db keys.


build library for external use with fusion or cygnus

$ npm run build:lib

run in development mode

client and host

$ npm start

rest api server

$ npm run devApiServer

production build

$ npm run build:all
  • dist.client - shambhala frontend
  • dist.server - shambhala backend
  • dist.lib - shambhala client library
  • dist.host - shambhala testing host application