Add frontend stuff to makefile

This commit is contained in:
Torjus Håkestad 2021-04-10 09:03:00 +02:00
parent 8242cdcbfb
commit e0afc7663c
2 changed files with 22 additions and 1 deletions

View File

@ -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_URL = https://github.com/geoacumen/geoacumen-country/raw/master/Geoacumen-Country.mmdb
GEODB_PATH = honeypot/Geoacumen-Country.mmdb GEODB_PATH = honeypot/Geoacumen-Country.mmdb
FRONTEND_BUILD_DIR = web/frontend/dist
ifeq ($(INSTALL_PREFIX), /) ifeq ($(INSTALL_PREFIX), /)
INSTALL_BIN_DIR=/usr/bin INSTALL_BIN_DIR=/usr/bin
INSTALL_ETC_DIR=/etc/$(NAME) INSTALL_ETC_DIR=/etc/$(NAME)
@ -34,12 +36,19 @@ $(BUILD_DIR):
$(BUILD_OUTPUT): $(BUILD_DIR) $(GEODB_PATH) $(BUILD_OUTPUT): $(BUILD_DIR) $(GEODB_PATH)
CGO_ENABLED=0 go build $(BUILD_FLAGS) cmd/apiary.go CGO_ENABLED=0 go build $(BUILD_FLAGS) cmd/apiary.go
$(FRONTEND_BUILD_DIR):
pushd web/frontend
yarn install
yarn build
popd
clean: clean:
rm -rv $(BUILD_DIR) rm -rv $(BUILD_DIR)
rm -rv $(FRONTEND_BUILD_DIR)
geodb: $(GEODB_PATH) geodb: $(GEODB_PATH)
build: $(BUILD_OUTPUT) build: $(BUILD_OUTPUT) $(FRONTEND_BUILD_DIR)
install: build install: build
mkdir -p $(INSTALL_BIN_DIR) mkdir -p $(INSTALL_BIN_DIR)

View File

@ -33,3 +33,15 @@ AccessLogEnable = true
# Address and port to listen to # Address and port to listen to
# Default: ":8080" # Default: ":8080"
ListenAddr = ":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"