diff --git a/Dockerfile b/Dockerfile index 21cbcb4..a37b48c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,8 +51,8 @@ RUN ./scripts/install-tofu.sh # Setting various environment variables required by the application ENV TERRARIUM_ROOT=/app -## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8056) -ENV TERRARIUM_SELF_ENDPOINT=localhost:8888 +## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8055) +ENV TERRARIUM_SELF_ENDPOINT=localhost:8055 ## Set API access config # API_ALLOW_ORIGINS (ex: https://cloud-barista.org,xxx.xxx.xxx.xxx or * for all) @@ -83,4 +83,4 @@ ENV TERRARIUM_AUTOCONTROL_DURATION_MS=10000 ENTRYPOINT [ "/app/mc-terrarium" ] # Exposing the port that the application will run on -EXPOSE 8888 +EXPOSE 8055 diff --git a/Makefile b/Makefile index eb18f6a..898e494 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,8 @@ compose-up: ## Up services by docker compose echo "Creating terrarium_network..."; \ docker network create terrarium_network; \ fi + @echo "Pulling the latest edge images..." + @docker pull cloudbaristaorg/mc-terrarium:edge @echo "Starting services by docker compose..." @docker compose up diff --git a/README.md b/README.md index af2d1dc..164f9f1 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Note - There may be an issue regarding Credential settings. Contributions are we - Required a Docker network, `terrarium_network` > [!NOTE] -> services in other docker composes can access the `mc-terrarium` service, like `http://mc-terrarium:8888/terrarium`. +> services in other docker composes can access the `mc-terrarium` service, like `http://mc-terrarium:8055/terrarium`. > _Condition: Set up `terrarium_network` in external docker compose_ You can do this by running the following command: @@ -65,7 +65,7 @@ make compose You can find the default username and password to access to API dashboard when the API server runs. -URL: http://localhost:8888/terrarium/swagger/index.html +URL: http://localhost:8055/terrarium/swagger/index.html Note - You can find API documentation on Swagger UI. diff --git a/api/docs.go b/api/docs.go index 2e9171f..492f7a0 100644 --- a/api/docs.go +++ b/api/docs.go @@ -2059,7 +2059,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "latest", - Host: "localhost:8888", + Host: "localhost:8055", BasePath: "/terrarium", Schemes: []string{}, Title: "Multi-Cloud Terrarium REST API", diff --git a/api/swagger.json b/api/swagger.json index b3acb6e..0f6921c 100644 --- a/api/swagger.json +++ b/api/swagger.json @@ -13,7 +13,7 @@ }, "version": "latest" }, - "host": "localhost:8888", + "host": "localhost:8055", "basePath": "/terrarium", "paths": { "/httpVersion": { diff --git a/api/swagger.yaml b/api/swagger.yaml index 1ffca35..98fd410 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -194,7 +194,7 @@ definitions: example: asia-northeast3 type: string type: object -host: localhost:8888 +host: localhost:8055 info: contact: name: API Support diff --git a/cmd/mc-terrarium/main.go b/cmd/mc-terrarium/main.go index 12628f2..7a69f93 100644 --- a/cmd/mc-terrarium/main.go +++ b/cmd/mc-terrarium/main.go @@ -69,7 +69,7 @@ func init() { // @license.name Apache 2.0 // @license.url http://www.apache.org/licenses/LICENSE-2.0.html -// @host localhost:8888 +// @host localhost:8055 // @BasePath /terrarium // @securityDefinitions.basic BasicAuth @@ -77,8 +77,8 @@ func main() { log.Info().Msg("preparing to run mc-terrarium server...") - // Set the default port number "8888" for the REST API server to listen on - port := flag.String("port", "8888", "port number for the restapiserver to listen to") + // Set the default port number "8055" for the REST API server to listen on + port := flag.String("port", "8055", "port number for the restapiserver to listen to") flag.Parse() // Validate port diff --git a/conf/config.yaml b/conf/config.yaml index 6d105c5..b55706a 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -2,13 +2,13 @@ terrarium: root: # To be set in runtime - ## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8888) + ## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8055) self: - endpoint: localhost:8888 + endpoint: localhost:8055 ## Set API access config api: - # Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8888 or * for all) + # Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8055 or * for all) allow: origins: "*" diff --git a/conf/setup.env b/conf/setup.env index 8603284..825dc8e 100644 --- a/conf/setup.env +++ b/conf/setup.env @@ -3,11 +3,11 @@ SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` export TERRARIUM_ROOT=`cd $SCRIPT_DIR && cd .. && pwd` -## Set TERRARIUM_SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8888) -export TERRARIUM_SELF_ENDPOINT=localhost:8888 +## Set TERRARIUM_SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8055) +export TERRARIUM_SELF_ENDPOINT=localhost:8055 ## Set API access config -# TERRARIUM_API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8888 or * for all) +# TERRARIUM_API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8055 or * for all) export TERRARIUM_API_ALLOW_ORIGINS=* # Set API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path) export TERRARIUM_API_AUTH_ENABLED=true diff --git a/conf/template-config.yaml b/conf/template-config.yaml index f4d6275..d075747 100644 --- a/conf/template-config.yaml +++ b/conf/template-config.yaml @@ -2,13 +2,13 @@ mcterrarium: root: # To be set in runtime - ## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8888) + ## Set SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8055) self: - endpoint: localhost:8888 + endpoint: localhost:8055 ## Set API access config api: - # Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8888 or * for all) + # Set API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8055 or * for all) allow: origins: "*" diff --git a/conf/template-setup.env b/conf/template-setup.env index 8603284..825dc8e 100644 --- a/conf/template-setup.env +++ b/conf/template-setup.env @@ -3,11 +3,11 @@ SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}` export TERRARIUM_ROOT=`cd $SCRIPT_DIR && cd .. && pwd` -## Set TERRARIUM_SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8888) -export TERRARIUM_SELF_ENDPOINT=localhost:8888 +## Set TERRARIUM_SELF_ENDPOINT, to access Swagger API dashboard outside (Ex: export SELF_ENDPOINT=x.x.x.x:8055) +export TERRARIUM_SELF_ENDPOINT=localhost:8055 ## Set API access config -# TERRARIUM_API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8888 or * for all) +# TERRARIUM_API_ALLOW_ORIGINS (ex: https://cloud-barista.org,http://localhost:8055 or * for all) export TERRARIUM_API_ALLOW_ORIGINS=* # Set API_AUTH_ENABLED=true currently for basic auth for all routes (i.e., url or path) export TERRARIUM_API_AUTH_ENABLED=true diff --git a/docker-compose.yaml b/docker-compose.yaml index 4a3c7a2..5da587d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ networks: services: mc-terrarium: - image: cloudbaristaorg/mc-terrarium:edge + image: cloudbaristaorg/mc-terrarium:0.0.9 container_name: mc-terrarium build: context: . @@ -12,8 +12,8 @@ services: networks: - terrarium_network ports: - - target: 8888 - published: 8888 + - target: 8055 + published: 8055 protocol: tcp env_file: - ./secrets/credentials # AWS credentials @@ -23,7 +23,7 @@ services: - ./container-volume/mc-terrarium-container/.terrarium:/app/.terrarium environment: # - TERRARIUM_ROOT=/app - # - TERRARIUM_SELF_ENDPOINT=localhost:8888 + # - TERRARIUM_SELF_ENDPOINT=localhost:8055 # - TERRARIUM_API_ALLOW_ORIGINS=* # - TERRARIUM_API_AUTH_ENABLED=true # - TERRARIUM_API_USERNAME=default @@ -33,13 +33,13 @@ services: # - TERRARIUM_LOGFILE_MAXBACKUPS=3 # - TERRARIUM_LOGFILE_MAXAGE=30 # - TERRARIUM_LOGFILE_COMPRESS=false - - TERRARIUM_LOGLEVEL=debug + # - TERRARIUM_LOGLEVEL=info # - TERRARIUM_LOGWRITER=both # - TERRARIUM_NODE_ENV=production # - TERRARIUM_AUTOCONTROL_DURATION_MS=10000 healthcheck: # for MC-Terrarirum - test: [ "CMD", "curl", "-f", "http://localhost:8888/terrarium/readyz" ] - interval: 1m + test: [ "CMD", "curl", "-f", "http://localhost:8055/terrarium/readyz" ] + interval: 5m timeout: 5s retries: 3 start_period: 10s diff --git a/secrets/README.md b/secrets/README.md index c3a549f..3c72ac9 100644 --- a/secrets/README.md +++ b/secrets/README.md @@ -132,7 +132,7 @@ docker run \ --env-file "${PWD}"/secrets/credentials \ --env-file "${PWD}"/secrets/credential-azure.env \ --mount type=bind,source="${PWD}"/secrets/,target=/app/secrets/ \ --p 8888:8888 \ +-p 8055:8055 \ --name mc-terrarium \ cloudbaristaorg/mc-terrarium:latest ```