mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 04:22:25 -06:00
Remove unnecessary storage config variables (#344)
* rewire config to not use extraneous serve vars * rename 'file' to 'local' for consistency * use Type and Size again
This commit is contained in:
parent
2582515b4d
commit
cb8688f429
51 changed files with 310 additions and 408 deletions
|
|
@ -35,7 +35,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/id"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/messages"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/util"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/uris"
|
||||
)
|
||||
|
||||
func sameActor(activityActor vocab.ActivityStreamsActorProperty, followActor vocab.ActivityStreamsActorProperty) bool {
|
||||
|
|
@ -106,7 +106,7 @@ func (f *federatingDB) NewID(ctx context.Context, t vocab.Type) (idURL *url.URL,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return url.Parse(util.GenerateURIForFollow(actorAccount.Username, newID))
|
||||
return url.Parse(uris.GenerateURIForFollow(actorAccount.Username, newID))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -241,7 +241,7 @@ func (f *federatingDB) ActorForInbox(ctx context.Context, inboxIRI *url.URL) (ac
|
|||
func (f *federatingDB) getAccountForIRI(ctx context.Context, iri *url.URL) (account *gtsmodel.Account, err error) {
|
||||
acct := >smodel.Account{}
|
||||
|
||||
if util.IsInboxPath(iri) {
|
||||
if uris.IsInboxPath(iri) {
|
||||
if err := f.db.GetWhere(ctx, []db.Where{{Key: "inbox_uri", Value: iri.String()}}, acct); err != nil {
|
||||
if err == db.ErrNoEntries {
|
||||
return nil, fmt.Errorf("no actor found that corresponds to inbox %s", iri.String())
|
||||
|
|
@ -251,7 +251,7 @@ func (f *federatingDB) getAccountForIRI(ctx context.Context, iri *url.URL) (acco
|
|||
return acct, nil
|
||||
}
|
||||
|
||||
if util.IsOutboxPath(iri) {
|
||||
if uris.IsOutboxPath(iri) {
|
||||
if err := f.db.GetWhere(ctx, []db.Where{{Key: "outbox_uri", Value: iri.String()}}, acct); err != nil {
|
||||
if err == db.ErrNoEntries {
|
||||
return nil, fmt.Errorf("no actor found that corresponds to outbox %s", iri.String())
|
||||
|
|
@ -261,7 +261,7 @@ func (f *federatingDB) getAccountForIRI(ctx context.Context, iri *url.URL) (acco
|
|||
return acct, nil
|
||||
}
|
||||
|
||||
if util.IsUserPath(iri) {
|
||||
if uris.IsUserPath(iri) {
|
||||
if err := f.db.GetWhere(ctx, []db.Where{{Key: "uri", Value: iri.String()}}, acct); err != nil {
|
||||
if err == db.ErrNoEntries {
|
||||
return nil, fmt.Errorf("no actor found that corresponds to uri %s", iri.String())
|
||||
|
|
@ -271,7 +271,7 @@ func (f *federatingDB) getAccountForIRI(ctx context.Context, iri *url.URL) (acco
|
|||
return acct, nil
|
||||
}
|
||||
|
||||
if util.IsFollowersPath(iri) {
|
||||
if uris.IsFollowersPath(iri) {
|
||||
if err := f.db.GetWhere(ctx, []db.Where{{Key: "followers_uri", Value: iri.String()}}, acct); err != nil {
|
||||
if err == db.ErrNoEntries {
|
||||
return nil, fmt.Errorf("no actor found that corresponds to followers_uri %s", iri.String())
|
||||
|
|
@ -281,7 +281,7 @@ func (f *federatingDB) getAccountForIRI(ctx context.Context, iri *url.URL) (acco
|
|||
return acct, nil
|
||||
}
|
||||
|
||||
if util.IsFollowingPath(iri) {
|
||||
if uris.IsFollowingPath(iri) {
|
||||
if err := f.db.GetWhere(ctx, []db.Where{{Key: "following_uri", Value: iri.String()}}, acct); err != nil {
|
||||
if err == db.ErrNoEntries {
|
||||
return nil, fmt.Errorf("no actor found that corresponds to following_uri %s", iri.String())
|
||||
|
|
@ -311,30 +311,30 @@ func (f *federatingDB) collectIRIs(ctx context.Context, iris []*url.URL) (vocab.
|
|||
// - A channel that messages for the processor can be placed into.
|
||||
// If a value is not present, nil will be returned for it. It's up to the caller to check this and respond appropriately.
|
||||
func extractFromCtx(ctx context.Context) (receivingAccount, requestingAccount *gtsmodel.Account, fromFederatorChan chan messages.FromFederator) {
|
||||
receivingAccountI := ctx.Value(util.APReceivingAccount)
|
||||
receivingAccountI := ctx.Value(ap.ContextReceivingAccount)
|
||||
if receivingAccountI != nil {
|
||||
var ok bool
|
||||
receivingAccount, ok = receivingAccountI.(*gtsmodel.Account)
|
||||
if !ok {
|
||||
logrus.Panicf("extractFromCtx: context entry with key %s could not be asserted to *gtsmodel.Account", util.APReceivingAccount)
|
||||
logrus.Panicf("extractFromCtx: context entry with key %s could not be asserted to *gtsmodel.Account", ap.ContextReceivingAccount)
|
||||
}
|
||||
}
|
||||
|
||||
requestingAcctI := ctx.Value(util.APRequestingAccount)
|
||||
requestingAcctI := ctx.Value(ap.ContextRequestingAccount)
|
||||
if requestingAcctI != nil {
|
||||
var ok bool
|
||||
requestingAccount, ok = requestingAcctI.(*gtsmodel.Account)
|
||||
if !ok {
|
||||
logrus.Panicf("extractFromCtx: context entry with key %s could not be asserted to *gtsmodel.Account", util.APRequestingAccount)
|
||||
logrus.Panicf("extractFromCtx: context entry with key %s could not be asserted to *gtsmodel.Account", ap.ContextRequestingAccount)
|
||||
}
|
||||
}
|
||||
|
||||
fromFederatorChanI := ctx.Value(util.APFromFederatorChanKey)
|
||||
fromFederatorChanI := ctx.Value(ap.ContextFromFederatorChan)
|
||||
if fromFederatorChanI != nil {
|
||||
var ok bool
|
||||
fromFederatorChan, ok = fromFederatorChanI.(chan messages.FromFederator)
|
||||
if !ok {
|
||||
logrus.Panicf("extractFromCtx: context entry with key %s could not be asserted to chan messages.FromFederator", util.APFromFederatorChanKey)
|
||||
logrus.Panicf("extractFromCtx: context entry with key %s could not be asserted to chan messages.FromFederator", ap.ContextFromFederatorChan)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue