Compare commits

..

1 Commits

Author SHA1 Message Date
httpjamesm ba9a0904cb Add version endpoint 2024-07-25 10:30:38 -07:00
9 changed files with 11 additions and 46 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ StackOverflow has a cluttered UI that might distract you from the content you're
The open-source [Libredirect](https://github.com/libredirect/libredirect) extension for Firefox and Chromium-based desktop browsers has support for redirections to AnonymousOverflow. To enable this, simply open the extension settings, click on Stack Overflow, then toggle "Enable". That's it, now Stack Overflow links will go to AnonymousOverflow.
The open-source [Proxy_Redirect](https://openuserjs.org/scripts/sjehuda/Proxy_Redirect) user.js script for web browsers with userscript support. You can install it with a web extension like [Greasemonkey](https://greasespot.net/), [Tampermonkey](https://tampermonkey.net/) or [Violentmonkey](https://violentmonkey.github.io/). Once installed, Stack Overflow links will go to AnonymousOverflow.
The open-source [FREEdirector](https://openuserjs.org/scripts/sjehuda/FREEdirector) user.js script for web browsers with userscript support. You can install it with a web extension like [Greasemonkey](https://greasespot.net/), [Tampermonkey](https://tampermonkey.net/) or [Violentmonkey](https://violentmonkey.github.io/). Once installed, Stack Overflow links will go to AnonymousOverflow.
## How it works
+1 -1
View File
@@ -123,7 +123,7 @@
{
"url": "https://soflow.nerdvpn.de",
"regions": ["Ukraine"],
"operators": ["https://nerdvpn.de"]
"operators": ["https://github.com/Sommerwiesel"]
},
{
"url": "https://overflow.einfachzocken.eu/",
+5 -18
View File
@@ -1,13 +1,9 @@
:root {
--code-bg: #36383d;
--code-fg: #ffffff;
}
:root,
[data-theme="dark"] {
--main-bg: #1b1f26;
--text-color: #fff;
--muted-text-color: #b3b3b3;
--code-bg: #36383d;
--code-fg: #ffffff;
--input-bg: #2b303b;
--input-bg-hover: #3b404b;
--meta-bg: #525262;
@@ -16,10 +12,12 @@
}
@media (prefers-color-scheme: light) {
:root:not([data-theme="dark"]) {
:root {
--main-bg: #dbdbdb;
--text-color: #000;
--muted-text-color: #636363;
--code-bg: #36383d;
--code-fg: #ffffff;
--input-bg: #bcbcbc;
--input-bg-hover: #a8a8a8;
--meta-bg: #aaa8a8;
@@ -28,17 +26,6 @@
}
}
[data-theme="light"] {
--main-bg: #dbdbdb;
--text-color: #000;
--muted-text-color: #636363;
--input-bg: #bcbcbc;
--input-bg-hover: #a8a8a8;
--meta-bg: #aaa8a8;
--divider-color: #b5b5b5;
--link-color: #335ad0;
}
a {
color: var(--link-color);
}
-5
View File
@@ -2,7 +2,6 @@ package routes
import (
"anonymousoverflow/config"
"anonymousoverflow/src/utils"
"fmt"
"regexp"
"strings"
@@ -11,10 +10,8 @@ import (
)
func GetHome(c *gin.Context) {
theme := utils.GetThemeFromEnv()
c.HTML(200, "home.html", gin.H{
"version": config.Version,
"theme": theme,
})
}
@@ -71,10 +68,8 @@ func PostHome(c *gin.Context) {
translated := translateUrl(body.URL)
if translated == "" {
theme := utils.GetThemeFromEnv()
c.HTML(400, "home.html", gin.H{
"errorMessage": "Invalid stack overflow/exchange URL",
"theme": theme,
})
return
}
-3
View File
@@ -2,7 +2,6 @@ package routes
import (
"anonymousoverflow/config"
"anonymousoverflow/src/utils"
"fmt"
"github.com/gin-gonic/gin"
@@ -18,11 +17,9 @@ func ChangeOptions(c *gin.Context) {
text = "enabled"
}
c.SetCookie("disable_images", fmt.Sprintf("%t", !c.MustGet("disable_images").(bool)), 60*60*24*365*10, "/", "", false, true)
theme := utils.GetThemeFromEnv()
c.HTML(200, "home.html", gin.H{
"successMessage": "Images are now " + text,
"version": config.Version,
"theme": theme,
})
default:
c.String(400, "400 Bad Request")
-3
View File
@@ -101,8 +101,6 @@ func ViewQuestion(c *gin.Context) {
imagePolicy = "'self'"
}
theme := utils.GetThemeFromEnv()
c.HTML(200, "question.html", gin.H{
"question": newFilteredQuestion,
"answers": answers,
@@ -110,7 +108,6 @@ func ViewQuestion(c *gin.Context) {
"currentUrl": fmt.Sprintf("%s%s", os.Getenv("APP_URL"), c.Request.URL.Path),
"sortValue": params.SoSortValue,
"domain": domain,
"theme": theme,
})
}
-11
View File
@@ -1,11 +0,0 @@
package utils
import "os"
func GetThemeFromEnv() string {
theme := os.Getenv("THEME")
if theme == "" {
theme = "auto"
}
return theme
}
+2 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-theme="{{ .theme }}">
<html>
<head>
<title>AnonymousOverflow - Private frontend for StackOverflow</title>
@@ -58,4 +58,4 @@
</div>
</body>
</html>
</html>
+2 -2
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-theme="{{ .theme }}">
<html>
<head>
<title>{{ .question.Title }} | AnonymousOverflow</title>
@@ -92,4 +92,4 @@
{{ end }}
</body>
</html>
</html>