mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-03-29 17:01:42 +01:00
Maintenance mode flag
This commit is contained in:
parent
28910368e3
commit
8289122347
@ -59,6 +59,10 @@ namespace VoidCat.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_settings.MaintenanceMode)
|
||||
{
|
||||
throw new InvalidOperationException("Site is in maintenance mode");
|
||||
}
|
||||
var uid = HttpContext.GetUserId();
|
||||
var mime = Request.Headers.GetHeader("V-Content-Type");
|
||||
var filename = Request.Headers.GetHeader("V-Filename");
|
||||
@ -150,6 +154,10 @@ namespace VoidCat.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_settings.MaintenanceMode)
|
||||
{
|
||||
throw new InvalidOperationException("Site is in maintenance mode");
|
||||
}
|
||||
var gid = id.FromBase58Guid();
|
||||
var meta = await _metadata.Get<SecretFileMeta>(gid);
|
||||
if (meta == default) return UploadResult.Error("File not found");
|
||||
|
@ -7,6 +7,11 @@ namespace VoidCat.Model
|
||||
/// </summary>
|
||||
public class VoidSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Maintenance flag
|
||||
/// </summary>
|
||||
public bool MaintenanceMode { get; init; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Base site url, used for redirect urls
|
||||
/// </summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user