Guard against running current master (#5959)

* Guard against running current master

With a longer release cycle for v2, we need to guard people from running master and corrupting their data. This adds a new requirement in that  a special config must be set when running master. We will remove when v2 rc is ready.

* add envs
This commit is contained in:
Andrew Camilleri 2024-04-30 11:29:05 +02:00 committed by GitHub
parent c348f442cc
commit 4821f77304
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 0 deletions

View file

@ -12,6 +12,7 @@ services:
args:
CONFIGURATION_NAME: Altcoins-Release
environment:
TESTS_EXPERIMENTALV2_CONFIRM: "true"
TESTS_BTCRPCCONNECTION: server=http://bitcoind:43782;ceiwHEbqWI83:DwubwWsoo3
TESTS_LTCRPCCONNECTION: server=http://litecoind:43782;ceiwHEbqWI83:DwubwWsoo3
TESTS_BTCNBXPLORERURL: http://nbxplorer:32838/

View file

@ -12,6 +12,7 @@ services:
args:
CONFIGURATION_NAME: Release
environment:
TESTS_EXPERIMENTALV2_CONFIRM: "true"
TESTS_BTCRPCCONNECTION: server=http://bitcoind:43782;ceiwHEbqWI83:DwubwWsoo3
TESTS_BTCNBXPLORERURL: http://nbxplorer:32838/
TESTS_DB: "Postgres"

View file

@ -45,6 +45,12 @@ namespace BTCPayServer
#endif
conf = confBuilder.Build();
var confirm = conf.GetOrDefault<bool>("EXPERIMENTALV2_CONFIRM", false);
if(!confirm)
{
throw new ConfigException("You are running an experimental version of BTCPay Server that is the basis for v2. Many things will change and break, including irreversible database migrations. THERE IS NO WAY BACK. Please confirm you understand this by setting the setting EXPERIMENTALV2_CONFIRM=true");
}
var builder = new WebHostBuilder()
.UseKestrel()
.UseConfiguration(conf)

View file

@ -4,6 +4,7 @@
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"EXPERIMENTALV2_CONFIRM": "true",
"BTCPAY_NETWORK": "regtest",
"BTCPAY_LAUNCHSETTINGS": "true",
"BTCPAY_BTCLIGHTNING": "type=clightning;server=tcp://127.0.0.1:30993/",
@ -37,6 +38,7 @@
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"EXPERIMENTALV2_CONFIRM": "true",
"BTCPAY_NETWORK": "regtest",
"BTCPAY_LAUNCHSETTINGS": "true",
"BTCPAY_PORT": "14142",
@ -74,6 +76,7 @@
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"EXPERIMENTALV2_CONFIRM": "true",
"BTCPAY_NETWORK": "regtest",
"BTCPAY_LAUNCHSETTINGS": "true",
"BTCPAY_PORT": "14142",