mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Adding BundleJsCss as property on BtcPayServerOptions
This commit is contained in:
@@ -78,6 +78,7 @@ namespace BTCPayServer.Configuration
|
|||||||
Logs.Configuration.LogInformation("Supported chains: " + String.Join(',', supportedChains.ToArray()));
|
Logs.Configuration.LogInformation("Supported chains: " + String.Join(',', supportedChains.ToArray()));
|
||||||
|
|
||||||
PostgresConnectionString = conf.GetOrDefault<string>("postgres", null);
|
PostgresConnectionString = conf.GetOrDefault<string>("postgres", null);
|
||||||
|
BundleJsCss = conf.GetOrDefault<bool>("bundlejscss", true);
|
||||||
ExternalUrl = conf.GetOrDefault<Uri>("externalurl", null);
|
ExternalUrl = conf.GetOrDefault<Uri>("externalurl", null);
|
||||||
InternalLightningNode = conf.GetOrDefault<Uri>("internallightningnode", null);
|
InternalLightningNode = conf.GetOrDefault<Uri>("internallightningnode", null);
|
||||||
}
|
}
|
||||||
@@ -95,5 +96,10 @@ namespace BTCPayServer.Configuration
|
|||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
public bool BundleJsCss
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace BTCPayServer.Configuration
|
|||||||
}
|
}
|
||||||
app.Option("--externalurl", $"The expected external url of this service, to use if BTCPay is behind a reverse proxy (default: empty, use the incoming HTTP request to figure out)", CommandOptionType.SingleValue);
|
app.Option("--externalurl", $"The expected external url of this service, to use if BTCPay is behind a reverse proxy (default: empty, use the incoming HTTP request to figure out)", CommandOptionType.SingleValue);
|
||||||
app.Option("--internallightningnode", $"An internal lightning node which can be used without https requirement and easily configured by the admin (default: empty)", CommandOptionType.SingleValue);
|
app.Option("--internallightningnode", $"An internal lightning node which can be used without https requirement and easily configured by the admin (default: empty)", CommandOptionType.SingleValue);
|
||||||
|
app.Option("--bundlejscss", $"Bundle javascript and css files for better performance (default: true)", CommandOptionType.SingleValue);
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -184,10 +184,15 @@ namespace BTCPayServer.Hosting
|
|||||||
});
|
});
|
||||||
|
|
||||||
// bundling
|
// bundling
|
||||||
services.AddBundles(options =>
|
|
||||||
|
services.AddBundles();
|
||||||
|
services.AddTransient<BundleOptions>(provider =>
|
||||||
{
|
{
|
||||||
options.UseMinifiedFiles = Environment.GetEnvironmentVariable("BTCPAY_BUNDLEJSCSS") == "true";
|
var opts = provider.GetRequiredService<BTCPayServerOptions>();
|
||||||
options.AppendVersion = true;
|
var bundle = new BundleOptions();
|
||||||
|
bundle.UseMinifiedFiles = opts.BundleJsCss;
|
||||||
|
bundle.AppendVersion = true;
|
||||||
|
return bundle;
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
@@ -22,8 +22,7 @@
|
|||||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||||
"BTCPAY_CHAINS": "btc,ltc",
|
"BTCPAY_CHAINS": "btc,ltc",
|
||||||
"BTCPAY_POSTGRES": "User ID=postgres;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
"BTCPAY_POSTGRES": "User ID=postgres;Host=127.0.0.1;Port=39372;Database=btcpayserver",
|
||||||
"BTCPAY_INTERNALLIGHTNINGNODE": "http://api-token:foiewnccewuify@127.0.0.1:54938/",
|
"BTCPAY_INTERNALLIGHTNINGNODE": "http://api-token:foiewnccewuify@127.0.0.1:54938/"
|
||||||
"BTCPAY_BUNDLEJSCSS": "true"
|
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:14142/"
|
"applicationUrl": "http://localhost:14142/"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user