summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-27 20:19:29 +0100
committerJannik Schönartz2019-02-27 20:19:29 +0100
commitf5a2f0f4a87c845d88380883f8cebe4253b42c11 (patch)
tree1a815b57c2ec92608a1f3b4644f0368ef5a4351c
parentfix major design issue (diff)
downloadbas-f5a2f0f4a87c845d88380883f8cebe4253b42c11.tar.gz
bas-f5a2f0f4a87c845d88380883f8cebe4253b42c11.tar.xz
bas-f5a2f0f4a87c845d88380883f8cebe4253b42c11.zip
[server/ipxe] Fix codemirror only loading on click bug & add the fixes for the tamas demo to the git
-rw-r--r--server/api/backends.js8
-rw-r--r--server/ipxe/bash_scripts/emergency_shell.sh3
-rw-r--r--server/ipxe/bash_scripts/tpm.sh7
-rw-r--r--server/ipxe/console_efi.h2
-rw-r--r--server/ipxe/default.ipxe10
-rw-r--r--server/ipxe/embedded_efi.ipxe1
-rw-r--r--server/ipxe/general_efi.h6
-rw-r--r--server/ipxe/minilinux.ipxe2
-rw-r--r--server/ipxe/registration.ipxe8
-rw-r--r--webapp/src/components/IpxeBuilderModuleConfig.vue21
10 files changed, 46 insertions, 22 deletions
diff --git a/server/api/backends.js b/server/api/backends.js
index 1d8e96d..1f9535b 100644
--- a/server/api/backends.js
+++ b/server/api/backends.js
@@ -165,8 +165,8 @@ router.get('/:id/import', (req, res) => {
var endRequest = []
const ba = new ExternalBackends()
const instance = ba.getInstance(backend.type)
- const groups = JSON.parse(backend.groupTypes).map(x => x.id)
- const clients = JSON.parse(backend.clientTypes).map(x => x.id)
+ const groups = JSON.parse(backend.groupTypes).map(x => parseInt(x.id))
+ const clients = JSON.parse(backend.clientTypes).map(x => parseInt(x.id))
// Get a list with all objects in the backend.
const objectPromise = new Promise(function (resolve, reject) {
@@ -175,7 +175,7 @@ router.get('/:id/import', (req, res) => {
objectPromise.then(result => {
// Check for the not implemented exception
- if (result.status) res.status(501).send(result)
+ if (result.status === 'NOT_IMPLEMENTED_EXCEPTION') res.status(501).send(result)
// Filter those objects in groups / clients
var groupObjects = []
@@ -312,7 +312,7 @@ noAuthRouter.get('/:id/:uuid/files/:filename', (req, res) => {
const instance = b.getInstance(backend.type)
instance.getFile(backend.credentials, externalId, filename).then(file => {
file.decoded = Buffer.from(file.value, 'base64').toString('UTF-8')
- res.send({ success: true, data: file })
+ res.send(file)
})
} else {
res.send({ success: false, status: 'CLIENT_NOT_FOUND', error: 'Couldn\'t find the client' })
diff --git a/server/ipxe/bash_scripts/emergency_shell.sh b/server/ipxe/bash_scripts/emergency_shell.sh
new file mode 100644
index 0000000..30ee09c
--- /dev/null
+++ b/server/ipxe/bash_scripts/emergency_shell.sh
@@ -0,0 +1,3 @@
+# TODO check wheather emergency_shell ist activatable
+. /lib/dracut-lib.sh
+emergency_shell \ No newline at end of file
diff --git a/server/ipxe/bash_scripts/tpm.sh b/server/ipxe/bash_scripts/tpm.sh
index 2b01287..faba4b3 100644
--- a/server/ipxe/bash_scripts/tpm.sh
+++ b/server/ipxe/bash_scripts/tpm.sh
@@ -1,7 +1,8 @@
#!/bin/bash
-
+set -x
+exec &> /log
# Check if the pc has tpm enabled
-if [ -d "/dev/tpm0" ]; then
+if [ -c "/dev/tpm0" ]; then
export TPM_INTERFACE_TYPE=dev
export TPM_DEVICE=/dev/tpm0
mkdir /run/tpm/
@@ -9,5 +10,5 @@ if [ -d "/dev/tpm0" ]; then
openssl rsa -in /run/tpm/$UUID-ssl-private.pem -out /run/tpm/$UUID-ssl-public.pem -outform PEM -pubout
create_tpm2_key -w /run/tpm/$UUID-ssl-private.pem -p 81000001 /run/tpm/$UUID-tpm-private.key
- curl -X PUT -F "tpm=@/run/tpm/$UUID-tpm-private.key" -F "openssl=@/run/tpm/$UUID-ssl-private.pem" --insecure https://$BAS/api/registration/$UUID/files
+ curl -X PUT -F "tpm=@/run/tpm/$UUID-tpm-private.key" -F "openssl=@/run/tpm/$UUID-ssl-public.pem" --insecure https://$BAS/api/registration/$UUID/files
fi
diff --git a/server/ipxe/console_efi.h b/server/ipxe/console_efi.h
index 0e7a65c..d351ee7 100644
--- a/server/ipxe/console_efi.h
+++ b/server/ipxe/console_efi.h
@@ -22,7 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*
*/
-#define CONSOLE_PCBIOS /* Default BIOS console */
+#undef CONSOLE_PCBIOS /* Default BIOS console */
#define CONSOLE_EFI /* Default EFI console */
//#undef CONSOLE_LINUX /* Default Linux console */
diff --git a/server/ipxe/default.ipxe b/server/ipxe/default.ipxe
index c16ef2e..d184713 100644
--- a/server/ipxe/default.ipxe
+++ b/server/ipxe/default.ipxe
@@ -3,6 +3,8 @@
:start
menu Default Script:
item bwlehrpool bwLehrpool
+item bwlehrpool_efi bwLehrpool_efi
+item bwlehrpool_tpm bwLehrpool_tpm
item reg Registration
item sh [Shell]
choose target && goto ${target}
@@ -10,12 +12,18 @@ choose target && goto ${target}
:bwlehrpool
chain --replace http://132.230.4.2/tftp/ipxelinux.0
+:bwlehrpool_efi
+chain --replace http://132.230.8.192/tftp/snponly.efi || shell
+
+:bwlehrpool_tpm
+kernel http://132.230.4.6/tbk/kernel-neu.sb.efi
+boot
+
:reg
set crosscert http://ca.ipxe.org/auto/
chain --replace https://bas.intra.uni-freiburg.de/api/ipxe/load/registration ||
goto start
-
:sh
shell ||
goto start
diff --git a/server/ipxe/embedded_efi.ipxe b/server/ipxe/embedded_efi.ipxe
index 70bfc17..bcb1770 100644
--- a/server/ipxe/embedded_efi.ipxe
+++ b/server/ipxe/embedded_efi.ipxe
@@ -5,6 +5,7 @@
################
ifopen
+dhcp
# Wallpaper
set img tftp://10.8.102.124/ipxeWallpaper3_scale.png || shell
diff --git a/server/ipxe/general_efi.h b/server/ipxe/general_efi.h
index 96ab724..1f60fa2 100644
--- a/server/ipxe/general_efi.h
+++ b/server/ipxe/general_efi.h
@@ -44,8 +44,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
* PXE support
*
*/
-//#undef PXE_STACK /* PXE stack in iPXE - you want this! */
-//#undef PXE_MENU /* PXE menu booting */
+#undef PXE_STACK /* PXE stack in iPXE - you want this! */
+#undef PXE_MENU /* PXE menu booting */
/*
* Download protocols
@@ -146,7 +146,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define POWEROFF_CMD /* Power off command */
//#define IMAGE_TRUST_CMD /* Image trust management commands */
//#define PCI_CMD /* PCI commands */
-//#define PARAM_CMD /* Form parameter commands */
+#define PARAM_CMD /* Form parameter commands */
//#define NEIGHBOUR_CMD /* Neighbour management commands */
//#define PING_CMD /* Ping command */
#define CONSOLE_CMD /* Console command */
diff --git a/server/ipxe/minilinux.ipxe b/server/ipxe/minilinux.ipxe
index ae70b4d..a482b72 100644
--- a/server/ipxe/minilinux.ipxe
+++ b/server/ipxe/minilinux.ipxe
@@ -2,5 +2,5 @@
kernel tftp://10.8.102.124/kernel/kernel
initrd tftp://10.8.102.124/initramfs-stage31-bss
-imgargs kernel ip=${net0/ip}:10.8.102.124:${net0/gateway}:${net0/netmask} BOOTIF=01-${net0/mac} bas=bas.intra.uni-freiburg.de
+imgargs kernel ip=${net0/ip}:10.8.102.124:${net0/gateway}:${net0/netmask} BOOTIF=01-${net0/mac} bas=bas.intra.uni-freiburg.de initrd=initramfs-stage31-bss
boot
diff --git a/server/ipxe/registration.ipxe b/server/ipxe/registration.ipxe
index 66e34e2..537cb58 100644
--- a/server/ipxe/registration.ipxe
+++ b/server/ipxe/registration.ipxe
@@ -10,11 +10,13 @@ set crosscert http://ca.ipxe.org/auto/
:start
menu Initializing client registration
item --key a automatic Automatic registration
+item --key k key Replace Secure Boot Keys
item --key m manual Manual registration
item --key l localboot Localboot
item --key r reboot Reboot
item --key p poweroff Power Off
item --key s sh [Shell]
+item --key u update Reload Menufile
choose --default automatic --timeout 15000 target && goto ${target} || goto automatic
:localboot
@@ -30,6 +32,9 @@ param ip ${net0/ip}
param purpose Pool PC
chain https://bas.intra.uni-freiburg.de/api/registration/add##params
+:key
+chain -ar http://132.230.4.6/tbk/ReplaceKeysWithOwnKeys.efi
+
:manual
params
param id 0
@@ -52,3 +57,6 @@ iseq ${password} sh || goto start
clear username
clear password
shell
+
+:update
+chain -ar registration.ipxe
diff --git a/webapp/src/components/IpxeBuilderModuleConfig.vue b/webapp/src/components/IpxeBuilderModuleConfig.vue
index e9cd504..709a04b 100644
--- a/webapp/src/components/IpxeBuilderModuleConfig.vue
+++ b/webapp/src/components/IpxeBuilderModuleConfig.vue
@@ -63,9 +63,8 @@
<v-btn flat color="warning" @click="cancelIpxe" :disabled=!disableButtons><v-icon left>cancel</v-icon>{{ $t('cancelIpxe') }}</v-btn>
<v-btn flat color="primary" @click="buildIpxe" :disabled=disableButtons><v-icon left>gavel</v-icon>{{ $t('buildIpxe') }}</v-btn>
</div>
-
<v-subheader></v-subheader>
- <v-expansion-panel v-model="scriptExpanded">
+ <v-expansion-panel v-model="scriptExpanded" class="non-selectable">
<v-expansion-panel-content>
<div slot="header">{{ $t('script') }}</div>
<v-card>
@@ -82,7 +81,7 @@
<v-subheader></v-subheader>
<v-expansion-panel v-model="certificateExpanded">
- <v-expansion-panel-content>
+ <v-expansion-panel-content class="non-selectable">
<div slot="header">{{ $t('trust') }}</div>
<v-card>
<codemirror class="script-editor" ref="certificate" v-model="certificate"></codemirror>
@@ -98,7 +97,7 @@
<v-subheader></v-subheader>
<v-expansion-panel v-model="generalExpanded">
- <v-expansion-panel-content>
+ <v-expansion-panel-content class="non-selectable">
<div slot="header">{{ $t('general') }}</div>
<v-card>
<codemirror class="script-editor" ref="general" v-model="general"></codemirror>
@@ -114,7 +113,7 @@
<v-subheader></v-subheader>
<v-expansion-panel v-model="consoleExpanded">
- <v-expansion-panel-content>
+ <v-expansion-panel-content class="non-selectable">
<div slot="header">{{ $t('console') }}</div>
<v-card>
<codemirror class="script-editor" ref="console" v-model="console"></codemirror>
@@ -159,16 +158,20 @@ export default {
...mapGetters(['tabsDark', 'tabsColor', 'tabsSliderColor'])
},
watch: {
- scriptExpanded: function () {
+ scriptExpanded: async function () {
+ await this.$nextTick()
if (this.scriptExpanded === 0) this.$refs.script.refresh()
},
- certificateExpanded: function () {
+ certificateExpanded: async function () {
+ await this.$nextTick()
if (this.certificateExpanded === 0) this.$refs.certificate.refresh()
},
- generalExpanded: function () {
+ generalExpanded: async function () {
+ await this.$nextTick()
if (this.generalExpanded === 0) this.$refs.general.refresh()
},
- consoleExpanded: function () {
+ consoleExpanded: async function () {
+ await this.$nextTick()
if (this.consoleExpanded === 0) this.$refs.console.refresh()
}
},