0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-22 22:06:21 -05:00
forgejo/modules
Gusted a9c97110f9 feat: add configurable cooldown to claim usernames (#6422)
Add a new option that allows instances to set a cooldown period to claim
old usernames. In the context of public instances this can be used to
prevent old usernames to be claimed after they are free and allow
graceful migration (by making use of the redirect feature) to a new
username. The granularity of this cooldown is a day. By default this
feature is disabled and thus no cooldown period.

The `CreatedUnix` column is added the `user_redirect` table, for
existing redirects the timestamp is simply zero as we simply do not know
when they were created and are likely already over the cooldown period
if the instance configures one.

Users can always reclaim their 'old' user name again within the cooldown
period. Users can also always reclaim 'old' names of organization they
currently own within the cooldown period.

Creating and renaming users as an admin user are not affected by the
cooldown period for moderation and user support reasons.

To avoid abuse of the cooldown feature, such that a user holds a lot of
usernames, a new option is added `MAX_USER_REDIRECTS` which sets a limit
to the amount of user redirects a user may have, by default this is
disabled. If a cooldown period is set then the default is 5. This
feature operates independently of the cooldown period feature.

Added integration and unit testing.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6422
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-01-24 04:16:56 +00:00
..
actions Fix wrong status of Set up Job when first step is skipped (#32120) 2024-09-29 10:38:49 +02:00
activitypub [PORT] Remove SHA1 for support for ssh rsa signing (#31857) (#5303) 2025-01-17 03:17:10 +00:00
analyze
assetfs
auth chore: avoid using gock 2024-12-18 06:40:02 +01:00
avatar
base fix: extend forgejo_auth_token table 2024-11-15 10:59:36 +01:00
cache Increase cacheContextLifetime to reduce false reports (#32011) 2024-09-14 17:09:03 +02:00
card Update 2024-12-30 17:47:34 +01:00
charset refactor: remove redundant err declarations (#32381) 2024-11-05 09:33:15 +01:00
container Add search action jobs for API routes, repo, org and global level (#6300) 2025-01-14 11:17:42 +00:00
csv
emoji
eventsource fix: use better code to group UID and stopwatches 2024-11-16 15:59:02 +01:00
forgefed
generate
git Support the new exit code for git remote subcommands for git version >=2.30.0 (#33129) 2025-01-12 08:52:51 +01:00
gitgraph fix: Proper paring of date for git commits 2024-11-10 22:23:28 +01:00
gitrepo
graceful chore: remove some Windows-specific files 2024-09-19 20:39:55 +05:00
hcaptcha
highlight feat: highlight Gradle Kotlin as Kotlin 2024-12-04 22:06:33 +01:00
hostmatcher Support allowed hosts for migrations to work with proxy (#32025) 2024-09-14 17:52:54 +02:00
html
httpcache Fix wrong last modify time (#32102) 2024-09-27 08:42:48 +02:00
httplib Fix wrong last modify time (#32102) 2024-09-27 08:42:48 +02:00
indexer feat: filepath filter for code search (#6143) 2024-12-22 12:24:29 +00:00
issue/template [CHORE] Use forked binding library 2024-11-05 22:47:34 +01:00
json
keying feat: harden keying implementation 2024-12-25 00:10:18 +01:00
label
lfs Add User-Agent for gitea's self-implemented lfs client. (branding) 2024-12-17 06:18:24 +01:00
log feat: add a buffer writer to the logger, for internal use (#6551) 2025-01-13 13:40:24 +00:00
markup Update module github.com/alecthomas/chroma/v2 to v2.15.0 (forgejo) (#6477) 2025-01-06 04:11:25 +00:00
mcaptcha
metrics
migration feat: implement migration of website field from gogs/gitea/github (#6474) 2025-01-20 12:18:19 +00:00
nosql
optional
options
packages Alt Linux Apt-Rpm repository support for Forgejo packages. (#6351) 2025-01-22 14:01:49 +00:00
paginator
pprof
private
process feat: add limited execution tracing support 2025-01-05 04:07:49 +01:00
proxy
proxyprotocol
public
queue chore: update mock redis client 2024-09-01 05:42:34 +02:00
recaptcha
references fix trailing comma not matched in the case of alphanumeric issue (#32945) 2024-12-28 19:00:07 +00:00
regexplru
repository feat: allow changing default branch update style 2024-12-23 18:55:25 +03:00
secret fix: teach the doctor about orphaned two_factor rows (#6639) 2025-01-21 17:30:08 +00:00
session
setting feat: add configurable cooldown to claim usernames (#6422) 2025-01-24 04:16:56 +00:00
sitemap
ssh fix: ensure correct ssh public key is used for authentication 2024-12-12 05:54:07 +01:00
storage Add artifacts test fixture (#30300) 2024-11-05 09:33:15 +01:00
structs Add search action jobs for API routes, repo, org and global level (#6300) 2025-01-14 11:17:42 +00:00
svg
sync
system
templates chore(branding): strip metadata information from the footer 2024-12-29 22:40:13 +00:00
test
testlogger test: add trailing newline to testlogger.go:recordError message 2024-11-14 14:38:47 +01:00
timeutil [PORT] Refactor DateUtils and merge TimeSince (gitea#32409) 2024-11-10 22:23:27 +01:00
translation Initial support for localization and pluralization with go-i18n-JSON-v2 format 2025-01-17 11:21:28 +01:00
turnstile
typesniffer Update modules/typesniffer/typesniffer.go 2024-11-28 10:27:33 +00:00
updatechecker
uri
user
util Validate OAuth Redirect URIs (#32643) 2024-12-03 10:19:22 +01:00
validation Validate OAuth Redirect URIs (#32643) 2024-12-03 10:19:22 +01:00
web [CHORE] Use forked binding library 2024-11-05 22:47:34 +01:00
webhook
zstd