From 5a0e93022467061f3558c5ac0e322b9bfc48e69d Mon Sep 17 00:00:00 2001
From: Arya Kiran
Date: Fri, 10 Mar 2023 15:38:11 +0530
Subject: [PATCH] rename /privacy to /about since there is a user called
privacy
---
cmd/gothub/root.go | 2 +-
pages/{privacy.go => about.go} | 23 ++++++++++++-----------
serve/serve.go | 2 +-
views/{privacy.html => about.go} | 9 ++++-----
views/header.html | 2 +-
5 files changed, 19 insertions(+), 19 deletions(-)
rename pages/{privacy.go => about.go} (77%)
rename views/{privacy.html => about.go} (83%)
diff --git a/cmd/gothub/root.go b/cmd/gothub/root.go
index 0af80ee..f46160c 100644
--- a/cmd/gothub/root.go
+++ b/cmd/gothub/root.go
@@ -10,7 +10,7 @@ import (
var rootCmd = &cobra.Command{
Use: "gothub",
Short: "An alternative front-end for GitHub.",
- Long: `An alternative front-end for GitHub, written by Odyssey346 and Midou360.`,
+ Long: `An alternative front-end for GitHub written in Go Fiber.`,
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
diff --git a/pages/privacy.go b/pages/about.go
similarity index 77%
rename from pages/privacy.go
rename to pages/about.go
index a663bf2..ab3ee48 100644
--- a/pages/privacy.go
+++ b/pages/about.go
@@ -8,17 +8,18 @@ import (
)
type PrivacyInfo struct {
- IPAddr string
- ReqURL string
- UserAgent string
- Diagnostics string
- Country string
- Provider string
- Cloudflare string
- PrivacyPolicy string
- Version string
- GoVersion string
- FiberVersion string
+ IPAddr string
+ ReqURL string
+ UserAgentLogged string
+ Diagnostics string
+ Country string
+ Provider string
+ Cloudflare string
+ PrivacyPolicy string
+ Version string
+ GoVersion string
+ FiberVersion string
+ UserAgent string
}
func HandlePrivacy(c *fiber.Ctx) error {
diff --git a/serve/serve.go b/serve/serve.go
index d778193..8352f29 100644
--- a/serve/serve.go
+++ b/serve/serve.go
@@ -98,7 +98,7 @@ func Serve() {
app.Static("/robots.txt", "./public/robots.txt", staticConfig)
app.Static("/favicon.ico", "./public/assets/favicon.ico", staticConfig)
app.Static("/logo.svg", "./public/assets/logo.svg", staticConfig)
- app.Get("/privacy", pages.HandlePrivacy)
+ app.Get("/about", pages.HandleAbout)
app.Get("/explore", ratelimiter, pages.HandleExplore)
app.Get("/:user", pages.HandleUser)
app.Get("/avatar/:id", func(c *fiber.Ctx) error {
diff --git a/views/privacy.html b/views/about.go
similarity index 83%
rename from views/privacy.html
rename to views/about.go
index bef689c..c0c924b 100644
--- a/views/privacy.html
+++ b/views/about.go
@@ -1,8 +1,9 @@
{{template "header" .}}
- Instance Privacy
+ About this GotHub instance
{{ if .privacyInformation}} {{ range $key, $value := .privacyInformation}}
+ Instance Privacy
The goal of this page is to bring transparency to the data collected by the
instances and to encourage privacy friendly practices.
@@ -11,7 +12,7 @@
- IP Address logged: {{.IPAddr}}
- Request URL logged: {{.ReqURL}}
- - User Agent logged: {{.UserAgent}}
+ - User Agent logged: {{.UserAgentLogged}}
- Diagnostic Information logged: {{.Diagnostics}}
{{ if .PrivacyPolicy }}
@@ -28,9 +29,7 @@
>
- -
- Go Version: Fiber {{ .FiberVersion}} running on {{ .GoVersion}}
-
+ - Go Version: Fiber {{ .FiberVersion}} running on {{ .GoVersion}}
- Country: {{.Country}}
- Cloudflare: {{.Cloudflare}}
- ISP: {{.Provider}}
diff --git a/views/header.html b/views/header.html
index e886a94..a34a271 100644
--- a/views/header.html
+++ b/views/header.html
@@ -24,7 +24,7 @@
>