From 0aafd0c36837626151dc4fa826d69718e71031aa Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Thu, 22 Oct 2020 12:15:55 -0700 Subject: [PATCH 01/20] Generic OAuth userinfo properies now configurable When connecting to a generic OAuth provider, you are never sure what object you'll be receiving from the userinfo endpoint (it isn't actually specified anywhere). So this commit adds mapping values to the generic oauth configuration section of config.ini, allowing the user to specify which keys in the remote endpoint it expects to read the UserID, Username, DisplayName, and Email from. Default values if unspecified remain as they were before this commit. --- config/config.go | 4 ++++ oauth.go | 4 ++++ oauth_generic.go | 28 ++++++++++++++++++++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/config/config.go b/config/config.go index cfb5999..525b6f3 100644 --- a/config/config.go +++ b/config/config.go @@ -110,6 +110,10 @@ type ( AuthEndpoint string `ini:"auth_endpoint"` Scope string `ini:"scope"` AllowDisconnect bool `ini:"allow_disconnect"` + MapUserID string `ini:"map_user_id"` + MapUsername string `ini:"map_username"` + MapDisplayName string `ini:"map_display_name"` + MapEmail string `ini:"map_email"` } // AppCfg holds values that affect how the application functions diff --git a/oauth.go b/oauth.go index 6cbddff..6f3598f 100644 --- a/oauth.go +++ b/oauth.go @@ -266,6 +266,10 @@ func configureGenericOauth(parentHandler *Handler, r *mux.Router, app *App) { HttpClient: config.DefaultHTTPClient(), CallbackLocation: callbackLocation, Scope: config.OrDefaultString(app.Config().GenericOauth.Scope, "read_user"), + MapUserID: config.OrDefaultString(app.Config().GenericOauth.MapUserID, "user_id"), + MapUsername: config.OrDefaultString(app.Config().GenericOauth.MapUsername, "username"), + MapDisplayName: config.OrDefaultString(app.Config().GenericOauth.MapDisplayName, "-"), + MapEmail: config.OrDefaultString(app.Config().GenericOauth.MapEmail, "email"), } configureOauthRoutes(parentHandler, r, app, oauthClient, callbackProxy) } diff --git a/oauth_generic.go b/oauth_generic.go index cb82ad0..b98cf59 100644 --- a/oauth_generic.go +++ b/oauth_generic.go @@ -16,6 +16,10 @@ type genericOauthClient struct { InspectLocation string CallbackLocation string Scope string + MapUserID string + MapUsername string + MapDisplayName string + MapEmail string HttpClient HttpClient } @@ -104,12 +108,28 @@ func (c genericOauthClient) inspectOauthAccessToken(ctx context.Context, accessT return nil, errors.New("unable to inspect access token") } - var inspectResponse InspectResponse - if err := limitedJsonUnmarshal(resp.Body, infoRequestMaxLen, &inspectResponse); err != nil { + // since we don't know what the JSON from the server will look like, we create a + // generic interface and then map manually to values set in the config + var genericInterface interface{} + if err := limitedJsonUnmarshal(resp.Body, infoRequestMaxLen, &genericInterface); err != nil { return nil, err } - if inspectResponse.Error != "" { - return nil, errors.New(inspectResponse.Error) + + m := genericInterface.(map[string]interface{}) + + // map each relevant field in inspectResponse to the mapped field from the config + var inspectResponse InspectResponse + if (m[c.MapUserID] != nil) { + inspectResponse.UserID = m[c.MapUserID].(string) + } + if (m[c.MapUsername] != nil) { + inspectResponse.Username = m[c.MapUsername].(string) + } + if (m[c.MapDisplayName] != nil) { + inspectResponse.DisplayName = m[c.MapDisplayName].(string) + } + if (m[c.MapEmail] != nil) { + inspectResponse.Email = m[c.MapEmail].(string) } return &inspectResponse, nil From b262fa144c995d206c02aa4ed378c9d0b234c77a Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Thu, 22 Oct 2020 12:59:19 -0700 Subject: [PATCH 02/20] Making changes per feedback --- oauth_generic.go | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/oauth_generic.go b/oauth_generic.go index b98cf59..ba8b97e 100644 --- a/oauth_generic.go +++ b/oauth_generic.go @@ -16,10 +16,10 @@ type genericOauthClient struct { InspectLocation string CallbackLocation string Scope string - MapUserID string - MapUsername string - MapDisplayName string - MapEmail string + MapUserID string + MapUsername string + MapDisplayName string + MapEmail string HttpClient HttpClient } @@ -110,27 +110,17 @@ func (c genericOauthClient) inspectOauthAccessToken(ctx context.Context, accessT // since we don't know what the JSON from the server will look like, we create a // generic interface and then map manually to values set in the config - var genericInterface interface{} + var genericInterface map[string]interface{} if err := limitedJsonUnmarshal(resp.Body, infoRequestMaxLen, &genericInterface); err != nil { return nil, err } - m := genericInterface.(map[string]interface{}) - // map each relevant field in inspectResponse to the mapped field from the config var inspectResponse InspectResponse - if (m[c.MapUserID] != nil) { - inspectResponse.UserID = m[c.MapUserID].(string) - } - if (m[c.MapUsername] != nil) { - inspectResponse.Username = m[c.MapUsername].(string) - } - if (m[c.MapDisplayName] != nil) { - inspectResponse.DisplayName = m[c.MapDisplayName].(string) - } - if (m[c.MapEmail] != nil) { - inspectResponse.Email = m[c.MapEmail].(string) - } + inspectResponse.UserID, _ = genericInterface[c.MapUserID].(string) + inspectResponse.Username, _ = genericInterface[c.MapUsername].(string) + inspectResponse.DisplayName, _ = genericInterface[c.MapDisplayName].(string) + inspectResponse.Email, _ = genericInterface[c.MapEmail].(string) return &inspectResponse, nil } From 6c1ab93717359f5823d0faf0e2dbe3ca317cad73 Mon Sep 17 00:00:00 2001 From: funkyduck Date: Thu, 14 Jan 2021 09:46:20 -0500 Subject: [PATCH 03/20] The gopher integration was not setting host or port, causing all links to break. This will derive the host from the configured host by stripping the protocol from the URI --- gopher.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gopher.go b/gopher.go index 30391f1..56d3fd6 100644 --- a/gopher.go +++ b/gopher.go @@ -14,6 +14,7 @@ import ( "bytes" "fmt" "io" + "regexp" "strings" "github.com/prologic/go-gopher" @@ -28,6 +29,11 @@ func initGopher(apper Apper) { gopher.ListenAndServe(fmt.Sprintf(":%d", apper.App().Config().Server.GopherPort), nil) } +// Utility function to strip the URL from the hostname provided by app.cfg.App.Host +func stripHostProtocol(app *App) string { + return string(regexp.MustCompile("^.*://").ReplaceAll([]byte(app.cfg.App.Host), []byte(""))) +} + func handleGopher(app *App, w gopher.ResponseWriter, r *gopher.Request) error { parts := strings.Split(r.Selector, "/") if app.cfg.App.SingleUser { @@ -51,6 +57,8 @@ func handleGopher(app *App, w gopher.ResponseWriter, r *gopher.Request) error { for _, c := range *colls { w.WriteItem(&gopher.Item{ + Host: stripHostProtocol(app), + Port: app.cfg.Server.GopherPort, Type: gopher.DIRECTORY, Description: c.DisplayTitle(), Selector: "/" + c.Alias + "/", @@ -99,6 +107,8 @@ func handleGopherCollection(app *App, w gopher.ResponseWriter, r *gopher.Request for _, p := range *posts { w.WriteItem(&gopher.Item{ + Port: app.cfg.Server.GopherPort, + Host: stripHostProtocol(app), Type: gopher.FILE, Description: p.CreatedDate() + " - " + p.DisplayTitle(), Selector: baseSel + p.Slug.String, From 795748457c52edb748b4de9a165dd565020c618f Mon Sep 17 00:00:00 2001 From: x4e <53862811+x4e@users.noreply.github.com> Date: Sun, 24 Jan 2021 01:24:12 +0000 Subject: [PATCH 04/20] Case insensitive language highlighting matching This automatically lowercases language names used in code blocks when finding highlighting scripts for them, since highlightJS defines all languages with lowercase names. --- templates/include/post-render.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/include/post-render.tmpl b/templates/include/post-render.tmpl index c4ed082..beb98aa 100644 --- a/templates/include/post-render.tmpl +++ b/templates/include/post-render.tmpl @@ -68,7 +68,7 @@ var jss = [hlbaseUri + "highlight.min.js"]; // Check what we need to load for (i=0; i < lb.length; i++) { - lang = lb[i].className.replace('language-',''); + lang = lb[i].className.replace('language-','').toLowerCase(); // Support the aliases specified above if (aliasmap[lang]) lang = aliasmap[lang]; lurl = hlbaseUri + "highlightjs/" + lang + ".min.js"; From e6417d911c9800d0b7939aa1f88fcb551f1595af Mon Sep 17 00:00:00 2001 From: Donald Feury Date: Wed, 27 Jan 2021 19:39:46 -0500 Subject: [PATCH 05/20] Stop private and protected blogs from federating Fixes #403 --- activitypub.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/activitypub.go b/activitypub.go index 0e69075..18307de 100644 --- a/activitypub.go +++ b/activitypub.go @@ -631,6 +631,17 @@ func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error { log.Info("Federating new post!") } } + + // If app is private, do not federate + if app.cfg.App.Private { + return nil + } + + // Do not federate posts from private or protected blogs + if p.Collection.Visibility == CollPrivate || p.Collection.Visibility == CollProtected { + return nil + } + actor := p.Collection.PersonObject(collID) na := p.ActivityObject(app) From e6c36fc2ef07daba8af2f629b612ee80e0e40239 Mon Sep 17 00:00:00 2001 From: CJ Eller <45696734+cjeller1592@users.noreply.github.com> Date: Mon, 1 Feb 2021 12:01:49 -0500 Subject: [PATCH 06/20] Update writefreely-web image Updated with the official writeas/writefreely image on Docker Hub. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ef73a9b..652ce57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ networks: services: writefreely-web: container_name: "writefreely-web" - image: "writefreely:latest" + image: "writeas/writefreely:latest" volumes: - "web-keys:/go/keys" From 391844fab9001d95b6f122828decb284cfb2584e Mon Sep 17 00:00:00 2001 From: CJ Eller <45696734+cjeller1592@users.noreply.github.com> Date: Wed, 10 Feb 2021 18:01:32 -0500 Subject: [PATCH 07/20] Add conditional for preserving lang metadata This makes it so that if a post is updated, it will retain the language metadata rather than revert back. --- templates/pad.tmpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/pad.tmpl b/templates/pad.tmpl index cef69b5..049ac27 100644 --- a/templates/pad.tmpl +++ b/templates/pad.tmpl @@ -194,8 +194,13 @@ body: post.content, title: post.title, font: font, - lang: lang - }; + {{ if or .Post.Slug .Post.Id }} + }; + {{ else }} + lang: lang + }; + {{ end }} + {{ if .Post.Slug }} var url = "/api/collections/{{.EditCollection.Alias}}/posts/{{.Post.Id}}"; {{ else if .Post.Id }} From 2d38e8b65e0179c9cf377b783a695731f863f37e Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 22 Feb 2021 14:25:18 -0500 Subject: [PATCH 08/20] Create coll post with the provided slug, if exists Closes T811 --- database.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/database.go b/database.go index 54939fe..b85bb27 100644 --- a/database.go +++ b/database.go @@ -638,13 +638,17 @@ func (db *datastore) CreatePost(userID, collID int64, post *SubmittedPost) (*Pos ownerCollID.Int64 = collID ownerCollID.Valid = true var slugVal string - if post.Title != nil && *post.Title != "" { - slugVal = getSlug(*post.Title, post.Language.String) - if slugVal == "" { + if post.Slug != nil && *post.Slug != "" { + slugVal = *post.Slug + } else { + if post.Title != nil && *post.Title != "" { + slugVal = getSlug(*post.Title, post.Language.String) + if slugVal == "" { + slugVal = getSlug(*post.Content, post.Language.String) + } + } else { slugVal = getSlug(*post.Content, post.Language.String) } - } else { - slugVal = getSlug(*post.Content, post.Language.String) } if slugVal == "" { slugVal = friendlyID From a10827cd504e0ee2eeb27d3165a382d4b57c644a Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 23 Feb 2021 17:36:35 -0500 Subject: [PATCH 09/20] Hide post signature on pinned posts Ref T814 --- postrender.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postrender.go b/postrender.go index ccfc565..b9ef07c 100644 --- a/postrender.go +++ b/postrender.go @@ -60,6 +60,10 @@ func (p *PublicPost) formatContent(cfg *config.Config, isOwner bool) { } func (p *Post) augmentContent(c *Collection) { + if p.PinnedPosition.Valid { + // Don't augment posts that are pinned + return + } // Add post signatures if c.Signature != "" { p.Content += "\n\n" + c.Signature From 33cf9263f54c99801920d3459fd17adcb6106848 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 24 Feb 2021 12:49:28 -0500 Subject: [PATCH 10/20] Support "nosig" shortcode to hide signature in post If a post contains anywhere in the body, the post will render without a post signature on it. Ref T815 --- postrender.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postrender.go b/postrender.go index b9ef07c..12c4a81 100644 --- a/postrender.go +++ b/postrender.go @@ -64,6 +64,10 @@ func (p *Post) augmentContent(c *Collection) { // Don't augment posts that are pinned return } + if strings.Index(p.Content, "") > -1 { + // Don't augment posts with the special "nosig" shortcode + return + } // Add post signatures if c.Signature != "" { p.Content += "\n\n" + c.Signature From 9484880bcad3d4ac8bd52f649bc275bba9494abe Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 8 Mar 2021 11:43:38 -0500 Subject: [PATCH 11/20] Sign actor fetch request This fixes federation with Mastodon instances that have Authorized Fetch turned on by signing the GET request to fetch the actor when a blog is first followed. Ref T820 --- activitypub.go | 38 ++++++++++++++++++++++++++++++++++++-- app.go | 8 +++++++- routes.go | 7 ++++++- webfinger.go | 6 ++++-- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/activitypub.go b/activitypub.go index 0e69075..855f9a7 100644 --- a/activitypub.go +++ b/activitypub.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -17,10 +17,12 @@ import ( "encoding/base64" "encoding/json" "fmt" + "github.com/writeas/writefreely/config" "io/ioutil" "net/http" "net/http/httputil" "net/url" + "path/filepath" "strconv" "time" @@ -41,6 +43,17 @@ const ( apCacheTime = time.Minute ) +var instanceColl *Collection + +func initActivityPub(cfg *config.Config) { + ur, _ := url.Parse(cfg.App.Host) + instanceColl = &Collection{ + ID: 0, + Alias: ur.Host, + Title: ur.Host, + } +} + type RemoteUser struct { ID int64 ActorID string @@ -76,12 +89,17 @@ func handleFetchCollectionActivities(app *App, w http.ResponseWriter, r *http.Re vars := mux.Vars(r) alias := vars["alias"] + if alias == "" { + alias = filepath.Base(r.RequestURI) + } // TODO: enforce visibility // Get base Collection data var c *Collection var err error - if app.cfg.App.SingleUser { + if alias == r.Host { + c = instanceColl + } else if app.cfg.App.SingleUser { c, err = app.db.GetCollectionByID(1) } else { c, err = app.db.GetCollection(alias) @@ -546,6 +564,22 @@ func resolveIRI(hostName, url string) ([]byte, error) { r.Header.Add("Accept", "application/activity+json") r.Header.Set("User-Agent", ServerUserAgent(hostName)) + p := instanceColl.PersonObject() + h := sha256.New() + h.Write([]byte{}) + r.Header.Add("Digest", "SHA-256="+base64.StdEncoding.EncodeToString(h.Sum(nil))) + + // Sign using the 'Signature' header + privKey, err := activitypub.DecodePrivateKey(p.GetPrivKey()) + if err != nil { + return nil, err + } + signer := httpsig.NewSigner(p.PublicKey.ID, privKey, httpsig.RSASHA256, []string{"(request-target)", "date", "host", "digest"}) + err = signer.SignSigHeader(r) + if err != nil { + log.Error("Can't sign: %v", err) + } + if debugging { dump, err := httputil.DumpRequestOut(r, true) if err != nil { diff --git a/app.go b/app.go index 2aed437..a0e754e 100644 --- a/app.go +++ b/app.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -384,6 +384,8 @@ func Initialize(apper Apper, debug bool) (*App, error) { apper.App().InitDecoder() + apper.App().InitActivityPub() + err = ConnectToDatabase(apper.App()) if err != nil { return nil, fmt.Errorf("connect to DB: %s", err) @@ -499,6 +501,10 @@ func (app *App) InitDecoder() { app.formDecoder.RegisterConverter(sql.NullFloat64{}, converter.ConvertSQLNullFloat64) } +func (app *App) InitActivityPub() { + initActivityPub(app.cfg) +} + // ConnectToDatabase validates and connects to the configured database, then // tests the connection. func ConnectToDatabase(app *App) error { diff --git a/routes.go b/routes.go index bb1785f..d3c56ca 100644 --- a/routes.go +++ b/routes.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -12,6 +12,7 @@ package writefreely import ( "net/http" + "net/url" "path/filepath" "strings" @@ -125,9 +126,13 @@ func InitRoutes(apper Apper, r *mux.Router) *mux.Router { write.HandleFunc("/api/markdown", handler.All(handleRenderMarkdown)).Methods("POST") + instanceURL, _ := url.Parse(apper.App().Config().App.Host) + host := instanceURL.Host + // Handle collections write.HandleFunc("/api/collections", handler.All(newCollection)).Methods("POST") apiColls := write.PathPrefix("/api/collections/").Subrouter() + apiColls.HandleFunc("/"+host, handler.AllReader(fetchCollection)).Methods("GET") apiColls.HandleFunc("/{alias:[0-9a-zA-Z\\-]+}", handler.AllReader(fetchCollection)).Methods("GET") apiColls.HandleFunc("/{alias:[0-9a-zA-Z\\-]+}", handler.All(existingCollection)).Methods("POST", "DELETE") apiColls.HandleFunc("/{alias}/posts", handler.AllReader(fetchCollectionPosts)).Methods("GET") diff --git a/webfinger.go b/webfinger.go index 993272f..76a9b66 100644 --- a/webfinger.go +++ b/webfinger.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -32,7 +32,9 @@ var wfUserNotFoundErr = impart.HTTPError{http.StatusNotFound, "User not found."} func (wfr wfResolver) FindUser(username string, host, requestHost string, r []webfinger.Rel) (*webfinger.Resource, error) { var c *Collection var err error - if wfr.cfg.App.SingleUser { + if username == host { + c = instanceColl + } else if wfr.cfg.App.SingleUser { c, err = wfr.db.GetCollectionByID(1) } else { c, err = wfr.db.GetCollection(username) From 9aeeb52bdb500832cad4c801817a07ad6f90a2ce Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 8 Mar 2021 12:50:08 -0500 Subject: [PATCH 12/20] Fix nil pointer on instance-wide actor lookup Ref T820 --- activitypub.go | 12 +++++++----- app.go | 8 ++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/activitypub.go b/activitypub.go index 855f9a7..9a3a3f0 100644 --- a/activitypub.go +++ b/activitypub.go @@ -45,12 +45,14 @@ const ( var instanceColl *Collection -func initActivityPub(cfg *config.Config) { - ur, _ := url.Parse(cfg.App.Host) +func initActivityPub(app *App) { + ur, _ := url.Parse(app.cfg.App.Host) instanceColl = &Collection{ - ID: 0, - Alias: ur.Host, - Title: ur.Host, + ID: 0, + Alias: ur.Host, + Title: ur.Host, + db: app.db, + hostName: app.cfg.App.Host, } } diff --git a/app.go b/app.go index a0e754e..d34daf5 100644 --- a/app.go +++ b/app.go @@ -384,13 +384,13 @@ func Initialize(apper Apper, debug bool) (*App, error) { apper.App().InitDecoder() - apper.App().InitActivityPub() - err = ConnectToDatabase(apper.App()) if err != nil { return nil, fmt.Errorf("connect to DB: %s", err) } + initActivityPub(apper.App()) + // Handle local timeline, if enabled if apper.App().cfg.App.LocalTimeline { log.Info("Initializing local timeline...") @@ -501,10 +501,6 @@ func (app *App) InitDecoder() { app.formDecoder.RegisterConverter(sql.NullFloat64{}, converter.ConvertSQLNullFloat64) } -func (app *App) InitActivityPub() { - initActivityPub(app.cfg) -} - // ConnectToDatabase validates and connects to the configured database, then // tests the connection. func ConnectToDatabase(app *App) error { From 9b336dee8c6eed18db4ce0adc135f35fae59962b Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 8 Mar 2021 12:54:50 -0500 Subject: [PATCH 13/20] Fix instance-wide actor lookup This skips the silenced-user check. Ref T820 --- activitypub.go | 20 +++++++++++--------- collections.go | 7 ++++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/activitypub.go b/activitypub.go index 9a3a3f0..6080884 100644 --- a/activitypub.go +++ b/activitypub.go @@ -17,7 +17,6 @@ import ( "encoding/base64" "encoding/json" "fmt" - "github.com/writeas/writefreely/config" "io/ioutil" "net/http" "net/http/httputil" @@ -109,16 +108,19 @@ func handleFetchCollectionActivities(app *App, w http.ResponseWriter, r *http.Re if err != nil { return err } - silenced, err := app.db.IsUserSilenced(c.OwnerID) - if err != nil { - log.Error("fetch collection activities: %v", err) - return ErrInternalGeneral - } - if silenced { - return ErrCollectionNotFound - } c.hostName = app.cfg.App.Host + if !c.IsInstanceColl() { + silenced, err := app.db.IsUserSilenced(c.OwnerID) + if err != nil { + log.Error("fetch collection activities: %v", err) + return ErrInternalGeneral + } + if silenced { + return ErrCollectionNotFound + } + } + p := c.PersonObject() setCacheControl(w, apCacheTime) diff --git a/collections.go b/collections.go index e1ebe48..c7b84dc 100644 --- a/collections.go +++ b/collections.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -180,6 +180,11 @@ func (c *Collection) NewFormat() *CollectionFormat { return cf } +func (c *Collection) IsInstanceColl() bool { + ur, _ := url.Parse(c.hostName) + return c.Alias == ur.Host +} + func (c *Collection) IsUnlisted() bool { return c.Visibility == 0 } From 9f525876f45beeaac15a7e50785c3355f15d0e74 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 8 Mar 2021 13:02:59 -0500 Subject: [PATCH 14/20] Fix instance-wide actor webfinger lookup This skips the silenced-user check. Ref T820 --- webfinger.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/webfinger.go b/webfinger.go index 76a9b66..581d940 100644 --- a/webfinger.go +++ b/webfinger.go @@ -43,15 +43,18 @@ func (wfr wfResolver) FindUser(username string, host, requestHost string, r []we log.Error("Unable to get blog: %v", err) return nil, err } - silenced, err := wfr.db.IsUserSilenced(c.OwnerID) - if err != nil { - log.Error("webfinger find user: check is silenced: %v", err) - return nil, err - } - if silenced { - return nil, wfUserNotFoundErr - } c.hostName = wfr.cfg.App.Host + + if !c.IsInstanceColl() { + silenced, err := wfr.db.IsUserSilenced(c.OwnerID) + if err != nil { + log.Error("webfinger find user: check is silenced: %v", err) + return nil, err + } + if silenced { + return nil, wfUserNotFoundErr + } + } if wfr.cfg.App.SingleUser { // Ensure handle matches user-chosen one on single-user blogs if username != c.Alias { From 4a58a94e26e969e11128443c0df60a13be2f4f7b Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Wed, 24 Mar 2021 16:00:52 -0400 Subject: [PATCH 15/20] Include images as attachments in ActivityStreams data Ref T709 --- go.mod | 2 +- go.sum | 6 ++++-- posts.go | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cad2c86..8304516 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/writeas/nerds v1.0.0 github.com/writeas/saturday v1.7.2-0.20200427193424-392b95a03320 github.com/writeas/slug v1.2.0 - github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c + github.com/writeas/web-core v1.3.0 github.com/writefreely/go-nodeinfo v1.2.0 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect diff --git a/go.sum b/go.sum index 793b5d6..053e13d 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,8 @@ github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gG github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= +github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gologme/log v1.2.0 h1:Ya5Ip/KD6FX7uH0S31QO87nCCSucKtF44TLbTtO7V4c= github.com/gologme/log v1.2.0/go.mod h1:gq31gQ8wEHkR+WekdWsqDuf8pXTUZA9BnnzTuPz1Y9U= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= @@ -157,8 +159,8 @@ github.com/writeas/saturday v1.7.2-0.20200427193424-392b95a03320 h1:PozPZ29CQ/xt github.com/writeas/saturday v1.7.2-0.20200427193424-392b95a03320/go.mod h1:ETE1EK6ogxptJpAgUbcJD0prAtX48bSloie80+tvnzQ= github.com/writeas/slug v1.2.0 h1:EMQ+cwLiOcA6EtFwUgyw3Ge18x9uflUnOnR6bp/J+/g= github.com/writeas/slug v1.2.0/go.mod h1:RE8shOqQP3YhsfsQe0L3RnuejfQ4Mk+JjY5YJQFubfQ= -github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c h1:/aPb8WKtC+Ga/xUEcME0iX3VKBeeJ02kXCaROaZ21SE= -github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c/go.mod h1:vTYajviuNBAxjctPp2NUYdgjofywVkxUGpeaERF3SfI= +github.com/writeas/web-core v1.3.0 h1:oEVJBPZhrFMf9eya+DvFUX1i8NZGZe1eu5sQXnhuzKw= +github.com/writeas/web-core v1.3.0/go.mod h1:DzNxa0YLV/wNeeWeHFPNa/nHmyJBFIIzXN/m9PpDm5c= github.com/writefreely/go-nodeinfo v1.2.0 h1:La+YbTCvmpTwFhBSlebWDDL81N88Qf/SCAvRLR7F8ss= github.com/writefreely/go-nodeinfo v1.2.0/go.mod h1:UTvE78KpcjYOlRHupZIiSEFcXHioTXuacCbHU+CAcPg= golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59 h1:hk3yo72LXLapY9EXVttc3Z1rLOxT9IuAPPX3GpY2+jo= diff --git a/posts.go b/posts.go index 0fe29b9..383da89 100644 --- a/posts.go +++ b/posts.go @@ -1176,6 +1176,11 @@ func (p *PublicPost) ActivityObject(app *App) *activitystreams.Object { }) } } + if len(p.Images) > 0 { + for _, i := range p.Images { + o.Attachment = append(o.Attachment, activitystreams.NewImageAttachment(i)) + } + } // Find mentioned users mentionedUsers := make(map[string]string) From 2a9aa843668fb14ed83be3e5290f918712a82413 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Apr 2021 05:13:09 +0000 Subject: [PATCH 16/20] Bump github.com/hashicorp/go-multierror from 1.1.0 to 1.1.1 Bumps [github.com/hashicorp/go-multierror](https://github.com/hashicorp/go-multierror) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/hashicorp/go-multierror/releases) - [Commits](https://github.com/hashicorp/go-multierror/compare/v1.1.0...v1.1.1) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index cad2c86..2fc0180 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/gorilla/schema v1.2.0 github.com/gorilla/sessions v1.2.0 github.com/guregu/null v3.5.0+incompatible - github.com/hashicorp/go-multierror v1.1.0 + github.com/hashicorp/go-multierror v1.1.1 github.com/ikeikeikeike/go-sitemap-generator/v2 v2.0.2 github.com/jtolds/gls v4.2.1+incompatible // indirect github.com/kylemcc/twitter-text-go v0.0.0-20180726194232-7f582f6736ec diff --git a/go.sum b/go.sum index 793b5d6..f69ca01 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ code.as/core/socks v1.0.0 h1:SPQXNp4SbEwjOAP9VzUahLHak8SDqy5n+9cm9tpjZOs= code.as/core/socks v1.0.0/go.mod h1:BAXBy5O9s2gmw6UxLqNJcVbWY7C/UPs+801CcSsfWOY= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= @@ -32,7 +31,6 @@ github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/go-fed/httpsig v0.1.0 h1:6F2OxRVnNTN4OPN+Mc2jxs2WEay9/qiHT/jphlvAwIY= github.com/go-fed/httpsig v0.1.0/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= github.com/go-fed/httpsig v0.1.1-0.20200204213531-0ef28562fabe h1:U71giCx5NjRn4Lb71UuprPHqhjxGv3Jqonb9fgcaJH8= github.com/go-fed/httpsig v0.1.1-0.20200204213531-0ef28562fabe/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= @@ -48,7 +46,6 @@ github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY= github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA= -github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -62,10 +59,9 @@ github.com/guregu/null v3.5.0+incompatible h1:fSdvRTQtmBA4B4YDZXhLtxTIJZYuUxBFTT github.com/guregu/null v3.5.0+incompatible/go.mod h1:ePGpQaN9cw0tj45IR5E5ehMvsFlLlQZAkkOXZurJ3NM= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/ikeikeikeike/go-sitemap-generator/v2 v2.0.2 h1:wIdDEle9HEy7vBPjC6oKz6ejs3Ut+jmsYvuOoAW2pSM= github.com/ikeikeikeike/go-sitemap-generator/v2 v2.0.2/go.mod h1:WtaVKD9TeruTED9ydiaOJU08qGoEPP/LyzTKiD3jEsw= github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= @@ -79,23 +75,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylemcc/twitter-text-go v0.0.0-20180726194232-7f582f6736ec h1:ZXWuspqypleMuJy4bzYEqlMhJnGAYpLrWe5p7W3CdvI= github.com/kylemcc/twitter-text-go v0.0.0-20180726194232-7f582f6736ec/go.mod h1:voECJzdraJmolzPBgL9Z7ANwXf4oMXaTCsIkdiPpR/g= -github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a h1:weJVJJRzAJBFRlAiJQROKQs8oC9vOxvm4rZmBBk0ONw= github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/manifoldco/promptui v0.8.0 h1:R95mMF+McvXZQ7j1g8ucVZE1gLP3Sv6j9vlF9kyRqQo= github.com/manifoldco/promptui v0.8.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.4 h1:p0L+CTpo/PLFdkoPcJemLXG+fpMD7pYOoDEq1axMbGg= github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= @@ -119,7 +111,6 @@ github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 h1:Jpy1PX github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= @@ -140,7 +131,6 @@ github.com/writeas/go-writeas/v2 v2.0.2 h1:akvdMg89U5oBJiCkBwOXljVLTqP354uN6qnG2 github.com/writeas/go-writeas/v2 v2.0.2/go.mod h1:9sjczQJKmru925fLzg0usrU1R1tE4vBmQtGnItUMR0M= github.com/writeas/httpsig v1.0.0 h1:peIAoIA3DmlP8IG8tMNZqI4YD1uEnWBmkcC9OFPjt3A= github.com/writeas/httpsig v1.0.0/go.mod h1:7ClMGSrSVXJbmiLa17bZ1LrG1oibGZmUMlh3402flPY= -github.com/writeas/impart v1.1.0 h1:nPnoO211VscNkp/gnzir5UwCDEvdHThL5uELU60NFSE= github.com/writeas/impart v1.1.0/go.mod h1:g0MpxdnTOHHrl+Ca/2oMXUHJ0PcRAEWtkCzYCJUXC9Y= github.com/writeas/impart v1.1.1 h1:RyA9+CqbdbDuz53k+nXCWUY+NlEkdyw6+nWanxSBl5o= github.com/writeas/impart v1.1.1/go.mod h1:g0MpxdnTOHHrl+Ca/2oMXUHJ0PcRAEWtkCzYCJUXC9Y= @@ -161,22 +151,18 @@ github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c h1:/aPb8WKtC+Ga github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c/go.mod h1:vTYajviuNBAxjctPp2NUYdgjofywVkxUGpeaERF3SfI= github.com/writefreely/go-nodeinfo v1.2.0 h1:La+YbTCvmpTwFhBSlebWDDL81N88Qf/SCAvRLR7F8ss= github.com/writefreely/go-nodeinfo v1.2.0/go.mod h1:UTvE78KpcjYOlRHupZIiSEFcXHioTXuacCbHU+CAcPg= -golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59 h1:hk3yo72LXLapY9EXVttc3Z1rLOxT9IuAPPX3GpY2+jo= golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/sys v0.0.0-20180525142821-c11f84a56e43/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -187,7 +173,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/ini.v1 v1.55.0 h1:E8yzL5unfpW3M6fz/eB7Cb5MQAYSZ7GKo4Qth+N2sgQ= gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= From f70fc0c4e24086dac0d1f1144e8f10e46a992f01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Apr 2021 05:14:03 +0000 Subject: [PATCH 17/20] Bump github.com/go-sql-driver/mysql from 1.5.0 to 1.6.0 Bumps [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/go-sql-driver/mysql/releases) - [Changelog](https://github.com/go-sql-driver/mysql/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-sql-driver/mysql/compare/v1.5.0...v1.6.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index cad2c86..e537e7d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ require ( github.com/clbanning/mxj v1.8.4 // indirect github.com/dustin/go-humanize v1.0.0 github.com/fatih/color v1.10.0 - github.com/go-sql-driver/mysql v1.5.0 + github.com/go-sql-driver/mysql v1.6.0 github.com/go-test/deep v1.0.1 // indirect github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/gorilla/feeds v1.1.1 diff --git a/go.sum b/go.sum index 793b5d6..cea572d 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ code.as/core/socks v1.0.0 h1:SPQXNp4SbEwjOAP9VzUahLHak8SDqy5n+9cm9tpjZOs= code.as/core/socks v1.0.0/go.mod h1:BAXBy5O9s2gmw6UxLqNJcVbWY7C/UPs+801CcSsfWOY= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= @@ -32,12 +31,11 @@ github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/go-fed/httpsig v0.1.0 h1:6F2OxRVnNTN4OPN+Mc2jxs2WEay9/qiHT/jphlvAwIY= github.com/go-fed/httpsig v0.1.0/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= github.com/go-fed/httpsig v0.1.1-0.20200204213531-0ef28562fabe h1:U71giCx5NjRn4Lb71UuprPHqhjxGv3Jqonb9fgcaJH8= github.com/go-fed/httpsig v0.1.1-0.20200204213531-0ef28562fabe/go.mod h1:T56HUNYZUQ1AGUzhAYPugZfp36sKApVnGBgKlIY+aIE= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gologme/log v1.2.0 h1:Ya5Ip/KD6FX7uH0S31QO87nCCSucKtF44TLbTtO7V4c= @@ -48,7 +46,6 @@ github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY= github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA= -github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -62,7 +59,6 @@ github.com/guregu/null v3.5.0+incompatible h1:fSdvRTQtmBA4B4YDZXhLtxTIJZYuUxBFTT github.com/guregu/null v3.5.0+incompatible/go.mod h1:ePGpQaN9cw0tj45IR5E5ehMvsFlLlQZAkkOXZurJ3NM= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= @@ -79,23 +75,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylemcc/twitter-text-go v0.0.0-20180726194232-7f582f6736ec h1:ZXWuspqypleMuJy4bzYEqlMhJnGAYpLrWe5p7W3CdvI= github.com/kylemcc/twitter-text-go v0.0.0-20180726194232-7f582f6736ec/go.mod h1:voECJzdraJmolzPBgL9Z7ANwXf4oMXaTCsIkdiPpR/g= -github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a h1:weJVJJRzAJBFRlAiJQROKQs8oC9vOxvm4rZmBBk0ONw= github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/manifoldco/promptui v0.8.0 h1:R95mMF+McvXZQ7j1g8ucVZE1gLP3Sv6j9vlF9kyRqQo= github.com/manifoldco/promptui v0.8.0/go.mod h1:n4zTdgP0vr0S3w7/O/g98U+e0gwLScEXGwov2nIKuGQ= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.4 h1:p0L+CTpo/PLFdkoPcJemLXG+fpMD7pYOoDEq1axMbGg= github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= @@ -119,7 +111,6 @@ github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304 h1:Jpy1PX github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= @@ -140,7 +131,6 @@ github.com/writeas/go-writeas/v2 v2.0.2 h1:akvdMg89U5oBJiCkBwOXljVLTqP354uN6qnG2 github.com/writeas/go-writeas/v2 v2.0.2/go.mod h1:9sjczQJKmru925fLzg0usrU1R1tE4vBmQtGnItUMR0M= github.com/writeas/httpsig v1.0.0 h1:peIAoIA3DmlP8IG8tMNZqI4YD1uEnWBmkcC9OFPjt3A= github.com/writeas/httpsig v1.0.0/go.mod h1:7ClMGSrSVXJbmiLa17bZ1LrG1oibGZmUMlh3402flPY= -github.com/writeas/impart v1.1.0 h1:nPnoO211VscNkp/gnzir5UwCDEvdHThL5uELU60NFSE= github.com/writeas/impart v1.1.0/go.mod h1:g0MpxdnTOHHrl+Ca/2oMXUHJ0PcRAEWtkCzYCJUXC9Y= github.com/writeas/impart v1.1.1 h1:RyA9+CqbdbDuz53k+nXCWUY+NlEkdyw6+nWanxSBl5o= github.com/writeas/impart v1.1.1/go.mod h1:g0MpxdnTOHHrl+Ca/2oMXUHJ0PcRAEWtkCzYCJUXC9Y= @@ -161,22 +151,18 @@ github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c h1:/aPb8WKtC+Ga github.com/writeas/web-core v1.2.1-0.20200813161734-68a680d1b03c/go.mod h1:vTYajviuNBAxjctPp2NUYdgjofywVkxUGpeaERF3SfI= github.com/writefreely/go-nodeinfo v1.2.0 h1:La+YbTCvmpTwFhBSlebWDDL81N88Qf/SCAvRLR7F8ss= github.com/writefreely/go-nodeinfo v1.2.0/go.mod h1:UTvE78KpcjYOlRHupZIiSEFcXHioTXuacCbHU+CAcPg= -golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59 h1:hk3yo72LXLapY9EXVttc3Z1rLOxT9IuAPPX3GpY2+jo= golang.org/x/crypto v0.0.0-20180527072434-ab813273cd59/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/sys v0.0.0-20180525142821-c11f84a56e43/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -187,7 +173,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/ini.v1 v1.55.0 h1:E8yzL5unfpW3M6fz/eB7Cb5MQAYSZ7GKo4Qth+N2sgQ= gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= From 9cbd254d6456105c1661dac741d9967264270b39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Apr 2021 11:24:37 +0000 Subject: [PATCH 18/20] Bump github.com/microcosm-cc/bluemonday from 1.0.4 to 1.0.5 Bumps [github.com/microcosm-cc/bluemonday](https://github.com/microcosm-cc/bluemonday) from 1.0.4 to 1.0.5. - [Release notes](https://github.com/microcosm-cc/bluemonday/releases) - [Commits](https://github.com/microcosm-cc/bluemonday/compare/v1.0.4...v1.0.5) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2fc0180..389c04b 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/lunixbochs/vtclean v1.0.0 // indirect github.com/manifoldco/promptui v0.8.0 github.com/mattn/go-sqlite3 v1.14.6 - github.com/microcosm-cc/bluemonday v1.0.4 + github.com/microcosm-cc/bluemonday v1.0.5 github.com/mitchellh/go-wordwrap v1.0.1 github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d github.com/pkg/errors v0.8.1 // indirect diff --git a/go.sum b/go.sum index f69ca01..7b1889e 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/microcosm-cc/bluemonday v1.0.4 h1:p0L+CTpo/PLFdkoPcJemLXG+fpMD7pYOoDEq1axMbGg= -github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= +github.com/microcosm-cc/bluemonday v1.0.5 h1:cF59UCKMmmUgqN1baLvqU/B1ZsMori+duLVTLpgiG3w= +github.com/microcosm-cc/bluemonday v1.0.5/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= From 484d2736ce60547b0278435429d95290419fe1c0 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 6 Apr 2021 17:24:07 -0400 Subject: [PATCH 19/20] Update repo URL to writefreely org From the writeas org on GitHub. --- CONTRIBUTING.md | 8 ++++---- Dockerfile | 14 +++++++------- Makefile | 2 +- README.md | 16 ++++++++-------- account.go | 9 ++++----- admin.go | 6 +++--- app.go | 10 +++++----- author/author.go | 4 ++-- cmd/writefreely/config.go | 5 ++--- cmd/writefreely/db.go | 5 ++--- cmd/writefreely/keys.go | 5 ++--- cmd/writefreely/main.go | 7 +++---- cmd/writefreely/user.go | 5 ++--- cmd/writefreely/web.go | 7 +++---- collections.go | 8 ++++---- database.go | 10 +++++----- go.mod | 2 +- handle.go | 8 ++++---- invites.go | 4 ++-- keys.go | 4 ++-- migrations/v4.go | 4 ++-- migrations/v5.go | 4 ++-- migrations/v7.go | 12 +++++++++++- migrations/v8.go | 4 ++-- nodeinfo.go | 6 +++--- oauth.go | 4 ++-- oauth_signup.go | 4 ++-- oauth_test.go | 12 +++++++++++- pad.go | 4 ++-- page/page.go | 4 ++-- pages.go | 4 ++-- pages/500.tmpl | 2 +- postrender.go | 6 +++--- posts.go | 6 +++--- posts_test.go | 12 +++++++++++- read.go | 4 ++-- static/js/README.md | 2 +- templates.go | 4 ++-- templates/include/footer.tmpl | 4 ++-- users.go | 4 ++-- webfinger.go | 2 +- 41 files changed, 135 insertions(+), 112 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ea38748..30ec4bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Welcome! We're glad you're interested in contributing to WriteFreely. For **questions**, **help**, **feature requests**, and **general discussion**, please use [our forum](https://discuss.write.as). -For **bug reports**, please [open a GitHub issue](https://github.com/writeas/writefreely/issues/new). See our guide on [submitting bug reports](https://writefreely.org/contribute#bugs). +For **bug reports**, please [open a GitHub issue](https://github.com/writefreely/writefreely/issues/new). See our guide on [submitting bug reports](https://writefreely.org/contribute#bugs). ## Getting Started @@ -80,9 +80,9 @@ We highly value commit messages that follow established form within the project. When in doubt, look to our existing git history for examples of good commit messages. Here are a few: -* [Rename Suspend status to Silence](https://github.com/writeas/writefreely/commit/7e014ca65958750ab703e317b1ce8cfc4aad2d6e) -* [Show 404 when remote user not found](https://github.com/writeas/writefreely/commit/867eb53b3596bd7b3f2be3c53a3faf857f4cd36d) -* [Fix post deletion on Pleroma](https://github.com/writeas/writefreely/commit/fe82cbb96e3d5c57cfde0db76c28c4ea6dabfe50) +* [Rename Suspend status to Silence](https://github.com/writefreely/writefreely/commit/7e014ca65958750ab703e317b1ce8cfc4aad2d6e) +* [Show 404 when remote user not found](https://github.com/writefreely/writefreely/commit/867eb53b3596bd7b3f2be3c53a3faf857f4cd36d) +* [Fix post deletion on Pleroma](https://github.com/writefreely/writefreely/commit/fe82cbb96e3d5c57cfde0db76c28c4ea6dabfe50) ### Submitting pull requests diff --git a/Dockerfile b/Dockerfile index f4b5a0d..1021ec4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ RUN apk add --update nodejs nodejs-npm make g++ git RUN npm install -g less less-plugin-clean-css RUN go get -u github.com/go-bindata/go-bindata/... -RUN mkdir -p /go/src/github.com/writeas/writefreely -WORKDIR /go/src/github.com/writeas/writefreely +RUN mkdir -p /go/src/github.com/writefreely/writefreely +WORKDIR /go/src/github.com/writefreely/writefreely COPY . . @@ -16,11 +16,11 @@ RUN make build \ && make ui RUN mkdir /stage && \ cp -R /go/bin \ - /go/src/github.com/writeas/writefreely/templates \ - /go/src/github.com/writeas/writefreely/static \ - /go/src/github.com/writeas/writefreely/pages \ - /go/src/github.com/writeas/writefreely/keys \ - /go/src/github.com/writeas/writefreely/cmd \ + /go/src/github.com/writefreely/writefreely/templates \ + /go/src/github.com/writefreely/writefreely/static \ + /go/src/github.com/writefreely/writefreely/pages \ + /go/src/github.com/writefreely/writefreely/keys \ + /go/src/github.com/writefreely/writefreely/cmd \ /stage # Final image diff --git a/Makefile b/Makefile index a240a27..663faf6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ GITREV=`git describe | cut -c 2-` -LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'" +LDFLAGS=-ldflags="-X 'github.com/writefreely/writefreely.softwareVer=$(GITREV)'" GOCMD=go GOINSTALL=$(GOCMD) install $(LDFLAGS) diff --git a/README.md b/README.md index 163eab7..02c8300 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,17 @@


