[backend] Add disclaimer when running in Development environment

This commit is contained in:
Laura Hausmann 2024-02-03 23:14:43 +01:00
parent b72a22b9b0
commit 4620758701
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -40,6 +40,12 @@ public static class WebApplicationExtensions {
app.Logger.LogInformation("Iceshrimp.NET v{version} ({domain})", instanceConfig.Version,
instanceConfig.AccountDomain);
if (app.Environment.IsDevelopment()) {
app.Logger.LogWarning("The hosting environment is set to Development.");
app.Logger.LogWarning("This application will not validate the Host header for incoming requests.");
app.Logger.LogWarning("If this is not a local development instance, please set the environment to Production.");
}
var provider = app.Services.CreateScope();
var context = provider.ServiceProvider.GetService<DatabaseContext>();
if (context == null) {