Replaced all other referenced to twt/twtxt
This commit is contained in:
@@ -16,7 +16,6 @@ import (
|
||||
|
||||
"git.mills.io/prologic/spyda"
|
||||
"git.mills.io/prologic/spyda/internal"
|
||||
"git.mills.io/prologic/spyda/types/retwt"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -34,22 +33,14 @@ var (
|
||||
|
||||
// Pod Oeprator
|
||||
adminUser string
|
||||
adminPass string
|
||||
adminName string
|
||||
adminEmail string
|
||||
|
||||
// Pod Settings
|
||||
openProfiles bool
|
||||
openRegistrations bool
|
||||
// Limits
|
||||
resultsPerpage int
|
||||
|
||||
// Pod Limits
|
||||
twtsPerPage int
|
||||
maxTwtLength int
|
||||
maxUploadSize int64
|
||||
maxFetchLimit int64
|
||||
maxCacheTTL time.Duration
|
||||
maxCacheItems int
|
||||
|
||||
// Pod Secrets
|
||||
// Secrets
|
||||
apiSigningKey string
|
||||
cookieSecret string
|
||||
magiclinkSecret string
|
||||
@@ -61,19 +52,10 @@ var (
|
||||
smtpPass string
|
||||
smtpFrom string
|
||||
|
||||
// Messaging Settings
|
||||
smtpBind string
|
||||
pop3Bind string
|
||||
|
||||
// Timeouts
|
||||
sessionExpiry time.Duration
|
||||
sessionCacheTTL time.Duration
|
||||
apiSessionTime time.Duration
|
||||
transcoderTimeout time.Duration
|
||||
|
||||
// Whitelists, Sources
|
||||
feedSources []string
|
||||
whitelistedDomains []string
|
||||
sessionExpiry time.Duration
|
||||
sessionCacheTTL time.Duration
|
||||
apiSessionTime time.Duration
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -89,48 +71,19 @@ func init() {
|
||||
flag.StringVarP(&theme, "theme", "t", internal.DefaultTheme, "set the default theme")
|
||||
flag.StringVarP(&baseURL, "base-url", "u", internal.DefaultBaseURL, "base url to use")
|
||||
|
||||
// Pod Oeprator
|
||||
// Administration
|
||||
flag.StringVarP(&adminName, "admin-name", "N", internal.DefaultAdminName, "default admin user name")
|
||||
flag.StringVarP(&adminEmail, "admin-email", "E", internal.DefaultAdminEmail, "default admin user email")
|
||||
flag.StringVarP(&adminUser, "admin-user", "A", internal.DefaultAdminUser, "default admin user to use")
|
||||
flag.StringVarP(&adminPass, "admin-pass", "P", internal.DefaultAdminName, "default admin user name")
|
||||
|
||||
// Pod Settings
|
||||
flag.BoolVarP(
|
||||
&openRegistrations, "open-registrations", "R", internal.DefaultOpenRegistrations,
|
||||
"whether or not to have open user registgration",
|
||||
)
|
||||
flag.BoolVarP(
|
||||
&openProfiles, "open-profiles", "O", internal.DefaultOpenProfiles,
|
||||
"whether or not to have open user profiles",
|
||||
// Limits
|
||||
flag.IntVarP(
|
||||
&resultsPerPage, "results-per-page", "T", internal.DefaultResultsPerPage,
|
||||
"maximum results per page to display",
|
||||
)
|
||||
|
||||
// Pod Limits
|
||||
flag.IntVarP(
|
||||
&twtsPerPage, "twts-per-page", "T", internal.DefaultTwtsPerPage,
|
||||
"maximum twts per page to display",
|
||||
)
|
||||
flag.IntVarP(
|
||||
&maxTwtLength, "max-twt-length", "L", internal.DefaultMaxTwtLength,
|
||||
"maximum length of posts",
|
||||
)
|
||||
flag.Int64VarP(
|
||||
&maxUploadSize, "max-upload-size", "U", internal.DefaultMaxUploadSize,
|
||||
"maximum upload size of media",
|
||||
)
|
||||
flag.Int64VarP(
|
||||
&maxFetchLimit, "max-fetch-limit", "F", internal.DefaultMaxFetchLimit,
|
||||
"maximum feed fetch limit in bytes",
|
||||
)
|
||||
flag.DurationVarP(
|
||||
&maxCacheTTL, "max-cache-ttl", "C", internal.DefaultMaxCacheTTL,
|
||||
"maximum cache ttl (time-to-live) of cached twts in memory",
|
||||
)
|
||||
flag.IntVarP(
|
||||
&maxCacheItems, "max-cache-items", "I", internal.DefaultMaxCacheItems,
|
||||
"maximum cache items (per feed source) of cached twts in memory",
|
||||
)
|
||||
|
||||
// Pod Secrets
|
||||
// Secrets
|
||||
flag.StringVar(
|
||||
&apiSigningKey, "api-signing-key", internal.DefaultAPISigningKey,
|
||||
"secret to use for signing api tokens",
|
||||
@@ -151,10 +104,6 @@ func init() {
|
||||
flag.StringVar(&smtpPass, "smtp-pass", internal.DefaultSMTPPass, "SMTP Pass to use for email sending")
|
||||
flag.StringVar(&smtpFrom, "smtp-from", internal.DefaultSMTPFrom, "SMTP From to use for email sending")
|
||||
|
||||
// Messaging Settings
|
||||
flag.StringVar(&smtpBind, "smtp-bind", internal.DefaultSMTPBind, "SMTP interface and port to bind to")
|
||||
flag.StringVar(&pop3Bind, "pop3-bind", internal.DefaultPOP3Bind, "POP3 interface and port to bind to")
|
||||
|
||||
// Timeouts
|
||||
flag.DurationVar(
|
||||
&sessionExpiry, "session-expiry", internal.DefaultSessionExpiry,
|
||||
@@ -168,20 +117,6 @@ func init() {
|
||||
&apiSessionTime, "api-session-time", internal.DefaultAPISessionTime,
|
||||
"timeout for api tokens to expire",
|
||||
)
|
||||
flag.DurationVar(
|
||||
&transcoderTimeout, "transcoder-timeout", internal.DefaultTranscoderTimeout,
|
||||
"timeout for the video transcoder",
|
||||
)
|
||||
|
||||
// Whitelists, Sources
|
||||
flag.StringSliceVar(
|
||||
&feedSources, "feed-sources", internal.DefaultFeedSources,
|
||||
"external feed sources for discovery of other feeds",
|
||||
)
|
||||
flag.StringSliceVar(
|
||||
&whitelistedDomains, "whitelist-domain", internal.DefaultWhitelistedDomains,
|
||||
"whitelist of external domains to permit for display of inline images",
|
||||
)
|
||||
}
|
||||
|
||||
func flagNameFromEnvironmentName(s string) string {
|
||||
@@ -232,8 +167,6 @@ func main() {
|
||||
log.SetLevel(log.InfoLevel)
|
||||
}
|
||||
|
||||
retwt.DefaultTwtManager()
|
||||
|
||||
svr, err := internal.NewServer(bind,
|
||||
// Debug mode
|
||||
internal.WithDebug(debug),
|
||||
@@ -246,24 +179,16 @@ func main() {
|
||||
internal.WithTheme(theme),
|
||||
internal.WithBaseURL(baseURL),
|
||||
|
||||
// Pod Oeprator
|
||||
// Administration
|
||||
internal.WithAdminUser(adminUser),
|
||||
internal.WithAdminPass(adminPass),
|
||||
internal.WithAdminName(adminName),
|
||||
internal.WithAdminEmail(adminEmail),
|
||||
|
||||
// Pod Settings
|
||||
internal.WithOpenProfiles(openProfiles),
|
||||
internal.WithOpenRegistrations(openRegistrations),
|
||||
// Limits
|
||||
internal.WithResultsPerPage(resultsPerPage),
|
||||
|
||||
// Pod Limits
|
||||
internal.WithTwtsPerPage(twtsPerPage),
|
||||
internal.WithMaxTwtLength(maxTwtLength),
|
||||
internal.WithMaxUploadSize(maxUploadSize),
|
||||
internal.WithMaxFetchLimit(maxFetchLimit),
|
||||
internal.WithMaxCacheTTL(maxCacheTTL),
|
||||
internal.WithMaxCacheItems(maxCacheItems),
|
||||
|
||||
// Pod Secrets
|
||||
// Secrets
|
||||
internal.WithAPISigningKey(apiSigningKey),
|
||||
internal.WithCookieSecret(cookieSecret),
|
||||
internal.WithMagicLinkSecret(magiclinkSecret),
|
||||
@@ -275,19 +200,10 @@ func main() {
|
||||
internal.WithSMTPPass(smtpPass),
|
||||
internal.WithSMTPFrom(smtpFrom),
|
||||
|
||||
// Messaging Settings
|
||||
internal.WithSMTPBind(smtpBind),
|
||||
internal.WithPOP3Bind(pop3Bind),
|
||||
|
||||
// Timeouts
|
||||
internal.WithSessionExpiry(sessionExpiry),
|
||||
internal.WithSessionCacheTTL(sessionCacheTTL),
|
||||
internal.WithAPISessionTime(apiSessionTime),
|
||||
internal.WithTranscoderTimeout(transcoderTimeout),
|
||||
|
||||
// Whitelists, Sources
|
||||
internal.WithFeedSources(feedSources),
|
||||
internal.WithWhitelistedDomains(whitelistedDomains),
|
||||
)
|
||||
if err != nil {
|
||||
log.WithError(err).Fatal("error creating server")
|
||||
|
||||
Reference in New Issue
Block a user