Put controller into demo mode (#185)
This commit is contained in:
7
Makefile
7
Makefile
@@ -3,8 +3,9 @@ export UNIFI_USERNAME ?= tfacctest
|
||||
export UNIFI_EMAIL ?= tfacctest@example.com
|
||||
export UNIFI_PASSWORD ?= tfacctest1234
|
||||
|
||||
TEST ?= ./...
|
||||
TESTARGS ?=
|
||||
TEST ?= ./...
|
||||
TESTARGS ?=
|
||||
TEST_COUNT ?= 1
|
||||
|
||||
.PHONY: default
|
||||
default: build
|
||||
@@ -15,7 +16,7 @@ build:
|
||||
|
||||
.PHONY: testacc
|
||||
testacc:
|
||||
TF_ACC=1 UNIFI_ACC_WLAN_CONCURRENCY=4 UNIFI_API=https://localhost:8443 UNIFI_INSECURE=true go test $(TEST) -v $(TESTARGS)
|
||||
TF_ACC=1 UNIFI_ACC_WLAN_CONCURRENCY=3 UNIFI_API=https://localhost:8443 UNIFI_INSECURE=true go test $(TEST) -v -count=$(TEST_COUNT) $(TESTARGS)
|
||||
|
||||
.PHONY: testacc-up
|
||||
testacc-up:
|
||||
|
||||
@@ -8,6 +8,8 @@ services:
|
||||
ports:
|
||||
- '${UNIFI_HTTP_PORT:-8080}:8080/tcp'
|
||||
- '${UNIFI_HTTPS_PORT:-8443}:8443/tcp'
|
||||
volumes:
|
||||
- './scripts/init.d:/usr/local/unifi/init.d:ro'
|
||||
|
||||
bootstrap:
|
||||
image: 'alpine/httpie'
|
||||
|
||||
8
scripts/init.d/demo-mode
Executable file
8
scripts/init.d/demo-mode
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
write_config() {
|
||||
echo "${1}=${2}" >> /usr/lib/unifi/data/system.properties
|
||||
}
|
||||
|
||||
write_config demo.skip_wizard false
|
||||
write_config is_simulation true
|
||||
Reference in New Issue
Block a user