mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 07:22:24 -05:00
[chore] remove nollamas middleware for now (after discussions with a security advisor) (#4433)
i'll keep this on a separate branch for now while i experiment with other possible alternatives, but for now both our hacky implementation especially, and more popular ones (like anubis) aren't looking too great on the deterrent front: https://github.com/eternal-flame-AD/pow-buster Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4433 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
247733aef4
commit
6801ce299a
28 changed files with 207 additions and 1395 deletions
|
|
@ -101,16 +101,12 @@ func (m *Module) Route(r *router.Router, mi ...gin.HandlerFunc) {
|
|||
|
||||
// Handlers that serve profiles and statuses should use
|
||||
// the SignatureCheck middleware, so that requests with
|
||||
// content-type application/activity+json can be served,
|
||||
// and (if enabled) the nollamas middleware, to protect
|
||||
// against scraping by shitty LLM bullshit.
|
||||
// content-type application/activity+json can be served.
|
||||
profileGroup := r.AttachGroup(profileGroupPath)
|
||||
profileGroup.Use(mi...)
|
||||
profileGroup.Use(middleware.SignatureCheck(m.isURIBlocked), middleware.CacheControl(middleware.CacheControlConfig{
|
||||
Directives: []string{"no-store"},
|
||||
}))
|
||||
nollamas := middleware.NoLLaMas(m.cookiePolicy, m.processor.InstanceGetV1)
|
||||
profileGroup.Use(nollamas)
|
||||
profileGroup.Handle(http.MethodGet, "", m.profileGETHandler) // use empty path here since it's the base of the group
|
||||
profileGroup.Handle(http.MethodGet, statusPath, m.threadGETHandler)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue