diff --git a/.eslintignore b/.eslintignore index bc89b1e9df..c2169d034f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -23,6 +23,6 @@ LICENSE marketing/*/* licenses/* certifications/* -ApiDocs/public/assets/* +ApiReference/public/assets/* JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/* _test/* \ No newline at end of file diff --git a/.github/workflows/compile.api-reference.yaml b/.github/workflows/compile.api-reference.yaml index 79248e8350..f033e40d81 100644 --- a/.github/workflows/compile.api-reference.yaml +++ b/.github/workflows/compile.api-reference.yaml @@ -1,4 +1,4 @@ -name: Compile ApiDocs +name: Compile ApiReference on: pull_request: @@ -20,5 +20,5 @@ jobs: - run: cd Common && npm install - run: cd Model && npm install - run: cd CommonServer && npm install - - run: cd ApiDocs && npm install && npm run compile + - run: cd ApiReference && npm install && npm run compile \ No newline at end of file diff --git a/.github/workflows/docker-build.api-reference.yml b/.github/workflows/docker-build.api-reference.yml index 0efcd3817f..398be02e0f 100644 --- a/.github/workflows/docker-build.api-reference.yml +++ b/.github/workflows/docker-build.api-reference.yml @@ -21,4 +21,4 @@ jobs: # build image for home - name: build docker image - run: sudo docker build -f ./ApiDocs/Dockerfile . + run: sudo docker build -f ./ApiReference/Dockerfile . diff --git a/.github/workflows/image-deployment.production.api-reference.yaml b/.github/workflows/image-deployment.production.api-reference.yaml index 402f5d3e3d..8935d7fceb 100644 --- a/.github/workflows/image-deployment.production.api-reference.yaml +++ b/.github/workflows/image-deployment.production.api-reference.yaml @@ -1,4 +1,4 @@ -name: ApiDocs Production Image Deploy to DockerHub +name: ApiReference Production Image Deploy to DockerHub on: push: @@ -23,6 +23,6 @@ jobs: # Build and deploy api-reference. - run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD - run: sudo docker buildx create --use - - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:5.0.$CI_PIPELINE_ID --push -f ./ApiDocs/Dockerfile . - - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:release --push -f ./ApiDocs/Dockerfile . + - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:5.0.$CI_PIPELINE_ID --push -f ./ApiReference/Dockerfile . + - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:release --push -f ./ApiReference/Dockerfile . diff --git a/.github/workflows/image-deployment.test.api-reference.yaml b/.github/workflows/image-deployment.test.api-reference.yaml index 64d6b3b335..36b7ee46a9 100644 --- a/.github/workflows/image-deployment.test.api-reference.yaml +++ b/.github/workflows/image-deployment.test.api-reference.yaml @@ -1,4 +1,4 @@ -name: ApiDocs Test Image Deploy to DockerHub +name: ApiReference Test Image Deploy to DockerHub on: push: @@ -23,6 +23,6 @@ jobs: # Build and deploy api-reference. - run: sudo docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD - run: sudo docker buildx create --use - - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:5.0.$CI_PIPELINE_ID-test --push -f ./ApiDocs/Dockerfile . - - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:test --push -f ./ApiDocs/Dockerfile . + - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:5.0.$CI_PIPELINE_ID-test --push -f ./ApiReference/Dockerfile . + - run: sudo docker buildx build --platform linux/amd64,linux/arm64 --tag oneuptime/api-reference:test --push -f ./ApiReference/Dockerfile . diff --git a/.prettierignore b/.prettierignore index 962e8ef8ab..91a8d2960b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -49,5 +49,5 @@ LICENSE marketing/*/* licenses/* certifications/* -ApiDocs/public/assets/* +ApiReference/public/assets/* JavaScriptSDK/src/cli/server-monitor/out/scripts/prettify/* \ No newline at end of file diff --git a/ApiReference/Dockerfile.tpl b/ApiReference/Dockerfile.tpl index ff0c5feb16..ef448c39b6 100755 --- a/ApiReference/Dockerfile.tpl +++ b/ApiReference/Dockerfile.tpl @@ -46,7 +46,7 @@ RUN mkdir /usr/src/app WORKDIR /usr/src/app # Install app dependencies -COPY ./ApiDocs/package*.json /usr/src/app/ +COPY ./ApiReference/package*.json /usr/src/app/ RUN npm install @@ -60,7 +60,7 @@ EXPOSE 1445 CMD [ "npm", "run", "dev" ] {{ else }} # Copy app source -COPY ./ApiDocs /usr/src/app +COPY ./ApiReference /usr/src/app # Bundle app source RUN npm run compile #Run the app diff --git a/ApiReference/README.md b/ApiReference/README.md index 08538946be..717c1dd424 100755 --- a/ApiReference/README.md +++ b/ApiReference/README.md @@ -1,6 +1,6 @@ # OneUptime API Documentation -[![Build Status](https://travis-ci.org/OneUptime/ApiDocs.svg?branch=master)](https://travis-ci.org/OneUptime/ApiDocs) +[![Build Status](https://travis-ci.org/OneUptime/ApiReference.svg?branch=master)](https://travis-ci.org/OneUptime/ApiReference) This is the API Reference for OneUptime which is hosted at [https://oneuptime.com/reference](https://oneuptime.com/reference). diff --git a/Ci/scripts/clean_install.sh b/Ci/scripts/clean_install.sh index dfeec0545e..e3b3159ca6 100644 --- a/Ci/scripts/clean_install.sh +++ b/Ci/scripts/clean_install.sh @@ -19,7 +19,7 @@ clean_install accounts clean_install backend clean_install home clean_install StatusPage -clean_install ApiDocs +clean_install ApiReference clean_install probe clean_install AdminDashboard clean_install InitScript diff --git a/Ci/scripts/docker-build-all-and-push.sh b/Ci/scripts/docker-build-all-and-push.sh index 3bb172dfe1..0c26de06af 100755 --- a/Ci/scripts/docker-build-all-and-push.sh +++ b/Ci/scripts/docker-build-all-and-push.sh @@ -35,7 +35,7 @@ build accounts $1 build backend $1 build home $1 build StatusPage $1 -build ApiDocs $1 +build ApiReference $1 build probe $1 build AdminDashboard $1 build InitScript $1 diff --git a/Ci/scripts/hosts-setup.sh b/Ci/scripts/hosts-setup.sh index e22b300a2b..05cb9c62e0 100644 --- a/Ci/scripts/hosts-setup.sh +++ b/Ci/scripts/hosts-setup.sh @@ -22,9 +22,9 @@ sudo sed -i '/StatusPage/c\' /etc/hosts STATUSPAGE_IP=`sudo k describe svc oneuptime-status | grep Endpoints | cut -d ":" -f 2` echo $STATUSPAGE_IP' status.app.local' | sudo tee -a /etc/hosts -sudo sed -i '/ApiDocs/c\' /etc/hosts -APIDOCS_IP=`sudo k describe svc oneuptime-ApiDocs | grep Endpoints | cut -d ":" -f 2` -echo $APIDOCS_IP' ApiDocs.app.local' | sudo tee -a /etc/hosts +sudo sed -i '/ApiReference/c\' /etc/hosts +ApiReference_IP=`sudo k describe svc oneuptime-ApiReference | grep Endpoints | cut -d ":" -f 2` +echo $ApiReference_IP' ApiReference.app.local' | sudo tee -a /etc/hosts sudo sed -i '/licensing/c\' /etc/hosts LICENSING_IP=`sudo k describe svc oneuptime-licensing | grep Endpoints | cut -d ":" -f 2` diff --git a/Ci/scripts/production-rollback.sh b/Ci/scripts/production-rollback.sh index 54a61710ff..1a36ef278e 100644 --- a/Ci/scripts/production-rollback.sh +++ b/Ci/scripts/production-rollback.sh @@ -26,7 +26,7 @@ function check { rollback backend rollback home rollback StatusPage - rollback ApiDocs + rollback ApiReference rollback probe rollback AdminDashboard rollback licensing @@ -43,7 +43,7 @@ check accounts check backend check home check StatusPage -check ApiDocs +check ApiReference check probe-1 check probe-2 check AdminDashboard diff --git a/Ci/scripts/staging-rollback.sh b/Ci/scripts/staging-rollback.sh index 8c4e4e19df..79a85ff30e 100755 --- a/Ci/scripts/staging-rollback.sh +++ b/Ci/scripts/staging-rollback.sh @@ -32,7 +32,7 @@ function check { rollback backend rollback home rollback StatusPage - rollback ApiDocs + rollback ApiReference rollback probe rollback AdminDashboard rollback licensing @@ -49,7 +49,7 @@ check accounts check backend check home check StatusPage -check ApiDocs +check ApiReference check probe-1 check probe-2 check AdminDashboard diff --git a/Ci/scripts/version-setup.sh b/Ci/scripts/version-setup.sh index abcffde340..cce7f8dcd4 100755 --- a/Ci/scripts/version-setup.sh +++ b/Ci/scripts/version-setup.sh @@ -16,7 +16,7 @@ version accounts version backend version home version StatusPage -version ApiDocs +version ApiReference version probe version AdminDashboard version InitScript diff --git a/Ci/spec/api-docs/audit.yaml b/Ci/spec/api-docs/audit.yaml index 8c52f8123d..d69971e146 100644 --- a/Ci/spec/api-docs/audit.yaml +++ b/Ci/spec/api-docs/audit.yaml @@ -1,23 +1,23 @@ ## ACCOUNTS -audit_ApiDocs: +audit_ApiReference: stage: BuildAndTest allow_failure: true script: - chmod +x ./ci/scripts/checkhash.sh - - export next_stage=`./ci/scripts/checkhash.sh audit_ApiDocs ApiDocs` + - export next_stage=`./ci/scripts/checkhash.sh audit_ApiReference ApiReference` - if [[ $next_stage == *"skip"* ]]; then exit ${CI_JOB_SKIP_EXIT_CODE:-0}; fi - sudo apt-get update - sudo apt-get install -y curl gcc - sudo apt-get install -y build-essential - curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash - - sudo apt-get install -y nodejs - - cd ApiDocs + - cd ApiReference - npm install - npm run audit - npm run dep-check - cd .. - chmod +x ./ci/scripts/storehash.sh - - ./ci/scripts/storehash.sh audit_ApiDocs ApiDocs + - ./ci/scripts/storehash.sh audit_ApiReference ApiReference - chmod +x ./ci/scripts/cleanup.sh - ./ci/scripts/cleanup.sh only: diff --git a/Ci/spec/api-docs/rollback.yaml b/Ci/spec/api-docs/rollback.yaml index 5174f0098e..16c93d7523 100644 --- a/Ci/spec/api-docs/rollback.yaml +++ b/Ci/spec/api-docs/rollback.yaml @@ -1,15 +1,15 @@ -staging_rollback_ApiDocs: +staging_rollback_ApiReference: stage: RollbackIfTestsFail script: - chmod +x ./ci/scripts/deployment-setup.sh - bash ./ci/scripts/deployment-setup.sh - chmod +x ./ci/scripts/deployment-staging-setup.sh - bash ./ci/scripts/deployment-staging-setup.sh - # Rollback ApiDocs + # Rollback ApiReference - chmod +x ./ci/scripts/job-status.sh - export smoke_test_staging_status=`./ci/scripts/job-status.sh smoke_test_staging` - if [[ $smoke_test_staging_status == \"success\" ]]; then exit 0; fi - - sudo kubectl rollout undo deployment/fi-ApiDocs + - sudo kubectl rollout undo deployment/fi-ApiReference - chmod +x ./ci/scripts/cleanup.sh - ./ci/scripts/cleanup.sh only: @@ -18,18 +18,18 @@ staging_rollback_ApiDocs: except: - $STAGING_SMOKE_TEST_STATUS -production_rollback_ApiDocs: +production_rollback_ApiReference: stage: RollbackIfTestsFail script: - chmod +x ./ci/scripts/deployment-setup.sh - bash ./ci/scripts/deployment-setup.sh - chmod +x ./ci/scripts/deployment-production-setup.sh - bash ./ci/scripts/deployment-production-setup.sh - # Rollback ApiDocs + # Rollback ApiReference - chmod +x ./ci/scripts/job-status.sh - export smoke_test_production_status=`./ci/scripts/job-status.sh smoke_test_production` - if [[ $smoke_test_production_status == \"success\" ]]; then exit 0; fi - - sudo kubectl rollout undo deployment/fi-ApiDocs + - sudo kubectl rollout undo deployment/fi-ApiReference - chmod +x ./ci/scripts/cleanup.sh - ./ci/scripts/cleanup.sh only: diff --git a/Ci/spec/e2e/docker-compose-test.yaml b/Ci/spec/e2e/docker-compose-test.yaml index fe5a317847..198608b7ac 100644 --- a/Ci/spec/e2e/docker-compose-test.yaml +++ b/Ci/spec/e2e/docker-compose-test.yaml @@ -21,7 +21,7 @@ e2e_docker_compose_test: - export DASHBOARD_URL=http://localhost:3000 - export BACKEND_URL=http://localhost:3002 - export STATUSPAGE_URL=http://localhost:3006 - - export APIDOCS_URL=http://localhost:1445 + - export ApiReference_URL=http://localhost:1445 - cd tests - npm install - npm run test diff --git a/Ci/spec/e2e/kubernetes-test.yaml b/Ci/spec/e2e/kubernetes-test.yaml index 641775c5df..f191c92919 100644 --- a/Ci/spec/e2e/kubernetes-test.yaml +++ b/Ci/spec/e2e/kubernetes-test.yaml @@ -13,7 +13,7 @@ e2e_microk8s_test: - export DASHBOARD_URL=http://localhost/dashboard - export BACKEND_URL=http://localhost/api - export STATUSPAGE_URL=http://localhost/StatusPage - - export APIDOCS_URL=http://localhost/docs + - export ApiReference_URL=http://localhost/docs - export LICENSING_URL=http://localhost/license - cd tests - npm install diff --git a/Ci/spec/tests/production.yaml b/Ci/spec/tests/production.yaml index aa2aee7819..5868d27b4a 100644 --- a/Ci/spec/tests/production.yaml +++ b/Ci/spec/tests/production.yaml @@ -7,7 +7,7 @@ smoke_test_production: - export DASHBOARD_URL=https://oneuptime.com/dashboard - export BACKEND_URL=https://oneuptime.com/api - export STATUSPAGE_URL=https://statuspage.oneuptime.com - - export APIDOCS_URL=https://oneuptime.com/docs + - export ApiReference_URL=https://oneuptime.com/docs - export LICENSING_URL=https://oneuptime.com/license - cd tests - npm install diff --git a/CommonServer/.env.tpl b/CommonServer/.env.tpl index 5c0c80bf9e..3ff954cfee 100644 --- a/CommonServer/.env.tpl +++ b/CommonServer/.env.tpl @@ -40,7 +40,7 @@ DATA_INGESTOR_ROUTE={{ .Env.DATA_INGESTOR_ROUTE }} ACCOUNTS_ROUTE={{ .Env.ACCOUNTS_ROUTE }} HOME_ROUTE={{ .Env.HOME_ROUTE }} HELMCHARTS_ROUTE={{ .Env.HELMCHARTS_ROUTE }} -APIDOCS_ROUTE={{ .Env.APIDOCS_ROUTE }} +ApiReference_ROUTE={{ .Env.ApiReference_ROUTE }} IDENTITY_ROUTE={{ .Env.IDENTITY_ROUTE }} FILE_ROUTE={{ .Env.FILE_ROUTE }} WORKFLOW_ROUTE={{ .Env.WORKFLOW_ROUTE }} diff --git a/CommonServer/Config.ts b/CommonServer/Config.ts index 6b8e918da9..97cbd19dab 100644 --- a/CommonServer/Config.ts +++ b/CommonServer/Config.ts @@ -140,8 +140,8 @@ export const WorkflowRoute: Route = new Route( process.env['WORKFLOW_ROUTE'] || '/workflow' ); -export const ApiDocsRoute: Route = new Route( - process.env['APIDOCS_ROUTE'] || '/api-reference' +export const ApiReferenceRoute: Route = new Route( + process.env['ApiReference_ROUTE'] || '/api-reference' ); export const AdminDashboardRoute: Route = new Route( diff --git a/CommonUI/.env.tpl b/CommonUI/.env.tpl index 308a2151fa..3dfdec7aff 100644 --- a/CommonUI/.env.tpl +++ b/CommonUI/.env.tpl @@ -7,7 +7,7 @@ DATA_INGESTOR_ROUTE={{ .Env.DATA_INGESTOR_ROUTE }} ACCOUNTS_ROUTE={{ .Env.ACCOUNTS_ROUTE }} HOME_ROUTE={{ .Env.HOME_ROUTE }} HELMCHARTS_ROUTE={{ .Env.HELMCHARTS_ROUTE }} -APIDOCS_ROUTE={{ .Env.APIDOCS_ROUTE }} +ApiReference_ROUTE={{ .Env.ApiReference_ROUTE }} IDENTITY_ROUTE={{ .Env.IDENTITY_ROUTE }} WORKFLOW_ROUTE={{ .Env.WORKFLOW_ROUTE }} FILE_ROUTE={{ .Env.FILE_ROUTE }} diff --git a/CommonUI/src/Config.ts b/CommonUI/src/Config.ts index 932c9ffe6c..6784130636 100644 --- a/CommonUI/src/Config.ts +++ b/CommonUI/src/Config.ts @@ -40,7 +40,7 @@ export const INTEGRATION_ROUTE: Route = new Route(env('INTEGRATION_ROUTE')); export const HELM_ROUTE: Route = new Route(env('HELMCHART_ROUTE')); -export const API_DOCS_ROUTE: Route = new Route(env('APIDOCS_ROUTE')); +export const API_DOCS_ROUTE: Route = new Route(env('ApiReference_ROUTE')); export const ADMIN_DASHBOARD_ROUTE: Route = new Route( env('ADMINDASHBOARD_ROUTE') diff --git a/Devops/update.sh b/Devops/update.sh index 38f1a02ded..8b1b72ea33 100644 --- a/Devops/update.sh +++ b/Devops/update.sh @@ -18,7 +18,7 @@ function update { update deployment/fi-accounts fi-accounts=oneuptime/accounts:$1 update deployment/fi-dashboard fi-dashboard=oneuptime/dashboard:$1 update deployment/fi-admin fi-admin=oneuptime/AdminDashboard:$1 -update deployment/fi-ApiDocs fi-ApiDocs=oneuptime/ApiDocs:$1 +update deployment/fi-ApiReference fi-ApiReference=oneuptime/ApiReference:$1 update deployment/fi-app-scan fi-app-scan=oneuptime/ApplicationScanner:$1 update deployment/fi-backend fi-backend=oneuptime/backend:$1 update deployment/fi-cont-scan fi-cont-scan=oneuptime/ContainerScanner:$1 diff --git a/Docs/project-description.md b/Docs/project-description.md index cdc2242063..22faab69da 100644 --- a/Docs/project-description.md +++ b/Docs/project-description.md @@ -3,7 +3,7 @@ - `accounts` - A React project used for Authentication (Log in, Sign up, Forgot Password, etc.) - `dashboard` - A React project for OneUptime user where user can interact with the OneUptime platform. - `admin-dashobard` - React Project where admin can block users, delete projects and more. -- `ApiDocs` - HTML/CSS project. A public reference of OneUptime documentation. +- `ApiReference` - HTML/CSS project. A public reference of OneUptime documentation. - `backend` - NodeJS Service. It's OneUptime API's. - `home` - HTML/CSS. Home Page / Marketing page of OneUptime. - `HttpTestServer` - A test server used to test website monitors for OneUptime. diff --git a/HelmChart/public/oneuptime/templates/api-docs.yaml b/HelmChart/public/oneuptime/templates/api-docs.yaml index fb60d084d1..cce43a4ef7 100644 --- a/HelmChart/public/oneuptime/templates/api-docs.yaml +++ b/HelmChart/public/oneuptime/templates/api-docs.yaml @@ -61,8 +61,8 @@ spec: fieldRef: fieldPath: spec.serviceAccountName ports: - - containerPort: {{ $.Values.host.apiDocsPort }} - hostPort: {{ $.Values.host.apiDocsPort }} + - containerPort: {{ $.Values.host.ApiReferencePort }} + hostPort: {{ $.Values.host.ApiReferencePort }} name: {{ printf "%s-%s" $.Release.Name "api-reference" }} restartPolicy: {{ $.Values.image.restartPolicy }} @@ -79,9 +79,9 @@ metadata: namespace: {{ $.Release.Namespace }} spec: ports: - - port: {{ $.Values.host.apiDocsServicePort }} + - port: {{ $.Values.host.ApiReferenceServicePort }} protocol: TCP - targetPort: {{ $.Values.host.apiDocsPort }} + targetPort: {{ $.Values.host.ApiReferencePort }} selector: app: {{ printf "%s-%s" $.Release.Name "api-reference" }} type: ClusterIP diff --git a/HelmChart/public/oneuptime/values.yaml b/HelmChart/public/oneuptime/values.yaml index 0250d1298b..3534a03eaa 100644 --- a/HelmChart/public/oneuptime/values.yaml +++ b/HelmChart/public/oneuptime/values.yaml @@ -172,7 +172,7 @@ host: dashboardPort: 3000 accountsPort: 3003 helmChartPort: 3423 - apiDocsPort: 1445 + ApiReferencePort: 1445 initScriptPort: 1447 # if port 25 is avaialble and accessible # then we can use it as default port @@ -184,7 +184,7 @@ host: realtimeServicePort: 80 fetchResourcesServicePort: 80 homeServicePort: 80 - apiDocsServicePort: 80 + ApiReferenceServicePort: 80 statusPageHttpServicePort: 80 statusPageHttpsServicePort: 443 dashboardServicePort: 80 diff --git a/config.tpl.env b/config.tpl.env index 9a61cc8fed..8f586848b1 100644 --- a/config.tpl.env +++ b/config.tpl.env @@ -66,7 +66,7 @@ DATA_INGESTOR_ROUTE=/data-ingestor ACCOUNTS_ROUTE=/accounts HOME_ROUTE= HELMCHARTS_ROUTE=/charts -APIDOCS_ROUTE=/reference +ApiReference_ROUTE=/reference IDENTITY_ROUTE=/identity FILE_ROUTE=/file STATUS_PAGE_ROUTE=/status-page diff --git a/docker-compose.tpl.yml b/docker-compose.tpl.yml index faec998d58..a9127fd653 100644 --- a/docker-compose.tpl.yml +++ b/docker-compose.tpl.yml @@ -510,18 +510,18 @@ services: env_file: - ./Common/.env - ./CommonServer/.env - - ./ApiDocs/.env + - ./ApiReference/.env {{ if or (eq .Env.ENVIRONMENT "development") (eq .Env.ENVIRONMENT "ci") }} build: network: host context: . - dockerfile: ./ApiDocs/Dockerfile + dockerfile: ./ApiReference/Dockerfile {{ else }} image: oneuptime/api-reference:{{ .Env.APP_TAG }} {{ end }} {{ if eq .Env.ENVIRONMENT "development" }} volumes: - - ./ApiDocs:/usr/src/app + - ./ApiReference:/usr/src/app # Use node modules of the container and not host system. # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder - /usr/src/app/node_modules/