Sync Upsun skill with latest configuration guidance (a38676782c33)#22
Sync Upsun skill with latest configuration guidance (a38676782c33)#22ganeshdipdumbare wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Automated sync updating the Upsun skill’s configuration reference docs to match the internal guidance source, adding cross-links and introducing/refreshing per-language/framework reference pages under references/config/.
Changes:
- Expanded
references/config.mdwith composable image guidance and links to per-language/framework reference files. - Added 28 new per-language/framework reference files under
references/config/(Node/Vite/Vue/React/Next/Nuxt, PHP frameworks, Python frameworks, Go frameworks, Ruby frameworks, CMS tools, and static-site generators).
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/upsun/skills/upsun/references/config.md | Core configuration reference updates (hooks, .environment, composable images, and links to per-framework docs). |
| plugins/upsun/skills/upsun/references/config/directus.md | Directus Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/django.md | Django Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/drupal.md | Drupal Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/echo.md | Echo (Go) Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/express.md | Express Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/flask.md | Flask Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/gatsby.md | Gatsby Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/gin.md | Gin (Go) Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/go.md | General Go Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/hugo.md | Hugo Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/jekyll.md | Jekyll Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/js.md | General Node.js Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/laravel.md | Laravel Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/nextjs.md | Next.js Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/nuxt.md | Nuxt Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/php.md | General PHP Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/python.md | General Python Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/rails.md | Rails Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/reactjs.md | React (static) Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/ruby.md | General Ruby Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/sinatra.md | Sinatra Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/static.md | Static sites Upsun configuration reference (incl. composable images). |
| plugins/upsun/skills/upsun/references/config/strapi.md | Strapi Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/sylius.md | Sylius Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/symfony.md | Symfony Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/vite.md | Vite Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/vuejs.md | Vue.js Upsun configuration reference. |
| plugins/upsun/skills/upsun/references/config/wordpress.md | WordPress Upsun configuration reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NODE_ENV=production | ||
| DATABASE_CLIENT=postgres | ||
| APP_KEYS=$PLATFORM_PROJECT_ENTROPY | ||
| API_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY | ||
| ADMIN_JWT_SECRET=$PLATFORM_PROJECT_ENTROPY | ||
| TRANSFER_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY | ||
| JWT_SECRET=$PLATFORM_PROJECT_ENTROPY |
There was a problem hiding this comment.
The .environment file is described as a shell script sourced at runtime; lines like NODE_ENV=production won’t be exported to the app process unless they use export .... Update the heredoc to emit export statements (or otherwise ensure these variables are in the process environment).
| NODE_ENV=production | |
| DATABASE_CLIENT=postgres | |
| APP_KEYS=$PLATFORM_PROJECT_ENTROPY | |
| API_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY | |
| ADMIN_JWT_SECRET=$PLATFORM_PROJECT_ENTROPY | |
| TRANSFER_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY | |
| JWT_SECRET=$PLATFORM_PROJECT_ENTROPY | |
| export NODE_ENV=production | |
| export DATABASE_CLIENT=postgres | |
| export APP_KEYS=$PLATFORM_PROJECT_ENTROPY | |
| export API_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY | |
| export ADMIN_JWT_SECRET=$PLATFORM_PROJECT_ENTROPY | |
| export TRANSFER_TOKEN_SALT=$PLATFORM_PROJECT_ENTROPY | |
| export JWT_SECRET=$PLATFORM_PROJECT_ENTROPY |
| build: | | ||
| set -ex | ||
| npm ci --omit=dev | ||
| npm run build | ||
|
|
There was a problem hiding this comment.
Using npm ci --omit=dev and then running npm run build will fail for many Vue/Vite projects because build tooling (e.g., Vite) is typically in devDependencies and will be omitted. Install dev dependencies for the build step (e.g., npm ci), and optionally prune dev deps after the build if you need to reduce runtime footprint.
| hooks: | ||
| build: | | ||
| set -ex | ||
| npm ci --omit=dev | ||
| npm run build | ||
|
|
There was a problem hiding this comment.
Using npm ci --omit=dev and then running npm run build will fail for typical Vite apps because Vite is usually a devDependency. Install dev dependencies for the build, and prune afterwards only if needed.
| hooks: | ||
| build: | | ||
| set -ex | ||
| # Use a production install and build the static site | ||
| npm install --omit=dev | ||
| npm run build | ||
|
|
There was a problem hiding this comment.
npm install --omit=dev followed by npm run build is likely to omit Gatsby itself (often a devDependency) and break builds. Prefer installing dev dependencies during build (e.g., npm ci) and prune afterwards only if you need to shrink runtime.
| cat > .environment <<EOF | ||
| CACHE_ENABLED=true | ||
| CACHE_STORE=redis | ||
| REDIS_HOST=$REDIS_HOST | ||
| REDIS_PORT=$REDIS_PORT | ||
| RATE_LIMITER_ENABLED=true | ||
| RATE_LIMITER_STORE=redis | ||
| RATE_LIMITER_REDIS_HOST=$REDIS_HOST | ||
| RATE_LIMITER_REDIS_PORT=$REDIS_PORT | ||
| KEY=$PLATFORM_PROJECT_ENTROPY | ||
| SECRET=$PLATFORM_PROJECT_ENTROPY |
There was a problem hiding this comment.
The build hook writes .environment using an unquoted heredoc, so $REDIS_HOST/$REDIS_PORT will be expanded during the build phase (when relationship variables are not available) and end up empty at runtime. Write these lines in a way that defers expansion to runtime (e.g., quote the heredoc delimiter or escape $), and ensure variables meant for the app process are exported in .environment.
| cat > .environment <<EOF | |
| CACHE_ENABLED=true | |
| CACHE_STORE=redis | |
| REDIS_HOST=$REDIS_HOST | |
| REDIS_PORT=$REDIS_PORT | |
| RATE_LIMITER_ENABLED=true | |
| RATE_LIMITER_STORE=redis | |
| RATE_LIMITER_REDIS_HOST=$REDIS_HOST | |
| RATE_LIMITER_REDIS_PORT=$REDIS_PORT | |
| KEY=$PLATFORM_PROJECT_ENTROPY | |
| SECRET=$PLATFORM_PROJECT_ENTROPY | |
| cat > .environment <<'EOF' | |
| export CACHE_ENABLED=true | |
| export CACHE_STORE=redis | |
| export REDIS_HOST=$REDIS_HOST | |
| export REDIS_PORT=$REDIS_PORT | |
| export RATE_LIMITER_ENABLED=true | |
| export RATE_LIMITER_STORE=redis | |
| export RATE_LIMITER_REDIS_HOST=$REDIS_HOST | |
| export RATE_LIMITER_REDIS_PORT=$REDIS_PORT | |
| export KEY=$PLATFORM_PROJECT_ENTROPY | |
| export SECRET=$PLATFORM_PROJECT_ENTROPY |
| ## Managed services (common) | ||
|
|
||
| Example minimal service definitions (image tags use current registry versions): | ||
|
|
||
| ```yaml | ||
| services: | ||
| - name: postgres | ||
| image: postgres:16 | ||
| env: | ||
| POSTGRES_USER: app | ||
| POSTGRES_PASSWORD: secret | ||
| POSTGRES_DB: app_db | ||
|
|
||
| - name: redis | ||
| image: redis:7.4 | ||
| ``` |
There was a problem hiding this comment.
The “Managed services” snippet uses a Docker/compose-style image: format, which doesn’t match Upsun’s services: <name>: { type: ... } configuration. Since this file is an Upsun config reference, consider rewriting that section using Upsun service definitions and relationship env var conventions to avoid confusion.
| export ADMIN_EMAIL='admin@example.com' | ||
| export ADMIN_PASSWORD='password' |
There was a problem hiding this comment.
This example bootstraps Directus with hard-coded admin credentials (admin@example.com / password). Even as guidance, this is likely to be copy-pasted into production and creates an immediate account-takeover risk. Prefer reading admin email/password from Upsun variables/secrets (or omit the bootstrap credential values and instruct the user to set them explicitly).
| export ADMIN_EMAIL='admin@example.com' | |
| export ADMIN_PASSWORD='password' | |
| : "${ADMIN_EMAIL:?Set ADMIN_EMAIL as an Upsun environment variable or secret before first deploy}" | |
| : "${ADMIN_PASSWORD:?Set ADMIN_PASSWORD as an Upsun environment variable or secret before first deploy}" | |
| export ADMIN_EMAIL ADMIN_PASSWORD |
| fi | ||
|
|
||
| # Configure Django settings for Upsun | ||
| export settings_dir=$(basename "$(dirname "$(find . -Maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")") |
There was a problem hiding this comment.
find uses -Maxdepth here, but the POSIX/GNU option is -maxdepth (lowercase). As written, settings_dir will be empty and the settings auto-configuration block won’t run.
| export settings_dir=$(basename "$(dirname "$(find . -Maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")") | |
| export settings_dir=$(basename "$(dirname "$(find . -maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")") |
| echo >> "$settings_dir"/settings.py "\n# Upsun configuration" | ||
| echo >> "$settings_dir"/settings.py 'ALLOWED_HOSTS = ["*"]' |
There was a problem hiding this comment.
The build hook appends ALLOWED_HOSTS = ["*"] to settings.py, which disables host header validation and is unsafe for production. Prefer deriving the allowed host(s) from the primary route at runtime, or setting a narrow default and instructing users to configure it explicitly.
| echo >> "$settings_dir"/settings.py "\n# Upsun configuration" | |
| echo >> "$settings_dir"/settings.py 'ALLOWED_HOSTS = ["*"]' | |
| cat >> "$settings_dir"/settings.py <<'EOF' | |
| # Upsun configuration | |
| import base64 | |
| import json | |
| import os | |
| def _upsun_allowed_hosts(): | |
| routes = os.environ.get("PLATFORM_ROUTES") | |
| if not routes: | |
| return ["localhost", "127.0.0.1", "[::1]"] | |
| try: | |
| decoded = base64.b64decode(routes).decode("utf-8") | |
| route_map = json.loads(decoded) | |
| except Exception: | |
| return ["localhost", "127.0.0.1", "[::1]"] | |
| hosts = [] | |
| for url in route_map.keys(): | |
| try: | |
| host = url.split("://", 1)[1].split("/", 1)[0] | |
| if host: | |
| hosts.append(host) | |
| except Exception: | |
| continue | |
| return hosts or ["localhost", "127.0.0.1", "[::1]"] | |
| ALLOWED_HOSTS = _upsun_allowed_hosts() | |
| EOF |
| /wp/wp-content/cache: | ||
| root: web/wp/wp-content/cache | ||
| scripts: false | ||
| allow: false | ||
| /wp/wp-content/uploads: | ||
| root: web/app/uploads | ||
| scripts: false | ||
| allow: false | ||
| rules: | ||
| '(?<!\-lock)\.(?i:jpe?g|gif|png|svg|bmp|ico|css|js(?:on)?|eot|ttf|woff|woff2|pdf|docx?|xlsx?|pp[st]x?|psd|odt|key|mp[2-5g]|m4[av]|og[gv]|wav|mov|wm[av]|avi|3g[p2])$': | ||
| allow: true | ||
| expires: 1w | ||
|
|
||
| mounts: | ||
| web/app/wp-content/cache: | ||
| source: tmp | ||
| web/app/uploads: | ||
| source: storage |
There was a problem hiding this comment.
The WordPress cache location root (web/wp/wp-content/cache) doesn’t match the cache mount path (web/app/wp-content/cache). As written, the cache directory served/blocked by the web location won’t be the same directory that’s writable/mounted. Align the web.locations roots with the mounts paths for the chosen variant (Bedrock vs standard) to avoid runtime write failures and misconfigured access rules.
Automated sync of the Upsun skill with configuration guidance in the internal
platformsh/airepository.Signature:
a38676782c33Rationale (from the generator): 28 reference file(s) generated/updated (0 NO_UPDATES/errors); core: Add cross-links to all per-language/framework reference files and clarify composable image note; keep existing core concepts and examples intact.
Provenance — each output is regenerated from the listed source(s):
plugins/upsun/skills/upsun/references/config.mdprompts/genconf/text/00-instructions.md.jinja,prompts/genconf/text/01-reference.md.jinja,prompts/genconf/text/02-composable-image.md.jinja,prompts/genconf/text/03-registry.md.jinja,prompts/genconf/text/04-source-info.md.jinja,prompts/genconf/text/06-retrieved.md.jinja,prompts/genconf/text/correction.md.jinjaplugins/upsun/skills/upsun/references/config/directus.mdguides/per-result/directus.md.jinjaplugins/upsun/skills/upsun/references/config/django.mdguides/per-result/django.md.jinjaplugins/upsun/skills/upsun/references/config/drupal.mdguides/per-result/drupal.md.jinjaplugins/upsun/skills/upsun/references/config/echo.mdguides/per-result/echo.md.jinjaplugins/upsun/skills/upsun/references/config/express.mdguides/per-result/express.md.jinjaplugins/upsun/skills/upsun/references/config/flask.mdguides/per-result/flask.md.jinjaplugins/upsun/skills/upsun/references/config/gatsby.mdguides/per-result/gatsby.md.jinjaplugins/upsun/skills/upsun/references/config/gin.mdguides/per-result/gin.md.jinjaplugins/upsun/skills/upsun/references/config/go.mdguides/per-group/go.md.jinjaplugins/upsun/skills/upsun/references/config/hugo.mdguides/per-result/hugo.md.jinjaplugins/upsun/skills/upsun/references/config/jekyll.mdguides/per-result/jekyll.md.jinjaplugins/upsun/skills/upsun/references/config/js.mdguides/per-group/js.md.jinjaplugins/upsun/skills/upsun/references/config/laravel.mdguides/per-result/laravel.md.jinjaplugins/upsun/skills/upsun/references/config/nextjs.mdguides/per-result/nextjs.md.jinjaplugins/upsun/skills/upsun/references/config/nuxt.mdguides/per-result/nuxt.md.jinjaplugins/upsun/skills/upsun/references/config/php.mdguides/per-group/php.md.jinjaplugins/upsun/skills/upsun/references/config/python.mdguides/per-group/python.md.jinjaplugins/upsun/skills/upsun/references/config/rails.mdguides/per-result/rails.md.jinjaplugins/upsun/skills/upsun/references/config/reactjs.mdguides/per-result/reactjs.md.jinjaplugins/upsun/skills/upsun/references/config/ruby.mdguides/per-group/ruby.md.jinjaplugins/upsun/skills/upsun/references/config/sinatra.mdguides/per-result/sinatra.md.jinjaplugins/upsun/skills/upsun/references/config/static.mdguides/per-group/static.md.jinjaplugins/upsun/skills/upsun/references/config/strapi.mdguides/per-result/strapi.md.jinjaplugins/upsun/skills/upsun/references/config/sylius.mdguides/per-result/sylius.md.jinjaplugins/upsun/skills/upsun/references/config/symfony.mdguides/per-result/symfony.md.jinjaplugins/upsun/skills/upsun/references/config/vite.mdguides/per-result/vite.md.jinjaplugins/upsun/skills/upsun/references/config/vuejs.mdguides/per-result/vuejs.md.jinjaplugins/upsun/skills/upsun/references/config/wordpress.mdguides/per-result/wordpress.md.jinjaSource locations in
platformsh/ai:prompts/genconf/text/*.md.jinja— cross-cutting templates (feed SKILL.md + references/config.md).guides/per-group/<lang>.md.jinja— per-language references.guides/per-result/<framework>.md.jinja— per-framework references.This PR was opened automatically. Please review for voice and accuracy before merging — the generator may occasionally over-reach. If the changes aren't wanted, close the PR; a subsequent run will open a FRESH PR on a new branch (the closed PR stays closed). A new PR will also be opened automatically when the source guidance changes or when upstream drifts.