diff --git a/Makefile b/Makefile index ad0ec32..025c792 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ BUILD_FLAGS = -tags embed -ldflags "-X github.uio.no/torjus/apiary.Build=$(GIT_C GEODB_URL = https://github.com/geoacumen/geoacumen-country/raw/master/Geoacumen-Country.mmdb GEODB_PATH = honeypot/Geoacumen-Country.mmdb +FRONTEND_BUILD_DIR = web/frontend/dist + ifeq ($(INSTALL_PREFIX), /) INSTALL_BIN_DIR=/usr/bin INSTALL_ETC_DIR=/etc/$(NAME) @@ -34,12 +36,19 @@ $(BUILD_DIR): $(BUILD_OUTPUT): $(BUILD_DIR) $(GEODB_PATH) CGO_ENABLED=0 go build $(BUILD_FLAGS) cmd/apiary.go +$(FRONTEND_BUILD_DIR): + pushd web/frontend + yarn install + yarn build + popd + clean: rm -rv $(BUILD_DIR) + rm -rv $(FRONTEND_BUILD_DIR) geodb: $(GEODB_PATH) -build: $(BUILD_OUTPUT) +build: $(BUILD_OUTPUT) $(FRONTEND_BUILD_DIR) install: build mkdir -p $(INSTALL_BIN_DIR) diff --git a/apiary.toml b/apiary.toml index 2933783..7102dc3 100644 --- a/apiary.toml +++ b/apiary.toml @@ -33,3 +33,15 @@ AccessLogEnable = true # Address and port to listen to # Default: ":8080" ListenAddr = ":8080" + +[Frontend.Autocert] +# Enable using letsencrypt for automatic certificates +# Default: false +Enable = false +# Domains to use for certificates. Required when using autocert. +# Default: "" +Domains = "example.org" +# Dir where certificates are cached. +# Default: "/tmp" +CacheDir = "/var/apiary/certs" +