From 1a574add4933c03d768698abe5b42aae82575ef4 Mon Sep 17 00:00:00 2001 From: Lukas Schulte Pelkum Date: Mon, 22 Aug 2022 16:58:36 +0200 Subject: [PATCH] remove deletion token notation support --- README.md | 18 +----------------- internal/config/config.go | 8 ++++---- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 48af4d8..741cc1e 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,6 @@ # pasty -Pasty is a fast and lightweight code pasting server - -## !!! Important deprecation notices !!! - -> This version of pasty uses a new field name for the so far called `deletionToken`: `modificationToken`. -> Instances using **PostgreSQL** are **not affected** as a corresponding SQL migration will run before the first startup. -> If you however use **another storage driver** you may have to **update the entries** by hand or using a simple query, depending on your driver as I don't plan to ship migrations for every single storage driver. -> It may be important to know that the **data migrator has been upgraded** too. This may serve as a **convenient workaround** (export data (field will be renamed) and import data with changed field names again). -> -> The old `deletionToken` field will be processed corresponding to these changes but I strongly recommend updating old pastes if possible. - -> Additionally, I changed the three `DELETION_TOKEN*`environment variables to their corresponding `MODIFICATION_TOKEN*` ones: -> - `DELETION_TOKENS` -> `MODIFICATION_TOKENS` -> - `DELETION_TOKEN_MASTER` -> `MODIFICATION_TOKEN_MASTER` -> - `DELETION_TOKEN_LENGTH` -> `MODIFICATION_TOKEN_LENGTH` -> -> Again, **the old ones will still work** because I do not want to jumble your configurations. However, **please consider updating** them to stay future-proof ^^. +pasty is a fast and lightweight code pasting server. ## Support diff --git a/internal/config/config.go b/internal/config/config.go index 6254e28..86ebcf8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -84,12 +84,12 @@ func Load() { HastebinSupport: env.MustBool("HASTEBIN_SUPPORT", false), IDLength: env.MustInt("ID_LENGTH", 6), IDCharacters: env.MustString("ID_CHARACTERS", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"), - ModificationTokens: env.MustBool("MODIFICATION_TOKENS", env.MustBool("DELETION_TOKENS", true)), // --- - ModificationTokenMaster: env.MustString("MODIFICATION_TOKEN_MASTER", env.MustString("DELETION_TOKEN_MASTER", "")), // - We don't want to destroy peoples old configuration - ModificationTokenLength: env.MustInt("MODIFICATION_TOKEN_LENGTH", env.MustInt("DELETION_TOKEN_LENGTH", 12)), // --- + ModificationTokens: env.MustBool("MODIFICATION_TOKENS", true), + ModificationTokenMaster: env.MustString("MODIFICATION_TOKEN_MASTER", ""), + ModificationTokenLength: env.MustInt("MODIFICATION_TOKEN_LENGTH", 12), ModificationTokenCharacters: env.MustString("MODIFICATION_TOKEN_CHARACTERS", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"), RateLimit: env.MustString("RATE_LIMIT", "30-M"), - LengthCap: env.MustInt("LENGTH_CAP", 50_000), + LengthCap: env.MustInt("LENGTH_CAP", 50000), AutoDelete: &AutoDeleteConfig{ Enabled: env.MustBool("AUTODELETE", false), Lifetime: env.MustDuration("AUTODELETE_LIFETIME", 720*time.Hour),