From 14a9292c9098bd5ff84ece5ada21c52f57449aff Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Thu, 14 Aug 2025 18:36:56 +0200 Subject: [PATCH 1/8] _index.html instead of index.html --- .platform/applications.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.platform/applications.yaml b/.platform/applications.yaml index 817fa770a7..a8b92116ae 100644 --- a/.platform/applications.yaml +++ b/.platform/applications.yaml @@ -29,7 +29,7 @@ mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" - mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/_index.html" cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" else echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" @@ -116,7 +116,7 @@ mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" - mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/_index.html" cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" else echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" From 76e85176df20718644d4d784309a7f9e5e8d7b0f Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 10:18:00 +0200 Subject: [PATCH 2/8] uglyURLs to false --- .platform/applications.yaml | 5 +++-- search/scrape.json | 2 +- sites/platform/config/_default/config.yaml | 2 +- sites/upsun/config/_default/config.yaml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.platform/applications.yaml b/.platform/applications.yaml index a8b92116ae..e449616ce7 100644 --- a/.platform/applications.yaml +++ b/.platform/applications.yaml @@ -29,7 +29,7 @@ mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" - mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/_index.html" + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" else echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" @@ -111,12 +111,13 @@ hooks: # Build hooks can modify the application files on disk but not access any services like databases. build: | + set -e #copy API docs into correct location # @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" - mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/_index.html" + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" else echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" diff --git a/search/scrape.json b/search/scrape.json index 3bd9963cbf..a157988489 100644 --- a/search/scrape.json +++ b/search/scrape.json @@ -43,7 +43,7 @@ "api.platform.sh" ], "start_urls": [ - "https://api.platform.sh/docs/" + "https://docs.platform.sh/api/" ] } } diff --git a/sites/platform/config/_default/config.yaml b/sites/platform/config/_default/config.yaml index c3d29459d7..d92d0027f3 100644 --- a/sites/platform/config/_default/config.yaml +++ b/sites/platform/config/_default/config.yaml @@ -10,7 +10,7 @@ themesdir: '../../themes' timeout: 60s -uglyurls: true +uglyURLs: false pygmentsUseClasses: true # Language settings diff --git a/sites/upsun/config/_default/config.yaml b/sites/upsun/config/_default/config.yaml index ae5960cd1d..8a1ac9e0ea 100644 --- a/sites/upsun/config/_default/config.yaml +++ b/sites/upsun/config/_default/config.yaml @@ -8,7 +8,7 @@ description: Upsun User Documentation theme: psh-docs themesdir: '../../themes' -uglyurls: true +uglyURLs: false pygmentsUseClasses: true # Language settings From 7f991bc74166b7f665328e8d9c798f6de3a08580 Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 10:22:15 +0200 Subject: [PATCH 3/8] uglyURLs to true --- sites/platform/config/_default/config.yaml | 2 +- sites/upsun/config/_default/config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/platform/config/_default/config.yaml b/sites/platform/config/_default/config.yaml index d92d0027f3..c4aacea07d 100644 --- a/sites/platform/config/_default/config.yaml +++ b/sites/platform/config/_default/config.yaml @@ -10,7 +10,7 @@ themesdir: '../../themes' timeout: 60s -uglyURLs: false +uglyURLs: true pygmentsUseClasses: true # Language settings diff --git a/sites/upsun/config/_default/config.yaml b/sites/upsun/config/_default/config.yaml index 8a1ac9e0ea..c3a64d0ebc 100644 --- a/sites/upsun/config/_default/config.yaml +++ b/sites/upsun/config/_default/config.yaml @@ -8,7 +8,7 @@ description: Upsun User Documentation theme: psh-docs themesdir: '../../themes' -uglyURLs: false +uglyURLs: true pygmentsUseClasses: true # Language settings From d7f44174267dbca1c622c69adf66f0b1d3d3d24a Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 10:45:42 +0200 Subject: [PATCH 4/8] set uglyURLs to false --- sites/platform/config/_default/config.yaml | 2 +- sites/upsun/config/_default/config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/platform/config/_default/config.yaml b/sites/platform/config/_default/config.yaml index c4aacea07d..d92d0027f3 100644 --- a/sites/platform/config/_default/config.yaml +++ b/sites/platform/config/_default/config.yaml @@ -10,7 +10,7 @@ themesdir: '../../themes' timeout: 60s -uglyURLs: true +uglyURLs: false pygmentsUseClasses: true # Language settings diff --git a/sites/upsun/config/_default/config.yaml b/sites/upsun/config/_default/config.yaml index c3a64d0ebc..8a1ac9e0ea 100644 --- a/sites/upsun/config/_default/config.yaml +++ b/sites/upsun/config/_default/config.yaml @@ -8,7 +8,7 @@ description: Upsun User Documentation theme: psh-docs themesdir: '../../themes' -uglyURLs: true +uglyURLs: false pygmentsUseClasses: true # Language settings From aebffd6e165e2efb807b07aef22ed6d440e571a6 Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 11:32:57 +0200 Subject: [PATCH 5/8] new test with redirection for psh --- .platform/applications.yaml | 356 ++++++++++++++++++------------------ 1 file changed, 179 insertions(+), 177 deletions(-) diff --git a/.platform/applications.yaml b/.platform/applications.yaml index e449616ce7..f5d675f3c5 100644 --- a/.platform/applications.yaml +++ b/.platform/applications.yaml @@ -1,182 +1,184 @@ - # The name of this application, which must be unique within a project. - name: 'docs' - - # The type key specifies the language and version for your application. - type: 'nodejs:20' - - # Specify the Hugo version as an env variable. - variables: - env: - HUGOVERSION: 0.139.4 - SITE_DIR: 'sites/platform' - - build: - flavor: none - - source: - root: "/" - - relationships: - search: "search:http" - - # The hooks that will be triggered when the package is deployed. - hooks: - # Build hooks can modify the application files on disk but not access any services like databases. - build: | - set -e - #copy API docs into correct location - # @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api - mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" - if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then - cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" - mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" - cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" - else - echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" - fi - - cd $SITE_DIR - cp ../../themes/psh-docs/postcss.config.js . - npm install - npm run build - ./build_docs.sh - - - - deploy: | - cd $SITE_DIR - ./deploy.sh - bash ./marker.sh "deployed" "${SITE_DIR}" - post_deploy: - cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}" - - # The configuration of the application when it is exposed to the web. - web: - commands: - # Run (404) error - start: cd $SITE_DIR && node index.js - locations: - '/': - # The public directory of the application relative to its root. - root: 'sites/platform/public' - passthru: true - index: ['index.html'] - scripts: false - allow: true - expires: 24h - rules: - \.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$: - expires: 4w - \.md$: - headers: - Content-Type: "text/markdown; charset=UTF-8" - \.txt$: - headers: - Content-Type: "text/plain; charset=UTF-8" - '/api': - root: 'sites/platform/public/api' - index: [ 'index.html' ] - expires: 24h - disk: 1024 - - mounts: - "sites/platform/public/scripts/xss/dist/config": - source: local - source_path: "sites/platform/config" - - size: S + name: 'docs' + # The type key specifies the language and version for your application. + type: 'nodejs:20' + + # Specify the Hugo version as an env variable. + variables: + env: + HUGOVERSION: 0.139.4 + SITE_DIR: 'sites/platform' + + build: + flavor: none + + source: + root: "/" + + relationships: + search: "search:http" + + # The hooks that will be triggered when the package is deployed. + hooks: + # Build hooks can modify the application files on disk but not access any services like databases. + build: | + set -e + #copy API docs into correct location + # @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api + mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" + if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then + cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" + cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" + else + echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" + fi + + cd $SITE_DIR + cp ../../themes/psh-docs/postcss.config.js . + npm install + npm run build + ./build_docs.sh + + + + deploy: | + cd $SITE_DIR + ./deploy.sh + bash ./marker.sh "deployed" "${SITE_DIR}" + post_deploy: + cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}" + + # The configuration of the application when it is exposed to the web. + web: + commands: + # Run (404) error + start: cd $SITE_DIR && node index.js + locations: + '/': + # The public directory of the application relative to its root. + root: 'sites/platform/public' + passthru: true + index: [ 'index.html' ] + scripts: false + allow: true + expires: 24h + rules: + '^/(.*[^/])$': + redirect: '/$1/' + \.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$: + expires: 4w + \.md$: + headers: + Content-Type: "text/markdown; charset=UTF-8" + \.txt$: + headers: + Content-Type: "text/plain; charset=UTF-8" + '/api': + root: 'sites/platform/public/api' + index: [ 'index.html' ] + expires: 24h + disk: 1024 + + mounts: + "sites/platform/public/scripts/xss/dist/config": + source: local + source_path: "sites/platform/config" + + size: S + +- # The name of this application, which must be unique within a project. + name: 'upsun' + + # The type key specifies the language and version for your application. + type: 'nodejs:20' + + # Specify the Hugo version as an env variable. + variables: + env: + HUGOVERSION: 0.139.4 + SITE_DIR: 'sites/upsun' + + build: + flavor: none + + source: + root: "/" + + relationships: + search: "search:http" + + # The hooks that will be triggered when the package is deployed. + hooks: + # Build hooks can modify the application files on disk but not access any services like databases. + build: | + set -e + #copy API docs into correct location + # @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api + mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" + if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then + cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" + mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" + cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" + else + echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" + fi + cd $SITE_DIR + cp ../../themes/psh-docs/postcss.config.js . + npm install + npm run build + ./build_docs.sh + # temporary generation of json version of public regions + ip addresses + # if this is still here after 20250621 ping @gilzow and ask why + cat "${PLATFORM_APP_DIR}/shared/data/regions.yaml" | python3 -c 'import sys,yaml,json; print(json.dumps(yaml.safe_load(str(sys.stdin.read()))))' | jq '[.. | objects | .outbound_ips? // empty] | add' > "${PLATFORM_APP_DIR}/${SITE_DIR}/public/outbound_ips.json" + + deploy: | + cd $SITE_DIR + ./deploy.sh + bash ./marker.sh "deployed" "${SITE_DIR}" + post_deploy: + cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}" + # The configuration of the application when it is exposed to the web. + web: + commands: + # Run (404) error + start: cd $SITE_DIR && node index.js + locations: + '/': + # The public directory of the application relative to its root. + root: 'sites/upsun/public' + passthru: true + index: [ 'index.html' ] + scripts: false + allow: true + expires: 24h + rules: + \.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$: + expires: 4w + \.md$: + headers: + Content-Type: "text/markdown; charset=UTF-8" + \.txt$: + headers: + Content-Type: "text/plain; charset=UTF-8" + '^/favicon.ico$': + allow: true + passthru: '/images/favicon.ico' + '/api': + root: 'sites/upsun/public/api' + index: [ 'index.html' ] + expires: 24h + + disk: 1024 + + mounts: + "sites/upsun/public/scripts/xss/dist/config": + source: local + source_path: "sites/upsun/config" + + size: S - # The name of this application, which must be unique within a project. - name: 'upsun' - - # The type key specifies the language and version for your application. - type: 'nodejs:20' - - # Specify the Hugo version as an env variable. - variables: - env: - HUGOVERSION: 0.139.4 - SITE_DIR: 'sites/upsun' - - build: - flavor: none - - source: - root: "/" - - relationships: - search: "search:http" - - # The hooks that will be triggered when the package is deployed. - hooks: - # Build hooks can modify the application files on disk but not access any services like databases. - build: | - set -e - #copy API docs into correct location - # @todo once api docs are fully moved we can alter the template.hbs file so style.css can be in /api - mkdir -p "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles" - if [ -f "${PLATFORM_APP_DIR}/shared/pages/api.html" ]; then - cp -a "${PLATFORM_APP_DIR}/shared/pages/." "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/" - mv "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/api.html" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" - cp "${PLATFORM_APP_DIR}/shared/pages/api-style.css" "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/styles/style.css" - else - echo "

