diff --git a/README.md b/README.md index f2c0974..473a139 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,35 @@ Access the web console with the default credentials: - Username: `mcmp` - Password: `mcmp_password` +## Step 6-1. Accept the Nexus Community Edition EULA (required for Application Manager) + +`mc-application-manager` stores imported packages in Nexus (`mc-application-manager-sonatype-nexus`). +Since Nexus Repository 3.77, the free edition (Community Edition) keeps the Docker registry and other features locked +until an administrator accepts the End User License Agreement. A fresh install starts with `accepted: false`, and +image pushes to the Docker registry fail with `403 You must accept the End User License Agreement` +(e.g. SW Catalogs > Register > Public Registry > Import & Create). + +Review the EULA (https://links.sonatype.com/products/nxrm/ce-eula), then accept it once after the platform is up: +```shell +cd mc-admin-cli/conf/docker +NEXUS_PW=$(grep -E '^MC_APPLICATION_MANAGER_NEXUS_INITIAL_PASSWORD=' .env | cut -d= -f2-) +NEXUS_PORT=$(grep -E '^MC_APPLICATION_MANAGER_NEXUS_PORT=' .env | cut -d= -f2-) +EULA_URL="http://localhost:${NEXUS_PORT}/service/rest/v1/system/eula" + +# Check the current state (accepted: false on a fresh install) +curl -s -u "admin:${NEXUS_PW}" "$EULA_URL" + +# Accept — the request must echo back the disclaimer text returned above +curl -s -u "admin:${NEXUS_PW}" "$EULA_URL" \ + | python3 -c 'import json,sys; d=json.load(sys.stdin); d["accepted"]=True; print(json.dumps(d))' \ + | curl -s -o /dev/null -w '%{http_code}\n' -u "admin:${NEXUS_PW}" -X POST \ + -H 'Content-Type: application/json' -d @- "$EULA_URL" +# Expected: 204, and a re-check shows "accepted" : true +``` +You can also accept it in the Nexus UI (`http://:${MC_APPLICATION_MANAGER_NEXUS_PORT}`, sign in as `admin`). +The acceptance is stored in the Nexus data volume, so it is required again after `cleanAll.sh` or any reset of +`conf/docker/container-volume/mc-application-manager/nexus`. + ## Step 7. Clean Up If you want to completely reset the environment (removes all Docker containers, images, and volumes): diff --git a/conf/api.yaml b/conf/api.yaml index 952a2b2..9778252 100644 --- a/conf/api.yaml +++ b/conf/api.yaml @@ -11,7 +11,7 @@ services: password: mc-iam-manager: - version: 0.7.0 + version: 0.7.1 baseurl: http://mc-iam-manager:5000 auth: type: bearer @@ -25,7 +25,7 @@ services: password: spider mc-web-console: - version: 0.7.0 + version: 0.7.1 baseurl: http://mc-web-console:3000 auth: type: bearer diff --git a/conf/docker/api.yaml b/conf/docker/api.yaml index 952a2b2..9778252 100644 --- a/conf/docker/api.yaml +++ b/conf/docker/api.yaml @@ -11,7 +11,7 @@ services: password: mc-iam-manager: - version: 0.7.0 + version: 0.7.1 baseurl: http://mc-iam-manager:5000 auth: type: bearer @@ -25,7 +25,7 @@ services: password: spider mc-web-console: - version: 0.7.0 + version: 0.7.1 baseurl: http://mc-web-console:3000 auth: type: bearer diff --git a/conf/docker/conf/mc-web-console/api/conf/api.yaml b/conf/docker/conf/mc-web-console/api/conf/api.yaml index d7eb2b9..ed86e17 100644 --- a/conf/docker/conf/mc-web-console/api/conf/api.yaml +++ b/conf/docker/conf/mc-web-console/api/conf/api.yaml @@ -11,7 +11,7 @@ services: password: mc-iam-manager: - version: 0.7.0 + version: 0.7.1 baseurl: http://mc-iam-manager:5000 auth: type: bearer @@ -25,7 +25,7 @@ services: password: default mc-web-console: - version: 0.7.0 + version: 0.7.1 baseurl: http://mc-web-console-api:3000 auth: type: bearer diff --git a/conf/docker/docker-compose.mini.yaml b/conf/docker/docker-compose.mini.yaml index eddf63f..d26bc1c 100644 --- a/conf/docker/docker-compose.mini.yaml +++ b/conf/docker/docker-compose.mini.yaml @@ -221,7 +221,7 @@ services: mc-iam-manager: container_name: mc-iam-manager - image: cloudbaristaorg/mc-iam-manager:0.7.0 + image: cloudbaristaorg/mc-iam-manager:0.7.1 restart: unless-stopped networks: - mc-iam-manager-network @@ -389,7 +389,7 @@ services: exec docker-entrypoint.sh postgres" mc-web-console-api: - image: cloudbaristaorg/mc-web-console-api:0.7.0 + image: cloudbaristaorg/mc-web-console-api:0.7.1 pull_policy: always container_name: mc-web-console-api platform: linux/amd64 @@ -438,7 +438,7 @@ services: <<: *default-health-check mc-web-console-front: - image: cloudbaristaorg/mc-web-console-front:0.7.0 + image: cloudbaristaorg/mc-web-console-front:0.7.1 pull_policy: always container_name: mc-web-console-front platform: linux/amd64 diff --git a/conf/docker/docker-compose.yaml b/conf/docker/docker-compose.yaml index 567b814..a15169d 100644 --- a/conf/docker/docker-compose.yaml +++ b/conf/docker/docker-compose.yaml @@ -278,7 +278,7 @@ services: mc-iam-manager: container_name: mc-iam-manager - image: cloudbaristaorg/mc-iam-manager:0.7.0 + image: cloudbaristaorg/mc-iam-manager:0.7.1 restart: unless-stopped networks: - mc-iam-manager-network @@ -1187,7 +1187,7 @@ services: exec docker-entrypoint.sh postgres" mc-web-console-api: - image: cloudbaristaorg/mc-web-console-api:0.7.0 + image: cloudbaristaorg/mc-web-console-api:0.7.1 pull_policy: always container_name: mc-web-console-api platform: linux/amd64 @@ -1231,7 +1231,7 @@ services: <<: *default-health-check mc-web-console-front: - image: cloudbaristaorg/mc-web-console-front:0.7.0 + image: cloudbaristaorg/mc-web-console-front:0.7.1 pull_policy: always container_name: mc-web-console-front platform: linux/amd64 diff --git a/src/cmd/rest/root.go b/src/cmd/rest/root.go index a8f79c3..716bdb1 100644 --- a/src/cmd/rest/root.go +++ b/src/cmd/rest/root.go @@ -25,7 +25,6 @@ var password string var isShowHeaders bool var sendData string var inputFileData string -var fileData string var isVerbose bool var authToken string @@ -48,7 +47,10 @@ var restCmd = &cobra.Command{ SetAuthToken() // Authorization: // default auth-scheme : Bearer SetBasicAuth() // Authorization: Basic SetHeaders() - SetReqData() + if err := SetReqData(); err != nil { + fmt.Println(err) + os.Exit(1) + } if isVerbose { fmt.Println("==============================") @@ -221,7 +223,7 @@ func init() { // Add flag for post data restCmd.PersistentFlags().StringVarP(&sendData, "data", "d", "", "Data to send to the server") - restCmd.PersistentFlags().StringVarP(&fileData, "file", "f", "", "Data to send to the server from file") + restCmd.PersistentFlags().StringVarP(&inputFileData, "file", "f", "", "Data to send to the server from file") restCmd.PersistentFlags().BoolVarP(&isVerbose, "verbose", "v", false, "Show more detail information")