gitlin/pages/about.go

51 行
1.4 KiB
Go
Raw 通常表示 履歴

package pages
import (
2023-06-06 20:25:00 +09:00
"gitler.moe/suwako/gitlin/utils"
"github.com/gofiber/fiber/v2"
"os"
"runtime"
)
type PrivacyInfo struct {
2023-06-06 20:25:00 +09:00
ProxyEnabled string
IPAddr string
ReqURL string
UserAgent string
Diagnostics string
Country string
Provider string
Cloudflare string
PrivacyPolicy string
2023-06-07 11:03:32 +09:00
Ver string
Ves string
2023-06-06 20:25:00 +09:00
GoVersion string
FiberVersion string
}
2023-03-10 21:26:19 +09:00
func HandleAbout(c *fiber.Ctx) error {
2023-06-06 20:25:00 +09:00
var privacyInfoArray []PrivacyInfo
privacyInfoArray = append(privacyInfoArray, PrivacyInfo{
ProxyEnabled: os.Getenv("GITLIN_PROXYING_ENABLED"),
IPAddr: os.Getenv("GITLIN_IP_LOGGED"),
ReqURL: os.Getenv("GITLIN_REQUEST_URL_LOGGED"),
UserAgent: os.Getenv("GITLIN_USER_AGENT_LOGGED"),
Diagnostics: os.Getenv("GITLIN_DIAGNOSTIC_INFO_LOGGED"),
Country: os.Getenv("GITLIN_INSTANCE_COUNTRY"),
Provider: os.Getenv("GITLIN_INSTANCE_PROVIDER"),
Cloudflare: os.Getenv("GITLIN_INSTANCE_CLOUDFLARE"),
PrivacyPolicy: os.Getenv("GITLIN_INSTANCE_PRIVACY_POLICY"),
2023-06-07 11:03:32 +09:00
Ver: utils.Ver,
Ves: utils.Ves,
2023-06-06 20:25:00 +09:00
FiberVersion: fiber.Version,
GoVersion: runtime.Version(),
})
2023-06-06 20:25:00 +09:00
return c.Render("about", fiber.Map{
2023-06-07 11:03:32 +09:00
"title": "Gitlinインスタンスについて",
"ver": utils.Ver,
"ves": utils.Ves,
2023-06-06 20:25:00 +09:00
"privacyInformation": privacyInfoArray,
})
}