Add docker envs
This commit is contained in:
parent
04cf93ca22
commit
5b576fa8d3
31 changed files with 224 additions and 86 deletions
15
.changeset/spicy-eels-hear.md
Normal file
15
.changeset/spicy-eels-hear.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
"saleor-app-emails-and-messages": minor
|
||||
"saleor-app-data-importer": minor
|
||||
"saleor-app-products-feed": minor
|
||||
"saleor-app-monitoring": minor
|
||||
"saleor-app-invoices": minor
|
||||
"saleor-app-klaviyo": minor
|
||||
"saleor-app-search": minor
|
||||
"saleor-app-slack": minor
|
||||
"saleor-app-taxes": minor
|
||||
"saleor-app-cms": minor
|
||||
"saleor-app-crm": minor
|
||||
---
|
||||
|
||||
Added additional ENV variables (see each app's .env.example), that can overwrite app base URL. This change allows easy apps development using Docker
|
|
@ -8,3 +8,10 @@ REST_APL_ENDPOINT=
|
|||
REST_APL_TOKEN=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -8,19 +8,22 @@ import { productVariantDeletedWebhook } from "./webhooks/product-variant-deleted
|
|||
import { productUpdatedWebhook } from "./webhooks/product-updated";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "CMS",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: ["MANAGE_PRODUCTS"],
|
||||
id: "saleor.app.cms",
|
||||
version: packageJson.version,
|
||||
webhooks: [
|
||||
productVariantCreatedWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
productVariantUpdatedWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
productVariantDeletedWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
productUpdatedWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
productVariantCreatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
productVariantUpdatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
productVariantDeletedWebhook.getWebhookManifest(apiBaseURL),
|
||||
productUpdatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
],
|
||||
extensions: [],
|
||||
author: "Saleor Commerce",
|
||||
|
@ -29,7 +32,7 @@ export default createManifestHandler({
|
|||
dataPrivacyUrl: "https://saleor.io/legal/privacy/",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
"SENTRY_PROJECT",
|
||||
"SENTRY_ORG",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"SENTRY_ENVIRONMENT"
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,4 +9,11 @@ REST_APL_TOKEN=
|
|||
MAILCHIMP_CLIENT_ID=
|
||||
MAILCHIMP_CLIENT_SECRET=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -6,11 +6,14 @@ import { customerCreatedWebhook } from "./webhooks/customer-created";
|
|||
import { customerMetadataUpdatedWebhook } from "./webhooks/customer-updated";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "CRM",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: [
|
||||
"MANAGE_USERS",
|
||||
/**
|
||||
|
@ -21,8 +24,8 @@ export default createManifestHandler({
|
|||
id: "saleor.app.crm",
|
||||
version: packageJson.version,
|
||||
webhooks: [
|
||||
customerCreatedWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
customerMetadataUpdatedWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
customerCreatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
customerMetadataUpdatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
],
|
||||
extensions: [
|
||||
/**
|
||||
|
@ -36,7 +39,7 @@ export default createManifestHandler({
|
|||
author: "Saleor Commerce",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
"SENTRY_PROJECT",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"SENTRY_ORG",
|
||||
"SENTRY_ENVIRONMENT"
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,4 +2,11 @@
|
|||
NEXT_PUBLIC_NUVO_LICENSE_KEY=
|
||||
NEXT_PUBLIC_NUVO_PROD_MODE=false
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -4,11 +4,14 @@ import { AppManifest } from "@saleor/app-sdk/types";
|
|||
import packageJson from "../../../package.json";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Data Importer",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: ["MANAGE_USERS"],
|
||||
id: "saleor.app.data-importer",
|
||||
version: packageJson.version,
|
||||
|
@ -31,7 +34,7 @@ export default createManifestHandler({
|
|||
author: "Saleor Commerce",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
"SENTRY_ORG",
|
||||
"SENTRY_DSN",
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"NEXT_PUBLIC_SENTRY_DSN"
|
||||
"NEXT_PUBLIC_SENTRY_DSN",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,11 @@ APL=
|
|||
REST_APL_ENDPOINT=
|
||||
REST_APL_TOKEN=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -4,11 +4,14 @@ import { AppManifest } from "@saleor/app-sdk/types";
|
|||
import packageJson from "../../../package.json";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Emails & Messages",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: ["MANAGE_ORDERS", "MANAGE_USERS"],
|
||||
id: "saleor.app.emails-and-messages",
|
||||
version: packageJson.version,
|
||||
|
@ -28,7 +31,7 @@ export default createManifestHandler({
|
|||
requiredSaleorVersion: ">=3.10 <4",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
"SENTRY_DSN",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"NEXT_PUBLIC_SENTRY_DSN",
|
||||
"SENTRY_ENVIRONMENT"
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,4 +8,11 @@ APP_LOG_LEVEL=info
|
|||
# See api/register.tsx
|
||||
# Leave empty to allow all domains
|
||||
# Example: "https:\/\/.*.saleor.cloud\/graphql\/" to enable Saleor Cloud APIs
|
||||
ALLOWED_DOMAIN_PATTERN=
|
||||
ALLOWED_DOMAIN_PATTERN=
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -6,9 +6,9 @@ import { invoiceRequestedWebhook } from "./webhooks/invoice-requested";
|
|||
import { REQUIRED_SALEOR_VERSION } from "../../saleor-app";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? context.appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? context.appBaseUrl;
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Invoices",
|
||||
|
|
|
@ -8,4 +8,11 @@ ALLOWED_DOMAIN_PATTERN=
|
|||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -11,18 +11,21 @@ const handler = createManifestHandler({
|
|||
async manifestFactory(context): Promise<AppManifest> {
|
||||
const { appBaseUrl } = context;
|
||||
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
return {
|
||||
id: "saleor.app.klaviyo",
|
||||
version: pkg.version,
|
||||
name: "Klaviyo",
|
||||
permissions: ["MANAGE_USERS", "MANAGE_ORDERS"],
|
||||
appUrl: appBaseUrl,
|
||||
tokenTargetUrl: `${appBaseUrl}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
webhooks: [
|
||||
customerCreatedWebhook.getWebhookManifest(appBaseUrl),
|
||||
fulfillmentCreatedWebhook.getWebhookManifest(appBaseUrl),
|
||||
orderCreatedWebhook.getWebhookManifest(appBaseUrl),
|
||||
orderFullyPaidWebhook.getWebhookManifest(appBaseUrl),
|
||||
customerCreatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
fulfillmentCreatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
orderCreatedWebhook.getWebhookManifest(apiBaseURL),
|
||||
orderFullyPaidWebhook.getWebhookManifest(apiBaseURL),
|
||||
],
|
||||
supportUrl: "https://github.com/saleor/apps/discussions",
|
||||
homepageUrl: "https://github.com/saleor/apps",
|
||||
|
@ -30,7 +33,7 @@ const handler = createManifestHandler({
|
|||
author: "Saleor Commerce",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
"SENTRY_PROJECT",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"NEXT_PUBLIC_VERCEL_ENV",
|
||||
"SENTRY_ENVIRONMENT"
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1,8 @@
|
|||
MONITORING_APP_API_URL=
|
||||
MONITORING_APP_API_URL=
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -18,7 +18,9 @@
|
|||
"SENTRY_PROJECT",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"NEXT_PUBLIC_VERCEL_ENV",
|
||||
"MONITORING_APP_API_URL"
|
||||
"MONITORING_APP_API_URL",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +1,18 @@
|
|||
APP_DEBUG=info
|
||||
APL=file
|
||||
# Optional
|
||||
# Regex pattern consumed conditionally to restrcit app installation to specific urls.
|
||||
# See api/register.tsx
|
||||
# Leave empty to allow all domains
|
||||
# Example: "https:\/\/.*.saleor.cloud\/graphql\/" to enable Saleor Cloud APIs
|
||||
ALLOWED_DOMAIN_PATTERN=
|
||||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -9,9 +9,9 @@ import { webhookProductVariantDeleted } from "./webhooks/product_variant_deleted
|
|||
import { webhookProductVariantUpdated } from "./webhooks/product_variant_updated";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? context.appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? context.appBaseUrl;
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Product Feed",
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -10,11 +10,14 @@ import { webhookProductVariantDeleted } from "./webhooks/saleor/product_variant_
|
|||
import { webhookProductVariantUpdated } from "./webhooks/saleor/product_variant_updated";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Search",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: [
|
||||
/**
|
||||
* Set permissions for app if needed
|
||||
|
@ -31,12 +34,12 @@ export default createManifestHandler({
|
|||
* Read more
|
||||
* https://docs.saleor.io/docs/3.x/developer/api-reference/objects/webhook
|
||||
*/
|
||||
webhookProductCreated.getWebhookManifest(context.appBaseUrl),
|
||||
webhookProductDeleted.getWebhookManifest(context.appBaseUrl),
|
||||
webhookProductUpdated.getWebhookManifest(context.appBaseUrl),
|
||||
webhookProductVariantCreated.getWebhookManifest(context.appBaseUrl),
|
||||
webhookProductVariantDeleted.getWebhookManifest(context.appBaseUrl),
|
||||
webhookProductVariantUpdated.getWebhookManifest(context.appBaseUrl),
|
||||
webhookProductCreated.getWebhookManifest(apiBaseURL),
|
||||
webhookProductDeleted.getWebhookManifest(apiBaseURL),
|
||||
webhookProductUpdated.getWebhookManifest(apiBaseURL),
|
||||
webhookProductVariantCreated.getWebhookManifest(apiBaseURL),
|
||||
webhookProductVariantDeleted.getWebhookManifest(apiBaseURL),
|
||||
webhookProductVariantUpdated.getWebhookManifest(apiBaseURL),
|
||||
],
|
||||
extensions: [
|
||||
/**
|
||||
|
@ -49,7 +52,7 @@ export default createManifestHandler({
|
|||
dataPrivacyUrl: "https://saleor.io/legal/privacy/",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
"SENTRY_ORG",
|
||||
"NEXT_PUBLIC_VERCEL_ENV",
|
||||
"NEXT_PUBLIC_SENTRY_DSN",
|
||||
"SENTRY_ENVIRONMENT"
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -5,15 +5,18 @@ import packageJson from "../../../package.json";
|
|||
import { orderCreatedWebhook } from "./webhooks/order-created";
|
||||
|
||||
const handler = createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Slack",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: ["MANAGE_ORDERS"],
|
||||
id: "saleor.app.slack",
|
||||
version: packageJson.version,
|
||||
webhooks: [orderCreatedWebhook.getWebhookManifest(context.appBaseUrl)],
|
||||
webhooks: [orderCreatedWebhook.getWebhookManifest(apiBaseURL)],
|
||||
extensions: [],
|
||||
author: "Saleor Commerce",
|
||||
supportUrl: "https://github.com/saleor/apps/discussions",
|
||||
|
@ -21,7 +24,7 @@ const handler = createManifestHandler({
|
|||
dataPrivacyUrl: "https://saleor.io/legal/privacy/",
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
"SENTRY_PROJECT",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"NEXT_PUBLIC_VERCEL_ENV"
|
||||
"NEXT_PUBLIC_VERCEL_ENV",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
APL=file
|
||||
|
||||
#"fatal" | "error" | "warn" | "info" | "debug" | "trace"
|
||||
APP_LOG_LEVEL=info
|
||||
NODE_ENV=
|
||||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
PORT=
|
||||
VERCEL_URL=
|
||||
REST_APL_ENDPOINT=
|
||||
REST_APL_TOKEN=
|
||||
ALLOWED_DOMAIN_PATTERN=
|
||||
|
||||
APP_LOG_LEVEL=info
|
||||
|
||||
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
|
||||
# APP_IFRAME_BASE_URL = http://localhost:3000, so Dashboard on host can access iframe
|
||||
# APP_API_BASE_URL=http://host.docker.internal:3000 - so Saleor can reach App running on host, from the container.
|
||||
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
|
||||
APP_IFRAME_BASE_URL=
|
||||
APP_API_BASE_URL=
|
|
@ -9,19 +9,22 @@ import { orderFulfilledAsyncWebhook } from "./webhooks/order-fulfilled";
|
|||
import { REQUIRED_SALEOR_VERSION } from "../../../saleor-app";
|
||||
|
||||
export default createManifestHandler({
|
||||
async manifestFactory(context) {
|
||||
async manifestFactory({ appBaseUrl }) {
|
||||
const iframeBaseUrl = process.env.APP_IFRAME_BASE_URL ?? appBaseUrl;
|
||||
const apiBaseURL = process.env.APP_API_BASE_URL ?? appBaseUrl;
|
||||
|
||||
const manifest: AppManifest = {
|
||||
name: "Taxes",
|
||||
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
|
||||
appUrl: context.appBaseUrl,
|
||||
tokenTargetUrl: `${apiBaseURL}/api/register`,
|
||||
appUrl: iframeBaseUrl,
|
||||
permissions: ["HANDLE_TAXES", "MANAGE_ORDERS"],
|
||||
id: "saleor.app.taxes",
|
||||
version: packageJson.version,
|
||||
webhooks: [
|
||||
orderCalculateTaxesSyncWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
checkoutCalculateTaxesSyncWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
orderCreatedAsyncWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
orderFulfilledAsyncWebhook.getWebhookManifest(context.appBaseUrl),
|
||||
orderCalculateTaxesSyncWebhook.getWebhookManifest(apiBaseURL),
|
||||
checkoutCalculateTaxesSyncWebhook.getWebhookManifest(apiBaseURL),
|
||||
orderCreatedAsyncWebhook.getWebhookManifest(apiBaseURL),
|
||||
orderFulfilledAsyncWebhook.getWebhookManifest(apiBaseURL),
|
||||
],
|
||||
extensions: [],
|
||||
homepageUrl: "https://github.com/saleor/apps",
|
||||
|
@ -31,7 +34,7 @@ export default createManifestHandler({
|
|||
requiredSaleorVersion: REQUIRED_SALEOR_VERSION,
|
||||
brand: {
|
||||
logo: {
|
||||
default: `${context.appBaseUrl}/logo.png`,
|
||||
default: `${apiBaseURL}/logo.png`,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
"SENTRY_DSN",
|
||||
"SENTRY_AUTH_TOKEN",
|
||||
"SENTRY_ENVIRONMENT",
|
||||
"NEXT_PUBLIC_SENTRY_DSN"
|
||||
"NEXT_PUBLIC_SENTRY_DSN",
|
||||
"APP_IFRAME_BASE_URL",
|
||||
"APP_API_BASE_URL"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue