diff --git a/internal/server/server_test.go b/internal/server/server_test.go index 09b1aad..4ddbf03 100644 --- a/internal/server/server_test.go +++ b/internal/server/server_test.go @@ -722,7 +722,7 @@ func TestLoginStoresTheToken(t *testing.T) { t.Error("'stay logged in' did not persist the cookie") } - // The session alone is now enough to claim a custom name. + // The session alone is now enough to claim a vanity name. req, _ := http.NewRequest("POST", h.ts.URL+"/upload", strings.NewReader("two")) req.Header.Set("Accept", "application/json") req.Header.Set("Vanity", "session-upload") @@ -1733,7 +1733,7 @@ func TestUploadPageKeepsTheOneOffTokenField(t *testing.T) { // so anything the upload depends on has to be in the markup ahead of it. The // form is laid out to look otherwise, which is exactly why this is pinned: a // tidy-up that moves the drop zone back up in the markup would silently strip -// the expiry, the custom name and the one-off token from every upload. +// the expiry, the vanity name and the one-off token from every upload. func TestUploadFormSendsTheFileLast(t *testing.T) { h := newHarness(t, nil) resp := h.get(t, "/", "") @@ -1757,10 +1757,10 @@ func TestUploadFormSendsTheFileLast(t *testing.T) { } } -// Anonymous visitors may type a custom name: the token that permits it can be +// Anonymous visitors may type a vanity name: the token that permits it can be // supplied in the same form, for this upload only. The rule itself is the // server's to enforce, not the markup's. -func TestCustomNameFieldIsAlwaysUsable(t *testing.T) { +func TestVanityFieldIsAlwaysUsable(t *testing.T) { h := newHarness(t, nil) resp := h.get(t, "/", "") raw, _ := io.ReadAll(resp.Body) @@ -1768,9 +1768,9 @@ func TestCustomNameFieldIsAlwaysUsable(t *testing.T) { form := string(raw) if i := strings.Index(form, `name="vanity"`); i < 0 { - t.Fatal("the upload form has no custom name field") + t.Fatal("the upload form has no vanity name field") } else if j := strings.Index(form[i:], ">"); strings.Contains(form[i:i+j], "disabled") { - t.Error("the custom name field is disabled, so a one-off token cannot be used with it") + t.Error("the vanity name field is disabled, so a one-off token cannot be used with it") } // Enabled in the page, still refused on the wire without a token. diff --git a/internal/server/upload.go b/internal/server/upload.go index 4e9fddb..9b0d00f 100644 --- a/internal/server/upload.go +++ b/internal/server/upload.go @@ -196,7 +196,7 @@ func (s *Server) storeUpload(w http.ResponseWriter, r *http.Request, req uploadR return } if req.vanity != "" && !lim.AllowVanity { - s.fail(w, r, http.StatusForbidden, "Custom names require a token.") + s.fail(w, r, http.StatusForbidden, "Vanity names require a token.") return } expires, err := resolveExpiry(req.expiry, lim, now) @@ -220,7 +220,7 @@ func (s *Server) storeUpload(w http.ResponseWriter, r *http.Request, req uploadR return case errors.Is(err, store.ErrBadID): s.fail(w, r, http.StatusBadRequest, - "A custom name must be 2-64 characters of letters, digits, dot, dash or underscore.") + "A vanity name must be 2-64 characters of letters, digits, dot, dash or underscore.") return case err != nil: s.log.Error("reserving object", "err", err) diff --git a/token.go b/token.go index b118def..98518cf 100644 --- a/token.go +++ b/token.go @@ -35,7 +35,7 @@ keeps its current value. Give a limit an empty value to go back to inheriting the server's default, and turn a flag off with "=false": uncensored-send token set friend --max-size= inherit the default again - uncensored-send token set friend --vanity=false revoke custom names + uncensored-send token set friend --vanity=false revoke vanity names Options: ` @@ -151,7 +151,7 @@ func (o *tokenOptions) register() *config.Set { fs.String(&o.defExpiry, "default-expiry", "", "", "DURATION", "lifetime applied when this token does not ask for one") fs.String(&o.chosen, "token", "t", "", "VALUE", "use this token instead of a generated one; \"-\" reads it from standard input") - fs.Bool(&o.vanity, "vanity", "", false, "allow this token to claim custom names; --vanity=false revokes it") + fs.Bool(&o.vanity, "vanity", "", false, "allow this token to claim vanity names; --vanity=false revokes it") fs.Bool(&o.admin, "admin", "", false, "allow this token to delete anyone's files; --admin=false revokes it") return fs } diff --git a/web/templates/admin.html b/web/templates/admin.html index 5f6591c..7a5c64c 100644 --- a/web/templates/admin.html +++ b/web/templates/admin.html @@ -29,7 +29,7 @@
Log in with a token to raise these.
{{end}} diff --git a/web/templates/login.html b/web/templates/login.html index 35719fd..8443b55 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -6,7 +6,7 @@