GotHub→Gitlin、Codeberg→Gitler
このコミットが含まれているのは:
コミット
e1d8e94cb6
|
@ -0,0 +1,44 @@
|
|||
package gitlin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
_ "github.com/joho/godotenv/autoload"
|
||||
)
|
||||
|
||||
var envCmd = &cobra.Command{
|
||||
Use: "env",
|
||||
Short: "Get environment variable status",
|
||||
Long: `This command will show you the status of all environment variables that are used by Gitlin.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
env()
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(envCmd)
|
||||
}
|
||||
|
||||
func env() {
|
||||
// Proxying
|
||||
fmt.Println("Proxying: " + os.Getenv("GITLIN_PROXYING_ENABLED"))
|
||||
// IP logging
|
||||
fmt.Println("IP logging: " + os.Getenv("GITLIN_IP_LOGGED"))
|
||||
// URL request logging
|
||||
fmt.Println("URL request logging: " + os.Getenv("GITLIN_REQUEST_URL_LOGGED"))
|
||||
// User-Agent logging
|
||||
fmt.Println("User-Agent logging: " + os.Getenv("GITLIN_USER_AGENT_LOGGED"))
|
||||
// Diagnostic information logging
|
||||
fmt.Println("Diagnostic information logging: " + os.Getenv("GITLIN_DIAGNOSTIC_INFO_LOGGED"))
|
||||
// Privacy Policy URL
|
||||
fmt.Println("Privacy Policy URL: " + os.Getenv("GITLIN_INSTANCE_PRIVACY_POLICY"))
|
||||
// Instance country
|
||||
fmt.Println("Instance country: " + os.Getenv("GITLIN_INSTANCE_COUNTRY"))
|
||||
// ISP
|
||||
fmt.Println("ISP/Hosting provider: " + os.Getenv("GITLIN_INSTANCE_PROVIDER"))
|
||||
// Cloudflare status
|
||||
fmt.Println("Cloudflare status: " + os.Getenv("GITLIN_INSTANCE_CLOUDFLARE"))
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package gothub
|
||||
package gitlin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -8,9 +8,9 @@ import (
|
|||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "gothub",
|
||||
Use: "gitlin",
|
||||
Short: "An alternative front-end for GitHub.",
|
||||
Long: `An alternative front-end for GitHub, maintained by Odyssey346, Midou36O and Arya.`,
|
||||
Long: `An alternative front-end for GitHub.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cmd.Help()
|
||||
},
|
||||
|
@ -18,7 +18,7 @@ var rootCmd = &cobra.Command{
|
|||
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error running GotHub's CLI: %v", err)
|
||||
fmt.Fprintf(os.Stderr, "Error running Gitlin's CLI: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package gothub
|
||||
package gitlin
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"codeberg.org/gothub/gothub/serve"
|
||||
"gitler.moe/suwako/gitlin/serve"
|
||||
)
|
||||
|
||||
var port string = "3000"
|
||||
var port string = "9715"
|
||||
|
||||
var serveCmd = &cobra.Command{
|
||||
Use: "serve",
|
||||
|
@ -20,7 +20,7 @@ var serveCmd = &cobra.Command{
|
|||
func init() {
|
||||
rootCmd.AddCommand(serveCmd)
|
||||
|
||||
serveCmd.Flags().StringVarP(&port, "port", "p", "", "The port GotHub will listen to. Defaults to 3000, and overrides the GOTHUB_PORT environment variable.")
|
||||
serveCmd.Flags().StringVarP(&port, "port", "p", "", "The port Gitlin will listen to. Defaults to 9715, and overrides the GITLIN_PORT environment variable.")
|
||||
|
||||
// set port variable to the value of the port flag
|
||||
port = serveCmd.Flag("port").Value.String()
|
|
@ -1,4 +1,4 @@
|
|||
package gothub
|
||||
package gitlin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -9,8 +9,8 @@ import (
|
|||
|
||||
var setupCmd = &cobra.Command{
|
||||
Use: "setup",
|
||||
Short: "Interactive GotHub instance setup wizard",
|
||||
Long: `This command allows you to setup your GotHub instance in an interactive way. It will ask you a few questions and then set environment variables for you.`,
|
||||
Short: "Interactive Gitlin instance setup wizard",
|
||||
Long: `This command allows you to setup your Gitlin instance in an interactive way. It will ask you a few questions and then set environment variables for you.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
setup()
|
||||
},
|
||||
|
@ -33,12 +33,12 @@ type Vars struct {
|
|||
}
|
||||
|
||||
func setup() {
|
||||
fmt.Println("GotHub setup wizard")
|
||||
fmt.Println("This wizard will help you setup your GotHub instance.")
|
||||
fmt.Println("Gitlin setup wizard")
|
||||
fmt.Println("This wizard will help you setup your Gitlin instance.")
|
||||
|
||||
// Docker check
|
||||
if os.Getenv("DOCKER") == "true" {
|
||||
fmt.Println("You are running GotHub in Docker. This wizard will not work in Docker. Please set the environment variables manually.")
|
||||
fmt.Println("You are running Gitlin in Docker. This wizard will not work in Docker. Please set the environment variables manually.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
@ -151,19 +151,19 @@ func setup() {
|
|||
defer f.Close()
|
||||
|
||||
// write to file. make it look nice
|
||||
f.WriteString("# GotHub environment variables\n")
|
||||
f.WriteString("# Gitlin environment variables\n")
|
||||
f.WriteString("# This file was generated by the setup wizard. You can edit it manually if you want.\n")
|
||||
f.WriteString("GOTHUB_SETUP_COMPLETE=true\n")
|
||||
f.WriteString("GOTHUB_IP_LOGGED=" + fmt.Sprint(vars.IPLogging) + "\n")
|
||||
f.WriteString("GOTHUB_REQUEST_URL_LOGGED=" + fmt.Sprint(vars.URLLogging) + "\n")
|
||||
f.WriteString("GOTHUB_USER_AGENT_LOGGED=" + fmt.Sprint(vars.UserAgentLogging) + "\n")
|
||||
f.WriteString("GOTHUB_DIAGNOSTIC_INFO_LOGGED=" + fmt.Sprint(vars.DiagnosticLogging) + "\n")
|
||||
f.WriteString("GOTHUB_INSTANCE_PRIVACY_POLICY=" + vars.PrivacyPolicy + "\n")
|
||||
f.WriteString("GOTHUB_INSTANCE_COUNTRY=" + vars.InstanceCountry + "\n")
|
||||
f.WriteString("GOTHUB_INSTANCE_PROVIDER=" + vars.InstanceProvider + "\n")
|
||||
f.WriteString("GOTHUB_INSTANCE_CLOUDFLARE=" + vars.CloudflareStatus)
|
||||
f.WriteString("GOTHUB_PROXYING_ENABLED=" + vars.Proxying)
|
||||
f.WriteString("GITLIN_SETUP_COMPLETE=true\n")
|
||||
f.WriteString("GITLIN_IP_LOGGED=" + fmt.Sprint(vars.IPLogging) + "\n")
|
||||
f.WriteString("GITLIN_REQUEST_URL_LOGGED=" + fmt.Sprint(vars.URLLogging) + "\n")
|
||||
f.WriteString("GITLIN_USER_AGENT_LOGGED=" + fmt.Sprint(vars.UserAgentLogging) + "\n")
|
||||
f.WriteString("GITLIN_DIAGNOSTIC_INFO_LOGGED=" + fmt.Sprint(vars.DiagnosticLogging) + "\n")
|
||||
f.WriteString("GITLIN_INSTANCE_PRIVACY_POLICY=" + vars.PrivacyPolicy + "\n")
|
||||
f.WriteString("GITLIN_INSTANCE_COUNTRY=" + vars.InstanceCountry + "\n")
|
||||
f.WriteString("GITLIN_INSTANCE_PROVIDER=" + vars.InstanceProvider + "\n")
|
||||
f.WriteString("GITLIN_INSTANCE_CLOUDFLARE=" + vars.CloudflareStatus + "\n")
|
||||
f.WriteString("GITLIN_PROXYING_ENABLED=" + vars.Proxying)
|
||||
|
||||
println("All done! You can now start your GotHub instance with 'gothub serve'.")
|
||||
println("You can review the environment variables with 'gothub env'.")
|
||||
println("All done! You can now start your Gitlin instance with 'gitlin serve'.")
|
||||
println("You can review the environment variables with 'gitlin env'.")
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package gothub
|
||||
package gitlin
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -14,8 +14,8 @@ import (
|
|||
|
||||
var updateCmd = &cobra.Command{
|
||||
Use: "update",
|
||||
Short: "Update GotHub.",
|
||||
Long: `This command checks for updates and re-builds GotHub. Does not work on Docker`,
|
||||
Short: "Update Gitlin.",
|
||||
Long: `This command checks for updates and re-builds Gitlin. Does not work on Docker`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
update()
|
||||
},
|
||||
|
@ -27,18 +27,18 @@ func init() {
|
|||
|
||||
func update() {
|
||||
if os.Getenv("DOCKER") == "true" {
|
||||
fmt.Println("The GotHub update command does not work on Docker. Please re-create the container with a new image instead.")
|
||||
fmt.Println("The Gitlin update command does not work on Docker. Please re-create the container with a new image instead.")
|
||||
os.Exit(1)
|
||||
}
|
||||
gitPull := exec.Command("git", "pull")
|
||||
curBranch := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD")
|
||||
curBranchOut, _ := curBranch.CombinedOutput()
|
||||
ldFlags := "-X codeberg.org/gothub/gothub/utils.Branch=" + strings.Replace(string(curBranchOut), "\n", "", -1)
|
||||
ldFlags := "-X gitler.moe/suwako/gitlin/utils.Branch=" + strings.Replace(string(curBranchOut), "\n", "", -1)
|
||||
var out bytes.Buffer
|
||||
gitPull.Stdout = &out
|
||||
err := gitPull.Run()
|
||||
if out.String() == "Already up to date.\r" {
|
||||
fmt.Println("GotHub is already up to date.")
|
||||
fmt.Println("Gitlin is already up to date.")
|
||||
os.Exit(0)
|
||||
}
|
||||
if err != nil {
|
||||
|
@ -46,21 +46,21 @@ func update() {
|
|||
os.Exit(1)
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
err := exec.Command("go", "build", "-o", "gothub.exe", ldFlags).Run()
|
||||
err := exec.Command("go", "build", "-o", "gitlin.exe", ldFlags).Run()
|
||||
if err != nil {
|
||||
fmt.Println("Couldn't build GotHub.", err)
|
||||
fmt.Println("Couldn't build Gitlin.", err)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
fmt.Println("GotHub updated successfully.")
|
||||
fmt.Println("Gitlin updated successfully.")
|
||||
os.Exit(0)
|
||||
}
|
||||
} else {
|
||||
err := exec.Command("go", "build", "-ldflags", ldFlags).Run()
|
||||
if err != nil {
|
||||
fmt.Println("Couldn't build GotHub.", err)
|
||||
fmt.Println("Couldn't build Gitlin.", err)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
fmt.Println("GotHub updated successfully.")
|
||||
fmt.Println("Gitlin updated successfully.")
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package gothub
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
_ "github.com/joho/godotenv/autoload"
|
||||
)
|
||||
|
||||
var envCmd = &cobra.Command{
|
||||
Use: "env",
|
||||
Short: "Get environment variable status",
|
||||
Long: `This command will show you the status of all environment variables that are used by GotHub.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
env()
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(envCmd)
|
||||
}
|
||||
|
||||
func env() {
|
||||
// Docker check
|
||||
if os.Getenv("DOCKER") == "true" {
|
||||
fmt.Println("Docker: true")
|
||||
} else {
|
||||
fmt.Println("Docker: false")
|
||||
}
|
||||
// Proxying
|
||||
fmt.Println("Proxying: " + os.Getenv("GOTHUB_PROXYING_ENABLED"))
|
||||
// IP logging
|
||||
fmt.Println("IP logging: " + os.Getenv("GOTHUB_IP_LOGGED"))
|
||||
// URL request logging
|
||||
fmt.Println("URL request logging: " + os.Getenv("GOTHUB_REQUEST_URL_LOGGED"))
|
||||
// User-Agent logging
|
||||
fmt.Println("User-Agent logging: " + os.Getenv("GOTHUB_USER_AGENT_LOGGED"))
|
||||
// Diagnostic information logging
|
||||
fmt.Println("Diagnostic information logging: " + os.Getenv("GOTHUB_DIAGNOSTIC_INFO_LOGGED"))
|
||||
// Privacy Policy URL
|
||||
fmt.Println("Privacy Policy URL: " + os.Getenv("GOTHUB_INSTANCE_PRIVACY_POLICY"))
|
||||
// Instance country
|
||||
fmt.Println("Instance country: " + os.Getenv("GOTHUB_INSTANCE_COUNTRY"))
|
||||
// ISP
|
||||
fmt.Println("ISP/Hosting provider: " + os.Getenv("GOTHUB_INSTANCE_PROVIDER"))
|
||||
// Cloudflare status
|
||||
fmt.Println("Cloudflare status: " + os.Getenv("GOTHUB_INSTANCE_CLOUDFLARE"))
|
||||
}
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
|||
module codeberg.org/gothub/gothub
|
||||
module gitler.moe/suwako/gitlin
|
||||
|
||||
go 1.20
|
||||
|
||||
|
|
4
main.go
4
main.go
|
@ -1,8 +1,8 @@
|
|||
package main
|
||||
|
||||
import "codeberg.org/gothub/gothub/cmd/gothub"
|
||||
import "gitler.moe/suwako/gitlin/cmd/gitlin"
|
||||
|
||||
func main() {
|
||||
gothub.Execute()
|
||||
gitlin.Execute()
|
||||
// Looking for the Fiber server? It's in serve/serve.go.
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package pages
|
||||
|
||||
import (
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"os"
|
||||
"runtime"
|
||||
|
@ -25,15 +25,15 @@ type PrivacyInfo struct {
|
|||
func HandleAbout(c *fiber.Ctx) error {
|
||||
var privacyInfoArray []PrivacyInfo
|
||||
privacyInfoArray = append(privacyInfoArray, PrivacyInfo{
|
||||
ProxyEnabled: os.Getenv("GOTHUB_PROXYING_ENABLED"),
|
||||
IPAddr: os.Getenv("GOTHUB_IP_LOGGED"),
|
||||
ReqURL: os.Getenv("GOTHUB_REQUEST_URL_LOGGED"),
|
||||
UserAgent: os.Getenv("GOTHUB_USER_AGENT_LOGGED"),
|
||||
Diagnostics: os.Getenv("GOTHUB_DIAGNOSTIC_INFO_LOGGED"),
|
||||
Country: os.Getenv("GOTHUB_INSTANCE_COUNTRY"),
|
||||
Provider: os.Getenv("GOTHUB_INSTANCE_PROVIDER"),
|
||||
Cloudflare: os.Getenv("GOTHUB_INSTANCE_CLOUDFLARE"),
|
||||
PrivacyPolicy: os.Getenv("GOTHUB_INSTANCE_PRIVACY_POLICY"),
|
||||
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"),
|
||||
Version: utils.Version(),
|
||||
FiberVersion: fiber.Version,
|
||||
GoVersion: runtime.Version(),
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
"github.com/gocolly/colly"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
@ -50,7 +50,7 @@ func DirView(c *fiber.Ctx) error {
|
|||
Scrape.DirName = c.Params("+")
|
||||
Scrape.Branch = c.Params("branch")
|
||||
|
||||
UserAgent, ok := os.LookupEnv("GOTHUB_USER_AGENT")
|
||||
UserAgent, ok := os.LookupEnv("GITLIN_USER_AGENT")
|
||||
if !ok {
|
||||
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package pages
|
|||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
)
|
||||
|
||||
type Items struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package pages
|
|||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
htmlfmt "github.com/alecthomas/chroma/v2/formatters/html"
|
||||
|
|
|
@ -3,7 +3,7 @@ package pages
|
|||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"codeberg.org/gitlin/gitlin/utils"
|
||||
"context"
|
||||
htmlfmt "github.com/alecthomas/chroma/v2/formatters/html"
|
||||
"github.com/alecthomas/chroma/v2/lexers"
|
||||
|
@ -54,7 +54,7 @@ func HandleGist(c *fiber.Ctx) error {
|
|||
// Scraping
|
||||
Scrape := Gist{}
|
||||
|
||||
UserAgent, ok := os.LookupEnv("GOTHUB_USER_AGENT")
|
||||
UserAgent, ok := os.LookupEnv("GITLIN_USER_AGENT")
|
||||
if !ok {
|
||||
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"os"
|
||||
"runtime"
|
||||
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
|
@ -15,6 +15,6 @@ func HandleIndex(c *fiber.Ctx) error {
|
|||
"version": utils.Version(),
|
||||
"fiberversion": fiber.Version,
|
||||
"goversion": runtime.Version(),
|
||||
"setupstatus": os.Getenv("GOTHUB_SETUP_COMPLETE"),
|
||||
"setupstatus": os.Getenv("GITLIN_SETUP_COMPLETE"),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
"github.com/gocolly/colly"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
@ -60,7 +60,7 @@ func HandleRepo(c *fiber.Ctx) error {
|
|||
// Scraping
|
||||
Scrape := Repo{}
|
||||
|
||||
UserAgent, ok := os.LookupEnv("GOTHUB_USER_AGENT")
|
||||
UserAgent, ok := os.LookupEnv("GITLIN_USER_AGENT")
|
||||
if !ok {
|
||||
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
"github.com/enescakir/emoji"
|
||||
"github.com/gocolly/colly"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
@ -53,7 +53,7 @@ func HandleUser(c *fiber.Ctx) error {
|
|||
// Scraping
|
||||
Scrape := User{}
|
||||
|
||||
UserAgent, ok := os.LookupEnv("GOTHUB_USER_AGENT")
|
||||
UserAgent, ok := os.LookupEnv("GITLIN_USER_AGENT")
|
||||
if !ok {
|
||||
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
|
||||
}
|
||||
|
|
バイナリファイルは表示されません。
変更後 幅: | 高さ: | サイズ: 816 KiB |
|
@ -1,150 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="512"
|
||||
height="512"
|
||||
viewBox="0 0 512 512"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
|
||||
sodipodi:docname="Gothub.svg"
|
||||
inkscape:export-filename="Gothub.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#505050"
|
||||
bordercolor="#eeeeee"
|
||||
borderopacity="1"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050"
|
||||
inkscape:document-units="px"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.60628882"
|
||||
inkscape:cx="204.52299"
|
||||
inkscape:cy="382.65591"
|
||||
inkscape:window-width="1916"
|
||||
inkscape:window-height="1052"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1"
|
||||
showguides="false">
|
||||
<sodipodi:guide
|
||||
position="141.16404,382.07517"
|
||||
orientation="0,-1"
|
||||
id="guide1429"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="135.2539,98.226561"
|
||||
orientation="1,0"
|
||||
id="guide1431"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="125.36911,129.87502"
|
||||
orientation="0,-1"
|
||||
id="guide1433"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
position="-107.88155,247.25285"
|
||||
orientation="0,-1"
|
||||
id="guide1504"
|
||||
inkscape:locked="false" />
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid1525" />
|
||||
</sodipodi:namedview>
|
||||
<defs
|
||||
id="defs2" />
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;stroke:#00b7c3;stroke-width:22.4136;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 123.99325,141.11509 15.329564,264.35212 123.99399,370.88491"
|
||||
id="path1053"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;stroke:#00b7c3;stroke-width:22.4136;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 387.90046,141.11509 496.56415,264.35212 387.89972,370.88491"
|
||||
id="path1053-3"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<g
|
||||
id="g1305"
|
||||
transform="matrix(1.1468686,0,0,0.98629683,-12.004035,4.5194566)">
|
||||
<g
|
||||
id="g1319"
|
||||
transform="translate(-2.1562723e-7,-23.280551)">
|
||||
<g
|
||||
id="g1309"
|
||||
transform="matrix(0.87193947,0,0,1.0138936,14.476872,-4.5822479)">
|
||||
<path
|
||||
style="fill:#00b7c3;fill-opacity:1;fill-rule:evenodd;stroke:#00b7c3;stroke-width:11.9;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path1178"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="177.40547"
|
||||
sodipodi:cy="224.18903"
|
||||
sodipodi:rx="26.364464"
|
||||
sodipodi:ry="25.116173"
|
||||
sodipodi:start="4.3181725"
|
||||
sodipodi:end="4.3135488"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 167.27928,200.99932 a 26.364464,25.116173 0 0 1 34.45672,13.51616 26.364464,25.116173 0 0 1 -14.14809,32.84089 26.364464,25.116173 0 0 1 -34.48943,-13.44024 26.364464,25.116173 0 0 1 14.06836,-32.87196"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:#00b7c3;fill-opacity:1;fill-rule:evenodd;stroke:#00b7c3;stroke-width:11.9;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path1178-6"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="325.32684"
|
||||
sodipodi:cy="224.18903"
|
||||
sodipodi:rx="26.364464"
|
||||
sodipodi:ry="25.116173"
|
||||
sodipodi:start="4.3181725"
|
||||
sodipodi:end="4.3135488"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 315.20065,200.99932 a 26.364464,25.116173 0 0 1 34.45672,13.51616 26.364464,25.116173 0 0 1 -14.14809,32.84089 26.364464,25.116173 0 0 1 -34.48943,-13.44024 26.364464,25.116173 0 0 1 14.06836,-32.87196"
|
||||
sodipodi:open="true" />
|
||||
</g>
|
||||
<g
|
||||
id="g1323"
|
||||
style="stroke-width:15.8562;stroke-dasharray:none">
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b7c3;stroke-width:15.8562;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path1279"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="197.87245"
|
||||
sodipodi:cy="307.86673"
|
||||
sodipodi:rx="35.728931"
|
||||
sodipodi:ry="49.459"
|
||||
sodipodi:start="6.1693083"
|
||||
sodipodi:end="2.8402113"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 233.36997,302.24665 a 35.728931,49.459 0 0 1 -28.13234,54.01682 35.728931,49.459 0 0 1 -41.48371,-33.71535"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#00b7c3;stroke-width:15.8562;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path1279-7"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="-269.4339"
|
||||
sodipodi:cy="307.93939"
|
||||
sodipodi:rx="35.728931"
|
||||
sodipodi:ry="49.459"
|
||||
sodipodi:start="6.1693083"
|
||||
sodipodi:end="2.8402113"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m -233.93638,302.31931 a 35.728931,49.459 0 0 1 -28.13234,54.01682 35.728931,49.459 0 0 1 -41.48371,-33.71535"
|
||||
sodipodi:open="true"
|
||||
transform="scale(-1,1)" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
変更前 幅: | 高さ: | サイズ: 5.9 KiB |
|
@ -1,10 +1,8 @@
|
|||
/* god bless you */
|
||||
|
||||
:root {
|
||||
--text: #fff;
|
||||
--background: #252525;
|
||||
--secondary-background: #353535;
|
||||
--background-darker: #151515;
|
||||
--text: #fcfcfc;
|
||||
--background: #4b1a4f;
|
||||
--secondary-background: #31363b;
|
||||
--background-darker: #2f1b2e;
|
||||
--accent: #00b7c3;
|
||||
--yellow: #8B8000;
|
||||
color-scheme: dark;
|
||||
|
@ -266,28 +264,6 @@ a:hover {
|
|||
background-color: var(--secondary-background);
|
||||
}
|
||||
|
||||
@media screen and (prefers-color-scheme: light) {
|
||||
:root {
|
||||
--text: #000;
|
||||
--background: #ececec;
|
||||
--secondary-background: #f5f5f5;
|
||||
--background-darker: #dddddd;
|
||||
--accent: #005ec3;
|
||||
--yellow: #f5f5a5;
|
||||
color-scheme: light;
|
||||
}
|
||||
a {
|
||||
color: black;
|
||||
}
|
||||
a:hover {
|
||||
color: #005ec3;
|
||||
}
|
||||
.explore-card {
|
||||
background-color: var(--background);
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
main {
|
||||
margin: 8px;
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"codeberg.org/gothub/gothub/pages"
|
||||
"codeberg.org/gothub/gothub/utils"
|
||||
"gitler.moe/suwako/gitlin/pages"
|
||||
"gitler.moe/suwako/gitlin/utils"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cache"
|
||||
|
@ -36,7 +36,7 @@ func Serve(port string) {
|
|||
app := fiber.New(fiber.Config{
|
||||
Views: engine,
|
||||
Prefork: false,
|
||||
AppName: "GotHub",
|
||||
AppName: "Gitlin",
|
||||
// kind of screwed up way to fix rate limits
|
||||
EnableTrustedProxyCheck: true,
|
||||
TrustedProxies: []string{"0.0.0.0/0"},
|
||||
|
@ -92,7 +92,7 @@ func Serve(port string) {
|
|||
MaxAge: 31536000,
|
||||
}
|
||||
|
||||
proxying, ok := os.LookupEnv("GOTHUB_PROXYING_ENABLED")
|
||||
proxying, ok := os.LookupEnv("GITLIN_PROXYING_ENABLED")
|
||||
if !ok {
|
||||
proxying = "true"
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ func Serve(port string) {
|
|||
app.Static("/css", "./public/css", 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.Static("/logo.png", "./public/assets/logo.png", staticConfig)
|
||||
app.Get("/about", pages.HandleAbout)
|
||||
app.Get("/explore", ratelimiter, pages.HandleExplore)
|
||||
app.Get("/:user", pages.HandleUser)
|
||||
|
@ -201,7 +201,7 @@ func Serve(port string) {
|
|||
})
|
||||
})
|
||||
|
||||
val, ok := os.LookupEnv("GOTHUB_PORT")
|
||||
val, ok := os.LookupEnv("GITLIN_PORT")
|
||||
if !ok {
|
||||
val = "3000"
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ func GetRequest(url string) gjson.Result {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
UserAgent, ok := os.LookupEnv("GOTHUB_USER_AGENT")
|
||||
UserAgent, ok := os.LookupEnv("GITLIN_USER_AGENT")
|
||||
if !ok {
|
||||
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{template "header" .}}
|
||||
|
||||
<main>
|
||||
<h2>About this GotHub instance</h2>
|
||||
<h2>About this Gitlin instance</h2>
|
||||
{{ if .privacyInformation}} {{ range $key, $value := .privacyInformation}}
|
||||
<h3>Instance Privacy</h3>
|
||||
<p>
|
||||
|
@ -24,8 +24,8 @@
|
|||
{{end}}
|
||||
<h3>Additional Information</h3>
|
||||
<p>
|
||||
GotHub version:
|
||||
<a href="https://codeberg.org/gothub/gothub/commit/{{.Version}}"
|
||||
Gitlin version:
|
||||
<a href="https://codeberg.org/gitlin/gitlin/commit/{{.Version}}"
|
||||
><code>{{.Version}}</code></a
|
||||
>
|
||||
</p>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<pre class="error">{{.error}}</pre>
|
||||
<h3>
|
||||
Think this is a bug?
|
||||
<a href="https://codeberg.org/gothub/gothub/issues" target="_blank"
|
||||
<a href="https://gitler.moe/suwako/gitlin/issues" target="_blank"
|
||||
>Create an issue on Codeberg.</a
|
||||
>
|
||||
{{ if .link }} Or view this page on
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
{{ if .title }}
|
||||
<title>{{ .title }} - GotHub</title>
|
||||
<title>{{ .title }} - Gitlin</title>
|
||||
{{ else }}
|
||||
<title>GotHub</title>
|
||||
<title>Gitlin</title>
|
||||
{{ end }}
|
||||
<link rel="stylesheet" href="/css/global.css">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
@ -15,17 +15,17 @@
|
|||
<div class="navbar">
|
||||
<a href="/" style="text-decoration: none" class="brand"
|
||||
><img
|
||||
src="/logo.svg"
|
||||
src="/logo.png"
|
||||
class="navbarImg"
|
||||
height="30"
|
||||
width="30"
|
||||
alt=""
|
||||
><b class="navbar-slogan">GotHub ({{.branch}})</b></a
|
||||
><b class="navbar-slogan">Gitlin ({{.branch}})</b></a
|
||||
>
|
||||
<div class="navbar-links">
|
||||
<a href="/explore">Explore</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="https://codeberg.org/gothub/gothub">Source code</a>
|
||||
<a href="https://gitler.moe/suwako/gitlin">Source code</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
{{template "header" .}}
|
||||
|
||||
<main>
|
||||
<h2>GotHub is an alternative front-end for GitHub.</h2>
|
||||
<div style="width: 100%; margin: auto;">
|
||||
<img src="/logo.png" alt="Gitlin" />
|
||||
<h2>Gitlin</h2>
|
||||
</div>
|
||||
{{ if not .setupstatus }}
|
||||
<div class="setup-notice">
|
||||
<b>GotHub is not set up!</b> Please look at
|
||||
<a href="https://codeberg.org/gothub/gothub/issues/92">this issue</a> to see
|
||||
how to set up GotHub, or set the GOTHUB_SETUP_COMPLETE environment variable
|
||||
<b>Gitlin is not set up!</b> Please look at
|
||||
<a href="https://gitler.moe/suwako/gitlin/issues/92">this issue</a> to see
|
||||
how to set up Gitlin, or set the GITLIN_SETUP_COMPLETE environment variable
|
||||
to true to suppress this message. If you are a user of this instance, please
|
||||
contact the instance maintainer.
|
||||
</div>
|
||||
|
@ -33,7 +36,7 @@
|
|||
>If you care, you can read GitHub's privacy policy here</a
|
||||
>
|
||||
<a href="https://tosdr.org/en/service/297" target="_blank">(TOS;DR)</a>.
|
||||
GotHub solves this by proxying all GitHub requests for you!
|
||||
Gitlin solves this by proxying all GitHub requests for you!
|
||||
</p>
|
||||
<h3>Usage</h3>
|
||||
<p>
|
||||
|
@ -47,7 +50,7 @@
|
|||
All content shown on this site are from GitHub. Any issues with content
|
||||
shown on this site needs to be reported to GitHub, not the instance host's
|
||||
internet or domain provider. GitHub is a registered trademark of GitHub,
|
||||
Inc. GotHub is not affiliated with GitHub, Inc.
|
||||
Inc. Gitlin is not affiliated with GitHub, Inc.
|
||||
</p>
|
||||
<p>
|
||||
This project was made as a "spiritual successor" to
|
||||
|
@ -62,16 +65,16 @@
|
|||
>
|
||||
<h3>Credits</h3>
|
||||
<p style="margin: 0; padding: 0">
|
||||
<a href="https://midou.dev">Midou36O</a> - desigining the GotHub logo
|
||||
<a href="https://midou.dev">Midou36O</a> - desigining the Gitlin logo
|
||||
</p>
|
||||
<p style="margin: 0; padding: 0">
|
||||
<a href="https://arya.projectsegfau.lt">Arya</a> - code contributions and
|
||||
maintainer
|
||||
</p>
|
||||
<h3>Info</h3>
|
||||
{{ if eq .version "unknown, please build with Go 1.13+ or use Git"}} GotHub
|
||||
version: <code>unknown</code> {{ else }} GotHub version:
|
||||
<a href="https://codeberg.org/gothub/gothub/commit/{{ .version}}"
|
||||
{{ if eq .version "unknown, please build with Go 1.13+ or use Git"}} Gitlin
|
||||
version: <code>unknown</code> {{ else }} Gitlin version:
|
||||
<a href="https://gitler.moe/suwako/gitlin/commit/{{ .version}}"
|
||||
><code>{{ .version}}</code></a
|
||||
>
|
||||
{{ end }}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<h2>Info</h2>
|
||||
<p>
|
||||
GotHub has implemented ratelimits in order to prevent rate-limits by GitHub.
|
||||
Gitlin has implemented ratelimits in order to prevent rate-limits by GitHub.
|
||||
You've been hit by the rate limiter.
|
||||
</p>
|
||||
</main>
|
||||
|
|
読み込み中…
新しいイシューから参照