Merge remote-tracking branch 'origin/master' into feature/traefik
This commit is contained in:
@@ -2,7 +2,7 @@ version: "3"
|
||||
|
||||
services:
|
||||
clightning_bitcoin:
|
||||
image: nicolasdorier/clightning:634f19a7b230edc686be56ab950b80784e56252c
|
||||
image: nicolasdorier/clightning:v0.6.1
|
||||
container_name: btcpayserver_clightning_bitcoin
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
@@ -2,7 +2,7 @@ version: "3"
|
||||
|
||||
services:
|
||||
lnd_bitcoin:
|
||||
image: btcpayserver/lnd:0.4.2.0.1
|
||||
image: btcpayserver/lnd:0.5-beta
|
||||
container_name: btcpayserver_lnd_bitcoin
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@@ -15,10 +15,12 @@ services:
|
||||
rpclisten=0.0.0.0:10009
|
||||
bitcoin.node=bitcoind
|
||||
bitcoind.rpchost=bitcoind:43782
|
||||
bitcoind.zmqpath=tcp://bitcoind:28332
|
||||
bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
||||
bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
||||
externalip=${BTCPAY_HOST}:9735
|
||||
alias=${LIGHTNING_ALIAS}
|
||||
noencryptwallet=1
|
||||
adminmacaroonpath=/data/admin.macaroon
|
||||
noseedbackup=1
|
||||
notls=1
|
||||
ports:
|
||||
- "9735:9735"
|
||||
@@ -45,8 +47,8 @@ services:
|
||||
bitcoind:
|
||||
environment:
|
||||
BITCOIN_EXTRA_ARGS: |
|
||||
zmqpubrawtx=tcp://0.0.0.0:28332
|
||||
zmqpubrawblock=tcp://0.0.0.0:28332
|
||||
zmqpubrawtx=tcp://0.0.0.0:28333
|
||||
expose:
|
||||
- "28332"
|
||||
- "28333"
|
||||
|
||||
@@ -4,7 +4,7 @@ services:
|
||||
|
||||
btcpayserver:
|
||||
restart: unless-stopped
|
||||
image: nicolasdorier/btcpayserver:1.0.2.105
|
||||
image: nicolasdorier/btcpayserver:1.0.2.106
|
||||
expose:
|
||||
- "49392"
|
||||
environment:
|
||||
|
||||
@@ -4,7 +4,7 @@ services:
|
||||
feathercoind:
|
||||
restart: unless-stopped
|
||||
container_name: btcpayserver_feathercoind
|
||||
image: chekaz/docker-feathercoin:0.16.0
|
||||
image: chekaz/docker-feathercoin:0.16.3
|
||||
environment:
|
||||
BITCOIN_EXTRA_ARGS: |
|
||||
rpcport=43782
|
||||
|
||||
@@ -2,7 +2,7 @@ version: "3"
|
||||
|
||||
services:
|
||||
clightning_litecoin:
|
||||
image: nicolasdorier/clightning:634f19a7b230edc686be56ab950b80784e56252c
|
||||
image: nicolasdorier/clightning:v0.6.1
|
||||
container_name: btcpayserver_clightning_litecoin
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
@@ -2,7 +2,7 @@ version: "3"
|
||||
|
||||
services:
|
||||
lnd_litecoin:
|
||||
image: btcpayserver/lnd:0.4.2.0.1
|
||||
image: btcpayserver/lnd:0.5-beta
|
||||
container_name: btcpayserver_lnd_litecoin
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@@ -13,10 +13,12 @@ services:
|
||||
restlisten=0.0.0.0:8080
|
||||
litecoin.node=litecoind
|
||||
litecoind.rpchost=litecoind:43782
|
||||
litecoind.zmqpath=tcp://litecoind:28332
|
||||
litecoind.zmqpubrawblock=tcp://litecoind:28332
|
||||
litecoind.zmqpubrawtx=tcp://litecoind:28333
|
||||
externalip=${BTCPAY_HOST}:9736
|
||||
alias=${LIGHTNING_ALIAS}
|
||||
noencryptwallet=1
|
||||
adminmacaroonpath=/data/admin.macaroon
|
||||
noseedbackup=1
|
||||
notls=1
|
||||
ports:
|
||||
- "9736:9735"
|
||||
@@ -42,10 +44,11 @@ services:
|
||||
litecoind:
|
||||
environment:
|
||||
BITCOIN_EXTRA_ARGS: |
|
||||
zmqpubrawtx=tcp://0.0.0.0:28332
|
||||
zmqpubrawblock=tcp://0.0.0.0:28332
|
||||
zmqpubrawtx=tcp://0.0.0.0:28333
|
||||
expose:
|
||||
- "28332"
|
||||
- "28333"
|
||||
|
||||
volumes:
|
||||
lnd_litecoin_datadir:
|
||||
@@ -8,59 +8,21 @@ namespace DockerGenerator
|
||||
{
|
||||
class Program
|
||||
{
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var root = Environment.GetEnvironmentVariable("INSIDE_CONTAINER") == "1" ? FindRoot("app")
|
||||
: Path.GetFullPath(Path.Combine(FindRoot("docker-compose-generator"), ".."));
|
||||
|
||||
Dictionary<string,string> ProxyMapping = new Dictionary<string, string>()
|
||||
{
|
||||
{"nginx", Path.GetFullPath(Path.Combine(root, "Production"))},
|
||||
{"no-reverseproxy", Path.GetFullPath(Path.Combine(root, "Production-NoReverseProxy"))},
|
||||
{"traefik", Path.GetFullPath(Path.Combine(root, "Production-Traefik"))}
|
||||
};
|
||||
if(args.Any(a => a == "pregen"))
|
||||
{
|
||||
|
||||
foreach(var proxy in ProxyMapping.Keys)
|
||||
{
|
||||
foreach(var lightning in new[] { "clightning", "" })
|
||||
{
|
||||
foreach(var btc in new[] { "btc", "" })
|
||||
{
|
||||
foreach(var ltc in new[] { "ltc", "" })
|
||||
{
|
||||
if(btc == "" && ltc == "")
|
||||
continue;
|
||||
string name = $"{btc}-{ltc}-{lightning}".Replace("--", "-");
|
||||
if(name.EndsWith("-"))
|
||||
name = name.Substring(0, name.Length - 1);
|
||||
if(name.StartsWith("-"))
|
||||
name = name.Substring(1, name.Length - 1);
|
||||
var composition = new DockerComposition();
|
||||
composition.SelectedCryptos = new HashSet<string>();
|
||||
composition.SelectedCryptos.Add(btc);
|
||||
composition.SelectedCryptos.Add(ltc);
|
||||
composition.SelectedLN = lightning;
|
||||
composition.SelectedProxy = proxy;
|
||||
new Program().Run(composition, name, ProxyMapping[proxy]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var composition = DockerComposition.FromEnvironmentVariables();
|
||||
Console.WriteLine("Crypto: " + string.Join(", ", composition.SelectedCryptos.ToArray()));
|
||||
Console.WriteLine("Lightning: " + composition.SelectedLN);
|
||||
Console.WriteLine("ReverseProxy: " + composition.SelectedProxy);
|
||||
var generatedLocation = Path.GetFullPath(Path.Combine(root, "Generated"));
|
||||
var composition = DockerComposition.FromEnvironmentVariables();
|
||||
Console.WriteLine("Crypto: " + string.Join(", ", composition.SelectedCryptos.ToArray()));
|
||||
Console.WriteLine("Lightning: " + composition.SelectedLN);
|
||||
Console.WriteLine("ReverseProxy: " + composition.SelectedProxy);
|
||||
var generatedLocation = Path.GetFullPath(Path.Combine(root, "Generated"));
|
||||
|
||||
var name = Environment.GetEnvironmentVariable("BTCPAYGEN_SUBNAME");
|
||||
name = string.IsNullOrEmpty(name) ? "generated" : name;
|
||||
new Program().Run(composition, name, generatedLocation);
|
||||
}
|
||||
var name = Environment.GetEnvironmentVariable("BTCPAYGEN_SUBNAME");
|
||||
name = string.IsNullOrEmpty(name) ? "generated" : name;
|
||||
new Program().Run(composition, name, generatedLocation);
|
||||
}
|
||||
|
||||
private void Run(DockerComposition composition, string name, string output)
|
||||
@@ -70,7 +32,7 @@ namespace DockerGenerator
|
||||
fragmentLocation = Path.GetFullPath(Path.Combine(fragmentLocation, "docker-fragments"));
|
||||
|
||||
var fragments = new List<string>();
|
||||
switch (@composition.SelectedProxy)
|
||||
switch (composition.SelectedProxy)
|
||||
{
|
||||
case "nginx":
|
||||
|
||||
@@ -88,26 +50,26 @@ namespace DockerGenerator
|
||||
fragments.Add("btcpayserver");
|
||||
fragments.Add("nbxplorer");
|
||||
fragments.Add("postgres");
|
||||
foreach(var crypto in CryptoDefinition.GetDefinitions())
|
||||
foreach (var crypto in CryptoDefinition.GetDefinitions())
|
||||
{
|
||||
if(!composition.SelectedCryptos.Contains(crypto.Crypto))
|
||||
if (!composition.SelectedCryptos.Contains(crypto.Crypto))
|
||||
continue;
|
||||
|
||||
fragments.Add(crypto.CryptoFragment);
|
||||
if(composition.SelectedLN == "clightning" && crypto.CLightningFragment != null)
|
||||
if (composition.SelectedLN == "clightning" && crypto.CLightningFragment != null)
|
||||
{
|
||||
fragments.Add(crypto.CLightningFragment);
|
||||
}
|
||||
if(composition.SelectedLN == "lnd" && crypto.LNDFragment != null)
|
||||
{
|
||||
fragments.Add(crypto.LNDFragment);
|
||||
}
|
||||
}
|
||||
if (composition.SelectedLN == "lnd" && crypto.LNDFragment != null)
|
||||
{
|
||||
fragments.Add(crypto.LNDFragment);
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var fragment in composition.AdditionalFragments)
|
||||
{
|
||||
fragments.Add(fragment.Trim());
|
||||
}
|
||||
foreach (var fragment in composition.AdditionalFragments)
|
||||
{
|
||||
fragments.Add(fragment.Trim());
|
||||
}
|
||||
|
||||
var def = new DockerComposeDefinition(name, fragments);
|
||||
def.FragmentLocation = fragmentLocation;
|
||||
@@ -119,11 +81,11 @@ namespace DockerGenerator
|
||||
{
|
||||
string directory = Directory.GetCurrentDirectory();
|
||||
int i = 0;
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
if(i > 10)
|
||||
if (i > 10)
|
||||
throw new DirectoryNotFoundException(rootDirectory);
|
||||
if(directory.EndsWith(rootDirectory))
|
||||
if (directory.EndsWith(rootDirectory))
|
||||
return directory;
|
||||
directory = Path.GetFullPath(Path.Combine(directory, ".."));
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user