summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHansjürg Wenger <hansjuerg.wenger@bfh.ch>2021-01-12 23:30:44 +0100
committerHansjürg Wenger <hansjuerg.wenger@bfh.ch>2021-01-12 23:30:44 +0100
commit88184af05d9377ce726ef32f7cda8ad3e956beb2 (patch)
tree311251da54f72dd4e2c4bbb2f56ef0d4e4c272f3
parent42c8e91228e8d6488d9d0c1762ad913c797c68ca (diff)
downloadwoocommerce-taler-88184af05d9377ce726ef32f7cda8ad3e956beb2.tar.gz
woocommerce-taler-88184af05d9377ce726ef32f7cda8ad3e956beb2.tar.bz2
woocommerce-taler-88184af05d9377ce726ef32f7cda8ad3e956beb2.zip
modified client-build
-rw-r--r--client-build/00-README3
-rwxr-xr-xclient-build/03-run-system.sh73
-rwxr-xr-xclient-build/04-run-system-survey.sh53
-rw-r--r--client-build/profiles/wooclient.preseed2
-rw-r--r--client-build/ssh/chromium.cfg (renamed from client-build/chromium.cfg)1
-rw-r--r--client-build/ssh/firefox.cfg10
-rw-r--r--client-build/ssh/root.cfg (renamed from server-build/my-simple-cdd/ssh.cfg)1
-rw-r--r--client-build/ssh/testuser.cfg9
-rw-r--r--server-build/my-simple-cdd/00-README2
-rwxr-xr-xserver-build/my-simple-cdd/03-run-system.sh11
-rw-r--r--server-build/my-simple-cdd/profiles/wootaler.preseed4
-rw-r--r--server-build/my-simple-cdd/ssh/root.cfg (renamed from client-build/ssh.cfg)1
12 files changed, 152 insertions, 18 deletions
diff --git a/client-build/00-README b/client-build/00-README
index 45087f0..c83a0f5 100644
--- a/client-build/00-README
+++ b/client-build/00-README
@@ -5,6 +5,9 @@ web browser.
We use simple-cdd to non-interactively run the Debian installer,
and have a profile 'wooclient' with our specifications.
+Be aware:
+There are connectivity problems with "GNUnet" in a NAT/NAPT setup...
+
Dependencies:
=============
diff --git a/client-build/03-run-system.sh b/client-build/03-run-system.sh
index ba11bda..da9ab4d 100755
--- a/client-build/03-run-system.sh
+++ b/client-build/03-run-system.sh
@@ -1,18 +1,73 @@
-#!/bin/sh
-# Run QEMU with the talerwoo.img (create via setup-system.sh)
+#!/bin/bash
+# Run QEMU with the wooclient.img
TARGET=wooclient.img
+SSHDIR=./ssh
+SSHKEY=${SSHDIR}/wooclient.key
+#SSHKNH=${SSHDIR}/known_hosts
+SSHKNH=/dev/null
+SSHOPTS="-o StrictHostKeyChecking=off -o UserKnownHostsFile=${SSHKNH}"
echo "start the system.."
# Run qemu
qemu-system-x86_64 -m 4G -enable-kvm -net nic,model=rtl8139 \
-net user,hostfwd=tcp::2222-:22,hostfwd=tcp::7776-:7776 \
- -display none -hda $TARGET > /dev/null 2>&1 &
+ -display none -hda $TARGET 2>&- &
-echo ".. and wait some time until it is ready!"
-# wait for system to boot up
-sleep 15
+echo ".. and wait some time (20s) until it is ready!"
+# wait 20s for system to boot up
+sleep 20
-# now start chromium in the VM
-echo "now start 'chromium' in the VM"
-ssh -F ./chromium.cfg localhost
+# create an ssh keypair..
+if [ ! -f $SSHKEY ]
+then
+ ssh-keygen -q -f $SSHKEY -t ed25519 -N ""
+ # ..and add the public keys to the vm
+ #ssh-keygen -f "${SSHKNH}/known_hosts" -R "[localhost]:2222"
+ echo "install ssh public key on \"root\" account - passwd \"wooclient\""
+ ssh-copy-id -f -i $SSHKEY -p 2222 $SSHOPTS root@localhost
+ echo "install ssh public key on \"testuser\" account - passwd \"test\$us3r\""
+ ssh-copy-id -f -i $SSHKEY -p 2222 $SSHOPTS testuser@localhost
+fi
+
+# Choose what to do
+SELMENU='
+firefox: start "firefox" in VM
+chromium: start "chromium" in VM
+local: use a "firefox" or "chromium" on the host
+login: login into VM as "root"
+exit: exit script: will terminate VM
+'
+echo "$SELMENU"
+PS3='please enter your choice: '
+choices=("firefox" "chromium" "local" "login" "exit")
+select opt in "${choices[@]}"
+do
+ case "$opt" in
+ "firefox")
+ ssh -q $SSHOPTS -F ${SSHDIR}/firefox.cfg localhost 2>&-
+ echo
+ ;;
+ "chromium")
+ ssh -q $SSHOPTS -F ${SSHDIR}/chromium.cfg localhost 2>&-
+ echo
+ ;;
+ "login")
+ ssh $SSHOPTS -F ${SSHDIR}/root.cfg localhost 2>&-
+ echo
+ ;;
+ "local")
+ echo
+ echo "manually start \"firefox\" or \"chrome|chromium\" on the host:"
+ echo "extensions \"re:claimID\" and \"GNU Taler wallet\" have to be installed!"
+ echo
+ ;;
+ "exit")
+ echo "terminating VM and exit"
+ kill %1
+ break
+ ;;
+ esac
+ read -n 1 -s -r -p "press any key to continue: "
+ echo
+done
diff --git a/client-build/04-run-system-survey.sh b/client-build/04-run-system-survey.sh
new file mode 100755
index 0000000..2256a8f
--- /dev/null
+++ b/client-build/04-run-system-survey.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Run QEMU with the wooclient.img
+
+TARGET=wooclient.img
+#SSHDIR=./ssh
+#SSHKEY=${SSHDIR}/wooclient.key
+#SSHKNH=${SSHDIR}/known_hosts
+SSHKNH=/dev/null
+SSHOPTS="-o StrictHostKeyChecking=off -o UserKnownHostsFile=${SSHKNH}"
+
+echo "start the system.."
+# Run qemu
+qemu-system-x86_64 -m 4G -enable-kvm -net nic,model=rtl8139 \
+ -net user,hostfwd=tcp::2222-:22,hostfwd=tcp::7776-:7776 \
+ -display none -hda $TARGET 2>&- &
+
+echo ".. and wait some time (20s) until it is ready!"
+# wait 20s for system to boot up
+sleep 20
+
+# Choose what to do
+SELMENU='
+firefox: start "firefox" in VM
+local: use a "firefox" or "chromium" on the host
+exit: exit script: will terminate VM
+'
+echo "$SELMENU"
+PS3='please enter your choice: '
+choices=("firefox" "local" "exit")
+select opt in "${choices[@]}"
+do
+ case "$opt" in
+ "firefox")
+ echo
+ echo "log into VM as \"testuser\" - use password \"test\$us3r\"."
+ ssh -q $SSHOPTS -l testuser -p 2222 localhost firefox-esr 2>&-
+ echo
+ ;;
+ "local")
+ echo
+ echo "manually start \"firefox\" or \"chrome|chromium\" on the host:"
+ echo "extensions \"re:claimID\" and \"GNU Taler wallet\" have to be installed!"
+ echo
+ ;;
+ "exit")
+ echo "terminating VM and exit"
+ kill %1
+ break
+ ;;
+ esac
+ read -n 1 -s -r -p "press any key to continue: "
+ echo
+done
diff --git a/client-build/profiles/wooclient.preseed b/client-build/profiles/wooclient.preseed
index eabd5fa..392dd1f 100644
--- a/client-build/profiles/wooclient.preseed
+++ b/client-build/profiles/wooclient.preseed
@@ -339,7 +339,7 @@ tasksel tasksel/first multiselect
#tasksel tasksel/desktop multiselect task-xfce-desktop
# Individual additional packages to install
-d-i pkgsel/include string git openssh-server chromium
+d-i pkgsel/include string git openssh-server chromium firefox-esr
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
d-i pkgsel/upgrade select none
diff --git a/client-build/chromium.cfg b/client-build/ssh/chromium.cfg
index c8cd2ff..1deb88f 100644
--- a/client-build/chromium.cfg
+++ b/client-build/ssh/chromium.cfg
@@ -4,6 +4,7 @@ Host localhost
LogLevel ERROR
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
+ IdentityFile=ssh/wooclient.key
ForwardX11 yes
ForwardX11Trusted yes
RemoteCommand chromium
diff --git a/client-build/ssh/firefox.cfg b/client-build/ssh/firefox.cfg
new file mode 100644
index 0000000..a5a7b1a
--- /dev/null
+++ b/client-build/ssh/firefox.cfg
@@ -0,0 +1,10 @@
+Host localhost
+ User testuser
+ Port 2222
+ LogLevel ERROR
+ StrictHostKeyChecking no
+ UserKnownHostsFile=/dev/null
+ ForwardX11 yes
+ ForwardX11Trusted yes
+ IdentityFile=ssh/wooclient.key
+ RemoteCommand "firefox-esr"
diff --git a/server-build/my-simple-cdd/ssh.cfg b/client-build/ssh/root.cfg
index d269483..e397e29 100644
--- a/server-build/my-simple-cdd/ssh.cfg
+++ b/client-build/ssh/root.cfg
@@ -4,3 +4,4 @@ Host localhost
LogLevel ERROR
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
+ IdentityFile=ssh/wooclient.key
diff --git a/client-build/ssh/testuser.cfg b/client-build/ssh/testuser.cfg
new file mode 100644
index 0000000..a4a364b
--- /dev/null
+++ b/client-build/ssh/testuser.cfg
@@ -0,0 +1,9 @@
+Host localhost
+ User testuser
+ Port 2222
+ LogLevel ERROR
+ StrictHostKeyChecking no
+ UserKnownHostsFile=/dev/null
+ IdentityFile=ssh/wooclient.key
+ ForwardX11 yes
+ ForwardX11Trusted yes
diff --git a/server-build/my-simple-cdd/00-README b/server-build/my-simple-cdd/00-README
index a836a3a..bf57334 100644
--- a/server-build/my-simple-cdd/00-README
+++ b/server-build/my-simple-cdd/00-README
@@ -56,7 +56,7 @@ d. Go into the Wordpress configuration for the OIDC plugin (which is NOT under W
Finally, login (as "root") with password "wootaler":
-$ ssh -F ./ssh.cfg localhost
+$ ssh -F ssh/root.cfg localhost
and run
diff --git a/server-build/my-simple-cdd/03-run-system.sh b/server-build/my-simple-cdd/03-run-system.sh
index da4cf78..737c02f 100755
--- a/server-build/my-simple-cdd/03-run-system.sh
+++ b/server-build/my-simple-cdd/03-run-system.sh
@@ -1,18 +1,19 @@
-#!/bin/sh
+#!/bin/bash
# Run QEMU with the talerwoo.img (create via setup-system.sh)
TARGET=talerwoo.img
+SSHDIR=./ssh
echo "start the system.."
# Run qemu
qemu-system-x86_64 -m 4G -enable-kvm -net nic,model=rtl8139 \
-net user,hostfwd=tcp::2222-:22,hostfwd=tcp::7776-:7776,hostfwd=tcp::9999-:80 \
- -display none -hda $TARGET > /dev/null 2>&1 &
+ -display none -hda $TARGET > /dev/null 2>&1- &
-echo ".. and wait some time until it is ready!"
+echo ".. and wait some time (20s) until it is ready!"
# wait for system to boot up
-sleep 15
+sleep 20
# login as root
echo "now login as 'root'"
-ssh -F ./ssh.cfg localhost
+ssh -F ${SSHDIR}/root.cfg localhost
diff --git a/server-build/my-simple-cdd/profiles/wootaler.preseed b/server-build/my-simple-cdd/profiles/wootaler.preseed
index e260e44..3b82ddb 100644
--- a/server-build/my-simple-cdd/profiles/wootaler.preseed
+++ b/server-build/my-simple-cdd/profiles/wootaler.preseed
@@ -68,8 +68,8 @@ d-i netcfg/choose_interface select auto
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
-d-i netcfg/get_hostname string unassigned-hostname
-d-i netcfg/get_domain string unassigned-domain
+d-i netcfg/get_hostname string wootaler
+d-i netcfg/get_domain string wootaler
# If you want to force a hostname, regardless of what either the DHCP
# server returns or what the reverse DNS entry for the IP is, uncomment
diff --git a/client-build/ssh.cfg b/server-build/my-simple-cdd/ssh/root.cfg
index d269483..28992ee 100644
--- a/client-build/ssh.cfg
+++ b/server-build/my-simple-cdd/ssh/root.cfg
@@ -4,3 +4,4 @@ Host localhost
LogLevel ERROR
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
+ IdentityFile=ssh/talerwoo.key