Giter Club home page Giter Club logo

bleskomat-server's Introduction

bleskomat-server

An open-source web server that facilitates Lightning Network payments on behalf of one or more Bleskomat ATMs. This project can be used with both the Bleskomat DIY project as well as the commercial Bleskomat ATM product.

Usage

It's possible to run the server in a number of ways:

Usage with Nodejs

To run the server, the following dependencies are required:

  • nodejs - On Linux and Mac, nodejs can be installed via nvm

Download or clone this repository.

In the project directory, install node dependencies:

npm ci

To run the server:

npm start

To run the server while printing debug info:

DEBUG=lnurl* npm start

The server runs with default configurations when none have been provided. To customize your server configuration, create a .env file in the root of the project directory. You can start by copying the example.env file:

cp example.env .env

Please refer to Configuration Options for details about how to configure your server.

Usage with Docker

To run the server:

docker run -p 3000:3000 --name bleskomat-server --detach bleskomat/bleskomat-server

To run the server while printing debug info:

docker run -p 3000:3000 --name bleskomat-server --detach -e DEBUG='lnurl*' bleskomat/bleskomat-server

Customize the server configuration by passing environment variables when running the docker container:

docker run -p 3000:3000 --name bleskomat-server --detach -e DEBUG='lnurl*' \
	-e BLESKOMAT_SERVER_HOST='0.0.0.0' \
	-e BLESKOMAT_SERVER_PORT='3000' \
	-e BLESKOMAT_SERVER_URL='https://DOMAINNAME' \
	-e BLESKOMAT_SERVER_ENDPOINT='/u' \
	-e BLESKOMAT_SERVER_AUTH_API_KEYS='[]' \
	-e BLESKOMAT_SERVER_LIGHTNING='{"backend":"dummy","config":{}}' \
	-e BLESKOMAT_SERVER_STORE='{"backend":"memory","config":{}}' bleskomat/bleskomat-server

Please refer to Configuration Options for details about how to configure your server.

Usage with Docker Compose

See the examples/docker-compose directory for example usage.

Please refer to Configuration Options for details about how to configure your server.

Configuration Options

Below is a list of configuration options for the bleskomat server:

  • BLESKOMAT_SERVER_HOST - The host on which the HTTP server listener will be bound.
  • BLESKOMAT_SERVER_PORT - The port on which the HTTP server will listen.
  • BLESKOMAT_SERVER_URL - The publicly accessible URL of the web server. This should not include the endpoint. Example - https://your-domain.com
  • BLESKOMAT_SERVER_ENDPOINT - The path of the LNURL route. The default is /u.
  • BLESKOMAT_SERVER_AUTH_API_KEYS - An array of API keys that are authorized to create signed LNURLs for the server. See How to generate API keys
  • BLESKOMAT_SERVER_LIGHTNING - The Lightning Network backend configuration. Please refer to Lightning Backend Configuration Options for details.
  • BLESKOMAT_SERVER_STORE - The data store configuration. Please refer to Configuring Data Store for details.

How to generate API keys

Using nodejs:

./node_modules/.bin/lnurl generateApiKey

Using the docker image:

docker run bleskomat/bleskomat-server ./node_modules/.bin/lnurl generateApiKey

See Generating a new API key for further details.

Notes

  • It is strongly recommended to only serve LNURL-related requests via HTTPS.
  • Exchange rates are queried using Coinbase's /v2/exchange-rates API end-point. The function that does this is defined in ./lib/getExchangeRate.js. If you prefer to use a different provider, that is the place to make your changes.

License

The project is licensed under the GNU Affero General Public License v3 (AGPL-3.0):

The AGPL license differs from the other GNU licenses in that it was built for network software. You can distribute modified versions if you keep track of the changes and the date you made them. As per usual with GNU licenses, you must license derivatives under AGPL. It provides the same restrictions and freedoms as the GPLv3 but with an additional clause which makes it so that source code must be distributed along with web publication. Since web sites and services are never distributed in the traditional sense, the AGPL is the GPL of the web.

Trademark

"Bleskomat" is a registered trademark. You are welcome to hack, fork, build, and use the source code and instructions found in this repository. However, the right to use the name "Bleskomat" with any commercial products or services is withheld and reserved for the trademark owner.

bleskomat-server's People

Contributors

chill117 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.