From dde6ceadfbb3a62fe39981393ebbfb297e64f997 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 3 Jul 2024 14:36:54 -0400 Subject: [PATCH 1/3] Allow local ISO to proceed if detected with Ubuntu --- .../ubuntu22.04/initramfs/scripts/init-premount/confluent | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent b/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent index 03761f3a..8a7e3777 100755 --- a/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent +++ b/confluent_osdeploy/ubuntu22.04/initramfs/scripts/init-premount/confluent @@ -79,8 +79,12 @@ if [ ! -z "$cons" ]; then fi echo "Preparing to deploy $osprofile from $MGR" echo $osprofile > /custom-installation/confluent/osprofile -echo URL=http://${MGR}/confluent-public/os/$osprofile/distribution/install.iso >> /conf/param.conf -fcmdline="$(cat /custom-installation/confluent/cmdline.orig) url=http://${MGR}/confluent-public/os/$osprofile/distribution/install.iso" +. /etc/os-release +DIRECTISO=$(blkid -t TYPE=iso9660 |grep -Ei ' LABEL="Ubuntu-Server '$VERSION_ID) +if [ -z "$DIRECTISO" ]; then + echo URL=http://${MGR}/confluent-public/os/$osprofile/distribution/install.iso >> /conf/param.conf + fcmdline="$(cat /custom-installation/confluent/cmdline.orig) url=http://${MGR}/confluent-public/os/$osprofile/distribution/install.iso" +fi if [ ! -z "$cons" ]; then fcmdline="$fcmdline console=${cons#/dev/}" fi From 4f21e627054a0b09dcc2c0bdeea05f0897af04b9 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 8 Jul 2024 10:02:03 -0400 Subject: [PATCH 2/3] Fix typo in the auth code --- confluent_server/confluent/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/auth.py b/confluent_server/confluent/auth.py index fd07a133..fb82af24 100644 --- a/confluent_server/confluent/auth.py +++ b/confluent_server/confluent/auth.py @@ -58,7 +58,7 @@ _allowedbyrole = { '/nodes/', '/node*/media/uploads/', '/node*/inventory/firmware/updates/*', - '/node*/suppport/servicedata*', + '/node*/support/servicedata*', '/node*/attributes/expression', '/nodes/*/console/session*', '/nodes/*/shell/sessions*', From 7bd41af2ccca18b82f6ffeb95d7b7c4500b20937 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 9 Jul 2024 08:41:34 -0400 Subject: [PATCH 3/3] More properly error on bad requests Avoid incurring an error code 500 issue in reaction to certain bad request data. --- confluent_server/confluent/httpapi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index e30df36d..10ab8b86 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -175,6 +175,8 @@ def _get_query_dict(env, reqbody, reqtype): qstring = None if qstring: for qpair in qstring.split('&'): + if '=' not in qpair: + continue qkey, qvalue = qpair.split('=') qdict[qkey] = qvalue if reqbody is not None: @@ -668,7 +670,11 @@ def resourcehandler_backend(env, start_response): if 'CONTENT_LENGTH' in env and int(env['CONTENT_LENGTH']) > 0: reqbody = env['wsgi.input'].read(int(env['CONTENT_LENGTH'])) reqtype = env['CONTENT_TYPE'] - operation = opmap[env['REQUEST_METHOD']] + operation = opmap.get(env['REQUEST_METHOD'], None) + if not operation: + start_response('400 Bad Method', headers) + yield '' + return querydict = _get_query_dict(env, reqbody, reqtype) if operation != 'retrieve' and 'restexplorerop' in querydict: operation = querydict['restexplorerop']