From 43c8443f3afa27aa9c8093a03e21f7cb66ba6aed Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 7 Dec 2018 13:08:17 +0900 Subject: [PATCH] Revert "Merge pull request #72 from Kukks/feature/mysql" This reverts commit a1878999450872ec0b3e12703330c186851de35d, reversing changes made to d7241f0d0fba7017d43696cb0cc2aa11c9cb0323. --- README.md | 1 - btcpay-setup.sh | 4 ---- build.ps1 | 1 - build.sh | 1 - .../docker-fragments/btcpayserver.yml | 2 ++ .../docker-fragments/mysql.yml | 19 ------------------- .../docker-fragments/postgres.yml | 5 ----- .../src/DockerComposition.cs | 7 ------- docker-compose-generator/src/Program.cs | 18 +++++------------- .../src/Properties/launchSettings.json | 3 +-- 10 files changed, 8 insertions(+), 53 deletions(-) delete mode 100644 docker-compose-generator/docker-fragments/mysql.yml diff --git a/README.md b/README.md index efcbf0d..fac68e0 100644 --- a/README.md +++ b/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`) diff --git a/btcpay-setup.sh b/btcpay-setup.sh index b69333a..859cff6 100755 --- a/btcpay-setup.sh +++ b/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\" diff --git a/build.ps1 b/build.ps1 index 0b1baed..2bafc9e 100755 --- a/build.ps1 +++ b/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 diff --git a/build.sh b/build.sh index dcb3588..09f9a4a 100755 --- a/build.sh +++ b/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 diff --git a/docker-compose-generator/docker-fragments/btcpayserver.yml b/docker-compose-generator/docker-fragments/btcpayserver.yml index 4ae1fa0..59790ce 100644 --- a/docker-compose-generator/docker-fragments/btcpayserver.yml +++ b/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" diff --git a/docker-compose-generator/docker-fragments/mysql.yml b/docker-compose-generator/docker-fragments/mysql.yml deleted file mode 100644 index 739ee72..0000000 --- a/docker-compose-generator/docker-fragments/mysql.yml +++ /dev/null @@ -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: diff --git a/docker-compose-generator/docker-fragments/postgres.yml b/docker-compose-generator/docker-fragments/postgres.yml index 49563b9..d558564 100644 --- a/docker-compose-generator/docker-fragments/postgres.yml +++ b/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: \ No newline at end of file diff --git a/docker-compose-generator/src/DockerComposition.cs b/docker-compose-generator/src/DockerComposition.cs index 050e39b..8a924ed 100644 --- a/docker-compose-generator/src/DockerComposition.cs +++ b/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() diff --git a/docker-compose-generator/src/Program.cs b/docker-compose-generator/src/Program.cs index 4bf6e32..df4c0ad 100644 --- a/docker-compose-generator/src/Program.cs +++ b/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 } } } -} \ No newline at end of file +} diff --git a/docker-compose-generator/src/Properties/launchSettings.json b/docker-compose-generator/src/Properties/launchSettings.json index eebb423..b29a0ab 100644 --- a/docker-compose-generator/src/Properties/launchSettings.json +++ b/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" } } }