Add RSS feeds (#194)

Closes #179

Reviewed-on: https://codeberg.org/rimgo/rimgo/pulls/194
Reviewed-by: orangix <orangix@noreply.codeberg.org>
Co-authored-by: video-prize-ranch <cb.8a3w5@simplelogin.co>
Co-committed-by: video-prize-ranch <cb.8a3w5@simplelogin.co>
This commit is contained in:
video-prize-ranch
2025-02-24 02:48:56 +00:00
committed by video-prize-ranch
parent 65e4a5f08e
commit 4e3022ce1a
11 changed files with 195 additions and 49 deletions

View File

@@ -9,6 +9,7 @@ type config struct {
Port string
Addr string
ImgurId string
Secure bool
FiberPrefork bool
ImageCache bool
CleanupInterval time.Duration
@@ -44,10 +45,11 @@ func LoadConfig() {
}
Config = config{
Port: port,
Addr: addr,
ImgurId: imgurId,
FiberPrefork: os.Getenv("FIBER_PREFORK") == "true",
Port: port,
Addr: addr,
ImgurId: imgurId,
Secure: os.Getenv("SECURE") == "true",
FiberPrefork: os.Getenv("FIBER_PREFORK") == "true",
Privacy: map[string]interface{}{
"set": os.Getenv("PRIVACY_NOT_COLLECTED") != "",
"policy": os.Getenv("PRIVACY_POLICY"),

11
utils/getUrl.go Normal file
View File

@@ -0,0 +1,11 @@
package utils
import "github.com/gofiber/fiber/v2"
func GetInstanceUrl(c *fiber.Ctx) string {
proto := "https://"
if !Config.Secure {
proto = "http://"
}
return proto + c.Hostname()
}