Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added instructions for one-domain-mode on manual deployment #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions deployment/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ sudo apt install libsecp256k1-dev

> Or the equivalent for your os package manager

Some systems may require creating a symlink between your libsecp256k1 installation path and the location that Bitcart looks for it in. You can discover that location from the failure logs.

More info on libsecp256k1 in [electrum docs](https://github.com/spesmilo/electrum-docs/blob/master/libsecp256k1-linux.rst) or [bitcoin core docs](https://github.com/bitcoin-core/secp256k1#build-steps)

### 2) Install Python 3
Expand Down Expand Up @@ -114,6 +116,10 @@ BITCART_CRYPTOS=btc,ltc
EOF
```

Other coins may require additional environmental variables in `conf/.env`, like `XMR_NETWORK` and `XMR_SERVER`.

Note that if you're running redis on a custom port, you need to set that custom port in the configuration file as well, like this: `REDIS_HOST=redis://localhost:1234`

Apply database migrations:

```bash
Expand Down Expand Up @@ -288,6 +294,64 @@ Continue with: [Your first invoice](../your-first-invoice/)

If you want the procaesses: bitcart api, daemons, worker and frontend (bitcart admin and bitcart store) to be managed with automatic startup, error reporting etc then consider using [supervisord](http://supervisord.org/) or [systemd](https://systemd.io/) to manage the processes.

Here's an example of a systemd service:

```
[Unit]
Description=Bitcart Core and Services
After=network.target
After=redis.service

[Service]
Type=simple
User=bitcart
WorkingDirectory=/path/to/bitcart
EnvironmentFile=/path/to/bitcart/conf/.env
Environment=XDG_CACHE_HOME=/home/bitcart/.cache
Environment=NPM_CONFIG_CACHE=/home/bitcart/.npm
ExecStart=/bin/bash -c 'python3 daemons/btc.py >> /var/log/bitcart/bitcart.log 2>&1 & \
python3 daemons/xmr.py >> /var/log/bitcart/bitcart.log 2>&1 & \
gunicorn -c gunicorn.conf.py main:app >> /var/log/bitcart/bitcart.log 2>&1 & \
python3 worker.py >> /var/log/bitcart/bitcart.log 2>&1 & \
cd bitcart-admin && yarn start >> /var/log/bitcart/bitcart.log 2>&1 & \
cd bitcart-store && NUXT_PORT=4141 yarn start >> /var/log/bitcart/bitcart.log 2>&1'
Restart=always

[Install]
WantedBy=multi-user.target
```

Make sure to also create a user called bitcart (or update the `User` attribute to whatever user you're having bitcart run as). Then run `chown bitcart:bitcart /path/to/bitcart -R` to ensure the user owns all the files it needs to have permission over.

## (Optional) One-domain-mode

Note that the [one-domain-mode](one-domain-mode.md) instructions only work with a Docker installation. In order to achieve the same effect on a manual deployment, you need to add the following environmental variables to your `conf/.env` file:

```
BITCART_HOST=sub.domain.com
BITCART_ADMIN_HOST=sub.domain.com/admin
BITCART_ADMIN_ROOTPATH=/admin
BITCART_BACKEND_ROOTPATH=/api
BITCART_ADMIN_API_URL=https://sub.domain.com/api
BITCART_ADMIN_URL=https://sub.doain.com/admin
BITCART_STORE_HOST=sub.domain.com
BITCART_STORE_URL=https://sub.domain.com
```

And update your web server to handle the routes correctly, like this:

```
location /admin {
proxy_pass http://localhost:4000;
}
location /api {
proxy_pass http://localhost:8000;
}
location / {
proxy_pass http://localhost:3000;
}
```

## Upgrading manual deployment

Note: it is recommended to use docker deployment for easy upgrades.
Expand Down
3 changes: 3 additions & 0 deletions guides/one-domain-mode.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# One domain mode

### Note that the following instructions only work with a Docker installation. In order to achieve the same effect on a [manual deployment](manual.md#optional-one-domain-mode), click the link and follow the instructions.
---

One domain mode is an opt-out feature, enabled by default, which simplifies the configuration of domains.One domain mode allows running all Bitcart services under one domain.

If you are deploying a new instance from the Bitcart Configurator, it is the default mode enabled.
Expand Down