mirror of
https://github.com/aljazceru/btcpayserver-docker.git
synced 2025-12-19 05:54:19 +01:00
Merge pull request #123 from Kukks/feature/exclude-fragments
Introduce Exclude Fragments option
This commit is contained in:
@@ -129,6 +129,7 @@ You can read [the article](https://medium.com/@BtcpayServer/hosting-btcpay-serve
|
|||||||
* `BTCPAY_SSHTRUSTEDFINGERPRINTS`: Optional, BTCPay will ensure that it is connecting to the expected SSH server by checking the host's public key against these fingerprints
|
* `BTCPAY_SSHTRUSTEDFINGERPRINTS`: Optional, BTCPay will ensure that it is connecting to the expected SSH server by checking the host's public key against these fingerprints
|
||||||
* `BTCPAYGEN_DOCKER_IMAGE`: Optional, Specify which generator image to use if you have customized the C# generator. Set to `btcpayserver/docker-compose-generator:local` to build the generator locally at runtime.
|
* `BTCPAYGEN_DOCKER_IMAGE`: Optional, Specify which generator image to use if you have customized the C# generator. Set to `btcpayserver/docker-compose-generator:local` to build the generator locally at runtime.
|
||||||
* `BTCPAY_IMAGE`: Optional, Specify which btcpayserver image to use if you have a customized btcpayserver.
|
* `BTCPAY_IMAGE`: Optional, Specify which btcpayserver image to use if you have a customized btcpayserver.
|
||||||
|
* `BTCPAYGEN_EXCLUDE_FRAGMENTS`: Semicolon-separated list of fragments you want to forcefully exclude(eg. `litecoin-clightning`)
|
||||||
|
|
||||||
Additionally, there are specific environment variables for some addons:
|
Additionally, there are specific environment variables for some addons:
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ Environment variables:
|
|||||||
Add-on specific variables:
|
Add-on specific variables:
|
||||||
LIBREPATRON_HOST: If libre patron is activated with opt-add-librepatron, the hostname of your libre patron website (eg. librepatron.example.com)
|
LIBREPATRON_HOST: If libre patron is activated with opt-add-librepatron, the hostname of your libre patron website (eg. librepatron.example.com)
|
||||||
WOOCOMMERCE_HOST: If woocommerce is activated with opt-add-woocommerce, the hostname of your woocommerce website (eg. store.example.com)
|
WOOCOMMERCE_HOST: If woocommerce is activated with opt-add-woocommerce, the hostname of your woocommerce website (eg. store.example.com)
|
||||||
|
BTCPAYGEN_EXCLUDE_FRAGMENTS: Semicolon-separated list of fragments you want to forcefully exclude(eg. litecoin-clightning)
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +162,7 @@ BTCPAYGEN_CRYPTO9:$BTCPAYGEN_CRYPTO9
|
|||||||
BTCPAYGEN_REVERSEPROXY:$BTCPAYGEN_REVERSEPROXY
|
BTCPAYGEN_REVERSEPROXY:$BTCPAYGEN_REVERSEPROXY
|
||||||
BTCPAYGEN_LIGHTNING:$BTCPAYGEN_LIGHTNING
|
BTCPAYGEN_LIGHTNING:$BTCPAYGEN_LIGHTNING
|
||||||
BTCPAYGEN_ADDITIONAL_FRAGMENTS:$BTCPAYGEN_ADDITIONAL_FRAGMENTS
|
BTCPAYGEN_ADDITIONAL_FRAGMENTS:$BTCPAYGEN_ADDITIONAL_FRAGMENTS
|
||||||
|
BTCPAYGEN_EXCLUDE_FRAGMENTS:$BTCPAYGEN_EXCLUDE_FRAGMENTS
|
||||||
BTCPAY_IMAGE:$BTCPAY_IMAGE
|
BTCPAY_IMAGE:$BTCPAY_IMAGE
|
||||||
ACME_CA_URI:$ACME_CA_URI
|
ACME_CA_URI:$ACME_CA_URI
|
||||||
----------------------
|
----------------------
|
||||||
@@ -200,6 +202,7 @@ export BTCPAYGEN_CRYPTO9=\"$BTCPAYGEN_CRYPTO9\"
|
|||||||
export BTCPAYGEN_LIGHTNING=\"$BTCPAYGEN_LIGHTNING\"
|
export BTCPAYGEN_LIGHTNING=\"$BTCPAYGEN_LIGHTNING\"
|
||||||
export BTCPAYGEN_REVERSEPROXY=\"$BTCPAYGEN_REVERSEPROXY\"
|
export BTCPAYGEN_REVERSEPROXY=\"$BTCPAYGEN_REVERSEPROXY\"
|
||||||
export BTCPAYGEN_ADDITIONAL_FRAGMENTS=\"$BTCPAYGEN_ADDITIONAL_FRAGMENTS\"
|
export BTCPAYGEN_ADDITIONAL_FRAGMENTS=\"$BTCPAYGEN_ADDITIONAL_FRAGMENTS\"
|
||||||
|
export BTCPAYGEN_EXCLUDE_FRAGMENTS=\"$BTCPAYGEN_EXCLUDE_FRAGMENTS\"
|
||||||
export BTCPAY_DOCKER_COMPOSE=\"$BTCPAY_DOCKER_COMPOSE\"
|
export BTCPAY_DOCKER_COMPOSE=\"$BTCPAY_DOCKER_COMPOSE\"
|
||||||
export BTCPAY_BASE_DIRECTORY=\"$BTCPAY_BASE_DIRECTORY\"
|
export BTCPAY_BASE_DIRECTORY=\"$BTCPAY_BASE_DIRECTORY\"
|
||||||
export BTCPAY_ENV_FILE=\"$BTCPAY_ENV_FILE\"
|
export BTCPAY_ENV_FILE=\"$BTCPAY_ENV_FILE\"
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ docker run -v "$(Get-Location)\Generated:/app/Generated" `
|
|||||||
-e "BTCPAYGEN_CRYPTO9=$BTCPAYGEN_CRYPTO9" `
|
-e "BTCPAYGEN_CRYPTO9=$BTCPAYGEN_CRYPTO9" `
|
||||||
-e "BTCPAYGEN_REVERSEPROXY=$BTCPAYGEN_REVERSEPROXY" `
|
-e "BTCPAYGEN_REVERSEPROXY=$BTCPAYGEN_REVERSEPROXY" `
|
||||||
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" `
|
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" `
|
||||||
|
-e "BTCPAYGEN_EXCLUDE_FRAGMENTS=$BTCPAYGEN_EXCLUDE_FRAGMENTS" `
|
||||||
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" `
|
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" `
|
||||||
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" `
|
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" `
|
||||||
--rm $BTCPAYGEN_DOCKER_IMAGE
|
--rm $BTCPAYGEN_DOCKER_IMAGE
|
||||||
|
|||||||
1
build.sh
1
build.sh
@@ -22,6 +22,7 @@ docker run -v "$(pwd)/Generated:/app/Generated" \
|
|||||||
-e "BTCPAYGEN_CRYPTO9=$BTCPAYGEN_CRYPTO9" \
|
-e "BTCPAYGEN_CRYPTO9=$BTCPAYGEN_CRYPTO9" \
|
||||||
-e "BTCPAYGEN_REVERSEPROXY=$BTCPAYGEN_REVERSEPROXY" \
|
-e "BTCPAYGEN_REVERSEPROXY=$BTCPAYGEN_REVERSEPROXY" \
|
||||||
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \
|
-e "BTCPAYGEN_ADDITIONAL_FRAGMENTS=$BTCPAYGEN_ADDITIONAL_FRAGMENTS" \
|
||||||
|
-e "BTCPAYGEN_EXCLUDE_FRAGMENTS=$BTCPAYGEN_EXCLUDE_FRAGMENTS" \
|
||||||
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \
|
-e "BTCPAYGEN_LIGHTNING=$BTCPAYGEN_LIGHTNING" \
|
||||||
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \
|
-e "BTCPAYGEN_SUBNAME=$BTCPAYGEN_SUBNAME" \
|
||||||
--rm $BTCPAYGEN_DOCKER_IMAGE
|
--rm $BTCPAYGEN_DOCKER_IMAGE
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ namespace DockerGenerator
|
|||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
} = new string[0];
|
} = new string[0];
|
||||||
|
public string[] ExcludeFragments
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
} = new string[0];
|
||||||
|
|
||||||
public static DockerComposition FromEnvironmentVariables()
|
public static DockerComposition FromEnvironmentVariables()
|
||||||
{
|
{
|
||||||
@@ -46,6 +51,11 @@ namespace DockerGenerator
|
|||||||
.Where(t => !string.IsNullOrWhiteSpace(t))
|
.Where(t => !string.IsNullOrWhiteSpace(t))
|
||||||
.Select(t => t.EndsWith(".yml") ? t.Substring(0, t.Length - ".yml".Length) : t)
|
.Select(t => t.EndsWith(".yml") ? t.Substring(0, t.Length - ".yml".Length) : t)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
composition.ExcludeFragments = (Environment.GetEnvironmentVariable("BTCPAYGEN_EXCLUDE_FRAGMENTS") ?? "").ToLowerInvariant()
|
||||||
|
.Split(new char[] { ';' , ',' })
|
||||||
|
.Where(t => !string.IsNullOrWhiteSpace(t))
|
||||||
|
.Select(t => t.EndsWith(".yml") ? t.Substring(0, t.Length - ".yml".Length) : t)
|
||||||
|
.ToArray();
|
||||||
return composition;
|
return composition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -72,6 +72,7 @@ namespace DockerGenerator
|
|||||||
{
|
{
|
||||||
fragments.Add(fragment.Trim());
|
fragments.Add(fragment.Trim());
|
||||||
}
|
}
|
||||||
|
fragments = fragments.Where(s => !composition.ExcludeFragments.Contains(s)).ToHashSet();
|
||||||
var def = new DockerComposeDefinition(name, fragments.ToList());
|
var def = new DockerComposeDefinition(name, fragments.ToList());
|
||||||
def.FragmentLocation = fragmentLocation;
|
def.FragmentLocation = fragmentLocation;
|
||||||
def.BuildOutputDirectory = output;
|
def.BuildOutputDirectory = output;
|
||||||
|
|||||||
Reference in New Issue
Block a user