Compare commits

...

2 Commits

Author SHA1 Message Date
httpjamesm e3d60d4d3e feat: allow stackoverflow.com/q/ in posthome 2023-09-28 13:53:34 -04:00
httpjamesm dcf0805334 docs: use official image in exmaple 2023-09-24 01:13:49 -04:00
2 changed files with 10 additions and 12 deletions
+9 -11
View File
@@ -1,14 +1,12 @@
version: '3'
services:
anonymousoverflow:
container_name: 'app'
build:
context: .
network: 'host'
environment:
- APP_URL=https://domain.com
- JWT_SIGNING_SECRET=secret
ports:
- '80:8080'
restart: 'always'
anonymousoverflow:
container_name: 'app'
image: 'ghcr.io/httpjamesm/anonymousoverflow:release'
environment:
- APP_URL=https://domain.com
- JWT_SIGNING_SECRET=secret
ports:
- '80:8080'
restart: 'always'
+1 -1
View File
@@ -40,7 +40,7 @@ func PostHome(c *gin.Context) {
// validate URL
isStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/questions/")
isShortenedStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/a/")
isShortenedStackOverflow := strings.HasPrefix(soLink, "https://stackoverflow.com/a/") || strings.HasPrefix(soLink, "https://stackoverflow.com/q/")
isStackExchange := stackExchangeRegex.MatchString(soLink)
if !isStackExchange && !isStackOverflow && !isShortenedStackOverflow {
c.HTML(400, "home.html", gin.H{