148ee1594f
Signed-off-by: Odyssium <hi@odyssey346.dev>
49 行
1.3 KiB
Go
49 行
1.3 KiB
Go
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")
|
|
}
|
|
// 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"))
|
|
}
|