Browse Source

Merge branch 'master' into dcg-latest

feature/auto_ssh
nicolas.dorier 6 years ago
parent
commit
f3e711fd3f
  1. 1
      README.md
  2. 4
      btcpay-setup.sh
  3. 1
      build.ps1
  4. 1
      build.sh
  5. 2
      docker-compose-generator/docker-fragments/btcpayserver.yml
  6. 19
      docker-compose-generator/docker-fragments/mysql.yml
  7. 5
      docker-compose-generator/docker-fragments/postgres.yml
  8. 7
      docker-compose-generator/src/DockerComposition.cs
  9. 18
      docker-compose-generator/src/Program.cs
  10. 3
      docker-compose-generator/src/Properties/launchSettings.json

1
README.md

@ -117,7 +117,6 @@ You can read [the article](https://medium.com/@BtcpayServer/hosting-btcpay-serve
* `BTCPAYGEN_CRYPTON`: N'th supported crypto currency where N is 9 at maximum. (eg. `btc`, `ltc`. Default: `(empty)`)
* `BTCPAYGEN_REVERSEPROXY`: Specify reverse proxy to use; NGinx has HTTPS support. (eg. `nginx`, `traefik`, `(empty)`. Default: `nginx`)
* `BTCPAYGEN_LIGHTNING`: Lightning network implementation to use (eg. `clightning`, `(empty)`)
* `BTCPAYGEN_DATABASE`: Database Engine to use(eg. `postgres`, `mysql`, `sqlite`. Default: `postgres`)
* `BTCPAYGEN_SUBNAME`: The subname of the generated docker-compose file, where the full name is `Generated/docker-compose.SUBNAME.yml` (Default: `generated`)
* `BTCPAYGEN_ADDITIONAL_FRAGMENTS`: Semicolon-separated list of additional fragments you want to use (eg. `opt-save-storage`)
* `LETSENCRYPT_EMAIL`: An email will be sent to this address if certificate expires and fails to renew automatically (eg. `me@example.com`)

4
btcpay-setup.sh

@ -57,7 +57,6 @@ Environment variables:
BTCPAYGEN_CRYPTON: N th supported crypto currency where N is maximum at maximum 9. (Default: none)
BTCPAYGEN_REVERSEPROXY: Whether to use or not a reverse proxy. NGinx setup HTTPS for you. (eg. nginx, traefik, none. Default: nginx)
BTCPAYGEN_LIGHTNING: Lightning network implementation to use (eg. clightning, lnd, none)
BTCPAYGEN_DATABASE: Database Engine to use(eg. postgres, mysql, sqlite. Default: postgres)
BTCPAYGEN_ADDITIONAL_FRAGMENTS: Semi colon separated list of additional fragments you want to use (eg. opt-save-storage)
ACME_CA_URI: The API endpoint to ask for HTTPS certificate (default: https://acme-v01.api.letsencrypt.org/directory)
BTCPAY_HOST_SSHKEYFILE: Optional, SSH private key that BTCPay can use to connect to this VM's SSH server. This key will be copied on BTCPay's data directory
@ -95,7 +94,6 @@ fi
: "${BTCPAYGEN_CRYPTO1:=btc}"
: "${BTCPAYGEN_REVERSEPROXY:=nginx}"
: "${BTCPAYGEN_LIGHTNING:=none}"
: "${BTCPAYGEN_DATABASE:=postgres}"
: "${ACME_CA_URI:=https://acme-v01.api.letsencrypt.org/directory}"
OLD_BTCPAY_DOCKER_COMPOSE=$BTCPAY_DOCKER_COMPOSE
@ -154,7 +152,6 @@ BTCPAYGEN_CRYPTO8:$BTCPAYGEN_CRYPTO8
BTCPAYGEN_CRYPTO9:$BTCPAYGEN_CRYPTO9
BTCPAYGEN_REVERSEPROXY:$BTCPAYGEN_REVERSEPROXY
BTCPAYGEN_LIGHTNING:$BTCPAYGEN_LIGHTNING
BTCPAYGEN_DATABASE:$BTCPAYGEN_DATABASE
BTCPAYGEN_ADDITIONAL_FRAGMENTS:$BTCPAYGEN_ADDITIONAL_FRAGMENTS
BTCPAY_IMAGE:$BTCPAY_IMAGE
ACME_CA_URI:$ACME_CA_URI
@ -193,7 +190,6 @@ export BTCPAYGEN_CRYPTO7=\"$BTCPAYGEN_CRYPTO7\"
export BTCPAYGEN_CRYPTO8=\"$BTCPAYGEN_CRYPTO8\"
export BTCPAYGEN_CRYPTO9=\"$BTCPAYGEN_CRYPTO9\"
export BTCPAYGEN_LIGHTNING=\"$BTCPAYGEN_LIGHTNING\"
export BTCPAYGEN_DATABASE=\"$BTCPAYGEN_DATABASE\"
export BTCPAYGEN_REVERSEPROXY=\"$BTCPAYGEN_REVERSEPROXY\"
export BTCPAYGEN_ADDITIONAL_FRAGMENTS=\"$BTCPAYGEN_ADDITIONAL_FRAGMENTS\"
export BTCPAY_DOCKER_COMPOSE=\"$BTCPAY_DOCKER_COMPOSE\"

1
build.ps1

@ -22,7 +22,6 @@ docker run -v "$(Get-Location)\Generated:/app/Generated" `
-e "BTCPAYGEN_REVERSEPROXY=$BTCPAYGEN_REVERSEPROXY" `
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" `
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" `
-e "BTCPAYGEN_DATABASE=$BTCPAYGEN_DATABASE" `
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" `
--rm $BTCPAYGEN_DOCKER_IMAGE

1
build.sh

@ -23,7 +23,6 @@ docker run -v "$(pwd)/Generated:/app/Generated" \
-e "BTCPAYGEN_REVERSEPROXY=$BTCPAYGEN_REVERSEPROXY" \
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \
-e "BTCPAYGEN_DATABASE=$BTCPAYGEN_DATABASE" \
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \
--rm $BTCPAYGEN_DOCKER_IMAGE

2
docker-compose-generator/docker-fragments/btcpayserver.yml

@ -9,6 +9,7 @@ services:
- "49392"
environment:
# BTCPay settings
BTCPAY_POSTGRES: User ID=postgres;Host=postgres;Port=5432;Database=btcpayserver${NBITCOIN_NETWORK:-regtest}
BTCPAY_NETWORK: ${NBITCOIN_NETWORK:-regtest}
BTCPAY_BIND: 0.0.0.0:49392
BTCPAY_EXTERNALURL: ${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST}/
@ -18,6 +19,7 @@ services:
BTCPAY_DEBUGLOG: btcpay.log
links:
- nbxplorer
- postgres
volumes:
- "btcpay_datadir:/datadir"
- "nbxplorer_datadir:/root/.nbxplorer"

19
docker-compose-generator/docker-fragments/mysql.yml

@ -1,19 +0,0 @@
version: "3"
services:
mysql:
restart: unless-stopped
image: mysql:8.0
volumes:
- "mysql_datadir:/var/lib/mysql"
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD="true"
btcpayserver:
environment:
BTCPAY_MYSQL: Server=mysql;Database=btcpayserver${NBITCOIN_NETWORK:-regtest};Uid=root;Pwd=;Port=3306;
links:
- mysql
volumes:
mysql_datadir:

5
docker-compose-generator/docker-fragments/postgres.yml

@ -6,11 +6,6 @@ services:
image: postgres:9.6.5
volumes:
- "postgres_datadir:/var/lib/postgresql/data"
btcpayserver:
environment:
BTCPAY_POSTGRES: User ID=postgres;Host=postgres;Port=5432;Database=btcpayserver${NBITCOIN_NETWORK:-regtest}
links:
- postgres
volumes:
postgres_datadir:

7
docker-compose-generator/src/DockerComposition.cs

@ -17,12 +17,6 @@ namespace DockerGenerator
get;
set;
}
public string SelectedDatabase
{
get;
set;
}
public string SelectedLN
{
get;
@ -45,7 +39,6 @@ namespace DockerGenerator
continue;
composition.SelectedCryptos.Add(selectedCrypto.ToLowerInvariant());
}
composition.SelectedDatabase = (Environment.GetEnvironmentVariable("BTCPAYGEN_DATABASE") ?? "postgtres").ToLowerInvariant();
composition.SelectedProxy = (Environment.GetEnvironmentVariable("BTCPAYGEN_REVERSEPROXY") ?? "").ToLowerInvariant();
composition.SelectedLN = (Environment.GetEnvironmentVariable("BTCPAYGEN_LIGHTNING") ?? "").ToLowerInvariant();
composition.AdditionalFragments = (Environment.GetEnvironmentVariable("BTCPAYGEN_ADDITIONAL_FRAGMENTS") ?? "").ToLowerInvariant()

18
docker-compose-generator/src/Program.cs

@ -8,10 +8,10 @@ namespace DockerGenerator
{
class Program
{
static void Main(string[] args)
{
var root = Environment.GetEnvironmentVariable("INSIDE_CONTAINER") == "1"
? FindRoot("app")
var root = Environment.GetEnvironmentVariable("INSIDE_CONTAINER") == "1" ? FindRoot("app")
: Path.GetFullPath(Path.Combine(FindRoot("docker-compose-generator"), ".."));
var composition = DockerComposition.FromEnvironmentVariables();
@ -27,9 +27,7 @@ namespace DockerGenerator
private void Run(DockerComposition composition, string name, string output)
{
var fragmentLocation = Environment.GetEnvironmentVariable("INSIDE_CONTAINER") == "1"
? "app"
: "docker-compose-generator";
var fragmentLocation = Environment.GetEnvironmentVariable("INSIDE_CONTAINER") == "1" ? "app" : "docker-compose-generator";
fragmentLocation = FindRoot(fragmentLocation);
fragmentLocation = Path.GetFullPath(Path.Combine(fragmentLocation, "docker-fragments"));
@ -51,14 +49,9 @@ namespace DockerGenerator
fragments.Add("btcpayserver-noreverseproxy");
break;
}
fragments.Add("btcpayserver");
fragments.Add("nbxplorer");
if (composition.SelectedDatabase != "sqlite")
{
fragments.Add(composition.SelectedDatabase);
}
fragments.Add("postgres");
foreach (var crypto in CryptoDefinition.GetDefinitions())
{
if (!composition.SelectedCryptos.Contains(crypto.Crypto))
@ -69,7 +62,6 @@ namespace DockerGenerator
{
fragments.Add(crypto.CLightningFragment);
}
if (composition.SelectedLN == "lnd" && crypto.LNDFragment != null)
{
fragments.Add(crypto.LNDFragment);
@ -102,4 +94,4 @@ namespace DockerGenerator
}
}
}
}
}

3
docker-compose-generator/src/Properties/launchSettings.json

@ -9,8 +9,7 @@
"BTCPAYGEN_CRYPTO3": "btg",
"BTCPAYGEN_CRYPTO2": "ltc",
"BTCPAYGEN_CRYPTO1": "btc",
"BTCPAYGEN_REVERSEPROXY": "nginx",
"BTCPAYGEN_DATABASE": "postgres"
"BTCPAYGEN_REVERSEPROXY": "nginx"
}
}
}

Loading…
Cancel
Save