You've already forked gotosocial_aur
Compare commits
8 Commits
85847aba04
...
main
Author | SHA1 | Date | |
---|---|---|---|
ddb049b558 | |||
d093e3fcb2 | |||
3266938652 | |||
fef593f4aa | |||
7db82fad46 | |||
e889e49d02 | |||
3894d3b818 | |||
7179c0b2d8 |
20
.SRCINFO
20
.SRCINFO
@ -1,6 +1,6 @@
|
||||
pkgbase = gotosocial
|
||||
pkgdesc = ActivityPub social network server written in Golang
|
||||
pkgver = 0.18.2
|
||||
pkgver = 0.19.1
|
||||
pkgrel = 11
|
||||
url = https://gotosocial.org
|
||||
arch = x86_64
|
||||
@ -13,6 +13,7 @@ pkgbase = gotosocial
|
||||
depends = glibc
|
||||
options = !lto
|
||||
backup = etc/gotosocial/config.yaml
|
||||
backup = etc/gotosocial/template/2fa.tmpl
|
||||
backup = etc/gotosocial/template/404.tmpl
|
||||
backup = etc/gotosocial/template/about.tmpl
|
||||
backup = etc/gotosocial/template/authorize.tmpl
|
||||
@ -41,34 +42,37 @@ pkgbase = gotosocial
|
||||
backup = etc/gotosocial/template/page_header.tmpl
|
||||
backup = etc/gotosocial/template/page_ogmeta.tmpl
|
||||
backup = etc/gotosocial/template/page_stylesheets.tmpl
|
||||
backup = etc/gotosocial/template/profile-gallery.tmpl
|
||||
backup = etc/gotosocial/template/profile.tmpl
|
||||
backup = etc/gotosocial/template/profile_about_user.tmpl
|
||||
backup = etc/gotosocial/template/profile_fields.tmpl
|
||||
backup = etc/gotosocial/template/profile_header.tmpl
|
||||
backup = etc/gotosocial/template/settings.tmpl
|
||||
backup = etc/gotosocial/template/sign-in.tmpl
|
||||
backup = etc/gotosocial/template/sign-up.tmpl
|
||||
backup = etc/gotosocial/template/signed-up.tmpl
|
||||
backup = etc/gotosocial/template/status.tmpl
|
||||
backup = etc/gotosocial/template/status_attachments.tmpl
|
||||
backup = etc/gotosocial/template/status_attachment.tmpl
|
||||
backup = etc/gotosocial/template/status_attributes.tmpl
|
||||
backup = etc/gotosocial/template/status_header.tmpl
|
||||
backup = etc/gotosocial/template/status_info.tmpl
|
||||
backup = etc/gotosocial/template/status_poll.tmpl
|
||||
backup = etc/gotosocial/template/tag.tmpl
|
||||
backup = etc/gotosocial/template/thread.tmpl
|
||||
source = gotosocial::git+https://github.com/superseriousbusiness/gotosocial#tag=v0.18.2
|
||||
source = gotosocial::git+https://github.com/superseriousbusiness/gotosocial#tag=v0.19.1
|
||||
source = sysusers.conf
|
||||
source = tmpfiles.conf
|
||||
source = use-fhs-directories.patch
|
||||
source = support-unix-sockets.patch
|
||||
sha512sums = 26ab454e2eb6894e4084a1f6a71d14b3279a3ae8456e8bbec48f133b889f5b2f20d8f4bc761bfe7d6c3fa14b49b69c11cb7162187700b527bb96873e89442d0f
|
||||
source = modded.patch
|
||||
sha512sums = cab294e99184ec25888101e04e5753ab9f042711662258e0155619e071750a364f102132682aa44e95fba7a9c10ca3cf00da18537406f8bdfa4ec95e2a74663d
|
||||
sha512sums = 2ff5499a31e12733cb20a9261942ed135fbac327d5a836b8955f3e86c009a603cf965440d9dbe6db64b80d0f652ba56faddb0ef398393b72474d8cf6c438ab80
|
||||
sha512sums = b89fad3073e140f17167515b38942e5b5e2bc2aee03c484e1bb7cf6444f86cb1e2a13a60b101e04d22633d348be073ca26cd309da4746e5062c12b4f3ce4b38a
|
||||
sha512sums = 913a5209487aba06bf1d8ac7c02506a05d01a8e12f172666c84bf6870d6237640d4745617b0f07ea8c9dcf665f4e0d24a0aabef31611909f7e9384ed6e7b7e77
|
||||
sha512sums = 5cd0f4f325c452f311e5187147a0d91bae5b2537f329a087e6bc8618317021dbf2d80d7c42d135946ce2399223bebfa4988d856bdba730a20084ce9c21f77990
|
||||
b2sums = 3cff26624bd7231018accc002d9292fcde6bb12f91d80faf473fb96fd49248f490f9e62aa724deaab4e22445c4a2865dcc2b38d52f2b5be75feb2c211100689d
|
||||
sha512sums = 7a9837521e4765d3b6b509876ccf19a89de6dcafa69e82e436d1c26ca98e416ec012e5323c2d446ef92288821d0c64669076ebe647f72dba4d4d51fc63ffd847
|
||||
b2sums = 773c579ec4f504141dbae393dcaf6cd2b9669f8338d4f01d546def27c05f5899b12b3f7287bcf229743a11335597d6cadd8bc803e076f3558848dcd808d80277
|
||||
b2sums = ccf672731b88fc6700b0b81737790365e1eea0066bad1bbf6b13dac1e5b42af69063838efca47a6d9c16ee3f6308e2e23b92cf79d4226cd88f8551fb7361649b
|
||||
b2sums = 4f65af952441c0f54bb32049a149675e207f8993678423d369c4095c57476464614ac720eccc64d7a93a81268ad7ca41cae75ca7211bd7b78f9035f6e5341f04
|
||||
b2sums = 9edd4520fb99856feb82d01935588add7f805aa180f2ed0fe169cb26576bc2e1d2c1e6ab11604d977cec6a4ad8f1d5be1413e1a366de59b89c5b869136538f8c
|
||||
b2sums = a2ae0a592608bb66784c704a076ceacd3f96b81006354a02da33d1292125f5e4e96c35472206cd2c998a9bc0eb2f191ccc66be69eb1397d8aa3eee145c9e7a7a
|
||||
b2sums = 9958c7a20249ced130963fd5cfc9c8750ee4b98554a404f62d2d488298008a7e891bc136fab2373bdbb82534881e8407430f08ff519138fb649e93052e197c11
|
||||
|
||||
pkgname = gotosocial
|
||||
|
16
PKGBUILD
16
PKGBUILD
@ -3,7 +3,7 @@
|
||||
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
|
||||
|
||||
pkgname=gotosocial
|
||||
pkgver=0.18.2
|
||||
pkgver=0.19.1
|
||||
pkgrel=11
|
||||
pkgdesc='ActivityPub social network server written in Golang'
|
||||
arch=('x86_64')
|
||||
@ -14,6 +14,7 @@ makedepends=('git' 'go' 'yarn' 'nodejs' 'go-swagger')
|
||||
options=('!lto')
|
||||
backup=(
|
||||
'etc/gotosocial/config.yaml'
|
||||
'etc/gotosocial/template/2fa.tmpl'
|
||||
'etc/gotosocial/template/404.tmpl'
|
||||
'etc/gotosocial/template/about.tmpl'
|
||||
'etc/gotosocial/template/authorize.tmpl'
|
||||
@ -42,14 +43,17 @@ backup=(
|
||||
'etc/gotosocial/template/page_header.tmpl'
|
||||
'etc/gotosocial/template/page_ogmeta.tmpl'
|
||||
'etc/gotosocial/template/page_stylesheets.tmpl'
|
||||
'etc/gotosocial/template/profile-gallery.tmpl'
|
||||
'etc/gotosocial/template/profile.tmpl'
|
||||
'etc/gotosocial/template/profile_about_user.tmpl'
|
||||
'etc/gotosocial/template/profile_fields.tmpl'
|
||||
'etc/gotosocial/template/profile_header.tmpl'
|
||||
'etc/gotosocial/template/settings.tmpl'
|
||||
'etc/gotosocial/template/sign-in.tmpl'
|
||||
'etc/gotosocial/template/sign-up.tmpl'
|
||||
'etc/gotosocial/template/signed-up.tmpl'
|
||||
'etc/gotosocial/template/status.tmpl'
|
||||
'etc/gotosocial/template/status_attachments.tmpl'
|
||||
'etc/gotosocial/template/status_attachment.tmpl'
|
||||
'etc/gotosocial/template/status_attributes.tmpl'
|
||||
'etc/gotosocial/template/status_header.tmpl'
|
||||
'etc/gotosocial/template/status_info.tmpl'
|
||||
@ -64,16 +68,16 @@ source=(
|
||||
'use-fhs-directories.patch'
|
||||
'modded.patch'
|
||||
)
|
||||
sha512sums=('26ab454e2eb6894e4084a1f6a71d14b3279a3ae8456e8bbec48f133b889f5b2f20d8f4bc761bfe7d6c3fa14b49b69c11cb7162187700b527bb96873e89442d0f'
|
||||
sha512sums=('cab294e99184ec25888101e04e5753ab9f042711662258e0155619e071750a364f102132682aa44e95fba7a9c10ca3cf00da18537406f8bdfa4ec95e2a74663d'
|
||||
'2ff5499a31e12733cb20a9261942ed135fbac327d5a836b8955f3e86c009a603cf965440d9dbe6db64b80d0f652ba56faddb0ef398393b72474d8cf6c438ab80'
|
||||
'b89fad3073e140f17167515b38942e5b5e2bc2aee03c484e1bb7cf6444f86cb1e2a13a60b101e04d22633d348be073ca26cd309da4746e5062c12b4f3ce4b38a'
|
||||
'913a5209487aba06bf1d8ac7c02506a05d01a8e12f172666c84bf6870d6237640d4745617b0f07ea8c9dcf665f4e0d24a0aabef31611909f7e9384ed6e7b7e77'
|
||||
'6c9a529ad0472d25500bb77bc9b6f268c01cef61559f5d9b26b192e84bd987d9eb22c6c5dee1dc7f60a5bb99513aff93f241e1e30478f81531fa53f55be442c6')
|
||||
b2sums=('3cff26624bd7231018accc002d9292fcde6bb12f91d80faf473fb96fd49248f490f9e62aa724deaab4e22445c4a2865dcc2b38d52f2b5be75feb2c211100689d'
|
||||
'7a9837521e4765d3b6b509876ccf19a89de6dcafa69e82e436d1c26ca98e416ec012e5323c2d446ef92288821d0c64669076ebe647f72dba4d4d51fc63ffd847')
|
||||
b2sums=('773c579ec4f504141dbae393dcaf6cd2b9669f8338d4f01d546def27c05f5899b12b3f7287bcf229743a11335597d6cadd8bc803e076f3558848dcd808d80277'
|
||||
'ccf672731b88fc6700b0b81737790365e1eea0066bad1bbf6b13dac1e5b42af69063838efca47a6d9c16ee3f6308e2e23b92cf79d4226cd88f8551fb7361649b'
|
||||
'4f65af952441c0f54bb32049a149675e207f8993678423d369c4095c57476464614ac720eccc64d7a93a81268ad7ca41cae75ca7211bd7b78f9035f6e5341f04'
|
||||
'9edd4520fb99856feb82d01935588add7f805aa180f2ed0fe169cb26576bc2e1d2c1e6ab11604d977cec6a4ad8f1d5be1413e1a366de59b89c5b869136538f8c'
|
||||
'b92f9b3b10109c2f63099c12c38c8615dc9b22f846ba15ec4c004069a7291f166cd4cb6ebf820f62dbf934a3388a767feaa3fdf8b47cf0a04532b182caaec149')
|
||||
'9958c7a20249ced130963fd5cfc9c8750ee4b98554a404f62d2d488298008a7e891bc136fab2373bdbb82534881e8407430f08ff519138fb649e93052e197c11')
|
||||
|
||||
prepare() {
|
||||
cd "$pkgname"
|
||||
|
163
modded.patch
163
modded.patch
@ -1,5 +1,5 @@
|
||||
diff --git a/example/config.yaml b/example/config.yaml
|
||||
index 2b3a873fb..52615a345 100644
|
||||
index 17a57b857..bf645a364 100644
|
||||
--- a/example/config.yaml
|
||||
+++ b/example/config.yaml
|
||||
@@ -105,13 +105,13 @@ account-domain: ""
|
||||
@ -42,35 +42,35 @@ index 2b3a873fb..52615a345 100644
|
||||
db-address: ""
|
||||
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 7d15b19dd..beb7b0235 100644
|
||||
index 4169208ed..60b3a1281 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -72,6 +72,7 @@ require (
|
||||
@@ -74,6 +74,7 @@ require (
|
||||
github.com/uptrace/bun/extra/bunotel v1.2.11
|
||||
github.com/wagslane/go-password-validator v0.3.0
|
||||
github.com/yuin/goldmark v1.7.8
|
||||
github.com/yuin/goldmark v1.7.11
|
||||
+ go.balki.me/anyhttp v0.5.0
|
||||
go.opentelemetry.io/otel v1.34.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0
|
||||
go.opentelemetry.io/otel v1.35.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0
|
||||
diff --git a/go.sum b/go.sum
|
||||
index 24176856b..a9680692a 100644
|
||||
index 597cee716..532e99852 100644
|
||||
--- a/go.sum
|
||||
+++ b/go.sum
|
||||
@@ -620,6 +620,8 @@ github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
||||
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
gitlab.com/NyaaaWhatsUpDoc/sqlite v1.35.0-concurrency-workaround h1:rSPHdoNXzXyWQUUeMEy8pdOFn8lH7XqdBRTS9G+jdTg=
|
||||
gitlab.com/NyaaaWhatsUpDoc/sqlite v1.35.0-concurrency-workaround/go.mod h1:9cr2sicr7jIaWTBKQmAxQLfBv9LL0su4ZTEV+utt3ic=
|
||||
@@ -489,6 +489,8 @@ github.com/yuin/goldmark v1.7.11 h1:ZCxLyDMtz0nT2HFfsYG8WZ47Trip2+JyLysKcMYE5bo=
|
||||
github.com/yuin/goldmark v1.7.11/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
|
||||
gitlab.com/NyaaaWhatsUpDoc/sqlite v1.37.0-concurrency-workaround h1:QbfrBqNKgAFSSK89fYf547vxDQuz8p6iJUzzAMrusNk=
|
||||
gitlab.com/NyaaaWhatsUpDoc/sqlite v1.37.0-concurrency-workaround/go.mod h1:5YiWv+YviqGMuGw4V+PNplcyaJ5v+vQd7TQOgkACoJM=
|
||||
+go.balki.me/anyhttp v0.5.0 h1:uys0oRciBpZfwtxXAevScKy6amIQBXyDrcV0EtGF5zo=
|
||||
+go.balki.me/anyhttp v0.5.0/go.mod h1:JhfekOIjgVODoVqUCficjpIgmB3wwlB7jhN0eN2EZ/s=
|
||||
go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80=
|
||||
go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
|
||||
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
diff --git a/internal/config/config.go b/internal/config/config.go
|
||||
index 8ce2105b4..93ad8d7b0 100644
|
||||
index b9804d404..331d41139 100644
|
||||
--- a/internal/config/config.go
|
||||
+++ b/internal/config/config.go
|
||||
@@ -59,6 +59,7 @@ type Configuration struct {
|
||||
@@ -58,6 +58,7 @@ type Configuration struct {
|
||||
BindAddress string `name:"bind-address" usage:"Bind address to use for the GoToSocial server (eg., 0.0.0.0, 172.138.0.9, [::], localhost). For ipv6, enclose the address in square brackets, eg [2001:db8::fed1]. Default binds to all interfaces."`
|
||||
Port int `name:"port" usage:"Port to use for GoToSocial. Change this to 443 if you're running the binary directly on the host machine."`
|
||||
TrustedProxies []string `name:"trusted-proxies" usage:"Proxies to trust when parsing x-forwarded headers into real IPs."`
|
||||
@ -78,7 +78,7 @@ index 8ce2105b4..93ad8d7b0 100644
|
||||
SoftwareVersion string `name:"software-version" usage:""`
|
||||
|
||||
DbType string `name:"db-type" usage:"Database type: eg., postgres"`
|
||||
@@ -194,6 +195,8 @@ type Configuration struct {
|
||||
@@ -193,6 +194,8 @@ type Configuration struct {
|
||||
AdminMediaListRemoteOnly bool `name:"remote-only" usage:"list only remote attachments/emojis; if specified then local-only cannot also be true"`
|
||||
|
||||
RequestIDHeader string `name:"request-id-header" usage:"Header to extract the Request ID from. Eg.,'X-Request-Id'."`
|
||||
@ -88,10 +88,10 @@ index 8ce2105b4..93ad8d7b0 100644
|
||||
|
||||
type HTTPClientConfiguration struct {
|
||||
diff --git a/internal/config/defaults.go b/internal/config/defaults.go
|
||||
index 78a8230d5..b8b2ff5f2 100644
|
||||
index 57c64db44..c19864002 100644
|
||||
--- a/internal/config/defaults.go
|
||||
+++ b/internal/config/defaults.go
|
||||
@@ -233,4 +233,6 @@
|
||||
@@ -234,4 +234,6 @@
|
||||
RequestIDHeader: "X-Request-Id",
|
||||
|
||||
LogClientIP: true,
|
||||
@ -99,19 +99,10 @@ index 78a8230d5..b8b2ff5f2 100644
|
||||
+ KalaclistaAllowedUnauthorizedGet: false,
|
||||
}
|
||||
diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go
|
||||
index 156c19fd5..ab12c44be 100644
|
||||
index f063cbf93..cdb5a663f 100644
|
||||
--- a/internal/config/helpers.gen.go
|
||||
+++ b/internal/config/helpers.gen.go
|
||||
@@ -2,7 +2,7 @@
|
||||
// GoToSocial
|
||||
// Copyright (C) GoToSocial Authors admin@gotosocial.org
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-//
|
||||
+//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -351,6 +351,31 @@ func GetTrustedProxies() []string { return global.GetTrustedProxies() }
|
||||
@@ -350,6 +350,31 @@ func GetTrustedProxies() []string { return global.GetTrustedProxies() }
|
||||
// SetTrustedProxies safely sets the value for global configuration 'TrustedProxies' field
|
||||
func SetTrustedProxies(v []string) { global.SetTrustedProxies(v) }
|
||||
|
||||
@ -143,30 +134,7 @@ index 156c19fd5..ab12c44be 100644
|
||||
// GetSoftwareVersion safely fetches the Configuration value for state's 'SoftwareVersion' field
|
||||
func (st *ConfigState) GetSoftwareVersion() (v string) {
|
||||
st.mutex.RLock()
|
||||
@@ -3328,19 +3353,13 @@ func (st *ConfigState) SetCacheConversationLastStatusIDsMemRatio(v float64) {
|
||||
}
|
||||
|
||||
// CacheConversationLastStatusIDsMemRatioFlag returns the flag name for the 'Cache.ConversationLastStatusIDsMemRatio' field
|
||||
-func CacheConversationLastStatusIDsMemRatioFlag() string {
|
||||
- return "cache-conversation-last-status-ids-mem-ratio"
|
||||
-}
|
||||
+func CacheConversationLastStatusIDsMemRatioFlag() string { return "cache-conversation-last-status-ids-mem-ratio" }
|
||||
|
||||
// GetCacheConversationLastStatusIDsMemRatio safely fetches the value for global configuration 'Cache.ConversationLastStatusIDsMemRatio' field
|
||||
-func GetCacheConversationLastStatusIDsMemRatio() float64 {
|
||||
- return global.GetCacheConversationLastStatusIDsMemRatio()
|
||||
-}
|
||||
+func GetCacheConversationLastStatusIDsMemRatio() float64 { return global.GetCacheConversationLastStatusIDsMemRatio() }
|
||||
|
||||
// SetCacheConversationLastStatusIDsMemRatio safely sets the value for global configuration 'Cache.ConversationLastStatusIDsMemRatio' field
|
||||
-func SetCacheConversationLastStatusIDsMemRatio(v float64) {
|
||||
- global.SetCacheConversationLastStatusIDsMemRatio(v)
|
||||
-}
|
||||
+func SetCacheConversationLastStatusIDsMemRatio(v float64) { global.SetCacheConversationLastStatusIDsMemRatio(v) }
|
||||
|
||||
// GetCacheDomainPermissionDraftMemRation safely fetches the Configuration value for state's 'Cache.DomainPermissionDraftMemRation' field
|
||||
func (st *ConfigState) GetCacheDomainPermissionDraftMemRation() (v float64) {
|
||||
@@ -4686,3 +4705,29 @@ func GetRequestIDHeader() string { return global.GetRequestIDHeader() }
|
||||
@@ -4681,3 +4706,28 @@ func GetRequestIDHeader() string { return global.GetRequestIDHeader() }
|
||||
|
||||
// SetRequestIDHeader safely sets the value for global configuration 'RequestIDHeader' field
|
||||
func SetRequestIDHeader(v string) { global.SetRequestIDHeader(v) }
|
||||
@ -195,36 +163,8 @@ index 156c19fd5..ab12c44be 100644
|
||||
+
|
||||
+// SetKalaclistaAllowedUnauthorizedGet safely sets the value for global configuration 'KalaclistaAllowedUnauthorizedGet' field
|
||||
+func SetKalaclistaAllowedUnauthorizedGet(v bool) { global.SetKalaclistaAllowedUnauthorizedGet(v) }
|
||||
+
|
||||
diff --git a/internal/middleware/signaturecheck.go b/internal/middleware/signaturecheck.go
|
||||
index ea63ec4f0..cb8b9df9a 100644
|
||||
--- a/internal/middleware/signaturecheck.go
|
||||
+++ b/internal/middleware/signaturecheck.go
|
||||
@@ -33,7 +33,8 @@
|
||||
sigHeader = string(httpsig.Signature)
|
||||
authHeader = string(httpsig.Authorization)
|
||||
// untyped error returned by httpsig when no signature is present
|
||||
- noSigError = "neither \"" + sigHeader + "\" nor \"" + authHeader + "\" have signature parameters"
|
||||
+ noSigError = "neither \"" + sigHeader + "\" nor \"" + authHeader + "\" have signature parameters"
|
||||
+ bothSigError = "both \"" + sigHeader + "\" and \"" + authHeader + "\" have signature parameters"
|
||||
)
|
||||
|
||||
// SignatureCheck returns a gin middleware for checking http signatures.
|
||||
@@ -54,6 +55,12 @@ func SignatureCheck(uriBlocked func(context.Context, *url.URL) (bool, error)) fu
|
||||
// Create the signature verifier from the request;
|
||||
// this will error if the request wasn't signed.
|
||||
verifier, err := httpsig.NewVerifier(c.Request)
|
||||
+ if err != nil && err.Error() == bothSigError {
|
||||
+ log.Debugf(ctx, "this request has both http signature headers, but fix it: %s", err)
|
||||
+ c.Request.Header.Del(authHeader)
|
||||
+ verifier, err = httpsig.NewVerifier(c.Request)
|
||||
+ }
|
||||
+
|
||||
if err != nil {
|
||||
// Only actually *abort* the request with 401
|
||||
// if a signature was present but malformed.
|
||||
diff --git a/internal/processing/fedi/common.go b/internal/processing/fedi/common.go
|
||||
index 1a4d38bc1..1d62aacdb 100644
|
||||
index 9059aef39..6e9a22b59 100644
|
||||
--- a/internal/processing/fedi/common.go
|
||||
+++ b/internal/processing/fedi/common.go
|
||||
@@ -20,8 +20,10 @@
|
||||
@ -234,10 +174,10 @@ index 1a4d38bc1..1d62aacdb 100644
|
||||
+ "net/http"
|
||||
"net/url"
|
||||
|
||||
+ "github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
+ "code.superseriousbusiness.org/gotosocial/internal/config"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/db"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
|
||||
@@ -51,6 +53,12 @@ func (p *Processor) authenticate(ctx context.Context, requestedUser string) (*co
|
||||
// get requesting account, dereferencing if necessary.
|
||||
pubKeyAuth, errWithCode := p.federator.AuthenticateFederatedRequest(ctx, requestedUser)
|
||||
@ -252,32 +192,32 @@ index 1a4d38bc1..1d62aacdb 100644
|
||||
}
|
||||
|
||||
diff --git a/internal/processing/fedi/emoji.go b/internal/processing/fedi/emoji.go
|
||||
index 9ac0ea244..446e496c0 100644
|
||||
index 8db8b48ea..d7e503f7d 100644
|
||||
--- a/internal/processing/fedi/emoji.go
|
||||
+++ b/internal/processing/fedi/emoji.go
|
||||
@@ -20,15 +20,19 @@
|
||||
@@ -20,14 +20,20 @@
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
+ "net/http"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/ap"
|
||||
+ "github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/ap"
|
||||
+ "code.superseriousbusiness.org/gotosocial/internal/config"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
|
||||
)
|
||||
|
||||
// EmojiGet handles the GET for a federated emoji originating from this instance.
|
||||
func (p *Processor) EmojiGet(ctx context.Context, requestedEmojiID string) (interface{}, gtserror.WithCode) {
|
||||
if _, errWithCode := p.federator.AuthenticateFederatedRequest(ctx, ""); errWithCode != nil {
|
||||
- return nil, errWithCode
|
||||
+ if !(config.GetKalaclistaAllowedUnauthorizedGet() && errWithCode.Code() == http.StatusUnauthorized) {
|
||||
+ return nil, errWithCode
|
||||
+ }
|
||||
+
|
||||
return nil, errWithCode
|
||||
}
|
||||
|
||||
requestedEmoji, err := p.state.DB.GetEmojiByID(ctx, requestedEmojiID)
|
||||
diff --git a/internal/processing/fedi/user.go b/internal/processing/fedi/user.go
|
||||
index 79c1b4fdb..b980161c9 100644
|
||||
index 53dfd6022..7d976a523 100644
|
||||
--- a/internal/processing/fedi/user.go
|
||||
+++ b/internal/processing/fedi/user.go
|
||||
@@ -21,9 +21,11 @@
|
||||
@ -287,30 +227,29 @@ index 79c1b4fdb..b980161c9 100644
|
||||
+ "net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/ap"
|
||||
+ "github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/uris"
|
||||
@@ -67,6 +69,16 @@ func (p *Processor) UserGet(ctx context.Context, requestedUsername string, reque
|
||||
"code.superseriousbusiness.org/gotosocial/internal/ap"
|
||||
+ "code.superseriousbusiness.org/gotosocial/internal/config"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/db"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/uris"
|
||||
@@ -67,6 +69,15 @@ func (p *Processor) UserGet(ctx context.Context, requestedUsername string, reque
|
||||
// we can serve a more complete profile.
|
||||
pubKeyAuth, errWithCode := p.federator.AuthenticateFederatedRequest(ctx, requestedUsername)
|
||||
if errWithCode != nil {
|
||||
+ // kalaclista modded: unauthorized-fetch
|
||||
+ if config.GetKalaclistaAllowedUnauthorizedGet() && errWithCode.Code() == http.StatusUnauthorized {
|
||||
+ person, err := p.converter.AccountToAS(ctx, receiver)
|
||||
+ if err != nil {
|
||||
+ err := gtserror.Newf("error converting account: %w", err)
|
||||
+ return nil, gtserror.NewErrorInternalError(err)
|
||||
+ }
|
||||
+
|
||||
+ return data(person)
|
||||
+ }
|
||||
+
|
||||
return nil, errWithCode // likely 401
|
||||
}
|
||||
|
||||
diff --git a/internal/router/router.go b/internal/router/router.go
|
||||
index c2bf18b4f..97ee65847 100644
|
||||
index 45419807d..7ef90e297 100644
|
||||
--- a/internal/router/router.go
|
||||
+++ b/internal/router/router.go
|
||||
@@ -23,6 +23,7 @@
|
||||
@ -320,11 +259,11 @@ index c2bf18b4f..97ee65847 100644
|
||||
+ "strings"
|
||||
"time"
|
||||
|
||||
"codeberg.org/gruf/go-bytesize"
|
||||
"code.superseriousbusiness.org/gotosocial/internal/config"
|
||||
@@ -31,6 +32,7 @@
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
"codeberg.org/gruf/go-bytesize"
|
||||
"codeberg.org/gruf/go-debug"
|
||||
"github.com/gin-gonic/gin"
|
||||
+ "go.balki.me/anyhttp"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
@ -1241,10 +1180,10 @@ index 000000000..ee3d81ff1
|
||||
+ return i.c
|
||||
+}
|
||||
diff --git a/vendor/modules.txt b/vendor/modules.txt
|
||||
index e053e6ce0..338ab8877 100644
|
||||
index 276f0f17c..ec3ecb43d 100644
|
||||
--- a/vendor/modules.txt
|
||||
+++ b/vendor/modules.txt
|
||||
@@ -959,6 +959,10 @@ github.com/yuin/goldmark/renderer
|
||||
@@ -968,6 +968,10 @@ github.com/yuin/goldmark/renderer
|
||||
github.com/yuin/goldmark/renderer/html
|
||||
github.com/yuin/goldmark/text
|
||||
github.com/yuin/goldmark/util
|
||||
@ -1252,6 +1191,6 @@ index e053e6ce0..338ab8877 100644
|
||||
+## explicit; go 1.20
|
||||
+go.balki.me/anyhttp
|
||||
+go.balki.me/anyhttp/idle
|
||||
# go.mongodb.org/mongo-driver v1.14.0
|
||||
# go.mongodb.org/mongo-driver v1.17.3
|
||||
## explicit; go 1.18
|
||||
go.mongodb.org/mongo-driver/bson
|
||||
|
Reference in New Issue
Block a user