Clarify name

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-06-26 22:15:38 +02:00
parent 1641e38856
commit 03f88fc637
No known key found for this signature in database
GPG Key ID: D91C3E91E4CAD6F5
4 changed files with 15 additions and 13 deletions

View File

@ -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.

6
api.go
View File

@ -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") {

View File

@ -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"`
}
)

View File

@ -117,7 +117,7 @@
</b-button>
</b-col>
<b-col
v-if="!customize.disableExpiry"
v-if="!customize.disableExpiryOverride"
cols="12"
md="6"
order="1"