-
Notifications
You must be signed in to change notification settings - Fork 11
bugfix: Upgrade to Saleor App SDK v1.3.0 and improve APL configuration #28
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
base: main
Are you sure you want to change the base?
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,115 @@ | ||
| # Saleor App Configuration | ||
| # ======================== | ||
|
|
||
| # Required: Secret key for encrypting metadata (generate a random 32+ character string) | ||
| # Used by EncryptedMetadataManager for securing app configuration data | ||
| SECRET_KEY=your-secret-key-here-minimum-32-characters | ||
|
|
||
| # APL (Auth Persistence Layer) Configuration | ||
| # ========================================== | ||
|
|
||
| # APL Type: Choose one of "file", "upstash", or "rest" | ||
| # - "file": Single tenant, local development (default) | ||
| # - "upstash": Multi-tenant, production ready | ||
| # - "rest": Saleor Cloud APL | ||
| APL=file | ||
|
|
||
| # For APL type "rest" (Saleor Cloud): | ||
| # REST_APL_ENDPOINT=https://your-saleor-cloud-instance.saleor.cloud/graphql/ | ||
| # REST_APL_TOKEN=your-saleor-cloud-token | ||
|
|
||
| # For APL type "upstash": | ||
| # UPSTASH_REDIS_REST_URL=your-upstash-redis-url | ||
| # UPSTASH_REDIS_REST_TOKEN=your-upstash-redis-token | ||
|
|
||
| # App URLs and Base Configuration | ||
| # =============================== | ||
|
|
||
| # Base URL for your app (used for manifest and webhooks) | ||
| # In development, this is typically http://localhost:3000 | ||
| # In production, this should be your deployed app URL | ||
| APP_BASE_URL=http://localhost:3000 | ||
|
|
||
| # Optional: Override iframe base URL (for embedded app interface) | ||
| # If not set, uses APP_BASE_URL | ||
| APP_IFRAME_BASE_URL=http://localhost:3000 | ||
|
|
||
| # Optional: Override API base URL (for webhooks and API endpoints) | ||
| # If not set, uses APP_BASE_URL | ||
| APP_API_BASE_URL=http://localhost:3000 | ||
|
|
||
| # Domain Security | ||
| # =============== | ||
|
|
||
| # Optional: Regex pattern to restrict which Saleor instances can install this app | ||
| # Example: ".*\\.saleor\\.cloud$" to only allow Saleor Cloud instances | ||
| # If not set, all domains are allowed | ||
| ALLOWED_DOMAIN_PATTERN= | ||
|
|
||
| # Server Configuration | ||
| # ==================== | ||
|
|
||
| # Port for the development server (default: 3000) | ||
| PORT=3000 | ||
|
|
||
| # Vercel deployment URL (automatically set by Vercel) | ||
| # VERCEL_URL=https://your-app.vercel.app | ||
|
|
||
| # Logging Configuration | ||
| # ==================== | ||
|
|
||
| # Log level: debug, info, warn, error (default: info) | ||
| APP_LOG_LEVEL=info | ||
|
|
||
| # OpenTelemetry Configuration (optional) | ||
| # ===================================== | ||
|
|
||
| # Enable OpenTelemetry logging (true/false) | ||
| OTEL_ENABLED=false | ||
|
|
||
| # Service name for OpenTelemetry | ||
| OTEL_SERVICE_NAME=saleor-invoice-app | ||
|
|
||
| # CI/CD Environment | ||
| # ================= | ||
|
|
||
| # Set to "true" when running in CI/CD environment | ||
| CI=false | ||
|
|
||
| # File Storage Configuration | ||
| # ========================== | ||
|
|
||
| # Directory for temporary PDF storage (default: auto-generated temp directory) | ||
| # Ensure this directory is writable by the application | ||
| TEMP_PDF_STORAGE_DIR= | ||
|
|
||
| # Saleor Cloud Migration Scripts (optional) | ||
| # ========================================= | ||
|
|
||
| # Required for running migration scripts with Saleor Cloud APL | ||
| # SALEOR_CLOUD_TOKEN=your-saleor-cloud-token | ||
| # SALEOR_CLOUD_RESOURCE_URL=https://your-saleor-cloud-instance.saleor.cloud/graphql/ | ||
|
|
||
| # Development Notes: | ||
| # ================== | ||
| # | ||
| # 1. For local development, you only need: | ||
| # - SECRET_KEY (required) | ||
| # - APP_BASE_URL (optional, defaults to http://localhost:3000) | ||
| # - APL=file (default) | ||
|
Comment on lines
+96
to
+99
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: I think if we only need these 3 we should probably have only these variables commented out, rest should be commented to avoid accidentaly using them |
||
| # | ||
| # 2. For production deployment: | ||
| # - Set APL to "upstash" or "rest" | ||
| # - Configure the corresponding APL environment variables | ||
| # - Set APP_BASE_URL to your production URL | ||
| # - Ensure SECRET_KEY is a strong, random string | ||
| # | ||
| # 3. For Saleor Cloud deployment: | ||
| # - Set APL=rest | ||
| # - Configure REST_APL_ENDPOINT and REST_APL_TOKEN | ||
| # - Set SALEOR_CLOUD_TOKEN and SALEOR_CLOUD_RESOURCE_URL for migrations | ||
|
Comment on lines
+107
to
+110
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: could you please remove this part? 🙏🏻 we don't need instructions for Saleor Cloud deployment in example 😉 |
||
| # | ||
| # 4. Security considerations: | ||
| # - Never commit SECRET_KEY to version control | ||
| # - Use strong, random values for all tokens | ||
| # - Restrict ALLOWED_DOMAIN_PATTERN in production | ||
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.
suggestion: These are actually not required to run the app. It's used when you need to have app work with Saleor running in a Docker container for example
It's described here in our docs: https://docs.saleor.io/developer/extending/apps/local-app-development#apps-url-overriding
I'm worried this description suggests you must provide this, which would be incorrect: it's used only for development, if you would use these env variables on production app it wouldn't have any multitenancy, since it would always try to connect to the same Saleor instance.