diff options
author | u <u@billy> | 2023-05-29 19:58:50 -0400 |
---|---|---|
committer | u <u@billy> | 2023-05-29 19:59:28 -0400 |
commit | 79097b522fa33fd25e97d10149a27d9d22aa430a (patch) | |
tree | 08946688b6b2d04d3a943b835f879a754f0428f7 | |
parent | a9b687835682ab161404744cba960281a2974f7b (diff) |
fossil-test service will use generated key
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/fossil-test@.service | 12 |
2 files changed, 10 insertions, 4 deletions
@@ -44,7 +44,7 @@ unit_files = $(addprefix src/fossil-user,@.service .socket) src/fossil-test@.ser | |||
44 | units = $(filter-out %@.service,$(notdir $(unit_files))) | 44 | units = $(filter-out %@.service,$(notdir $(unit_files))) |
45 | executables = src/endofossil | 45 | executables = src/endofossil |
46 | bindir = /usr/local/bin | 46 | bindir = /usr/local/bin |
47 | dependencies = socat fossil ssh | 47 | dependencies = socat fossil ssh fakeroot |
48 | 48 | ||
49 | SSH_USERNAME != if [ "$$SUDO_USER" ]; then echo "$$SUDO_USER"; else id -u; fi | 49 | SSH_USERNAME != if [ "$$SUDO_USER" ]; then echo "$$SUDO_USER"; else id -u; fi |
50 | 50 | ||
diff --git a/src/fossil-test@.service b/src/fossil-test@.service index c1ad063..8498733 100644 --- a/src/fossil-test@.service +++ b/src/fossil-test@.service | |||
@@ -3,10 +3,16 @@ Description = Test Endofossil by attempting a clone | |||
3 | 3 | ||
4 | [Service] | 4 | [Service] |
5 | Type = oneshot | 5 | Type = oneshot |
6 | DynamicUser = yes | ||
7 | User = fossil-test-user-%i | ||
8 | PrivateUsers = yes | ||
6 | RuntimeDirectory = fossil-test-%i | 9 | RuntimeDirectory = fossil-test-%i |
7 | WorkingDirectory = /run/fossil-test-%i | 10 | WorkingDirectory = /run/fossil-test-%i |
11 | Environment = HOME=/run/fossil-test-%i | ||
12 | BindPaths = /run/fossil-test-%i:/root | ||
13 | |||
8 | ExecStart = sh -xc 'mkdir .ssh' | 14 | ExecStart = sh -xc 'mkdir .ssh' |
9 | ExecStart = sh -xc 'ssh-keygen -t ed25519 -f .ssh/id_ed25519 -N ""' | 15 | ExecStart = sh -xc 'fakeroot ssh-keygen -t ed25519 -f .ssh/id_ed25519 -N ""' |
10 | ExecStart = sh -xc 'HOME=. ssh %i@localhost fossil test-http src/fossil/db' | 16 | ExecStart = sh -xc 'fakeroot ssh -o UserKnownHostsFile=.ssh/known_hosts -o StrictHostKeyChecking=accept-new -i .ssh/id_ed25519 %i@localhost fossil test-http src/fossil/db' |
11 | ExecStart = sh -xc 'HOME=. fossil clone ssh://%i@localhost/src/fossil/db db~$(date -Ins).fossil' | 17 | ExecStart = sh -xc 'fakeroot fossil clone ssh://%i@localhost/src/fossil/db db~$(date -Ins).fossil' |
12 | 18 | ||