mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
PR #15: https for local run
This commit is contained in:
parent
9860ed0871
commit
923320da5f
@ -7,6 +7,7 @@
|
||||
/testenv/run/
|
||||
/testenv/.tox/
|
||||
/testenv/.mypy_cache/
|
||||
/testenv/.ssl/
|
||||
/.git/
|
||||
/v*.tar.gz
|
||||
/*.pkg.tar.xz
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,6 +10,7 @@
|
||||
/testenv/.coverage
|
||||
/testenv/run/*.sock
|
||||
/testenv/run/*.pid
|
||||
/testenv/.ssl/
|
||||
/v*.tar.gz
|
||||
/*.pkg.tar.xz
|
||||
/*.pkg.tar.zst
|
||||
|
||||
19
Makefile
19
Makefile
@ -78,7 +78,18 @@ $(TESTENV_GPIO):
|
||||
test -c $(TESTENV_GPIO)
|
||||
|
||||
|
||||
run: testenv $(TESTENV_GPIO)
|
||||
run: testenv testenv-ssl $(TESTENV_GPIO)
|
||||
test -d testenv/.ssl || docker run --rm \
|
||||
--volume `pwd`:/src:ro \
|
||||
--volume `pwd`/testenv:/src/testenv:rw \
|
||||
-t $(TESTENV_IMAGE) bash -c " \
|
||||
groupadd kvmd-nginx \
|
||||
&& /src/scripts/kvmd-gencert --do-the-thing \
|
||||
&& chown -R root:root /etc/kvmd/nginx/ssl \
|
||||
&& chmod 664 /etc/kvmd/nginx/ssl/* \
|
||||
&& chmod 775 /etc/kvmd/nginx/ssl \
|
||||
&& mv /etc/kvmd/nginx/ssl /src/testenv/.ssl \
|
||||
"
|
||||
- docker run --rm --name kvmd \
|
||||
--cap-add SYS_ADMIN \
|
||||
--volume `pwd`/testenv/run:/run/kvmd:rw \
|
||||
@ -95,11 +106,15 @@ run: testenv $(TESTENV_GPIO)
|
||||
--env KVMD_PROCFS_PREFIX=/fake_procfs \
|
||||
$(if $(TESTENV_RELAY),--device $(TESTENV_RELAY):$(TESTENV_RELAY),) \
|
||||
--publish 8080:80/tcp \
|
||||
--publish 4430:443/tcp \
|
||||
-it $(TESTENV_IMAGE) /bin/bash -c " \
|
||||
mount -t debugfs none /sys/kernel/debug \
|
||||
&& test -d /sys/kernel/debug/gpio-mockup/`basename $(TESTENV_GPIO)`/ \
|
||||
&& (socat PTY,link=$(TESTENV_HID) PTY,link=/dev/ttyS11 &) \
|
||||
&& cp -r /usr/share/kvmd/configs.default/nginx/* /etc/kvmd/nginx \
|
||||
&& sed -i '$$ s/.$$//' /etc/kvmd/nginx/nginx.conf \
|
||||
&& cat testenv/nginx.append.conf >> /etc/kvmd/nginx/nginx.conf \
|
||||
&& cp -a /testenv/.ssl /etc/kvmd/nginx/ssl \
|
||||
&& cp /usr/share/kvmd/configs.default/kvmd/*.yaml /etc/kvmd \
|
||||
&& cp /usr/share/kvmd/configs.default/kvmd/*passwd /etc/kvmd \
|
||||
&& cp /usr/share/kvmd/configs.default/kvmd/main/$(if $(P),$(P),$(DEFAULT_PLATFORM)).yaml /etc/kvmd/main.yaml \
|
||||
@ -216,7 +231,7 @@ clean:
|
||||
clean-all: testenv clean
|
||||
- docker run --rm \
|
||||
--volume `pwd`:/src \
|
||||
-it $(TESTENV_IMAGE) bash -c "cd src && rm -rf testenv/{.tox,.mypy_cache,.coverage}"
|
||||
-it $(TESTENV_IMAGE) bash -c "cd src && rm -rf testenv/{.ssl,.tox,.mypy_cache,.coverage}"
|
||||
|
||||
|
||||
.PHONY: testenv
|
||||
|
||||
8
testenv/nginx.append.conf
Normal file
8
testenv/nginx.append.conf
Normal file
@ -0,0 +1,8 @@
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name localhost;
|
||||
include /etc/kvmd/nginx/ssl.conf;
|
||||
include /etc/kvmd/nginx/kvmd.ctx-server.conf;
|
||||
include /usr/share/kvmd/extras/*/nginx.ctx-server.conf;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user