Put controller into demo mode (#185)

This commit is contained in:
Joshua Spence
2021-09-15 23:14:09 +10:00
committed by GitHub
parent f31c1055b0
commit a1849cacdc
3 changed files with 14 additions and 3 deletions

View File

@@ -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:

View File

@@ -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
View 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