Merge remote-tracking branch 'upstream/dev' into scraping

This commit is contained in:
Arya Kiran
2023-02-09 22:17:47 +05:30
6 changed files with 31 additions and 13 deletions
@@ -36,4 +36,4 @@ Anything else we should know? (e.g. if you are using a modified version of GotHu
## Contact Details
<!-- Here you can put your contact information should we need to contact you privately. We recommend Matrix. If you don't have a contact method, or don't want your contact method public, tell us. -->
<!-- Here you can put your contact information should we need to contact you privately. We recommend Matrix. If you don't have a contact method, or don't want your contact method public, tell us. -->
+4 -1
View File
@@ -24,4 +24,7 @@ go.work
tmp/
# Gothub binary.
gothub
gothub
# Fiber compressed files
*.fiber.gz
+2 -1
View File
@@ -28,7 +28,8 @@ These instances run the ``dev`` branch of GotHub. While this might mean they are
| Link | Cloudflare | Country | ISP |
| -------- | ---------- | ----------- | ----- |
| [gh.dev.odyssey346.dev (official)](https://gh.dev.odyssey346.dev) | No | 🇫🇷 | OVHcloud (Trolling Solutions) |
| [gothub.esmailelbob.xyz](https://gothub.esmailelbob.xyz) | No | 🇨🇦 | OVHcloud |
| [gothub.esmailelbob.xyz](https://gothub.esmailelbob.xyz) | No | 🇨🇦 | OVHcloud |
| [dev.gh.akisblack.dev](https://dev.gh.akisblack.dev) | No | 🇩🇪 | OVHcloud |
Have an instance you want on the list? Make an issue or PR!
-4
View File
@@ -42,10 +42,6 @@ main {
padding: 8px;
}
.navbarImg {
height: 30px;
}
.indexGitHub {
background: #252525;
color: #fff;
+23 -5
View File
@@ -74,12 +74,30 @@ func Serve() {
},
})
staticConfig := fiber.Static{
Compress: true,
// Cache-Control: max-age=31536000
MaxAge: 31536000,
}
// add global headers
app.Use(func(c *fiber.Ctx) error {
c.Set("X-Frame-Options", "SAMEORIGIN")
c.Set("X-XSS-Protection", "1; mode=block")
c.Set("X-Content-Type-Options", "nosniff")
c.Set("Referrer-Policy", "no-referrer")
c.Set("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data; font-src 'self'; script-src 'self'; frame-ancestors 'self'; form-action 'self'; base-uri 'self'; connect-src 'self';")
c.Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload")
return c.Next()
})
app.Get("/", pages.HandleIndex)
app.Static("/css", "./public/css")
app.Static("/fonts", "./public/fonts")
app.Static("/robots.txt", "./public/robots.txt")
app.Static("/favicon.ico", "./public/assets/favicon.ico")
app.Static("/logo.svg", "./public/assets/logo.svg")
app.Static("/css", "./public/css", staticConfig)
app.Static("/fonts", "./public/fonts", staticConfig)
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("/explore", ratelimiter, pages.HandleExplore)
app.Get("/:user", ratelimiter, pages.HandleUser)
app.Get("/avatar/:id", func(c *fiber.Ctx) error {
+1 -1
View File
@@ -13,7 +13,7 @@
<body>
<nav>
<div class="navbar">
<a href="/" style="text-decoration: none;" class="brand"><img src="/logo.svg" class="navbarImg" alt="GotHub" /><b class="navbarSlogan">GotHub (alpha)</b></a>
<a href="/" style="text-decoration: none;" class="brand"><img src="/logo.svg" class="navbarImg" height="30" width="30" alt="" /><b class="navbarSlogan">GotHub (alpha)</b></a>
<div class="navbarLinks">
<a href="/explore">Explore</a>
<a href="https://codeberg.org/gothub/gothub">Source code</a>