diff --git a/app/client/packages/rts/src/ce/server.ts b/app/client/packages/rts/src/ce/server.ts new file mode 100644 index 000000000000..fadc4b548f38 --- /dev/null +++ b/app/client/packages/rts/src/ce/server.ts @@ -0,0 +1,44 @@ +import http from "http"; +import express from "express"; +import type { LogLevelDesc } from "loglevel"; +import log from "loglevel"; +import { VERSION as buildVersion } from "../version"; // release version of the api + +// routes +import ast_routes from "../routes/ast_routes"; +import dsl_routes from "../routes/dsl_routes"; +import health_check_routes from "../routes/health_check_routes"; + +import { RTS_BASE_API_PATH } from "@constants/routes"; + +// Setting the logLevel for all log messages +const logLevel: LogLevelDesc = (process.env.APPSMITH_LOG_LEVEL || + "debug") as LogLevelDesc; + +log.setLevel(logLevel); + +const APPSMITH_RTS_PORT = process.env.APPSMITH_RTS_PORT || 8091; + +//Disable x-powered-by header to prevent information disclosure +const app = express(); + +app.disable("x-powered-by"); +const server = new http.Server(app); + +// parse incoming json requests +app.use(express.json({ limit: "5mb" })); + +app.use(`${RTS_BASE_API_PATH}/ast`, ast_routes); +app.use(`${RTS_BASE_API_PATH}/dsl`, dsl_routes); +app.use(`${RTS_BASE_API_PATH}`, health_check_routes); + +server.headersTimeout = 61000; +server.keepAliveTimeout = 60000; +// Run the server +server.listen(APPSMITH_RTS_PORT, () => { + log.info( + `RTS version ${buildVersion} running at http://localhost:${APPSMITH_RTS_PORT}`, + ); +}); + +export default server; diff --git a/app/client/packages/rts/src/ee/server.ts b/app/client/packages/rts/src/ee/server.ts new file mode 100644 index 000000000000..4ca75e90ae3e --- /dev/null +++ b/app/client/packages/rts/src/ee/server.ts @@ -0,0 +1 @@ +import "../ce/server.ts"; diff --git a/app/client/packages/rts/src/instrumentation.ts b/app/client/packages/rts/src/instrumentation.ts deleted file mode 100644 index 05769222ee80..000000000000 --- a/app/client/packages/rts/src/instrumentation.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { - BatchSpanProcessor, - NodeTracerProvider, -} from "@opentelemetry/sdk-trace-node"; -import { Resource } from "@opentelemetry/resources"; -import { - ATTR_DEPLOYMENT_NAME, - ATTR_SERVICE_INSTANCE_ID, -} from "@opentelemetry/semantic-conventions/incubating"; -import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions"; -import { registerInstrumentations } from "@opentelemetry/instrumentation"; -import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"; -import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"; - -const APPSMITH_NEW_RELIC_OTEL_EXPORTER_OTLP_ENDPOINT = - process.env.APPSMITH_NEW_RELIC_OTEL_EXPORTER_OTLP_ENDPOINT || - "http://localhost:4318"; - -const provider = new NodeTracerProvider({ - resource: new Resource({ - [ATTR_DEPLOYMENT_NAME]: `${process.env.APPSMITH_DEPLOYMENT_NAME || "self-hosted"}`, - [ATTR_SERVICE_INSTANCE_ID]: `${process.env.HOSTNAME || "appsmith-0"}`, - [ATTR_SERVICE_NAME]: "appsmith-rts", - }), -}); - -const nrTracesExporter = new OTLPTraceExporter({ - url: `${APPSMITH_NEW_RELIC_OTEL_EXPORTER_OTLP_ENDPOINT}/v1/traces`, - headers: { - "api-key": `${process.env.APPSMITH_NEW_RELIC_OTLP_LICENSE_KEY}`, - }, -}); - -registerInstrumentations({ - instrumentations: [new HttpInstrumentation()], -}); - -const batchSpanProcessor = new BatchSpanProcessor( - nrTracesExporter, - //Optional BatchSpanProcessor Configurations - { - // The maximum queue size. After the size is reached spans are dropped. - maxQueueSize: 100, - // The maximum batch size of every export. It must be smaller or equal to maxQueueSize. - maxExportBatchSize: 50, - // The interval between two consecutive exports - scheduledDelayMillis: 500, - // How long the export can run before it is cancelled - exportTimeoutMillis: 30000, - }, -); - -provider.addSpanProcessor(batchSpanProcessor); -provider.register(); diff --git a/app/client/packages/rts/src/server.ts b/app/client/packages/rts/src/server.ts index 665fc6ae69c2..f882c9736e46 100644 --- a/app/client/packages/rts/src/server.ts +++ b/app/client/packages/rts/src/server.ts @@ -1,45 +1 @@ -import "./instrumentation"; -import http from "http"; -import express from "express"; -import type { LogLevelDesc } from "loglevel"; -import log from "loglevel"; -import { VERSION as buildVersion } from "./version"; // release version of the api - -// routes -import ast_routes from "./routes/ast_routes"; -import dsl_routes from "./routes/dsl_routes"; -import health_check_routes from "./routes/health_check_routes"; - -import { RTS_BASE_API_PATH } from "@constants/routes"; - -// Setting the logLevel for all log messages -const logLevel: LogLevelDesc = (process.env.APPSMITH_LOG_LEVEL || - "debug") as LogLevelDesc; - -log.setLevel(logLevel); - -const APPSMITH_RTS_PORT = process.env.APPSMITH_RTS_PORT || 8091; - -//Disable x-powered-by header to prevent information disclosure -const app = express(); - -app.disable("x-powered-by"); -const server = new http.Server(app); - -// parse incoming json requests -app.use(express.json({ limit: "5mb" })); - -app.use(`${RTS_BASE_API_PATH}/ast`, ast_routes); -app.use(`${RTS_BASE_API_PATH}/dsl`, dsl_routes); -app.use(`${RTS_BASE_API_PATH}`, health_check_routes); - -server.headersTimeout = 61000; -server.keepAliveTimeout = 60000; -// Run the server -server.listen(APPSMITH_RTS_PORT, () => { - log.info( - `RTS version ${buildVersion} running at http://localhost:${APPSMITH_RTS_PORT}`, - ); -}); - -export default server; +import "./ee/server.ts"; diff --git a/app/client/packages/rts/src/test/server.test.ts b/app/client/packages/rts/src/test/server.test.ts index 2088884f899b..f874445892e9 100644 --- a/app/client/packages/rts/src/test/server.test.ts +++ b/app/client/packages/rts/src/test/server.test.ts @@ -1,4 +1,4 @@ -import app from "../server"; +import app from "../ce/server"; import { RTS_BASE_API_PATH } from "@constants/routes"; import supertest from "supertest"; diff --git a/app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java b/app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java index 297ac13544cc..4e3289e41cc8 100644 --- a/app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java +++ b/app/server/appsmith-git/src/main/java/com/appsmith/git/files/FileUtilsCEImpl.java @@ -627,7 +627,7 @@ private boolean saveActionCollection(Object sourceEntity, String body, String re Path bodyPath = path.resolve(resourceName + CommonConstants.JS_EXTENSION); String resourceType = ACTION_COLLECTION_BODY; span.tag(RESOURCE_TYPE, resourceType); - observationHelper.startSpan(span, true); + observationHelper.startSpan(span); writeStringToFile(body, bodyPath); } @@ -637,7 +637,7 @@ private boolean saveActionCollection(Object sourceEntity, String body, String re } catch (IOException e) { log.debug(e.getMessage()); } finally { - observationHelper.endSpan(span, true); + observationHelper.endSpan(span); } return false; } @@ -663,7 +663,7 @@ private boolean saveActions(Object sourceEntity, String body, String resourceNam Path bodyPath = path.resolve(resourceName + CommonConstants.TEXT_FILE_EXTENSION); String resourceType = NEW_ACTION_BODY; span.tag(RESOURCE_TYPE, resourceType); - observationHelper.startSpan(span, true); + observationHelper.startSpan(span); writeStringToFile(body, bodyPath); } @@ -673,7 +673,7 @@ private boolean saveActions(Object sourceEntity, String body, String resourceNam } catch (IOException e) { log.error("Error while reading file {} with message {} with cause", path, e.getMessage(), e.getCause()); } finally { - observationHelper.endSpan(span, true); + observationHelper.endSpan(span); } return false; } diff --git a/app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java b/app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java index 8fd33e9b3d0f..abc686507de9 100644 --- a/app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java +++ b/app/server/appsmith-git/src/main/java/com/appsmith/git/files/operations/FileOperationsCEv2Impl.java @@ -83,7 +83,7 @@ public void saveWidgets(JSONObject sourceEntity, String resourceName, Path path) Files.createDirectories(path); String resourceType = WIDGETS; span.tag(RESOURCE_TYPE, resourceType); - observationHelper.startSpan(span, true); + observationHelper.startSpan(span); writeToFile( objectReader.readTree(sourceEntity.toString()), @@ -91,7 +91,7 @@ public void saveWidgets(JSONObject sourceEntity, String resourceName, Path path) } catch (IOException e) { log.debug("Error while writings widgets data to file, {}", e.getMessage()); } finally { - observationHelper.endSpan(span, true); + observationHelper.endSpan(span); } } @@ -103,13 +103,13 @@ public boolean writeToFile(Object sourceEntity, Path path) throws IOException { resourceType = METADATA; } span.tag(RESOURCE_TYPE, resourceType); - observationHelper.startSpan(span, true); + observationHelper.startSpan(span); try (BufferedWriter fileWriter = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) { objectWriter.writeValue(fileWriter, sourceEntity); return true; } finally { - observationHelper.endSpan(span, true); + observationHelper.endSpan(span); } } @@ -122,7 +122,7 @@ public boolean writeToFile(Object sourceEntity, Path path) throws IOException { @Override public Object readFile(Path filePath) { Span span = observationHelper.createSpan(GitSpan.FILE_READ); - observationHelper.startSpan(span, true); + observationHelper.startSpan(span); Object file; try (FileReader reader = new FileReader(filePath.toFile())) { @@ -131,7 +131,7 @@ public Object readFile(Path filePath) { log.error("Error while reading file {} with message {} with cause", filePath, e.getMessage(), e.getCause()); return null; } finally { - observationHelper.endSpan(span, true); + observationHelper.endSpan(span); } return file; } @@ -289,14 +289,14 @@ public void deleteFile(Path filePath) { @Override public String readFileAsString(Path filePath) { Span span = observationHelper.createSpan(GitSpan.FILE_READ); - observationHelper.startSpan(span, true); + observationHelper.startSpan(span); String data = CommonConstants.EMPTY_STRING; try { data = FileUtils.readFileToString(filePath.toFile(), "UTF-8"); } catch (IOException e) { log.error("Error while reading the file from git repo {} ", e.getMessage()); } finally { - observationHelper.endSpan(span, true); + observationHelper.endSpan(span); } return data; } diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java index 0c31653c6c39..86695f0addac 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/ObservationHelper.java @@ -7,9 +7,9 @@ public interface ObservationHelper { Span createSpan(String name); - default Span startSpan(Span span, boolean isDetail) { + default Span startSpan(Span span) { return span; } - default void endSpan(Span span, boolean isDetail) {} + default void endSpan(Span span) {} } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java deleted file mode 100644 index adb895737897..000000000000 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/annotations/ConditionalOnMicrometerMetricsEnabled.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.appsmith.server.annotations; - -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * It creates an annotation @ConditionalOnMicrometerMetricsEnabled which checks if the Micrometer metrics have been - * explicitly enabled via env variable. - */ -@Target({ElementType.TYPE, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@ConditionalOnExpression("${appsmith.observability.metrics.enabled}") -public @interface ConditionalOnMicrometerMetricsEnabled {} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java index 00efcaa7626c..c2f2de0b2131 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/CommonConfig.java @@ -64,15 +64,6 @@ public class CommonConfig { @Value("${disable.telemetry:true}") private boolean isTelemetryDisabled; - @Value("${appsmith.observability.tracing.detail.enabled:false}") - private boolean tracingDetail; - - @Value("${appsmith.observability.metrics.detail.enabled:false}") - private boolean metricsDetail; - - @Value("${appsmith.observability.metrics.interval.millis:60000}") - private int metricsIntervalMillis; - private List allowedDomains; private String mongoDBVersion; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java index 1a55dd8a08af..233182b97165 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/ReactorNettyConfiguration.java @@ -15,8 +15,6 @@ public class ReactorNettyConfiguration implements WebServerFactoryCustomizer httpServer.metrics(true, Function.identity())); - } + factory.addServerCustomizers(httpServer -> httpServer.metrics(true, Function.identity())); } } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java index ee4ad90f9317..2f7e741dd4dc 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ObservationHelperImpl.java @@ -44,18 +44,12 @@ public Span createSpan(String name) { } @Override - public Span startSpan(Span span, boolean isDetail) { - if (!isDetail || commonConfig.isTracingDetail()) { - return span.start(); - } else { - return span; - } + public Span startSpan(Span span) { + return span.start(); } @Override - public void endSpan(Span span, boolean isDetail) { - if (!isDetail || commonConfig.isTracingDetail()) { - span.end(); - } + public void endSpan(Span span) { + span.end(); } } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java index b4d159e67b7e..849cd358ffda 100755 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/layouts/UpdateLayoutServiceCEImpl.java @@ -135,7 +135,7 @@ private Mono updateLayoutDsl( Span extractAllWidgetNamesAndDynamicBindingsFromDSLSpan = observationHelper.createSpan(EXTRACT_ALL_WIDGET_NAMES_AND_DYNAMIC_BINDINGS_FROM_DSL); - observationHelper.startSpan(extractAllWidgetNamesAndDynamicBindingsFromDSLSpan, true); + observationHelper.startSpan(extractAllWidgetNamesAndDynamicBindingsFromDSLSpan); try { dsl = extractAllWidgetNamesAndDynamicBindingsFromDSL( @@ -146,7 +146,7 @@ private Mono updateLayoutDsl( .then(Mono.error(t)); } - observationHelper.endSpan(extractAllWidgetNamesAndDynamicBindingsFromDSLSpan, true); + observationHelper.endSpan(extractAllWidgetNamesAndDynamicBindingsFromDSLSpan); layout.setWidgetNames(widgetNames); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java index ef535c21694f..a7791fd341e7 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/onload/internal/OnLoadExecutablesUtilCEImpl.java @@ -228,7 +228,7 @@ public Mono>> findAllOnLoadExecutables( Span computeOnPageLoadExecutablesSchedulingOrderSpan = observationHelper.createSpan(COMPUTE_ON_PAGE_LOAD_EXECUTABLES_SCHEDULING_ORDER); - observationHelper.startSpan(computeOnPageLoadExecutablesSchedulingOrderSpan, true); + observationHelper.startSpan(computeOnPageLoadExecutablesSchedulingOrderSpan); List> executablesList = computeOnPageLoadExecutablesSchedulingOrder( graph, @@ -236,7 +236,7 @@ public Mono>> findAllOnLoadExecutables( executableNameToExecutableMap, explicitUserSetOnLoadExecutablesRef); - observationHelper.endSpan(computeOnPageLoadExecutablesSchedulingOrderSpan, true); + observationHelper.endSpan(computeOnPageLoadExecutablesSchedulingOrderSpan); return executablesList; }) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java index 4f2e12d7e51a..7bfddccccef6 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ConsolidatedAPIServiceCEImpl.java @@ -715,7 +715,7 @@ private boolean isPossibleToCreateQueryWithoutDatasource(Plugin plugin) { log.error("Error while computing etag for ConsolidatedAPIResponseDTO", e); return ""; } finally { - observationHelper.endSpan(computeEtagSpan, true); + observationHelper.endSpan(computeEtagSpan); } } } diff --git a/app/server/appsmith-server/src/main/resources/application-ce.properties b/app/server/appsmith-server/src/main/resources/application-ce.properties new file mode 100644 index 000000000000..712eed456c1a --- /dev/null +++ b/app/server/appsmith-server/src/main/resources/application-ce.properties @@ -0,0 +1,111 @@ +spring.application.name=appsmith-server +server.port=${PORT:8080} +# Allow the Spring context to close all active requests before shutting down the server +# Please ref: https://docs.spring.io/spring-boot/docs/2.3.0.RELEASE/reference/html/spring-boot-features.html#boot-features-graceful-shutdown +server.shutdown=graceful +server.max-http-request-header-size=16KB + +spring.lifecycle.timeout-per-shutdown-phase=20s + +spring.profiles.active=${ACTIVE_PROFILE:production} + +appsmith.db.url=${APPSMITH_DB_URL:${APPSMITH_MONGODB_URI}} +# This property allows us to override beans during testing. This is useful when we want to set different configurations +# and different parameters during test as compared to production. If this property is disabled, some tests will fail. +spring.main.allow-bean-definition-overriding=true +spring.data.redis.repositories.enabled=false + +#spring.main.web-application-type=reactive + +# This property allows the server to run behind a proxy server and still resolve all the urls correctly +server.forward-headers-strategy=NATIVE + +spring.data.mongodb.auto-index-creation=false +spring.data.mongodb.authentication-database=admin +# Ensures that the size of the request object that we handle is controlled. By default it's 212KB. +spring.codec.max-in-memory-size=150MB +# The value is same as appsmith.codec as both these values serves same purpose. +spring.webflux.multipart.max-in-memory-size=${APPSMITH_CODEC_SIZE:150}MB +appsmith.codec.max-in-memory-size=${APPSMITH_CODEC_SIZE:150} + +# Log properties +logging.level.root=info +logging.level.com.appsmith=debug +logging.level.com.external.plugins=debug +logging.pattern.console=[%d{ISO8601, UTC}] [%t] requestId=%X{X-Appsmith-Request-Id} userEmail=%X{userEmail} traceId=%X{traceId} spanId=%X{spanId} - %m%n + +#Spring security +spring.security.oauth2.client.registration.google.client-id=${APPSMITH_OAUTH2_GOOGLE_CLIENT_ID:missing_value_sentinel} +spring.security.oauth2.client.registration.google.client-secret=${APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET:} +spring.security.oauth2.client.provider.google.userNameAttribute=email +spring.security.oauth2.client.registration.github.client-id=${APPSMITH_OAUTH2_GITHUB_CLIENT_ID:missing_value_sentinel} +spring.security.oauth2.client.registration.github.client-secret=${APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET:} +spring.security.oauth2.client.provider.github.userNameAttribute=login + +# Accounts from specific domains are allowed to login +# DEPRECATED, in favor of signup.allowed-domains +oauth2.allowed-domains=${APPSMITH_OAUTH2_ALLOWED_DOMAINS:} + +# Segment +segment.writeKey=${APPSMITH_SEGMENT_KEY:} +# Is this instance hosted on Appsmith cloud? +is.cloud-hosting = ${APPSMITH_CLOUD_HOSTING:false} +disable.telemetry = ${APPSMITH_DISABLE_TELEMETRY:true} +segment.ce.key = ${APPSMITH_SEGMENT_CE_KEY:} +logging.verbose.enabled = ${APPSMITH_VERBOSE_LOGGING_ENABLED:false} + +# Sentry +sentry.dsn=${APPSMITH_SERVER_SENTRY_DSN:} +sentry.send-default-pii=true +sentry.debug=false +sentry.environment=${APPSMITH_SERVER_SENTRY_ENVIRONMENT:} + +# Redis Properties +appsmith.redis.url=${APPSMITH_REDIS_URL} + +# Mail Properties +# Email defaults to false, because, when true and the other SMTP properties are not set, Spring will try to use a +# default localhost:25 SMTP server and throw an error. If false, this error won't happen because there's no attempt +# to send an email. +mail.enabled=${APPSMITH_MAIL_ENABLED:false} +mail.from=${APPSMITH_MAIL_FROM:} +mail.support=${APPSMITH_MAIL_SUPPORT:support@appsmith.com} +reply.to=${APPSMITH_REPLY_TO:appsmith@localhost} +spring.mail.host=${APPSMITH_MAIL_HOST:} +spring.mail.port=${APPSMITH_MAIL_PORT:} +spring.mail.username=${APPSMITH_MAIL_USERNAME:} +spring.mail.password=${APPSMITH_MAIL_PASSWORD:} +spring.mail.properties.mail.smtp.auth=${APPSMITH_MAIL_SMTP_AUTH:} +spring.mail.properties.mail.smtp.starttls.enable=${APPSMITH_MAIL_SMTP_TLS_ENABLED:} +admin.emails = ${APPSMITH_ADMIN_EMAILS:} + +# Appsmith Cloud Services +appsmith.cloud_services.base_url = ${APPSMITH_CLOUD_SERVICES_BASE_URL:} +appsmith.cloud_services.signature_base_url = ${APPSMITH_CLOUD_SERVICES_SIGNATURE_BASE_URL:} +appsmith.cloud_services.template_upload_auth_header = ${APPSMITH_CLOUD_SERVICES_TEMPLATE_UPLOAD_AUTH:} +github_repo = ${APPSMITH_GITHUB_REPO:} + +# Support disabling signup with an environment variable +signup.disabled = ${APPSMITH_SIGNUP_DISABLED:false} +signup.allowed-domains=${APPSMITH_SIGNUP_ALLOWED_DOMAINS:} + +# Google recaptcha config +google.recaptcha.key.site = ${APPSMITH_RECAPTCHA_SITE_KEY:} +google.recaptcha.key.secret= ${APPSMITH_RECAPTCHA_SECRET_KEY:} + +# Plugin Interface level settings +appsmith.plugin.response.size.max=${APPSMITH_PLUGIN_MAX_RESPONSE_SIZE_MB:5} + +# Location env file with environment variables, that can be configured from the UI. +appsmith.admin.envfile=${APPSMITH_ENVFILE_PATH:/appsmith-stacks/configuration/docker.env} + +# RTS port +appsmith.rts.port=${APPSMITH_RTS_PORT:} + +appsmith.internal.password=${APPSMITH_INTERNAL_PASSWORD:} + +# GIT stale index.lock file valid time +appsmith.index.lock.file.time=${APPSMITH_INDEX_LOCK_FILE_TIME:300} + +springdoc.api-docs.path=/v3/docs +springdoc.swagger-ui.path=/v3/swagger diff --git a/app/server/appsmith-server/src/main/resources/application-ee.properties b/app/server/appsmith-server/src/main/resources/application-ee.properties new file mode 100644 index 000000000000..9365ae02f5cf --- /dev/null +++ b/app/server/appsmith-server/src/main/resources/application-ee.properties @@ -0,0 +1 @@ +spring.config.import=application-ce.properties diff --git a/app/server/appsmith-server/src/main/resources/application.properties b/app/server/appsmith-server/src/main/resources/application.properties index ee5af36ee784..9ba45368d374 100644 --- a/app/server/appsmith-server/src/main/resources/application.properties +++ b/app/server/appsmith-server/src/main/resources/application.properties @@ -1,131 +1 @@ -spring.application.name=appsmith-server -server.port=${PORT:8080} -# Allow the Spring context to close all active requests before shutting down the server -# Please ref: https://docs.spring.io/spring-boot/docs/2.3.0.RELEASE/reference/html/spring-boot-features.html#boot-features-graceful-shutdown -server.shutdown=graceful -server.max-http-request-header-size=16KB - -spring.lifecycle.timeout-per-shutdown-phase=20s - -spring.profiles.active=${ACTIVE_PROFILE:production} - -appsmith.db.url=${APPSMITH_DB_URL:${APPSMITH_MONGODB_URI}} -# This property allows us to override beans during testing. This is useful when we want to set different configurations -# and different parameters during test as compared to production. If this property is disabled, some tests will fail. -spring.main.allow-bean-definition-overriding=true -spring.data.redis.repositories.enabled=false - -#spring.main.web-application-type=reactive - -# This property allows the server to run behind a proxy server and still resolve all the urls correctly -server.forward-headers-strategy=NATIVE - -spring.data.mongodb.auto-index-creation=false -spring.data.mongodb.authentication-database=admin -# Ensures that the size of the request object that we handle is controlled. By default it's 212KB. -spring.codec.max-in-memory-size=150MB -# The value is same as appsmith.codec as both these values serves same purpose. -spring.webflux.multipart.max-in-memory-size=${APPSMITH_CODEC_SIZE:150}MB -appsmith.codec.max-in-memory-size=${APPSMITH_CODEC_SIZE:150} - -# Log properties -logging.level.root=info -logging.level.com.appsmith=debug -logging.level.com.external.plugins=debug -logging.pattern.console=[%d{ISO8601, UTC}] [%t] requestId=%X{X-Appsmith-Request-Id} userEmail=%X{userEmail} traceId=%X{traceId} spanId=%X{spanId} - %m%n - -#Spring security -spring.security.oauth2.client.registration.google.client-id=${APPSMITH_OAUTH2_GOOGLE_CLIENT_ID:missing_value_sentinel} -spring.security.oauth2.client.registration.google.client-secret=${APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET:} -spring.security.oauth2.client.provider.google.userNameAttribute=email -spring.security.oauth2.client.registration.github.client-id=${APPSMITH_OAUTH2_GITHUB_CLIENT_ID:missing_value_sentinel} -spring.security.oauth2.client.registration.github.client-secret=${APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET:} -spring.security.oauth2.client.provider.github.userNameAttribute=login - -# Accounts from specific domains are allowed to login -# DEPRECATED, in favor of signup.allowed-domains -oauth2.allowed-domains=${APPSMITH_OAUTH2_ALLOWED_DOMAINS:} - -# Segment -segment.writeKey=${APPSMITH_SEGMENT_KEY:} -# Is this instance hosted on Appsmith cloud? -is.cloud-hosting = ${APPSMITH_CLOUD_HOSTING:false} -disable.telemetry = ${APPSMITH_DISABLE_TELEMETRY:true} -segment.ce.key = ${APPSMITH_SEGMENT_CE_KEY:} -logging.verbose.enabled = ${APPSMITH_VERBOSE_LOGGING_ENABLED:false} - -# Sentry -sentry.dsn=${APPSMITH_SERVER_SENTRY_DSN:} -sentry.send-default-pii=true -sentry.debug=false -sentry.environment=${APPSMITH_SERVER_SENTRY_ENVIRONMENT:} - -# Redis Properties -appsmith.redis.url=${APPSMITH_REDIS_URL} - -# Mail Properties -# Email defaults to false, because, when true and the other SMTP properties are not set, Spring will try to use a -# default localhost:25 SMTP server and throw an error. If false, this error won't happen because there's no attempt -# to send an email. -mail.enabled=${APPSMITH_MAIL_ENABLED:false} -mail.from=${APPSMITH_MAIL_FROM:} -mail.support=${APPSMITH_MAIL_SUPPORT:support@appsmith.com} -reply.to=${APPSMITH_REPLY_TO:appsmith@localhost} -spring.mail.host=${APPSMITH_MAIL_HOST:} -spring.mail.port=${APPSMITH_MAIL_PORT:} -spring.mail.username=${APPSMITH_MAIL_USERNAME:} -spring.mail.password=${APPSMITH_MAIL_PASSWORD:} -spring.mail.properties.mail.smtp.auth=${APPSMITH_MAIL_SMTP_AUTH:} -spring.mail.properties.mail.smtp.starttls.enable=${APPSMITH_MAIL_SMTP_TLS_ENABLED:} -admin.emails = ${APPSMITH_ADMIN_EMAILS:} - -# Appsmith Cloud Services -appsmith.cloud_services.base_url = ${APPSMITH_CLOUD_SERVICES_BASE_URL:} -appsmith.cloud_services.signature_base_url = ${APPSMITH_CLOUD_SERVICES_SIGNATURE_BASE_URL:} -appsmith.cloud_services.template_upload_auth_header = ${APPSMITH_CLOUD_SERVICES_TEMPLATE_UPLOAD_AUTH:} -github_repo = ${APPSMITH_GITHUB_REPO:} - -# The following configurations are to help support prometheus scraping for monitoring -management.endpoints.web.exposure.include=prometheus,metrics -management.tracing.enabled=${APPSMITH_TRACING_ENABLED:false} -management.otlp.tracing.endpoint=${APPSMITH_NEW_RELIC_OTEL_EXPORTER_OTLP_ENDPOINT:http://localhost:4318}/v1/traces -management.otlp.tracing.headers.api-key=${APPSMITH_NEW_RELIC_OTLP_LICENSE_KEY:} -management.opentelemetry.resource-attributes.service.name=appsmith-server -management.opentelemetry.resource-attributes.service.instance.id=${HOSTNAME:appsmith-0} -management.opentelemetry.resource-attributes.deployment.name=${APPSMITH_DEPLOYMENT_NAME:self-hosted} -management.tracing.sampling.probability=${APPSMITH_SAMPLING_PROBABILITY:0.1} -management.prometheus.metrics.export.descriptions=true -management.metrics.distribution.slo.http.server.requests=100,200,500,1000,2000,5000,10000,20000,30000 -management.metrics.distribution.slo.appsmith=100,200,500,1000,2000,5000,10000,20000,30000 - -# Observability and Micrometer related configs -# Keeping this license key around, until later -appsmith.observability.metrics.enabled=${APPSMITH_MICROMETER_METRICS_ENABLED:false} -appsmith.observability.tracing.detail.enabled=${APPSMITH_ENABLE_TRACING_DETAIL:false} -appsmith.observability.metrics.detail.enabled=${APPSMITH_ENABLE_METRICS_DETAIL:false} -appsmith.observability.metrics.interval.millis=${APPSMITH_METRICS_INTERVAL_MILLIS:60000} - -# Support disabling signup with an environment variable -signup.disabled = ${APPSMITH_SIGNUP_DISABLED:false} -signup.allowed-domains=${APPSMITH_SIGNUP_ALLOWED_DOMAINS:} - -# Google recaptcha config -google.recaptcha.key.site = ${APPSMITH_RECAPTCHA_SITE_KEY:} -google.recaptcha.key.secret= ${APPSMITH_RECAPTCHA_SECRET_KEY:} - -# Plugin Interface level settings -appsmith.plugin.response.size.max=${APPSMITH_PLUGIN_MAX_RESPONSE_SIZE_MB:5} - -# Location env file with environment variables, that can be configured from the UI. -appsmith.admin.envfile=${APPSMITH_ENVFILE_PATH:/appsmith-stacks/configuration/docker.env} - -# RTS port -appsmith.rts.port=${APPSMITH_RTS_PORT:} - -appsmith.internal.password=${APPSMITH_INTERNAL_PASSWORD:} - -# GIT stale index.lock file valid time -appsmith.index.lock.file.time=${APPSMITH_INDEX_LOCK_FILE_TIME:300} - -springdoc.api-docs.path=/v3/docs -springdoc.swagger-ui.path=/v3/swagger +spring.config.import=application-ee.properties