Updated installation and components

Issue-ID: NONRTRIC-854
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I6d23663dedb09eb0684e158112a39db41476ec76
diff --git a/https-server/Dockerfile b/https-server/Dockerfile
index 941acb2..7792de2 100644
--- a/https-server/Dockerfile
+++ b/https-server/Dockerfile
@@ -15,12 +15,14 @@
 #  ============LICENSE_END=================================================
 #
 
-FROM golang:1.19-bullseye AS build
+FROM golang:1.20.3-buster AS build
+
 WORKDIR /app
-COPY go.mod .
-COPY go.sum .
-RUN go mod download
+
 COPY main.go .
+RUN go mod init main
+RUN go mod tidy
+
 RUN go build -o /pm-https-server
 
 #Replaced distroless image with ubuntu for debug purposes
diff --git a/https-server/README.md b/https-server/README.md
index 757eeec..e5e6e93 100644
--- a/https-server/README.md
+++ b/https-server/README.md
@@ -5,7 +5,7 @@
 
 This server can be used to simulate a RAN node for file download over https.
 Files can be requested in three ways:
-- static file (always the same files returned)
+- static file (always the same file returned)
 - semi-static files (the requested file must exist in the container)
 - generated files (file contents is generated using a template where the start/stop time as well the node name is based on requested file. Counter values are also generated)
 
@@ -20,7 +20,7 @@
 
 
 ### Configuration
-The following env vars (all optional) may be set to control the behavior of the server
+The following env vars (all optional) may be set to control the behaviour of the server
 
 - ALWAYS_RETURN - Name of a file under "/files" in the container that is always returned regardless of requested file on the url `/files/<file-id>`. The can be used when the file contents is not important.
 
@@ -30,7 +30,7 @@
 
 If generated files shall be used, load the file pm-template.xml.gz to the /template-files dir in the container.
 
-Configure the following for desired behaviou
+Configure the following for desired behaviour
 - static file: ALWAYS_RETURN
 - semi-static files: none
 - generated files: GENERATED_FILE_START_TIME and GENERATED_FILE_TIMEZONE
diff --git a/https-server/build.sh b/https-server/build.sh
index c7aabac..8647a0b 100755
--- a/https-server/build.sh
+++ b/https-server/build.sh
@@ -18,14 +18,14 @@
 #
 
 # Build image from Dockerfile with/without custom image tag
-# Optionally push to external docker hub repo
+# Optionally push to external image repo
 
 print_usage() {
     echo "Usage: build.sh no-push|<docker-hub-repo-name> [<image-tag>]"
     exit 1
 }
 
