diff --git a/README.md b/README.md index 5e6e9d2..ccf41f8 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ disableAppTitle: false # Disable the dropdown and the API functionality to override the # secret expiry -disableExpiry: false +disableExpiryOverride: false # Disable the footer linking back to the project. If you disable it # please consider a donation to support the project. diff --git a/api.go b/api.go index 66e1055..d3d598a 100644 --- a/api.go +++ b/api.go @@ -47,8 +47,10 @@ func (a apiServer) handleCreate(res http.ResponseWriter, r *http.Request) { secret string ) - if ev, err := strconv.ParseInt(r.URL.Query().Get("expire"), 10, 64); err == nil && (ev < expiry || cfg.SecretExpiry == 0) && !cust.DisableExpiry { - expiry = ev + if !cust.DisableExpiryOverride { + if ev, err := strconv.ParseInt(r.URL.Query().Get("expire"), 10, 64); err == nil && (ev < expiry || cfg.SecretExpiry == 0) { + expiry = ev + } } if strings.HasPrefix(r.Header.Get("Content-Type"), "application/json") { diff --git a/customize.go b/customize.go index 7e3e638..9a52189 100644 --- a/customize.go +++ b/customize.go @@ -12,15 +12,15 @@ import ( type ( customize struct { - AppIcon string `json:"appIcon,omitempty" yaml:"appIcon"` - AppTitle string `json:"appTitle,omitempty" yaml:"appTitle"` - DisableAppTitle bool `json:"disableAppTitle,omitempty" yaml:"disableAppTitle"` - DisableExpiry bool `json:"disableExpiry,omitempty" yaml:"disableExpiry"` - DisablePoweredBy bool `json:"disablePoweredBy,omitempty" yaml:"disablePoweredBy"` - DisableQRSupport bool `json:"disableQRSupport,omitempty" yaml:"disableQRSupport"` - DisableThemeSwitcher bool `json:"disableThemeSwitcher,omitempty" yaml:"disableThemeSwitcher"` - ExpiryChoices []int64 `json:"expiryChoices,omitempty" yaml:"expiryChoices"` - OverlayFSPath string `json:"-" yaml:"overlayFSPath"` + AppIcon string `json:"appIcon,omitempty" yaml:"appIcon"` + AppTitle string `json:"appTitle,omitempty" yaml:"appTitle"` + DisableAppTitle bool `json:"disableAppTitle,omitempty" yaml:"disableAppTitle"` + DisableExpiryOverride bool `json:"disableExpiryOverride,omitempty" yaml:"disableExpiryOverride"` + DisablePoweredBy bool `json:"disablePoweredBy,omitempty" yaml:"disablePoweredBy"` + DisableQRSupport bool `json:"disableQRSupport,omitempty" yaml:"disableQRSupport"` + DisableThemeSwitcher bool `json:"disableThemeSwitcher,omitempty" yaml:"disableThemeSwitcher"` + ExpiryChoices []int64 `json:"expiryChoices,omitempty" yaml:"expiryChoices"` + OverlayFSPath string `json:"-" yaml:"overlayFSPath"` } ) diff --git a/src/app.vue b/src/app.vue index 3065b6d..0f74fb8 100644 --- a/src/app.vue +++ b/src/app.vue @@ -117,7 +117,7 @@