Bluesky app fork with some witchin' additions 馃挮
at post-text-option 67 lines 1.4 kB view raw
1package main 2 3import ( 4 "os" 5 6 _ "github.com/joho/godotenv/autoload" 7 8 logging "github.com/ipfs/go-log" 9 "github.com/urfave/cli/v2" 10) 11 12var log = logging.Logger("embedr") 13 14func init() { 15 logging.SetAllLoggers(logging.LevelDebug) 16 //logging.SetAllLoggers(logging.LevelWarn) 17} 18 19func main() { 20 run(os.Args) 21} 22 23func run(args []string) { 24 25 app := cli.App{ 26 Name: "embedr", 27 Usage: "web server for embed.bsky.app post embeds", 28 } 29 30 app.Commands = []*cli.Command{ 31 &cli.Command{ 32 Name: "serve", 33 Usage: "run the server", 34 Action: serve, 35 Flags: []cli.Flag{ 36 &cli.StringFlag{ 37 Name: "appview-host", 38 Usage: "method, hostname, and port of PDS instance", 39 Value: "https://public.api.bsky.app", 40 EnvVars: []string{"ATP_APPVIEW_HOST"}, 41 }, 42 &cli.StringFlag{ 43 Name: "http-address", 44 Usage: "Specify the local IP/port to bind to", 45 Required: false, 46 Value: ":8100", 47 EnvVars: []string{"HTTP_ADDRESS"}, 48 }, 49 &cli.StringFlag{ 50 Name: "metrics-address", 51 Usage: "Specify the local IP/port to bind the metrics server to", 52 Required: false, 53 Value: ":9090", 54 EnvVars: []string{"METRICS_HTTP_ADDRESS"}, 55 }, 56 &cli.BoolFlag{ 57 Name: "debug", 58 Usage: "Enable debug mode", 59 Value: false, 60 Required: false, 61 EnvVars: []string{"DEBUG"}, 62 }, 63 }, 64 }, 65 } 66 app.RunAndExitOnError() 67}