kenshin samourai
5 years ago
committed by
GitHub
38 changed files with 853 additions and 216 deletions
@ -0,0 +1,57 @@ |
|||
# Installation of Dojo on Synology |
|||
|
|||
This will install Dojo on your Synology hardware. |
|||
|
|||
|
|||
|
|||
## Table of Content ## |
|||
- [Requirements](#requirements) |
|||
- [Install procedure](#install) |
|||
|
|||
|
|||
|
|||
<a name="requirements"/> |
|||
|
|||
## Requirements ## |
|||
|
|||
* Synology hardware connected 24/7 to internet |
|||
* Disk: 500GB (minimal) / 1TB (recommended) |
|||
* RAM: 4GB (minimal) |
|||
|
|||
<a name="install"/> |
|||
|
|||
## Install procedure |
|||
|
|||
- Connect to Synology web ui as administrator |
|||
- Open `Package center`, search for `Docker`, click `Install`. |
|||
![](./static/synology_docker-package.png) |
|||
- Open SSH terminal to your Synology |
|||
- Follow `first-time install procedure` in [DOCKER_setup.md](DOCKER_setup.md#install), but skip the first two steps: |
|||
``` |
|||
* Install Docker and Docker Compose on the host machine and check that your installation is working. |
|||
* Install Tor Browser on the host machine. |
|||
``` |
|||
You can use `/volume1/dojo` as `<dojo_dir>`. |
|||
- Install will complete with the following warnings, which you can safely ignore: |
|||
``` |
|||
Attaching to nginx, nodejs, bitcoind, tor, db |
|||
nginx | WARNING: no logs are available with the 'db' log driver |
|||
nodejs | WARNING: no logs are available with the 'db' log driver |
|||
bitcoind | WARNING: no logs are available with the 'db' log driver |
|||
tor | WARNING: no logs are available with the 'db' log driver |
|||
db | WARNING: no logs are available with the 'db' log driver |
|||
``` |
|||
![](./static/synology_install_complete.png) |
|||
|
|||
## Dojo status & logs |
|||
- Connect to Synology web ui as administrator |
|||
- Open `Docker`, then `Container`. |
|||
![](./static/synology_containers.png) |
|||
|
|||
- You will see the following containers running: |
|||
* bitcoind |
|||
* db |
|||
* nginx |
|||
* nodejs |
|||
* tor |
|||
- Select a container (ie `bitcoind`), click `Detail`, `Log` to see container's logs in real time |
After Width: | Height: | Size: 669 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 143 KiB |
@ -0,0 +1,16 @@ |
|||
######################################### |
|||
# CONFIGURATION OF EXPLORER CONTAINER |
|||
######################################### |
|||
|
|||
|
|||
# Install and run a block explorer inside Dojo (recommended) |
|||
# Value: on | off |
|||
EXPLORER_INSTALL=on |
|||
|
|||
|
|||
# Password required for accessing the block explorer |
|||
# (login can be anything) |
|||
# Keep this password secret! |
|||
# Provide a value with a high entropy! |
|||
# Type: alphanumeric |
|||
EXPLORER_KEY=myExplorerPassword |
@ -0,0 +1,33 @@ |
|||
FROM node:8.12.0-stretch |
|||
|
|||
ENV LOGS_DIR /data/logs |
|||
ENV APP_DIR /home/node/app |
|||
|
|||
ENV EXPLORER_URL https://github.com/janoside/btc-rpc-explorer/archive |
|||
ENV EXPLORER_VERSION 1.1.5 |
|||
|
|||
|
|||
# Create logs and apps directory |
|||
RUN mkdir -p "$LOGS_DIR" && \ |
|||
chown -R node:node "$LOGS_DIR" && \ |
|||
mkdir "$APP_DIR" |
|||
|
|||
# Download the source code and install it |
|||
RUN set -ex && \ |
|||
wget -qO explorer.tar.gz "$EXPLORER_URL/v$EXPLORER_VERSION.tar.gz" && \ |
|||
tar -xzvf explorer.tar.gz -C "$APP_DIR/" --strip-components 1 && \ |
|||
rm explorer.tar.gz && \ |
|||
cd "$APP_DIR" && \ |
|||
npm install --only=prod && \ |
|||
chown -R node:node "$APP_DIR" |
|||
|
|||
# Copy restart script |
|||
COPY ./restart.sh "$APP_DIR/restart.sh" |
|||
|
|||
RUN chown node:node "$APP_DIR/restart.sh" && \ |
|||
chmod u+x "$APP_DIR/restart.sh" && \ |
|||
chmod g+x "$APP_DIR/restart.sh" |
|||
|
|||
EXPOSE 3002 |
|||
|
|||
USER node |
@ -0,0 +1,21 @@ |
|||
#!/bin/bash |
|||
|
|||
cd /home/node/app |
|||
|
|||
explorer_options=( |
|||
--port 3002 |
|||
--host 172.28.1.7 |
|||
--basic-auth-password "$EXPLORER_KEY" |
|||
--coin BTC |
|||
--bitcoind-host "$BITCOIND_IP" |
|||
--bitcoind-port "$BITCOIND_RPC_PORT" |
|||
--bitcoind-user "$BITCOIND_RPC_USER" |
|||
--bitcoind-pass "$BITCOIND_RPC_PASSWORD" |
|||
--no-rates |
|||
--privacy-mode |
|||
) |
|||
|
|||
# Blacklist all functions provided by the RPC API |
|||
explorer_options+=(--rpc-blacklist "addnode,analyzepsbt,clearbanned,combinepsbt,combinerawtransaction,converttopsbt,createmultisig,createpsbt,createrawtransaction,decodepsbt,decoderawtransaction,decodescript,deriveaddresses,disconnectnode,echo,echojson,estimaterawfee,estimatesmartfee,finalizepsbt,generatetoaddress,generatetodescriptor,getaddednodeinfo,getbestblockhash,getblock,getblockchaininfo,getblockcount,getblockfilter,getblockhash,getblockheader,getblockstats,getblocktemplate,getchaintips,getchaintxstats,getconnectioncount,getdescriptorinfo,getdifficulty,getmemoryinfo,getmempoolancestors,getmempooldescendants,getmempoolentry,getmempoolinfo,getmininginfo,getnettotals,getnetworkhashps,getnetworkinfo,getnodeaddresses,getpeerinfo,getrawmempool,getrawtransaction,getrpcinfo,gettxout,gettxoutproof,gettxoutsetinfo,help,invalidateblock,joinpsbts,listbanned,logging,ping,preciousblock,prioritisetransaction,pruneblockchain,reconsiderblock,savemempool,scantxoutset,sendrawtransaction,setban,setmocktime,setnetworkactive,signmessagewithprivkey,signrawtransactionwithkey,stop,submitblock,submitheader,syncwithvalidationinterfacequeue,testmempoolaccept,uptime,utxoupdatepsbt,validateaddress,verifychain,verifymessage,verifytxoutproof,waitforblock,waitforblockheight,waitfornewblock") |
|||
|
|||
node ./bin/cli.js "${explorer_options[@]}" > /data/logs/explorer-error.log 2> /data/logs/explorer-output.log |
@ -1,18 +1,18 @@ |
|||
FROM nginx:1.15.10-alpine |
|||
FROM nginx:1.15.10-alpine |
|||
|
|||
# Create data directory |
|||
ENV LOGS_DIR /data/logs |
|||
ENV LOGS_DIR /data/logs |
|||
|
|||
RUN mkdir -p "$LOGS_DIR" && \ |
|||
chown -R nginx:nginx "$LOGS_DIR" |
|||
RUN mkdir -p "$LOGS_DIR" && \ |
|||
chown -R nginx:nginx "$LOGS_DIR" |
|||
|
|||
# Copy configuration files |
|||
COPY ./nginx.conf /etc/nginx/nginx.conf |
|||
|
|||
COPY ./dojo.conf /etc/nginx/sites-enabled/dojo.conf |
|||
COPY ./nginx.conf /etc/nginx/nginx.conf |
|||
COPY ./dojo.conf /etc/nginx/sites-enabled/dojo.conf |
|||
COPY ./dojo-explorer.conf /etc/nginx/sites-enabled/dojo-explorer.conf |
|||
|
|||
# Copy wait-for script |
|||
COPY ./wait-for /wait-for |
|||
COPY ./wait-for /wait-for |
|||
|
|||
RUN chmod u+x /wait-for && \ |
|||
chmod g+x /wait-for |
|||
RUN chmod u+x /wait-for && \ |
|||
chmod g+x /wait-for |
@ -0,0 +1,15 @@ |
|||
server { |
|||
listen 9080; |
|||
server_name _; |
|||
resolver 127.0.0.11 valid=30s; |
|||
|
|||
location / { |
|||
set $upstream http://explorer:3002; |
|||
proxy_pass $upstream; |
|||
proxy_http_version 1.1; |
|||
proxy_set_header Upgrade $http_upgrade; |
|||
proxy_set_header Connection 'upgrade'; |
|||
proxy_set_header Host $host; |
|||
proxy_cache_bypass $http_upgrade; |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
version: "3.2" |
|||
|
|||
services: |
|||
explorer: |
|||
image: "samouraiwallet/dojo-explorer:${DOJO_EXPLORER_VERSION_TAG}" |
|||
container_name: explorer |
|||
build: |
|||
context: ./explorer |
|||
env_file: |
|||
- ./.env |
|||
- ./conf/docker-bitcoind.conf |
|||
- ./conf/docker-explorer.conf |
|||
restart: always |
|||
command: "/home/node/app/restart.sh" |
|||
expose: |
|||
- "3002" |
|||
volumes: |
|||
- data-explorer:/data/logs |
|||
networks: |
|||
dojonet: |
|||
ipv4_address: 172.28.1.7 |
|||
|
|||
node: |
|||
depends_on: |
|||
- explorer |
|||
|
|||
volumes: |
|||
data-explorer: |
Loading…
Reference in new issue