Currently under maintenance. Please check back later.

" >> "${PLATFORM_APP_DIR}/${SITE_DIR}/public/api/index.html" - fi - cd $SITE_DIR - cp ../../themes/psh-docs/postcss.config.js . - npm install - npm run build - ./build_docs.sh - # temporary generation of json version of public regions + ip addresses - # if this is still here after 20250621 ping @gilzow and ask why - cat "${PLATFORM_APP_DIR}/shared/data/regions.yaml" | python3 -c 'import sys,yaml,json; print(json.dumps(yaml.safe_load(str(sys.stdin.read()))))' | jq '[.. | objects | .outbound_ips? // empty] | add' > "${PLATFORM_APP_DIR}/${SITE_DIR}/public/outbound_ips.json" - - deploy: | - cd $SITE_DIR - ./deploy.sh - bash ./marker.sh "deployed" "${SITE_DIR}" - post_deploy: - cd $SITE_DIR && bash ./marker.sh "post_deploy" "${SITE_DIR}" - # The configuration of the application when it is exposed to the web. - web: - commands: - # Run (404) error - start: cd $SITE_DIR && node index.js - locations: - '/': - # The public directory of the application relative to its root. - root: 'sites/upsun/public' - passthru: true - index: ['index.html'] - scripts: false - allow: true - expires: 24h - rules: - \.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$: - expires: 4w - \.md$: - headers: - Content-Type: "text/markdown; charset=UTF-8" - \.txt$: - headers: - Content-Type: "text/plain; charset=UTF-8" - '^/favicon.ico$': - allow: true - passthru: '/images/favicon.ico' - '/api': - root: 'sites/upsun/public/api' - index: [ 'index.html' ] - expires: 24h - - disk: 1024 - - mounts: - "sites/upsun/public/scripts/xss/dist/config": - source: local - source_path: "sites/upsun/config" - - size: S -- name: redirectionio-upsun source: root: upsun-redirectionio @@ -210,7 +212,7 @@ source: local source_path: log -- +- # The name of this application, which must be unique within a project. name: redirectionio-psh source: root: psh-redirectionio From b18bdb19bbeb51a280be0c164ccedb7cba24faed Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 11:38:00 +0200 Subject: [PATCH 6/8] remove redirect rules (wrong) --- .platform/applications.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.platform/applications.yaml b/.platform/applications.yaml index f5d675f3c5..bea3bc6d07 100644 --- a/.platform/applications.yaml +++ b/.platform/applications.yaml @@ -65,8 +65,6 @@ allow: true expires: 24h rules: - '^/(.*[^/])$': - redirect: '/$1/' \.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|yaml|ico|svg?|cast|mp4|json|yaml|svg?|ttf)$: expires: 4w \.md$: From b1066fd510cf6ba0c6f7bde9e648bd6b18018795 Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 12:09:36 +0200 Subject: [PATCH 7/8] serving directly upsun/platform app (avoid hiting redirection.io) --- .platform/routes.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.platform/routes.yaml b/.platform/routes.yaml index 003e393d1c..9717659f5a 100644 --- a/.platform/routes.yaml +++ b/.platform/routes.yaml @@ -1,6 +1,6 @@ https://{default}/: type: upstream - upstream: redirectionio-psh:http + upstream: platform:http id: platformsh primary: true cache: @@ -291,7 +291,7 @@ https://{default}/: https://docs.upsun.com/: type: upstream - upstream: 'redirectionio-upsun:http' + upstream: 'upsun:http' id: upsun cache: enabled: true From 941303f5972a3e8e500e9c6520a1be1b33076398 Mon Sep 17 00:00:00 2001 From: Florent Huck Date: Mon, 18 Aug 2025 12:10:29 +0200 Subject: [PATCH 8/8] serving directly upsun/platform app (avoid hiting redirection.io) --- .platform/routes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.platform/routes.yaml b/.platform/routes.yaml index 9717659f5a..1ae9969a84 100644 --- a/.platform/routes.yaml +++ b/.platform/routes.yaml @@ -1,6 +1,6 @@ https://{default}/: type: upstream - upstream: platform:http + upstream: docs:http id: platformsh primary: true cache: