-
Notifications
You must be signed in to change notification settings - Fork 0
Sync Upsun skill with latest configuration guidance (a38676782c33) #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,124 @@ | ||||||||||
| ## Directus Application Configuration | ||||||||||
|
|
||||||||||
| Reference configuration for Directus applications on Upsun. | ||||||||||
|
|
||||||||||
| **Framework Priority**: Use Directus-specific configuration instead of generic Node.js guidance when both apply. | ||||||||||
|
|
||||||||||
| **Minimum Requirements**: Node.js 18+ required for Directus compatibility | ||||||||||
|
|
||||||||||
| ```yaml | ||||||||||
| applications: | ||||||||||
| directus: | ||||||||||
| type: nodejs:22 | ||||||||||
|
|
||||||||||
| build: | ||||||||||
| flavor: none | ||||||||||
|
|
||||||||||
| hooks: | ||||||||||
| build: | | ||||||||||
| set -ex | ||||||||||
| npm install | ||||||||||
| npm run argon2-rebuild | ||||||||||
|
|
||||||||||
| # Create .environment file with dynamic variables | ||||||||||
| 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 | ||||||||||
| EOF | ||||||||||
|
|
||||||||||
| deploy: | | ||||||||||
| set -ex | ||||||||||
| if [ ! -f var/upsun.installed ]; then | ||||||||||
| echo 'Bootstrapping Directus on first deploy...' | ||||||||||
|
|
||||||||||
| export PROJECT_NAME='Directus on Upsun' | ||||||||||
| export ADMIN_EMAIL='admin@example.com' | ||||||||||
| export ADMIN_PASSWORD='password' | ||||||||||
|
Comment on lines
+43
to
+44
|
||||||||||
| export ADMIN_EMAIL='admin@example.com' | |
| export ADMIN_PASSWORD='password' | |
| : "${ADMIN_EMAIL:?Set ADMIN_EMAIL in the environment before first deploy}" | |
| : "${ADMIN_PASSWORD:?Set ADMIN_PASSWORD in the environment before first deploy}" |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relationships entries should bind to a service endpoint (string form), not an empty mapping. The canonical structure in references/config.md uses e.g. relationships: database: 'db:postgresql' (config.md:64). Update this example to use the correct relationship binding for db and redis.
| db: {} | |
| redis: {} | |
| db: 'db:postgresql' | |
| redis: 'redis:redis' |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,93 @@ | ||||||
| ## Django Application Configuration | ||||||
|
|
||||||
| Reference configuration for Django web applications on Upsun. | ||||||
|
|
||||||
| Framework Variants: For Django derivatives (nanodjango, microdjango), adapt management commands accordingly. | ||||||
|
|
||||||
| Example configuration: | ||||||
|
|
||||||
| ```yaml | ||||||
| applications: | ||||||
| site: | ||||||
| type: python:3.13 | ||||||
|
|
||||||
| dependencies: | ||||||
| python3: | ||||||
| uv: '*' | ||||||
|
|
||||||
| hooks: | ||||||
| build: | | ||||||
| set -ex | ||||||
| uv sync --frozen --no-dev --no-managed-python | ||||||
|
|
||||||
| # Auto-detect WSGI module name | ||||||
| export WSGI_NAME=$(basename "$(dirname "$(find . -maxdepth 4 -path './.*' -prune -o -name wsgi.py -print | head -n1)")") | ||||||
| if [ -z "$WSGI_NAME" ]; then | ||||||
| echo >&2 'Failed to find WSGI module name' | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| # Configure Django settings for Upsun | ||||||
| export settings_dir=$(basename "$(dirname "$(find . -maxdepth 4 -path './.*' -prune -o -name settings.py -print | head -n1)")") | ||||||
| if [ -n "$settings_dir" ]; then | ||||||
| echo >> "$settings_dir"/settings.py "\n# Upsun configuration" | ||||||
|
||||||
| echo >> "$settings_dir"/settings.py "\n# Upsun configuration" | |
| printf '\n# Upsun configuration\n' >> "$settings_dir"/settings.py |
Copilot
AI
Apr 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relationships entries should bind to a service endpoint (string form), not an empty mapping. The canonical structure in references/config.md uses e.g. relationships: database: 'db:postgresql' (config.md:64). Update this example to bind db to the db service endpoint.
| db: {} | |
| db: 'db:postgresql' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
.environmentheredoc will expand$REDIS_HOST/$REDIS_PORTat build time, but build hooks don’t have service relationship env vars (so these will be empty). Also, the lines written are notexported, so they won’t reach the Node process. Use a quoted heredoc (to defer expansion to runtime) and writeexport …entries instead (or avoid duplicating REDIS_* entirely and let Directus read the relationship vars directly).