Browse Source

More fixes

logo_rebranding
James Mills 3 months ago
parent
commit
c6f068139e
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 2
      client/client.go
  2. 4
      cmd/yarn/root.go
  3. 4
      cmd/yarnd/main.go
  4. 6
      doc.go
  5. 74
      go.mod
  6. 639
      go.sum
  7. 6
      internal/api.go
  8. 8
      internal/cache.go
  9. 4
      internal/context.go
  10. 6
      internal/follow_handlers.go
  11. 7
      internal/server.go
  12. 3
      internal/services.go
  13. 8
      internal/utils.go
  14. 2
      version.go

2
client/client.go

@ -16,7 +16,7 @@ import (
var (
// DefaultUserAgent ...
DefaultUserAgent = fmt.Sprintf("twt/%s", twtxt.FullVersion())
DefaultUserAgent = fmt.Sprintf("twt/%s", yarn.FullVersion())
// ErrBadRequest ...
ErrBadRequest = errors.New("error: bad request")

4
cmd/yarn/root.go

@ -20,8 +20,8 @@ var configFile string
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "twt",
Version: twtxt.FullVersion(),
Use: "yarn",
Version: yarn.FullVersion(),
Short: "Command-line client for twtxt",
Long: `...`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {

4
cmd/yarnd/main.go

@ -232,7 +232,7 @@ func main() {
parseArgs()
if version {
fmt.Printf("twtxt v%s", twtxt.FullVersion())
fmt.Printf("twtxt v%s", yarn.FullVersion())
os.Exit(0)
}
@ -337,7 +337,7 @@ func main() {
}()
}
log.Infof("%s v%s listening on http://%s", path.Base(os.Args[0]), twtxt.FullVersion(), bind)
log.Infof("%s v%s listening on http://%s", path.Base(os.Args[0]), yarn.FullVersion(), bind)
if err := svr.Run(); err != nil {
log.WithError(err).Fatal("error running or shutting down server")
}

6
doc.go

@ -1,8 +1,8 @@
package twtxt
package yarn
/* 📕 twtxt is a Self-Hosted, Twitter-like Decentralised microBlogging platform. No ads, no tracking, your content, your data!
/* 📕 yarn is a Self-Hosted, Twitter-like Decentralised microBlogging platform. No ads, no tracking, your content, your data!
Copyright (C) 2020 James Mills
Copyright (C) 2020-present James Mills
twtxt is covered by the MIT license:

74
go.mod

@ -3,99 +3,83 @@ module git.mills.io/yarnsocial/yarn
go 1.16
require (
git.mills.io/prologic/bitcask v0.3.9
git.mills.io/prologic/go-gopher v0.0.0-20201022213256-724979970b3f
git.mills.io/prologic/observe v0.0.0-20181231082615-747b185a0928
git.mills.io/prologic/read-file-last-line v0.0.0-20200806014221-326f63458987
git.mills.io/prologic/smtpd v0.0.0-20201215080427-fd3f94c87eb7
github.com/Masterminds/goutils v1.1.0 // indirect
git.mills.io/prologic/bitcask v0.3.11
git.mills.io/prologic/go-gopher v0.0.0-20210710073742-5715073cee0f
git.mills.io/prologic/observe v0.0.0-20210710122508-45e27ec8bb27
git.mills.io/prologic/read-file-last-line v0.0.0-20210710073401-af293d63a6d0
git.mills.io/prologic/smtpd v0.0.0-20210710122116-a525b76c287a
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/NYTimes/gziphandler v1.1.1
github.com/PuerkitoBio/goquery v1.6.0
github.com/PuerkitoBio/goquery v1.7.0
github.com/andreadipersio/securecookie v0.0.0-20131119095127-e3c3b33544ec
github.com/andybalholm/cascadia v1.2.0 // indirect
github.com/andyleap/microformats v0.0.0-20150523144534-25ae286f528b
github.com/audiolion/ipip v1.0.0
github.com/bakape/thumbnailer/v2 v2.6.4
github.com/bakape/thumbnailer/v2 v2.7.0
github.com/chai2010/webp v1.1.0
github.com/creasty/defaults v1.5.1
github.com/cyphar/filepath-securejoin v0.2.2
github.com/cyphar/filepath-securejoin v0.2.3
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/disintegration/gift v1.2.1
github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec
github.com/dustin/go-humanize v1.0.0
github.com/elithrar/simple-scrypt v1.3.0
github.com/emersion/go-mbox v1.0.2
github.com/emersion/go-message v0.14.0
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/emersion/go-message v0.15.0
github.com/gabstv/merger v1.0.1
github.com/go-mail/mail v2.3.1+incompatible
github.com/goccy/go-yaml v1.8.4
github.com/gomarkdown/markdown v0.0.0-20201113031856-722100d81a8e
github.com/goccy/go-yaml v1.8.10
github.com/gomarkdown/markdown v0.0.0-20210514010506-3b9f47219fe7
github.com/gorilla/feeds v1.1.1
github.com/goware/urlx v0.3.1
github.com/grokify/html-strip-tags-go v0.0.0-20200923094847-079d207a09f1 // indirect
github.com/h2non/filetype v1.1.0
github.com/h2non/filetype v1.1.1
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/james4k/fmatter v0.0.0-20150827042251-377c8ea6259d
github.com/jinzhu/gorm v1.9.16 // indirect
github.com/julienschmidt/httprouter v1.3.0
github.com/justinas/nosurf v1.1.1
github.com/kr/pretty v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lithammer/shortuuid/v3 v3.0.5
github.com/magiconair/properties v1.8.4 // indirect
github.com/lithammer/shortuuid/v3 v3.0.7
github.com/marcinwyszynski/popart v0.0.0-20160216095024-f601a19c2970
github.com/marksalpeter/sugar v0.0.0-20160713164314-a69afe358ea8 // indirect
github.com/marksalpeter/token/v2 v2.0.0
github.com/matryer/is v1.4.0
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/microcosm-cc/bluemonday v1.0.4
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/microcosm-cc/bluemonday v1.0.15
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.4.0 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/naoina/go-stringutil v0.1.0 // indirect
github.com/naoina/toml v0.1.1
github.com/nicksnyder/go-i18n/v2 v2.1.2
github.com/nullrocks/identicon v0.0.0-20180626043057-7875f45b0022
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/prometheus/client_golang v1.9.0 // indirect
github.com/prologic/go-gopher v0.0.0-20210626004351-e7ec35345d00 // indirect
github.com/prometheus/common v0.29.0 // indirect
github.com/prometheus/procfs v0.7.0 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/renstrom/shortuuid v3.0.0+incompatible
github.com/rickb777/accept v0.0.0-20170318132422-d5183c44530d
github.com/robfig/cron v1.2.0
github.com/securisec/go-keywords v0.0.0-20200619134240-769e7273f2ed
github.com/sirupsen/logrus v1.7.0
github.com/smartystreets/assertions v1.0.0 // indirect
github.com/spf13/afero v1.5.1 // indirect
github.com/spf13/cobra v1.1.1
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/spf13/viper v1.8.1
github.com/steambap/captcha v1.3.1
github.com/stretchr/objx v0.3.0 // indirect
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.7.0
github.com/tebeka/selenium v0.9.9
github.com/theplant-retired/timezones v0.0.0-20150304063004-f9bd3c0ef9db
github.com/unrolled/logger v0.0.0-20201216141554-31a3694fe979
github.com/vcraescu/go-paginator v1.0.0
github.com/wblakecaldwell/profiler v0.0.0-20150908040756-6111ef1313a1
github.com/writeas/slug v1.2.0
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/exp v0.0.0-20201229011636-eab1b5eb1a03 // indirect
golang.org/x/image v0.0.0-20201208152932-35266b937fa6 // indirect
golang.org/x/net v0.0.0-20201224014010-6772e930b67b
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
golang.org/x/net v0.0.0-20210614182718-04defd469f4e
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/text v0.3.6
google.golang.org/protobuf v1.25.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/mail.v2 v2.3.1 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
gorm.io/gorm v1.20.9 // indirect
)

639
go.sum

File diff suppressed because it is too large

6
internal/api.go

@ -628,7 +628,7 @@ func (a *API) FollowEndpoint() httprouter.Handle {
"FOLLOW: @<%s %s> from @<%s %s> using %s/%s",
followee.Username, URLForUser(a.config.BaseURL, followee.Username),
user.Username, URLForUser(a.config.BaseURL, user.Username),
"twtxt", twtxt.FullVersion(),
"twtxt", yarn.FullVersion(),
),
); err != nil {
log.WithError(err).Warnf("error appending special FOLLOW post")
@ -656,7 +656,7 @@ func (a *API) FollowEndpoint() httprouter.Handle {
"FOLLOW: @<%s %s> from @<%s %s> using %s/%s",
feed.Name, URLForUser(a.config.BaseURL, feed.Name),
user.Username, URLForUser(a.config.BaseURL, user.Username),
"twtxt", twtxt.FullVersion(),
"twtxt", yarn.FullVersion(),
),
); err != nil {
log.WithError(err).Warnf("error appending special FOLLOW post")
@ -730,7 +730,7 @@ func (a *API) UnfollowEndpoint() httprouter.Handle {
"UNFOLLOW: @<%s %s> from @<%s %s> using %s/%s",
followee.Username, URLForUser(a.config.BaseURL, followee.Username),
user.Username, URLForUser(a.config.BaseURL, user.Username),
"twtxt", twtxt.FullVersion(),
"twtxt", yarn.FullVersion(),
),
); err != nil {
log.WithError(err).Warnf("error appending special FOLLOW post")

8
internal/cache.go

@ -214,14 +214,14 @@ func (cache *Cache) FetchTwts(conf *Config, archive Archiver, feeds types.Feeds,
var userAgent string
if len(feedFollowers) == 1 {
userAgent = fmt.Sprintf(
"twtxt/%s (+%s; @%s)",
twtxt.FullVersion(),
"yarnd/%s (+%s; @%s)",
yarn.FullVersion(),
URLForUser(conf.BaseURL, feedFollowers[0]), feedFollowers[0],
)
} else {
userAgent = fmt.Sprintf(
"twtxt/%s (~%s; contact=%s)",
twtxt.FullVersion(),
"yarnd/%s (~%s; contact=%s)",
yarn.FullVersion(),
URLForWhoFollows(conf.BaseURL, feed, len(feedFollowers)),
URLForPage(conf.BaseURL, "support"),
)

4
internal/context.go

@ -99,7 +99,7 @@ func NewContext(conf *Config, db Store, req *http.Request) *Context {
Logo: template.HTML(conf.Logo),
BaseURL: conf.BaseURL,
InstanceName: conf.Name,
SoftwareVersion: twtxt.FullVersion(),
SoftwareVersion: yarn.FullVersion(),
TwtsPerPage: conf.TwtsPerPage,
TwtPrompt: conf.RandomTwtPrompt(),
MaxTwtLength: conf.MaxTwtLength,
@ -107,7 +107,7 @@ func NewContext(conf *Config, db Store, req *http.Request) *Context {
OpenProfiles: conf.OpenProfiles,
LastTwt: types.NilTwt,
Commit: twtxt.Commit,
Commit: yarn.Commit,
Theme: conf.Theme,
Lang: conf.Lang,
AcceptLangs: req.Header.Get("Accept-Language"),

6
internal/follow_handlers.go

@ -93,7 +93,7 @@ func (s *Server) FollowHandler() httprouter.Handle {
"FOLLOW: @<%s %s> from @<%s %s> using %s/%s",
followee.Username, URLForUser(s.config.BaseURL, followee.Username),
user.Username, URLForUser(s.config.BaseURL, user.Username),
"twtxt", twtxt.FullVersion(),
"twtxt", yarn.FullVersion(),
),
); err != nil {
log.WithError(err).Warnf("error appending special FOLLOW post")
@ -125,7 +125,7 @@ func (s *Server) FollowHandler() httprouter.Handle {
"FOLLOW: @<%s %s> from @<%s %s> using %s/%s",
feed.Name, URLForUser(s.config.BaseURL, feed.Name),
user.Username, URLForUser(s.config.BaseURL, user.Username),
"twtxt", twtxt.FullVersion(),
"twtxt", yarn.FullVersion(),
),
); err != nil {
log.WithError(err).Warnf("error appending special FOLLOW post")
@ -260,7 +260,7 @@ func (s *Server) UnfollowHandler() httprouter.Handle {
"UNFOLLOW: @<%s %s> from @<%s %s> using %s/%s",
followee.Username, URLForUser(s.config.BaseURL, followee.Username),
user.Username, URLForUser(s.config.BaseURL, user.Username),
"twtxt", twtxt.FullVersion(),
"twtxt", yarn.FullVersion(),
),
); err != nil {
log.WithError(err).Warnf("error appending special FOLLOW post")

7
internal/server.go

@ -25,6 +25,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/unrolled/logger"
"git.mills.io/yarnsocial/yarn"
"git.mills.io/yarnsocial/yarn/internal/auth"
"git.mills.io/yarnsocial/yarn/internal/passwords"
"git.mills.io/yarnsocial/yarn/internal/session"
@ -297,9 +298,9 @@ func (s *Server) setupMetrics() {
)
metrics.GaugeVec("server", "info").
With(map[string]string{
"full_version": twtxt.FullVersion(),
"version": twtxt.Version,
"commit": twtxt.Commit,
"full_version": yarn.FullVersion(),
"version": yarn.Version,
"commit": yarn.Commit,
}).Set(1)
// old avatars

3
internal/services.go

@ -16,6 +16,7 @@ import (
"time"
"git.mills.io/prologic/smtpd"
"git.mills.io/yarnsocial/yarn"
"git.mills.io/yarnsocial/yarn/internal/passwords"
"github.com/emersion/go-message"
"github.com/marcinwyszynski/popart"
@ -321,7 +322,7 @@ func (s *SMTPService) ListenAndServe() error {
Addr: s.config.SMTPBind,
Handler: s.mailHandler(),
HandlerRcpt: s.rcptHandler(),
Appname: fmt.Sprintf("%x SMTP v%s", s.config.Name, twtxt.Version),
Appname: fmt.Sprintf("%x SMTP v%s", s.config.Name, yarn.Version),
Hostname: HostnameFromURL(s.config.BaseURL),
AuthMechs: authMechs,
AuthHandler: s.authHandler(),

8
internal/utils.go

@ -31,6 +31,8 @@ import (
_ "image/jpeg"
"image/png"
"git.mills.io/yarnsocial/yarn"
"git.mills.io/yarnsocial/yarn/types"
"github.com/PuerkitoBio/goquery"
"github.com/audiolion/ipip"
"github.com/bakape/thumbnailer/v2"
@ -43,8 +45,6 @@ import (
"github.com/gomarkdown/markdown/parser"
"github.com/goware/urlx"
"github.com/h2non/filetype"
"git.mills.io/yarnsocial/yarn"
"git.mills.io/yarnsocial/yarn/types"
shortuuid "github.com/lithammer/shortuuid/v3"
"github.com/microcosm-cc/bluemonday"
"github.com/nullrocks/identicon"
@ -278,8 +278,8 @@ func Request(conf *Config, method, url string, headers http.Header) (*http.Respo
headers.Set(
"User-Agent",
fmt.Sprintf(
"twtxt/%s (Pod: %s Support: %s)",
twtxt.FullVersion(), conf.Name, URLForPage(conf.BaseURL, "support"),
"yarnd/%s (Pod: %s Support: %s)",
yarn.FullVersion(), conf.Name, URLForPage(conf.BaseURL, "support"),
),
)
}

2
version.go

@ -1,4 +1,4 @@
package twtxt
package yarn
import (
"fmt"

Loading…
Cancel
Save