-if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+if [ $# -lt 1 ] || [ $# -gt 2 ]; then
     print_usage
 fi
 
@@ -39,14 +39,39 @@
     echo "Attempt to push built image to: "$REPO
 fi
 
-if [ "$2" != "" ]; then
-    IMAGE_TAG=$2
-fi
- echo "Setting image tag to: "$IMAGE_TAG
+shift
+while [ $# -ne 0 ]; do
+    if [ $1 == "--tag" ]; then
+        shift
+        if [ -z "$1" ]; then
+            print_usage
+        fi
+        IMAGE_TAG=$1
+        echo "Setting image tag to: "$IMAGE_TAG
+        shift
+    else
+        echo "Unknown parameter: $1"
+        print_usage
+    fi
+done
+
+./gen-cert.sh
+
+echo ""
+echo "Certs generated"
 
 IMAGE=$IMAGE_NAME:$IMAGE_TAG
-echo "Building image $IMAGE"
+
+export DOCKER_DEFAULT_PLATFORM=linux/amd64
+CURRENT_PLATFORM=$(docker system info --format '{{.OSType}}/{{.Architecture}}')
+if [ $CURRENT_PLATFORM != $DOCKER_DEFAULT_PLATFORM ]; then
+    echo "Image may not work on the current platform: $CURRENT_PLATFORM, only platform $DOCKER_DEFAULT_PLATFORM supported"
+fi
+
+echo "Building image: $IMAGE with architecture: $DOCKER_DEFAULT_PLATFORM"
+
 docker build -t $IMAGE_NAME:$IMAGE_TAG .
+
 if [ $? -ne 0 ]; then
     echo "BUILD FAILED"
     exit 1
diff --git a/https-server/certs/.gitignore b/https-server/certs/.gitignore
deleted file mode 100644
index be870b4..0000000
--- a/https-server/certs/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.crt
-*.key
diff --git a/https-server/certs/server.crt b/https-server/certs/server.crt
new file mode 100644
index 0000000..f80319e
--- /dev/null
+++ b/https-server/certs/server.crt
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICmDCCAYACCQCzTWEB5G++JDANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJT
+RTAgFw0yMzA1MTcxMjQ2MjVaGA8yMDUwMTAwMTEyNDYyNVowDTELMAkGA1UEBhMC
+U0UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDrFmC9idjCLOYkV0Nb
+R61ZCEBNuLF+UAsZ7GrS+WaME81CuEDZLeHsqwCOiPKf6XF23XHoXqZ+lFY2+Bv0
+uf+FcR3Y7p3BcQn4Ier65ybvHRc/53RspOLdi4TXttEjhGEJsApFsnOSYEkDv/1x
+TU9etwUvjWNdopKQ/fszV6WB1JgLvdSC4US+Do/+V3vUJWW8aJhTfUUtUfyVreJr
++/Rs+lfyMcoBv6d7SsyImO4Lq1Gv4giyKu4D3R9Vvz6CNp2mTKrhgiVbnSKMl1cm
+bkewFPuAvbjxxNGXUWipGug3pJgTxWS8/IyfyQ6TXl5fWvDRt5wrXNbc3nrJVoSs
+1QPFAgMBAAEwDQYJKoZIhvcNAQELBQADggEBACfMN8UZSGzHNsFbiuDoy0hSZzDk
+2ZpJV+BgtH/119lgIRzEEOC749rx68T55B8vKH8go1Pio3sVeDp2bZ7phG9Bcxn9
+hTIN9VJQ9vVnPrnaPzDuQdzY+4FyTMcMXtgHfC7Nu4bYor+rXbqdmv+RrucG9jpg
+uZaLdgtyYK+vpEqLauRYc3wWzyDtV6Td/8r4htxf+zslWvrQ1AXEXf5uuozWTTZJ
+g23vQ243NIQ9MF430QS40uvBBssACeI3NG8aD/OfhWO7TIKr69y+EfHu7i/hcFO1
+LkRj+CMt70TQMULHGeG7CP8VZJNHJz0kCZWj6R+Z9MOA/dVaIiyAS5LI/uY=
+-----END CERTIFICATE-----
diff --git a/https-server/certs/server.key b/https-server/certs/server.key
new file mode 100644
index 0000000..927d144
--- /dev/null
+++ b/https-server/certs/server.key
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDrFmC9idjCLOYk
+V0NbR61ZCEBNuLF+UAsZ7GrS+WaME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KNNujUEDBRtiW
+j6GD5FJQAVQn3tEd9Gluj+ZLUP5C/nt6arEUwIgzn0GeQe9WIADfO4pVS/tOdXai
+Uv+DSear5wgYG4nuAD+ZQVpnG5NQHPDKMyYelJJnCmlxj0TVByYCvfG2yQKBgQCz
+UQNl8Sobwk/0gvbM04UfgZ784Kvqf9O/Ep/Hz/x+Z6rZFYIDq8WBMLINCaI8oYxL
+ybPmZtsz7Ec6RvyKQC5c4I0tihMnJbcJOekjKlWWtUke39KhK6n7IyopWHetv2Mh
+GFT+F/MmlCDJ+0HirZLT2WgMkhkmsUBpffpEJZPZzQKBgQDQKT183favwULOkQaP
+AGItpQVt3aYyuZYi5veIDlzk3tatAIzya/G6Bqfnpy9CO6yPKdp1pkJxM1xb374T
+z6Mz4A4NPOD2Ofd0WAmiIkP0H1+zfjjtmdBO/9PpASLByNxt2MUdjWvaGk2w7U42
+Eb1duJr2Yud1NfUvKI7dZudF1A==
+-----END PRIVATE KEY-----
diff --git a/https-server/gen-cert.sh b/https-server/gen-cert.sh
index 4678361..f44d798 100755
--- a/https-server/gen-cert.sh
+++ b/https-server/gen-cert.sh
@@ -17,7 +17,7 @@
 #  ============LICENSE_END=================================================
 #
 
-#Generate basic cert and key for web server
+#Generate basic cert and key for https server
 
 cat <<__EOF__ |  openssl req -new -newkey rsa:2048 -sha256 -nodes -x509 -keyout certs/server.key -out certs/server.crt -days 9999
 SE