Compare commits

..

1 commit

Author SHA1 Message Date
httpjamesm
cf4ca7d191 Instance domain change 2024-07-25 09:46:24 -07:00
15 changed files with 27 additions and 115 deletions

View file

@ -22,13 +22,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v3
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@ -36,17 +32,16 @@ jobs:
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
uses: docker/build-push-action@v6
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}

View file

@ -1,4 +1,4 @@
FROM golang:1.22.1-alpine3.19 AS build
FROM golang:1.22.1-alpine3.19 as build
WORKDIR /app
@ -9,10 +9,7 @@ RUN go mod download
COPY . .
# Architecture and OS are set dynamically (by BuildKit)
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
ENV CGO_ENABLED=0
RUN go build -o anonymousoverflow && go build -o healthcheck ./src/healthcheck

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

View file

@ -2,7 +2,7 @@
"clearnet": [
{
"url": "https://code.whatever.social",
"regions": ["Canada", "United States"],
"regions": ["Germany"],
"operators": ["https://whatever.social", "https://httpjames.space"]
},
{
@ -47,7 +47,7 @@
},
{
"url": "https://ao.bloat.cat",
"regions": ["Germany"],
"regions": ["Romania"],
"operators": ["https://bloat.cat"]
},
{
@ -76,14 +76,14 @@
"operators": ["https://rootdo.com"]
},
{
"url": "https://anonoverflow.hyperreal.coffee",
"regions": ["United States"],
"operators": ["https://hyperreal.coffee"]
"url": "https://anonoverflow.nirn.quest",
"regions": ["Canada"],
"operators": ["https://nirn.quest", "https://hyperreal.coffee"]
},
{
"url": "https://o.sudovanilla.org",
"url": "https://overflow.sudovanilla.com",
"regions": ["United States"],
"operators": ["https://sudovanilla.org"]
"operators": ["https://sudovanilla.com"]
},
{
"url": "https://anonymousoverflow.privacyfucking.rocks/",
@ -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/",
@ -149,26 +149,6 @@
"url": "https://anonflow.aketawi.space/",
"regions": ["Russia"],
"operators": ["https://www.aketawi.space/"]
},
{
"url": "https://anonymousoverflow.gitro.xyz",
"regions": ["Germany"],
"operators": ["https://gitro.xyz"]
},
{
"url": "https://ao.bunk.lol",
"regions": ["Iceland"],
"operators": ["https://bunk.lol"]
},
{
"url": "https://o.iii.st/",
"regions": ["Germany"],
"operators": ["https://iii.st/"]
},
{
"url": "https://overflow.canine.tools/",
"regions": ["United States"],
"operators": ["https://canine.tools/"]
}
],
@ -209,11 +189,6 @@
"operators": [
"http://darknessrdor43qkl2ngwitj72zdavfz2cead4t5ed72bybgauww5lyd.onion/"
]
},
{
"url": "http://o.zx56doutynmbgezxtpccduajwcblzx7fgio2yuy57a3jingco2c6fvqd.onion/",
"regions": ["Germany"],
"operators": ["https://iii.st/"]
}
],

View file

@ -86,8 +86,6 @@ func main() {
r.GET("/proxy", routes.GetImage)
r.GET("/version", routes.GetVersion)
soPingCheck := checks.NewPingCheck("https://stackoverflow.com", "GET", 5000, nil, nil)
sePingCheck := checks.NewPingCheck("https://stackexchange.com", "GET", 5000, nil, nil)
healthcheck.New(r, config.DefaultConfig(), []checks.Check{soPingCheck, sePingCheck})

View file

@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49 48">
<circle cx="14.5" cy="33.5" r="14.5" fill="#8cffc0"/>
<circle cx="14.5" cy="14.5" r="14.5" fill="#fff"/>
<circle cx="34.5" cy="14.5" r="14.5" fill="#8cffc0"/>
<circle cx="34.5" cy="33.5" r="14.5" fill="#fff"/>
</svg>

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

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,20 +26,8 @@
}
}
[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);
word-wrap: break-word;
}
html {
@ -92,4 +78,4 @@ details {
.fw-nowrap {
flex-wrap: nowrap;
}
}

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
}

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")

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,
})
}

View file

@ -1,10 +0,0 @@
package routes
import (
"anonymousoverflow/config"
"github.com/gin-gonic/gin"
)
func GetVersion(c *gin.Context) {
c.String(200, config.Version)
}

View file

@ -1,11 +0,0 @@
package utils
import "os"
func GetThemeFromEnv() string {
theme := os.Getenv("THEME")
if theme == "" {
theme = "auto"
}
return theme
}

View file

@ -1,12 +1,11 @@
<!DOCTYPE html>
<html data-theme="{{ .theme }}">
<html>
<head>
<title>AnonymousOverflow - Private frontend for StackOverflow</title>
<link rel="stylesheet" href="/static/home.css" />
<meta http-equiv="Content-Security-Policy"
content="default-src 'none'; style-src 'self'; script-src 'none'; img-src 'self';" />
<link rel="icon" href="/static/codecircles.svg" />
<link rel="icon" href="/static/codecircles.webp" />
<meta name="description" content="View StackOverflow threads in privacy and without the clutter." />
{{ template "sharedHead.html" }}
@ -15,7 +14,7 @@
<body>
<div class="container">
<div class="title">
<img class="logo" src="/static/codecircles.svg" alt="" />
<img class="logo" src="/static/codecircles.webp" alt="" />
<h1>Anonymous&shy;Overflow</h1>
</div>
<h2>Get programming help without compromising your privacy.</h2>
@ -59,4 +58,4 @@
</div>
</body>
</html>
</html>

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-theme="{{ .theme }}">
<html>
<head>
<title>{{ .question.Title }} | AnonymousOverflow</title>
@ -23,7 +23,7 @@
<body>
<div class="header">
<a href="/" class="logo-link">
<img class="logo" src="/static/codecircles.svg" alt="AnonymousOverflow home" />
<img class="logo" src="/static/codecircles.webp" alt="AnonymousOverflow home" />
</a>
</div>
<div class="card">
@ -92,4 +92,4 @@
{{ end }}
</body>
</html>
</html>