Skip to content

Commit

Permalink
readme: make it more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Jan 23, 2019
1 parent b57092e commit a2b5a71
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 40 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Expand Up @@ -2,11 +2,12 @@ FROM python:3

WORKDIR /usr/src/app

COPY requirements.txt ./
COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 8000

COPY . .

CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8000"]
CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8000"]
71 changes: 33 additions & 38 deletions README.md
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/djmelik/lndash.svg?branch=master)](https://travis-ci.org/djmelik/lndash)

lndash is a simple read-only web dashboard for [lnd](https://github.com/lightningnetwork/lnd) - Lightning Network Daemon.
lndash is a simple read-only web dashboard for [lnd](https://github.com/lightningnetwork/lnd) - Lightning Network Daemon

## Features

Expand All @@ -14,47 +14,32 @@ lndash is a simple read-only web dashboard for [lnd](https://github.com/lightnin

## Installation

*Please note that the following installation instructions are still a work in progress. This guide was written on a Debian system.*
*This guide was written on a Debian system.*

1. Install dependencies.
1. Clone lndash repository and enter the project directory:

```
apt-get install python3-pip python3-virtualenv virtualenv
```

2. Clone lndash repository.

```
```sh
git clone https://github.com/djmelik/lndash.git
```

3. Enter lndash project directory.

```
cd lndash
```

4. Set up python virtualenv.
2. Install required dependencies for virtualenv, set it up and activate:

```
```sh
sudo apt-get install python3-pip python3-virtualenv virtualenv
virtualenv -p python3 venv
```

5. Activate virtual environment.

```
source venv/bin/activate
```

6. Install python libs & dependencies.
3. Install python libs & dependencies into running virtualenv:

```
```sh
pip install -r requirements.txt
```

7. Copy the tls certificate and **readonly** macaroon from lnd to config directory.
7. Copy the tls certificate and **readonly** macaroon from lnd to lndash config directory:

```
```sh
cp ~/.lnd/tls.cert config/tls.cert
cp ~/.lnd/data/chain/bitcoin/mainnet/readonly.macaroon config/readonly.macaroon
```
Expand All @@ -65,39 +50,49 @@ cp ~/.lnd/data/chain/bitcoin/mainnet/readonly.macaroon config/readonly.macaroon
export LNDASH_LND_SERVER="127.0.0.1:10009"
```

9. Run the application.
9. Run the application:

```
```sh
gunicorn main:app
```

If you want gunicorn to listen on all interfaces and/or change the port, run the application using the following:

```
```sh
gunicorn main:app -b 0.0.0.0:8080
```

10. (Optional) You can set up an nginx reverse proxy and publicly expose your lndash instance. *Note: need to write these instructions.*

## Docker

### Building the docker container
`cd` into the `lndash` directory and run the following command:

Run the following command in the `lndash` directory:

```
docker build -t lndash:latest .
```

This will build the docker container and give it the tag `lndash`.

### Running the docker container

Three things need to be configured to run the `lndash` docker container.

1. The path to the TLS certificate.
2. The path to the readonly macaroon.
3. The port on which the web app should listen.
4. The LND server's RPC address
1. The path to the TLS certificate
2. The path to the readonly macaroon
3. The port on which the web app should listen
4. The LND server's RPC addres

These can all be configured via the docker command line, as follows:

```
docker run -d --restart -v=/home/ubuntu/lndashcredentials/tls.cert:/usr/src/app/config/tls.cert -v=/home/ubuntu/lndashcredentials/readonly.macaroon:/usr/src/app/config/readonly.macaroon -p 80:8000 -e LNDASH_LND_SERVER='192.168.1.2:10009' lndash:latest
docker run -d --restart -v=$HOME/.lnd/tls.cert:/usr/src/app/config/tls.cert -v=$HOME/.lnd/data/chain/bitcoin/mainnet/readonly.macaroon:/usr/src/app/config/readonly.macaroon -p 80:8000 -e LNDASH_LND_SERVER="192.168.1.2:10009" lndash:latest
```
The above command line assumes tls.cert and readonly.macaroon have been copied to the directory `/home/ubuntu/lndashcredentials`, and that the LND server is available on port 10009 at IP address 192.168.1.2. It makes the `lndash` server available on port 80.

The above command line assumes `tls.cert` and `readonly.macaroon` are stored at these locations and that the LND server is available on port 10009 at IP address 192.168.1.2. It makes the `lndash` server available on port 80. Change these values as needed.

## Nginx reverse proxy

You can set up an nginx reverse proxy and publicly expose your lndash instance.

*Note: need to write these instructions.*

0 comments on commit a2b5a71

Please sign in to comment.