diff options
| author | 2022-04-26 20:20:53 -0700 | |
|---|---|---|
| committer | 2023-01-31 15:16:26 +0100 | |
| commit | 93f17a3cc09b34f7e8ff1ee14d83b952de4be66d (patch) | |
| tree | dc4ab98fd8dadce212f59810eb9657cdcd94cc2f | |
| parent | [bugfix] Use background context instead of request context for async processi... (diff) | |
| download | gotosocial-93f17a3cc09b34f7e8ff1ee14d83b952de4be66d.tar.xz | |
[chore] update URLs to forked source
To satisfy the requirements of the AGPL v3 license used by GoToSocial, I
must update the URLs provided by the server to point at this forked
repository, and I must do so before making the server available over any
network.
| -rw-r--r-- | cmd/gotosocial/main.go | 113 | ||||
| -rw-r--r-- | web/template/footer.tmpl | 27 |
2 files changed, 0 insertions, 140 deletions
diff --git a/cmd/gotosocial/main.go b/cmd/gotosocial/main.go index 6edede6d5..f89b49a58 100644 --- a/cmd/gotosocial/main.go +++ b/cmd/gotosocial/main.go @@ -1,113 +0,0 @@ -/* - GoToSocial - Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -package main - -import ( - "log" - "runtime/debug" - "strings" - - "github.com/spf13/cobra" - - _ "github.com/superseriousbusiness/gotosocial/docs" - "github.com/superseriousbusiness/gotosocial/internal/config" -) - -// Version is the version of GoToSocial being used. -// It's injected into the binary by the build script. -var Version string - -//go:generate swagger generate spec -func main() { - // Load version string - version := version() - - // override version in config store - config.SetSoftwareVersion(version) - - // instantiate the root command - rootCmd := &cobra.Command{ - Use: "gotosocial", - Short: "GoToSocial - a fediverse social media server", - Long: "GoToSocial - a fediverse social media server\n\nFor help, see: https://docs.gotosocial.org.\n\nCode: https://github.com/superseriousbusiness/gotosocial", - Version: version, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - // before running any other cmd funcs, we must load config-path - return config.LoadEarlyFlags(cmd) - }, - SilenceErrors: true, - SilenceUsage: true, - } - - // attach global flags to the root command so that they can be accessed from any subcommand - config.AddGlobalFlags(rootCmd) - - // add subcommands - rootCmd.AddCommand(serverCommands()) - rootCmd.AddCommand(testrigCommands()) - rootCmd.AddCommand(debugCommands()) - rootCmd.AddCommand(adminCommands()) - - // run - if err := rootCmd.Execute(); err != nil { - log.Fatalf("error executing command: %s", err) - } -} - -// version will build a version string from binary's stored build information. -func version() string { - // Read build information from binary - build, ok := debug.ReadBuildInfo() - if !ok { - return "" - } - - // Define easy getter to fetch build settings - getSetting := func(key string) string { - for i := 0; i < len(build.Settings); i++ { - if build.Settings[i].Key == key { - return build.Settings[i].Value - } - } - return "" - } - - var info []string - - if Version != "" { - // Append version if set - info = append(info, Version) - } - - if vcs := getSetting("vcs"); vcs != "" { - // A VCS type was set (99.9% probably git) - - if commit := getSetting("vcs.revision"); commit != "" { - if len(commit) > 7 { - // Truncate commit - commit = commit[:7] - } - - // Append VCS + commit if set - info = append(info, vcs+"-"+commit) - } - } - - return strings.Join(info, " ") -} diff --git a/web/template/footer.tmpl b/web/template/footer.tmpl index 11e14ba4d..4660ba10c 100644 --- a/web/template/footer.tmpl +++ b/web/template/footer.tmpl @@ -1,27 +0,0 @@ - <!-- footer.tmpl --> - </div> - <footer> - <div id="version"> - <a name="Source code" href="https://github.com/superseriousbusiness/gotosocial"> - GoToSocial <span class="accent">{{.instance.Version}}</span> - </a> - </div> - {{ if .instance.ContactAccount }} - <div id="contact"> - Contact: <a href="{{.instance.ContactAccount.URL}}" class="nounderline">{{.instance.ContactAccount.Username}}</a><br> - </div> - {{ end }} - {{ if .instance.Email }} - <div id="email"> - Email: <a href="mailto:{{.instance.Email}}" class="nounderline">{{.instance.Email}}</a><br> - </div> - {{ end }} - </footer> - </div> - {{ if .javascript }} - {{ range .javascript }} - <script src="{{.}}"></script> - {{ end }} - {{ end }} -</body> -</html>
\ No newline at end of file |
