Skip to content

Commit

Permalink
Redo configuration logic (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankchhabra authored Aug 6, 2020
1 parent 1817423 commit ad2bec7
Show file tree
Hide file tree
Showing 16 changed files with 282 additions and 170 deletions.
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@
.ssh
.viminfo

# Files created by containers that we shouldn't accidently commit
# Files and data directories created by services
# that we shouldn't accidently commit

*.dat
*.log
*.lock
*.cookie
*.pid
*.env
bitcoin/*
lnd/*
tor/*
db/*

# Commit these empty directories

!lnd/.gitkeep
!tor/data/.gitkeep
!tor/run/.gitkeep
!db/.gitkeep

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ If you're looking to run Umbrel on:

Ensure that your account is [correctly permissioned to use docker](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).

### Step 1. Run this from your home directory (if installing on dedicated hardware)
### Step 1. Download

> It will clone this repo while preserving home directory's existing structure.
> Run this in an empty directory where you want to install Umbrel
```bash
curl -L https://github.com/getumbrel/umbrel/archive/v0.1.6-beta.3.tar.gz | tar -xz --strip-components=1
Expand All @@ -83,17 +83,17 @@ curl -L https://github.com/getumbrel/umbrel/archive/v0.1.6-beta.3.tar.gz | tar -
### Step 2. Configure

```bash
# To configure Umbrel for mainnet, run:
# To use Umbrel on mainnet, run:
./scripts/configure

# For testnet, run:
TESTNET=1 ./scripts/configure
NETWORK=testnet ./scripts/configure

# For regtest, run:
REGTEST=1 ./scripts/configure
NETWORK=regtest ./scripts/configure
```

### Step 3. Run Umbrel
### Step 3. Run

```bash
sudo ./scripts/start
Expand Down
File renamed without changes.
14 changes: 3 additions & 11 deletions contrib/partitioner/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,9 @@ def main():
os.system('/bin/sed -i "s/#txindex=1/txindex=1/g;" ' + str(homedirpath) + '/bitcoin/bitcoin.conf')

'''
Setup secrets, db, bitcoin, nginx, and lnd directory.. as a new install
Setup db, bitcoin, nginx, and lnd directory.. as a new install
'''
print('Setup secrets, db, bitcoin, nginx, tor and lnd directory.. as a new install')
os.system('/bin/cp -fr ' + homedirpath + '/secrets /mnt/data')
print('Setup db, bitcoin, nginx, tor and lnd directory.. as a new install')
os.system('/bin/cp -fr ' + homedirpath + '/db /mnt/data')
os.system('/bin/cp -fr ' + homedirpath + '/bitcoin /mnt/data')
os.system('/bin/cp -fr ' + homedirpath + '/lnd /mnt/data')
Expand All @@ -202,20 +201,15 @@ def main():

'''
Check other folders in partition3
- secrets
- db
- lnd
- nginx
- tor
'''
# Secrets folder
if not os.path.exists('/mnt/data/secrets'):
print('secrets folder does\'nt exist!')
os.system('/bin/cp -fr ' + homedirpath + '/secrets /mnt/data')

# tor folder
if not os.path.exists('/mnt/data/tor'):
print('secrets folder does\'nt exist!')
print('tor folder does\'nt exist!')
os.system('/bin/cp -fr ' + homedirpath + '/tor /mnt/data')

# db folder
Expand Down Expand Up @@ -267,15 +261,13 @@ def main():
os.system('/bin/mount -a');

print('Remove old folders (after copying)')
os.system('/bin/rm -fr ' + homedirpath + '/secrets')
os.system('/bin/rm -fr ' + homedirpath + '/db')
os.system('/bin/rm -fr ' + homedirpath + '/bitcoin')
os.system('/bin/rm -fr ' + homedirpath + '/lnd')
os.system('/bin/rm -fr ' + homedirpath + '/tor')
os.system('/bin/rm -fr ' + homedirpath + '/nginx')
os.system('/bin/rm -fr ' + homedirpath + '/docker-compose.yml')
print('Set up symlinks')
os.system('/bin/ln -s /mnt/data/secrets ' + homedirpath + '/secrets')
os.system('/bin/ln -s /mnt/data/db ' + homedirpath + '/db')
os.system('/bin/ln -s /mnt/data/bitcoin ' + homedirpath + '/bitcoin')
os.system('/bin/ln -s /mnt/data/lnd ' + homedirpath + '/lnd')
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ services:
JWT_PRIVATE_KEY_FILE: "/jwt-private-key/jwt.key"
JWT_EXPIRATION: "3600"
DOCKER_COMPOSE_DIRECTORY: $PWD
DEVICE_HOST: $DEVICE_HOST
DEVICE_HOST: ${DEVICE_HOST:-http://umbrel.local}
MIDDLEWARE_API_URL: "http://10.11.2.2"
UMBREL_DASHBOARD_HIDDEN_SERVICE_FILE: "/var/lib/tor/web/hostname"
SHUTDOWN_SIGNAL_FILE: "/signals/shutdown"
Expand All @@ -129,13 +129,13 @@ services:
environment:
PORT: "3005"
BITCOIN_HOST: "10.11.1.1"
RPC_PORT: "RPCPORT"
RPC_USER: "lncm"
RPC_PASSWORD: "RPCPASS"
LND_NETWORK: "mainnet"
RPC_PORT: $BITCOIN_RPC_PORT
RPC_USER: $BITCOIN_RPC_USER
RPC_PASSWORD: $BITCOIN_RPC_PASS
LND_NETWORK: $BITCOIN_NETWORK
LND_HOST: "10.11.1.2"
JWT_PUBLIC_KEY_FILE: "/jwt-public-key/jwt.pem"
DEVICE_HOST: $DEVICE_HOST
DEVICE_HOST: ${DEVICE_HOST:-http://umbrel.local}
networks:
net:
ipv4_address: 10.11.2.2
Expand All @@ -146,12 +146,12 @@ services:
depends_on: [ bitcoin, lnd ]
restart: unless-stopped
volumes:
- "${PWD}/lnd:/lnd"
- "${PWD}/secrets:/secrets"
- "${PWD}/statuses:/statuses"
- "/var/run/docker.sock:/var/run/docker.sock"
- ${PWD}/lnd:/lnd
- ${PWD}/statuses:/statuses
- /var/run/docker.sock:/var/run/docker.sock
environment:
JSONRPCURL: http://10.11.1.1:RPCPORT
JSONRPCURL: "http://10.11.1.1:${BITCOIN_RPC_PORT}"
RPCPASS: $BITCOIN_RPC_PASS
LND_CONTAINER_NAME: lnd
SLEEPTIME: 3600
networks:
Expand Down
Empty file added lnd/.gitkeep
Empty file.
Loading

0 comments on commit ad2bec7

Please sign in to comment.