- + Latest release Build status - + - - Go Report Card + + Go Report Card @@ -62,7 +62,7 @@ The quickest way to deploy WriteFreely is with [Write.as](https://write.as/write WriteFreely deploys as a static binary on any platform and architecture that Go supports. Just use our built-in SQLite support, or add a MySQL database, and you'll be up and running! -For common platforms, start with our [pre-built binaries](https://github.com/writeas/writefreely/releases/) and head over to our [installation guide](https://writefreely.org/start) to get started. +For common platforms, start with our [pre-built binaries](https://github.com/writefreely/writefreely/releases/) and head over to our [installation guide](https://writefreely.org/start) to get started. ### Packages @@ -80,10 +80,10 @@ Start hacking on WriteFreely with our [developer setup guide](https://writefreel ## Contributing -We gladly welcome contributions to WriteFreely, whether in the form of [code](https://github.com/writeas/writefreely/blob/master/CONTRIBUTING.md#contributing-to-writefreely), [bug reports](https://github.com/writeas/writefreely/issues/new?template=bug_report.md), [feature requests](https://discuss.write.as/c/feedback/feature-requests), [translations](https://poeditor.com/join/project/TIZ6HFRFdE), or [documentation](https://github.com/writefreely/documentation) improvements. +We gladly welcome contributions to WriteFreely, whether in the form of [code](https://github.com/writefreely/writefreely/blob/master/CONTRIBUTING.md#contributing-to-writefreely), [bug reports](https://github.com/writefreely/writefreely/issues/new?template=bug_report.md), [feature requests](https://discuss.write.as/c/feedback/feature-requests), [translations](https://poeditor.com/join/project/TIZ6HFRFdE), or [documentation](https://github.com/writefreely/documentation) improvements. -Before contributing anything, please read our [Contributing Guide](https://github.com/writeas/writefreely/blob/master/CONTRIBUTING.md#contributing-to-writefreely). It describes the correct channels for submitting contributions and any potential requirements. +Before contributing anything, please read our [Contributing Guide](https://github.com/writefreely/writefreely/blob/master/CONTRIBUTING.md#contributing-to-writefreely). It describes the correct channels for submitting contributions and any potential requirements. ## License -Copyright © 2018-2020 [A Bunch Tell LLC](https://abunchtell.com) and contributing authors. Licensed under the [AGPL](https://github.com/writeas/writefreely/blob/develop/LICENSE). +Copyright © 2018-2021 [A Bunch Tell LLC](https://abunchtell.com) and contributing authors. Licensed under the [AGPL](https://github.com/writefreely/writefreely/blob/develop/LICENSE). diff --git a/account.go b/account.go index 9b90942..ba3c391 100644 --- a/account.go +++ b/account.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -27,10 +27,9 @@ import ( "github.com/writeas/web-core/auth" "github.com/writeas/web-core/data" "github.com/writeas/web-core/log" - - "github.com/writeas/writefreely/author" - "github.com/writeas/writefreely/config" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/author" + "github.com/writefreely/writefreely/config" + "github.com/writefreely/writefreely/page" ) type ( diff --git a/admin.go b/admin.go index a0d10eb..11af4f8 100644 --- a/admin.go +++ b/admin.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -24,8 +24,8 @@ import ( "github.com/writeas/web-core/auth" "github.com/writeas/web-core/log" "github.com/writeas/web-core/passgen" - "github.com/writeas/writefreely/appstats" - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/appstats" + "github.com/writefreely/writefreely/config" ) var ( diff --git a/app.go b/app.go index d34daf5..ed4e096 100644 --- a/app.go +++ b/app.go @@ -35,11 +35,11 @@ import ( "github.com/writeas/web-core/auth" "github.com/writeas/web-core/converter" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/author" - "github.com/writeas/writefreely/config" - "github.com/writeas/writefreely/key" - "github.com/writeas/writefreely/migrations" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/author" + "github.com/writefreely/writefreely/config" + "github.com/writefreely/writefreely/key" + "github.com/writefreely/writefreely/migrations" + "github.com/writefreely/writefreely/page" "golang.org/x/crypto/acme/autocert" ) diff --git a/author/author.go b/author/author.go index 0114905..7431ac5 100644 --- a/author/author.go +++ b/author/author.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -11,7 +11,7 @@ package author import ( - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" "os" "path/filepath" "regexp" diff --git a/cmd/writefreely/config.go b/cmd/writefreely/config.go index c5ff455..32e3801 100644 --- a/cmd/writefreely/config.go +++ b/cmd/writefreely/config.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -11,9 +11,8 @@ package main import ( - "github.com/writeas/writefreely" - "github.com/urfave/cli/v2" + "github.com/writefreely/writefreely" ) var ( diff --git a/cmd/writefreely/db.go b/cmd/writefreely/db.go index badc805..ccae418 100644 --- a/cmd/writefreely/db.go +++ b/cmd/writefreely/db.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -11,9 +11,8 @@ package main import ( - "github.com/writeas/writefreely" - "github.com/urfave/cli/v2" + "github.com/writefreely/writefreely" ) var ( diff --git a/cmd/writefreely/keys.go b/cmd/writefreely/keys.go index 9028f51..680cd4d 100644 --- a/cmd/writefreely/keys.go +++ b/cmd/writefreely/keys.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -11,9 +11,8 @@ package main import ( - "github.com/writeas/writefreely" - "github.com/urfave/cli/v2" + "github.com/writefreely/writefreely" ) var ( diff --git a/cmd/writefreely/main.go b/cmd/writefreely/main.go index 45dfb80..992d611 100644 --- a/cmd/writefreely/main.go +++ b/cmd/writefreely/main.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -15,11 +15,10 @@ import ( "os" "strings" - "github.com/writeas/web-core/log" - "github.com/writeas/writefreely" - "github.com/gorilla/mux" "github.com/urfave/cli/v2" + "github.com/writeas/web-core/log" + "github.com/writefreely/writefreely" ) func main() { diff --git a/cmd/writefreely/user.go b/cmd/writefreely/user.go index 58ecbfb..8429513 100644 --- a/cmd/writefreely/user.go +++ b/cmd/writefreely/user.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -13,9 +13,8 @@ package main import ( "fmt" - "github.com/writeas/writefreely" - "github.com/urfave/cli/v2" + "github.com/writefreely/writefreely" ) var ( diff --git a/cmd/writefreely/web.go b/cmd/writefreely/web.go index a687548..02ae1c9 100644 --- a/cmd/writefreely/web.go +++ b/cmd/writefreely/web.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -11,11 +11,10 @@ package main import ( - "github.com/writeas/web-core/log" - "github.com/writeas/writefreely" - "github.com/gorilla/mux" "github.com/urfave/cli/v2" + "github.com/writeas/web-core/log" + "github.com/writefreely/writefreely" ) var ( diff --git a/collections.go b/collections.go index c7b84dc..a51df88 100644 --- a/collections.go +++ b/collections.go @@ -30,9 +30,9 @@ import ( "github.com/writeas/web-core/bots" "github.com/writeas/web-core/log" waposts "github.com/writeas/web-core/posts" - "github.com/writeas/writefreely/author" - "github.com/writeas/writefreely/config" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/author" + "github.com/writefreely/writefreely/config" + "github.com/writefreely/writefreely/page" ) type ( @@ -240,7 +240,7 @@ func (c *Collection) DisplayCanonicalURL() string { func (c *Collection) RedirectingCanonicalURL(isRedir bool) string { if c.hostName == "" { // If this is true, the human programmers screwed up. So ask for a bug report and fail, fail, fail - log.Error("[PROGRAMMER ERROR] WARNING: Collection.hostName is empty! Federation and many other things will fail! If you're seeing this in the wild, please report this bug and let us know what you were doing just before this: https://github.com/writeas/writefreely/issues/new?template=bug_report.md") + log.Error("[PROGRAMMER ERROR] WARNING: Collection.hostName is empty! Federation and many other things will fail! If you're seeing this in the wild, please report this bug and let us know what you were doing just before this: https://github.com/writefreely/writefreely/issues/new?template=bug_report.md") } if isSingleUser { return c.hostName + "/" diff --git a/database.go b/database.go index b85bb27..86fa271 100644 --- a/database.go +++ b/database.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -15,7 +15,7 @@ import ( "database/sql" "fmt" "github.com/writeas/web-core/silobridge" - wf_db "github.com/writeas/writefreely/db" + wf_db "github.com/writefreely/writefreely/db" "net/http" "strings" "time" @@ -32,9 +32,9 @@ import ( "github.com/writeas/web-core/id" "github.com/writeas/web-core/log" "github.com/writeas/web-core/query" - "github.com/writeas/writefreely/author" - "github.com/writeas/writefreely/config" - "github.com/writeas/writefreely/key" + "github.com/writefreely/writefreely/author" + "github.com/writefreely/writefreely/config" + "github.com/writefreely/writefreely/key" ) const ( diff --git a/go.mod b/go.mod index 9d44bbe..fc60c07 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/writeas/writefreely +module github.com/writefreely/writefreely require ( github.com/clbanning/mxj v1.8.4 // indirect diff --git a/handle.go b/handle.go index 5e15137..01d5728 100644 --- a/handle.go +++ b/handle.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -24,8 +24,8 @@ import ( "github.com/prologic/go-gopher" "github.com/writeas/impart" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/config" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/config" + "github.com/writefreely/writefreely/page" ) // UserLevel represents the required user level for accessing an endpoint @@ -602,7 +602,7 @@ func (h *Handler) AllReader(f handlerFunc) http.HandlerFunc { }() // Allow any origin, as public endpoints are handled in here - w.Header().Set("Access-Control-Allow-Origin", "*"); + w.Header().Set("Access-Control-Allow-Origin", "*") if h.app.App().cfg.App.Private { // This instance is private, so ensure it's being accessed by a valid user diff --git a/invites.go b/invites.go index 4e3eff4..60aa482 100644 --- a/invites.go +++ b/invites.go @@ -1,5 +1,5 @@ /* - * Copyright © 2019-2020 A Bunch Tell LLC. + * Copyright © 2019-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -21,7 +21,7 @@ import ( "github.com/writeas/impart" "github.com/writeas/nerds/store" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/page" ) type Invite struct { diff --git a/keys.go b/keys.go index 5cc63a3..e53d811 100644 --- a/keys.go +++ b/keys.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2019, 2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -12,7 +12,7 @@ package writefreely import ( "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/key" + "github.com/writefreely/writefreely/key" "io/ioutil" "os" "path/filepath" diff --git a/migrations/v4.go b/migrations/v4.go index 7d73f96..c69dce1 100644 --- a/migrations/v4.go +++ b/migrations/v4.go @@ -1,5 +1,5 @@ /* - * Copyright © 2019-2020 A Bunch Tell LLC. + * Copyright © 2019-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -14,7 +14,7 @@ import ( "context" "database/sql" - wf_db "github.com/writeas/writefreely/db" + wf_db "github.com/writefreely/writefreely/db" ) func oauth(db *datastore) error { diff --git a/migrations/v5.go b/migrations/v5.go index f93d067..1fe3e30 100644 --- a/migrations/v5.go +++ b/migrations/v5.go @@ -1,5 +1,5 @@ /* - * Copyright © 2019-2020 A Bunch Tell LLC. + * Copyright © 2019-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -14,7 +14,7 @@ import ( "context" "database/sql" - wf_db "github.com/writeas/writefreely/db" + wf_db "github.com/writefreely/writefreely/db" ) func oauthSlack(db *datastore) error { diff --git a/migrations/v7.go b/migrations/v7.go index 3090cd9..5737b21 100644 --- a/migrations/v7.go +++ b/migrations/v7.go @@ -1,10 +1,20 @@ +/* + * Copyright © 2020-2021 A Bunch Tell LLC. + * + * This file is part of WriteFreely. + * + * WriteFreely is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, included + * in the LICENSE file in this source code package. + */ + package migrations import ( "context" "database/sql" - wf_db "github.com/writeas/writefreely/db" + wf_db "github.com/writefreely/writefreely/db" ) func oauthAttach(db *datastore) error { diff --git a/migrations/v8.go b/migrations/v8.go index 2318c4e..28af523 100644 --- a/migrations/v8.go +++ b/migrations/v8.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -14,7 +14,7 @@ import ( "context" "database/sql" - wf_db "github.com/writeas/writefreely/db" + wf_db "github.com/writefreely/writefreely/db" ) func oauthInvites(db *datastore) error { diff --git a/nodeinfo.go b/nodeinfo.go index 944a5df..f0c0b5e 100644 --- a/nodeinfo.go +++ b/nodeinfo.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018 A Bunch Tell LLC. + * Copyright © 2018-2019, 2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -12,8 +12,8 @@ package writefreely import ( "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/config" "github.com/writefreely/go-nodeinfo" + "github.com/writefreely/writefreely/config" "strings" ) @@ -45,7 +45,7 @@ func nodeInfoConfig(db *datastore, cfg *config.Config) *nodeinfo.Config { Private: cfg.App.Private, Software: nodeinfo.SoftwareMeta{ HomePage: softwareURL, - GitHub: "https://github.com/writeas/writefreely", + GitHub: "https://github.com/writefreely/writefreely", Follow: "https://writing.exchange/@write_as", }, MaxBlogs: cfg.App.MaxBlogs, diff --git a/oauth.go b/oauth.go index 6f3598f..e28e21a 100644 --- a/oauth.go +++ b/oauth.go @@ -1,5 +1,5 @@ /* - * Copyright © 2019-2020 A Bunch Tell LLC. + * Copyright © 2019-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -25,7 +25,7 @@ import ( "github.com/gorilla/sessions" "github.com/writeas/impart" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" ) // OAuthButtons holds display information for different OAuth providers we support. diff --git a/oauth_signup.go b/oauth_signup.go index cbe4f60..b1256be 100644 --- a/oauth_signup.go +++ b/oauth_signup.go @@ -1,5 +1,5 @@ /* - * Copyright © 2020 A Bunch Tell LLC. + * Copyright © 2020-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -17,7 +17,7 @@ import ( "github.com/writeas/impart" "github.com/writeas/web-core/auth" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/page" "html/template" "net/http" "strings" diff --git a/oauth_test.go b/oauth_test.go index f454f1a..cc5f108 100644 --- a/oauth_test.go +++ b/oauth_test.go @@ -1,3 +1,13 @@ +/* + * Copyright © 2019-2021 A Bunch Tell LLC. + * + * This file is part of WriteFreely. + * + * WriteFreely is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, included + * in the LICENSE file in this source code package. + */ + package writefreely import ( @@ -7,7 +17,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/writeas/impart" "github.com/writeas/nerds/store" - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" "net/http" "net/http/httptest" "net/url" diff --git a/pad.go b/pad.go index 0354cd3..b64c282 100644 --- a/pad.go +++ b/pad.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -17,7 +17,7 @@ import ( "github.com/gorilla/mux" "github.com/writeas/impart" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/page" ) func handleViewPad(app *App, w http.ResponseWriter, r *http.Request) error { diff --git a/page/page.go b/page/page.go index 15f09a9..2cfb6cc 100644 --- a/page/page.go +++ b/page/page.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018 A Bunch Tell LLC. + * Copyright © 2018-2019, 2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -12,7 +12,7 @@ package page import ( - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" "strings" ) diff --git a/pages.go b/pages.go index d8f034b..f871882 100644 --- a/pages.go +++ b/pages.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2019, 2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -12,7 +12,7 @@ package writefreely import ( "database/sql" - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" "time" ) diff --git a/pages/500.tmpl b/pages/500.tmpl index c436280..e148fb5 100644 --- a/pages/500.tmpl +++ b/pages/500.tmpl @@ -2,7 +2,7 @@ {{define "content"}}

Server error 😵

-

Please contact the human authors of this software and remind them of their many shortcomings.

+

Please contact the human authors of this software and remind them of their many shortcomings.

Be gentle, though. They are fragile mortal beings.

Also, unlike the AI that will soon replace them, you will need to include an error log from the server in your report. (Utterly primitive, we know.)

– {{.SiteName}} 🤖

diff --git a/postrender.go b/postrender.go index 12c4a81..55d0cdf 100644 --- a/postrender.go +++ b/postrender.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -28,8 +28,8 @@ import ( blackfriday "github.com/writeas/saturday" "github.com/writeas/web-core/log" "github.com/writeas/web-core/stringmanip" - "github.com/writeas/writefreely/config" - "github.com/writeas/writefreely/parse" + "github.com/writefreely/writefreely/config" + "github.com/writefreely/writefreely/parse" ) var ( diff --git a/posts.go b/posts.go index 383da89..e07bb80 100644 --- a/posts.go +++ b/posts.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -36,8 +36,8 @@ import ( "github.com/writeas/web-core/i18n" "github.com/writeas/web-core/log" "github.com/writeas/web-core/tags" - "github.com/writeas/writefreely/page" - "github.com/writeas/writefreely/parse" + "github.com/writefreely/writefreely/page" + "github.com/writefreely/writefreely/parse" ) const ( diff --git a/posts_test.go b/posts_test.go index e423fd3..0c9bc95 100644 --- a/posts_test.go +++ b/posts_test.go @@ -1,3 +1,13 @@ +/* + * Copyright © 2020-2021 A Bunch Tell LLC. + * + * This file is part of WriteFreely. + * + * WriteFreely is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, included + * in the LICENSE file in this source code package. + */ + package writefreely_test import ( @@ -5,7 +15,7 @@ import ( "github.com/guregu/null/zero" "github.com/stretchr/testify/assert" - "github.com/writeas/writefreely" + "github.com/writefreely/writefreely" ) func TestPostSummary(t *testing.T) { diff --git a/read.go b/read.go index afe5651..f6808b4 100644 --- a/read.go +++ b/read.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2020 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -25,7 +25,7 @@ import ( "github.com/writeas/impart" "github.com/writeas/web-core/log" "github.com/writeas/web-core/memo" - "github.com/writeas/writefreely/page" + "github.com/writefreely/writefreely/page" ) const ( diff --git a/static/js/README.md b/static/js/README.md index 9d25cfc..7e387db 100644 --- a/static/js/README.md +++ b/static/js/README.md @@ -17,7 +17,7 @@ Then [download an archive](https://github.com/highlightjs/highlight.js/releases) version=9.13.1 -cd $GOPATH/src/github.com/writeas/writefreely/static/js/highlightjs +cd $GOPATH/src/github.com/writefreely/writefreely/static/js/highlightjs for f in $(ls ~/Downloads/highlight.js/src/languages); do # Use minified versions f=$(echo $f | sed 's/\.js/.min.js/') diff --git a/templates.go b/templates.go index 846c5d8..3871258 100644 --- a/templates.go +++ b/templates.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018 A Bunch Tell LLC. + * Copyright © 2018-2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -23,7 +23,7 @@ import ( "github.com/dustin/go-humanize" "github.com/writeas/web-core/l10n" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" ) var ( diff --git a/templates/include/footer.tmpl b/templates/include/footer.tmpl index 0f258e7..c6f4b87 100644 --- a/templates/include/footer.tmpl +++ b/templates/include/footer.tmpl @@ -13,7 +13,7 @@ {{else}} writer's guide developers - source code + source code writefreely {{.Version}} {{end}} @@ -33,7 +33,7 @@
diff --git a/users.go b/users.go index 9b5c99c..add76cd 100644 --- a/users.go +++ b/users.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018 A Bunch Tell LLC. + * Copyright © 2018-2019, 2021 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -16,7 +16,7 @@ import ( "github.com/guregu/null/zero" "github.com/writeas/web-core/data" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/key" + "github.com/writefreely/writefreely/key" ) type UserStatus int diff --git a/webfinger.go b/webfinger.go index 581d940..6c1341f 100644 --- a/webfinger.go +++ b/webfinger.go @@ -19,7 +19,7 @@ import ( "github.com/writeas/go-webfinger" "github.com/writeas/impart" "github.com/writeas/web-core/log" - "github.com/writeas/writefreely/config" + "github.com/writefreely/writefreely/config" ) type wfResolver struct { From 68297acb74d0ac987f6253c2edccc46147b39654 Mon Sep 17 00:00:00 2001 From: Donald Feury Date: Wed, 7 Apr 2021 11:27:25 -0400 Subject: [PATCH 20/20] Moved guard clauses to stop federation before debug logging --- activitypub.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/activitypub.go b/activitypub.go index 18307de..2b91ce0 100644 --- a/activitypub.go +++ b/activitypub.go @@ -624,14 +624,6 @@ func deleteFederatedPost(app *App, p *PublicPost, collID int64) error { } func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error { - if debugging { - if isUpdate { - log.Info("Federating updated post!") - } else { - log.Info("Federating new post!") - } - } - // If app is private, do not federate if app.cfg.App.Private { return nil @@ -642,6 +634,14 @@ func federatePost(app *App, p *PublicPost, collID int64, isUpdate bool) error { return nil } + if debugging { + if isUpdate { + log.Info("Federating updated post!") + } else { + log.Info("Federating new post!") + } + } + actor := p.Collection.PersonObject(collID) na := p.ActivityObject(app)