Add frontend stuff to makefile
This commit is contained in:
parent
8242cdcbfb
commit
e0afc7663c
11
Makefile
11
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)
|
||||
|
12
apiary.toml
12
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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user