aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
blob: f5a82fe905ced1b358ba8600d4317a53c5ba372c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main

import (
	"flag"
	"log"

	"git.feuerfuchs.dev/Feuerfuchs/gopherproxy/gopherproxy"
)

var (
	// TODO: Allow config file and environment vars
	//       (opt -> env -> config -> default)
	bind            = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to")
	startpagefile   = flag.String("startpage-file", "startpage.txt", "Default page to display if no URL is specified")
	robotsfile      = flag.String("robots-file", "robots.txt", "robots.txt file")
	robotsdebug     = flag.Bool("robots-debug", false, "print output about ignored robots.txt")
	vipsconcurrency = flag.Int("vips-concurrency", 1, "Concurrency level of libvips")
)

func main() {
	flag.Parse()

	// Use a config struct
	log.Fatal(gopherproxy.ListenAndServe(*bind, *startpagefile, *robotsfile, *robotsdebug, *vipsconcurrency))
}