Commit Graph

335 Commits

Author SHA1 Message Date
srix
293bd34266
fix: cleanup stale postgres postmaster.pid (#35171)
## Description
issue of Postgres not coming up with error` Previous Postgres was not
shutdown cleanly. Please start and stop Postgres 14 properly with
'supervisorctl' only. `


https://www.notion.so/appsmith/Closed-Beta-Customer-issues-45a274a9eb8e4762a72cbff74cd3bad5?pvs=4#ecca04d205414f25a289884cebdc0f9b


Fixes
https://app.zenhub.com/workspaces/workflows-pod-652fff131a95920b9bf2bc7e/issues/zh/226_

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10107093349>
> Commit: 357bf5d2ff0c1f65b4cbf46b0f3ee823ac192614
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10107093349&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Fri, 26 Jul 2024 07:15:19 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced PostgreSQL upgrade process with improved error handling and
robust management of old server instances.

- **Bug Fixes**
- Reinstituted logic for checking and managing the `postmaster.pid`
file, ensuring proper startup and shutdown of old PostgreSQL servers.

- **Refactor**
- Improved formatting and readability of shell scripts without altering
their functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-26 12:52:49 +05:30
Shrikant Sharat Kandula
bf6fd3faf8
chore: Remove Postgres v13 from base image (#34740)
1. This was kept for a short grace period, to be removed once we're
confident of upgrading to v14.
2. The `pg-upgrade.sh` script is capable of handling this. It will
install v13 when upgrading to v14, if it's not already available. See:
2adb12d57b/deploy/docker/fs/opt/appsmith/pg-upgrade.sh (L53-L54)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated PostgreSQL version in Docker setup from 13 to 14 for improved
performance and security.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-05 17:54:58 +05:30
Shrikant Sharat Kandula
064d74c833
chore: Remove current symlink to Postgres (#34454)
Reason for this previously documented at
https://github.com/appsmithorg/appsmith/pull/34265#issue-2356259090.

Cypress tests don' make sense since the only diff is on
`base.dockerfile`.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Dockerfile to streamline PostgreSQL setup. Removed creation of
a symlink to the current version of PostgreSQL.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-25 13:03:51 +05:30
Shrikant Sharat Kandula
26c0f07e14
chore: Add script to upgrade Postgres 13 data to 14 (#34317)
We're upgrading embedded Postgres from 13 to 14, and this PR includes a
script to perform the upgrade of the data folder from v13 schema to v14
schema. This script temporarily installs Postgres 13, if not available,
for the upgrade process, so will continue to work when and if we choose
to remove `postgresql-13` from the base image.

Tested this manually as well, running an Appsmith with Postgres 13,
executing some workflows via webhook, getting some run data generated,
then upgrading Postgres with the script in this PR, and ensuring that
the workflow run history is still there and visible on the UI exactly
the same. It is.

No conflicts or additional changes needed on EE. [All server and Cypress
tests pass on EE](https://github.com/appsmithorg/appsmith-ee/pull/4493).


![shot-2024-06-20-02-13-26](https://github.com/appsmithorg/appsmith/assets/120119/9bb60e3a-6cc9-4df9-9064-caead78729a6)


**/test sanity**



<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9590240540>
> Commit: 9c75da53f871ffb912015c18a7504327cba88f2c
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9590240540&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->





<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added automation script for upgrading PostgreSQL to the latest
version.
- Introduced testing script for PostgreSQL upgrades in Docker
environments.

- **Improvements**
- Upgraded PostgreSQL from version 13 to 14 in Docker setup, ensuring
compatibility and performance enhancements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-21 19:34:08 +05:30
Shrikant Sharat Kandula
88e39f42be chore: fix log line splitting in supervisor event handler 2024-06-20 20:28:20 +05:30
Shrikant Sharat Kandula
3f7b53589c
fix: Supervisor buffer overflow errors (#34351)
Should fix the flood of buffer overflow errors we see from Supervisor.

The one "change" this PR has, is that all the logs from the Docker
container will now be coming from `stderr`, not `stdout`. I don't expect
it to cause any problems, but it _is_ a change in behaviour nonetheless.

Why do that? Because of the way Supervisor event listening works. This
fix is based on the conversation at
https://github.com/Supervisor/supervisor/issues/1417. Essentially that
`stdout` should be reserved as a communication channel between
Supervisord and the event-listener, and for logging, we should use
`stderr`.

**/test sanity**



<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9592028116>
> Commit: 34a29eabc8dc82fb6a43b143e400d725d197a655
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9592028116&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Improved logging by switching to `print` statements with explicit
flushing for more reliable output handling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-20 19:36:15 +05:30
Shrikant Sharat Kandula
e38c7cc32b
chore: Remove redundant adding Postgres bin to PATH (#34316)
This temporary change is no longer needed.

**/test sanity**


<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9574310795>
> Commit: abad77fb024c61b595c529aa2ed024b8dcdf5dfb
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9574310795&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Improved the startup script by removing obsolete PATH modification for
PostgreSQL.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-20 10:08:30 +05:30
yatinappsmith
9263757188
chore: fix braces version (#34282)
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9547569754>
> Commit: 3516b9f76c77b499fe363d3aab583595911fa087
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9547569754&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->






## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Jest dependency from version 29.1.2 to 29.7.0 for improved
testing capabilities.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-18 14:58:17 +05:30
Shrikant Sharat Kandula
a638c47507
chore: Fix PATH getting reset by su (#34286)
The `PATH` env variable gets reset to it's original value by `su`,
because its a "secure" env variable, and is _never_ preserved across
user-switches.

Because of this, the Postgres commands like `initdb` are not found on
the `PATH`. This PR fixes this by setting the `PATH` in the command
passed to `su` itself, so that `initdb` can now be found.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved the initialization process for local Postgres data folder to
ensure compatibility with environment variables.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-17 18:53:38 +05:30
Shrikant Sharat Kandula
929873a2c6
chore: Add Postgres bin to PATH (#34265)
Instead of using absolute paths to Postgres binaries, and in doing so,
hard-coding the Postgres version number, we add the bin folder to `PATH`
so they're available directly.

This also won't need the `current` symlink we created. That symlink is
causing problems in some post-installations scripts in `apt`/`dpkg`,
since they're expecting a _number_ in that folder, and sees `current`,
it's confused and produces this error:

```
dpkg: warning: version 'current' has bad syntax: version number does not start with digit
```

After this is merged, we should be able to get rid of the `current`
symlink as well.

**/test sanity**

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9541787920>
> Commit: 1012266e0924248b0f13a91bee464303e86b87a6
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9541787920&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Docker configurations to streamline PostgreSQL 13 integration.
- Simplified PostgreSQL commands in scripts by removing explicit
versioning paths.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-17 12:53:34 +05:30
Shrikant Sharat Kandula
e97dc64432
chore: Remove mockdb as it isn't working anyway (#34266)
Output from a fresh Appsmith CE container:


![shot-2024-06-17-03-29-43@2x](https://github.com/appsmithorg/appsmith/assets/120119/309a88f7-b6d7-40e9-ba67-5e4aba264624)

To confirm again, the list of database doesn't include anything:

![shot-2024-06-17-03-50-06@2x](https://github.com/appsmithorg/appsmith/assets/120119/e630bcf8-cd6d-4174-aef6-6aa5d19c65ed)




**/test sanity**

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9541763632>
> Commit: 87f2b15a152bfc488773059a159ac79ad3785f1c
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9541763632&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->
2024-06-17 12:45:49 +05:30
Shrikant Sharat Kandula
981e720f77
fix: DB URL override fails in some cases (#34206)
The current fallback implementation doesn't work in the below case:

> The `APPSMITH_MONGODB_URI` is set _outside_ the container, and
`APPSMITH_DB_URL` is set in the `docker.env`.

This scenario will be showing up a lot more now that the `docker.env.sh`
that generates new `docker.env` files has `APPSMITH_DB_URL` in it.

Problem is that since we load env variables from both outside and
`docker.env` individually, we end up loading both `APPSMITH_MONGODB_URI`
and `APPSMITH_DB_URL`. And in this case, the `APPSMITH_DB_URL` will be
from the just-generated `docker.env`, so we'll end up with a localhost
URL, even though `APPSMITH_MONGODB_URI` was set to an external endpoint
outside the container.

This is the problem we were facing with our DPs recently.

This PR fixes this problem by doing the env name "rename" separately for
outside env variables, and once for `docker.env` env variables.

**/test sanity**

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9481037167>
> Commit: c6ce2a8dda4a13d3aab64adf8c9af08abd1cea62
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9481037167&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->
2024-06-12 17:45:19 +05:30
Shrikant Sharat Kandula
4dba047942
chore: Use tlog instead of echo in more places (#34182)
**/test sanity**



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Updated logging mechanism from `echo` to `tlog` for improved log
management across various scripts.
  
- **Chores**
- Enhanced logging for better clarity and consistency in deployment
scripts.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-11 20:10:33 +05:30
Abhijeet
0b4c273bfa
Revert "chore: Update postgres version references (#33987)"
This reverts commit 27b560d1df.
2024-06-10 15:29:12 +05:30
Shrikant Sharat Kandula
347d431887
chore: Add time to logs from entrypoint.sh (#34116)
Logs messages from `entrypoint.sh` and the other `run-*.sh` scripts
don't show timestamp today, and its getting hard to see the order of
things in the logs, especially between different processes.

This PR adds a command `tlog` to print logs with UTC timestamp prefixed.
We're only using it in `entrypoint.sh` now, but follow-up PR(s) will add
it to the other `run-*` scripts as well.



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated Dockerfile to include `/opt/bin` in the `PATH` and modified
permissions settings for executable files.

- **Refactor**
- Enhanced logging in the entrypoint script by replacing `echo`
statements with `tlog` for better clarity and debugging.

- **New Features**
- Introduced `tlog`, a new shell script for consistent and timestamped
logging.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-10 09:23:43 +05:30
Abhijeet
27b560d1df
chore: Update postgres version references (#33987)
## Description
PR to update the version references for postgres. This will help us in
keeping the diff minimum between release and pg branch as we will be
upgrading the postgres version to 15 on pg branch.

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated Docker scripts to use a generic placeholder for PostgreSQL
version, enhancing flexibility and future-proofing the setup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-06 10:30:20 +05:30
Shrikant Sharat Kandula
8abc516129
chore: Create a symlink to current version of Postgres 2024-06-05 20:18:15 +05:30
Goutham Pratapa
b5ae870087
[ops]: add warning for custom APPSMITH_GIT_ROOT (#33355) 2024-05-27 17:17:37 +05:30
Trisha Anand
921807d80b
chore: Update incorrect docker tagging and add fargate tag in deployment telemetry (#33472)
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No

---------

Co-authored-by: Goutham Pratapa <goutham@appsmith.com>
2024-05-27 17:16:13 +05:30
Shrikant Sharat Kandula
cece3fcdf8
chore: Delete unused files (#33702)
These files are no longer used in the product or code and can be deleted.
2024-05-24 13:13:41 +05:30
Goutham Pratapa
bf05e0f185
chore: Switch to vanilla Caddy, when rate limiting is disabled (#33387)
Depends-on:
[33591](https://github.com/appsmithorg/appsmith/pull/33591/files)
Fixes: #31997

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2024-05-24 13:11:56 +05:30
Shrikant Sharat Kandula
1ed5a0d84c
chore: Install latest NodeJS again (#33700)
/test sanity
2024-05-23 18:39:37 +05:30
Shrikant Sharat Kandula
86cfc5fefd
chore: Hardcode pin NodeJS version 2024-05-23 12:57:41 +05:30
Shrikant Sharat Kandula
0f167af5d3
chore: Pin NodeJS version to the one in package.json (#33685)
The newer NodeJS version `20.13` requires a more recent version of
glibc, one which isn't available on Ubuntu 20.04 yet. We need to stick
to NodeJS v20.11 until we can update Ubuntu itself to 22.04, or the
updated glibc shows up in Ubuntu 20.04.

Pinning NodeJS version for now to unblock.
2024-05-23 12:51:48 +05:30
Abhijeet
039f664499
revert: "fix: Remove the strict check for mongo url" (#33671)
Reverts appsmithorg/appsmith#33652

Reverting the change as the root cause was different
https://theappsmith.slack.com/archives/C0134BAVDB4/p1716393908273869?thread_ts=1716375955.137629&cid=C0134BAVDB4

## Automation

/ok-to-test tags="@tag.Sanity"<!-- This is an auto-generated comment:
Cypress test results -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/9201290830>
> Commit: 8e623fa37565078c23f1a307cbdfa416cfa89ed0
> Workflow: `PR Automation test suite`
> Tags: `@tag.Sanity`

<!-- end of auto-generated comment: Cypress test results  -->
2024-05-23 09:03:13 +05:30
Abhijeet
cfcc00ef67
fix: Remove the strict check for mongo url (#33652)
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Sanity"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9191016385>
> Commit: c74e98018a6b4bd212e922eb1b3015195a5234a0
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9191016385&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->





## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
2024-05-22 18:10:22 +05:30
Abhijeet
7e339d419d
test: Enable server tests for the PRs with base PG branch (#33429)
## Description
1. PR to enable server tests on PRs with `pg` as the base branch. 
2. Replace the DB URI from `APPSMITH_MONGODB_URI` to `APPSMITH_DB_URL` 

## Automation

/ok-to-test tags="@tag.Sanity, @tag.GenerateCRUD, @tag.Fork"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9174148396>
> Commit: 762b4255f654946a1a47a196df5a1afae5be09f2
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9174148396&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->












## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2024-05-22 15:55:20 +05:30
Goutham Pratapa
5965150bc4
chore: add vanilla caddy to base.dockerfile (#33591) 2024-05-21 16:46:13 +05:30
Adesh Atole
5ad365a86e
fix: Consider heroku deployment while generating Caddyfile (#33559)
## Description

Looks like while replacing NGINX with Caddy, Heroku deployment usecase
was missed.
Updated Caddyfile generation to use `$PORT` if available.

Fixes #33555 

Tested on Heroku Standard-2x Dyno.
2024-05-21 12:07:58 +05:30
Shrikant Sharat Kandula
c43a7c5645
chore: Fix blank lines in logs (#33515)
Fix blank line noise in logs routed via Supervisor.
2024-05-16 16:53:42 +05:30
Goutham Pratapa
d684b19d9d
[fix]: file permissions for entrypoint.sh (#33359)
## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
2024-05-10 20:15:46 +05:30
Goutham Pratapa
9ade3d6bbb
fix: setup proxy variables in the start (#32451)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Chores**
- Improved proxy settings, IP retrieval with timeout, and curl request
timeouts in the deployment process.
	- Enhanced Redis compatibility checks and installation steps.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-05-10 17:17:29 +05:30
Shrikant Sharat Kandula
809710245d
chore: Add an internal request ID for logging (#33086)
/ok-to-test tags="@tag.All"

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8918415111>
> Commit: f902355ece5445d27fd8a65dcf4607afb4c5d656
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8918415111&attempt=2"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->
2024-05-02 13:00:23 +05:30
Shrikant Sharat Kandula
0591c4636e
chore: Validate tag before doing anything (#32978)
1. Add validation for the tag before building the image or doing
anything. This is strict case-sensitive validation, that will allow only
three numbers in the version, and the first number has to be a single
digit. Support for `-beta` versions is also being removed, as we just
don't use it. Thanks to removing this, we'll build the `latest` and
`v1.2.3` images together, instead of building two separate images.
2. The server and client are reading version from `version` key in
`info.json`, but RTS is reading it from `githubRef` key in `info.json`.
This discrepancy is debt, and has no reason to exist. We fix RTS to also
read the version from the `version` field.

Why are we doing this? [Slack
conversation](https://theappsmith.slack.com/archives/C0341RERY4R/p1714098736865219?thread_ts=1714066995.288859&cid=C0341RERY4R).
2024-05-01 11:44:53 +05:30
Shrikant Sharat Kandula
f8a3a54df9
chore: Use CS to get Appsmith server IP (#32998)
We're currently relying on ipify.org for this, and this PR will move to
using CS for this information. This is so that all external
communication from the core of the product's backend, is only to
cs.appsmith.com, which makes whitelisting easier for users.

Also removing the unused variables `APPSMITH_CLOUD_SERVICES_USERNAME`
and `APPSMITH_CLOUD_SERVICES_PASSWORD`.

⚠️ This will cause conflicts on sync.

/ok-to-test tags="@tag.Sanity"
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8859016811>
> Commit: 46576ca46adcba288693c3d5aaa9cc547c1e8f57
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8859016811&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Removed username and password fields from cloud services configuration
to enhance security.
- Updated network utilities to initialize with new cloud services
configuration, improving integration and functionality.
  
- **Bug Fixes**
- Adjusted the method of fetching and handling IP address data to
improve reliability and accuracy of network services.

- **Chores**
- Updated application properties and deployment scripts to align with
the new configuration and address retrieval methods.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-28 17:31:13 +05:30
Goutham Pratapa
947add2f20
[ops]: get infra details (#32552)
Outputs on having the container up and running

On kubernetes:
```
root@ce32552-appsmith-66fc68d7f-97tjn:/opt/appsmith# cat /tmp/appsmith/infra.json
{"cloudProvider":"amazon","Tool":"kubernetes","EFS":"present","Hostname":"ce32552-appsmith-66fc68d7f-97tjn"}
```

On local setup:
```
root@26327db8d65a:/opt/appsmith# cat /tmp/appsmith/infra.json
{"cloudProvider":"local","Tool":"docker","EFS":"absent","Hostname":"26327db8d65a"}
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced infrastructure detection to enhance system insights,
including cloud provider, deployment tools, and host details.
- Enhanced analytics by incorporating deployment properties into event
tracking.

- **Refactor**
- Modified server configuration and initialization to integrate new
deployment properties.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Trisha Anand <trisha@appsmith.com>
2024-04-26 18:56:45 +05:30
Shrikant Sharat Kandula
67a103de0e
chore: Health check only backend, caddy and RTS (#32891)
This is to avoid low-impact failures from getting the whole container to
restart.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Modified health check to focus on critical services (`editor`, `rts`,
`backend`) for more efficient monitoring.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-25 10:36:13 +05:30
Goutham Pratapa
a9afdd9a11
[feat]: print appsmith info details in startup (#32549)
Fixes: [21899](https://github.com/appsmithorg/appsmith/issues/21899)
2024-04-22 09:35:14 +05:30
Shrikant Sharat Kandula
7a50b9095f
chore: Local Caddy support (#31325)
Replaces NGINX for local dev with Caddy.

The advandage here is that the script that generates `Caddyfile` at
runtime on production deployments, is also used to generate the
`Caddyfile` at local development. This reduces the local--production
gap.

/ok-to-test tags="@tag.Sanity"
2024-04-19 06:38:01 +05:30
Shrikant Sharat Kandula
0a9f9b9043
test: Fix Caddy route tests with custom Caddy (#32675)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Refactor**
- Updated base Docker image and installation processes for tools within
the Docker environment.
- **Chores**
- Modified scripts to enhance file handling and environment variable
configurations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-18 14:03:10 +05:30
Goutham Pratapa
8534e1253b
fix: Support symlinks in ca-certs folder (#32391)
Fixes: [30928](https://github.com/appsmithorg/appsmith/issues/30928)
2024-04-04 14:48:39 +05:30
Shrikant Sharat Kandula
305d4d7fab
chore: Remove old undocumented migrate command (#32114)
This removes the `appsmithctl migrate` command which can migrate an
Appsmith instance from on EC2 instance to another, using SSH. Why are we
removing it?

1. It's not documented on docs.appsmith.com at all.
2. The problem is better solved with a combination of `appsmithctl
backup` and `appsmithctl restore`, with much _more_ flexibility.
2024-03-27 19:58:44 +05:30
Goutham Pratapa
f85d64d775
feat: Support encrypted backups and fix restoring to renamed databases (#29902)
Fixes: [31004](https://github.com/appsmithorg/appsmith/issues/31004)


Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2024-03-27 18:09:02 +05:30
Valera Melnikov
92c72ee20e
chore: update node version and appropriate git workflows (#31486)
## Description
- update node version and appropriate git workflow
- added the path to webpack cache folder, this should speed up bundle
creation about a minute

[Test, build and push Docker
Image](https://github.com/appsmithorg/appsmith/actions/runs/8421752151)
[Build Client, Server & Run only
Cypress](https://github.com/appsmithorg/appsmith/actions/runs/8421752151)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Chores**
- Updated actions/cache and actions/setup-node to v4 across various
workflows for improved caching and Node.js setup.
- Modified the `yarn install` command to use `--immutable` flag,
enhancing dependency management.
- **Documentation**
- Updated comments within workflows to include cautionary and important
notes, ensuring better clarity.
- **Refactor**
	- Adjusted caching paths and keys for more efficient caching behavior.
- Changed Node.js installation to version 20.11.1 in Dockerfile,
aligning with the latest version for better performance and security.
- **Tests**
- Modified assertion in `getCurrentLocationSaga` test to check for the
presence of a property, improving test accuracy.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2024-03-26 14:12:11 +03:00
dependabot[bot]
1fe9173121
chore(deps): bump ip from 2.0.0 to 2.0.1 in /deploy/docker/fs/opt/appsmith/utils (#31213)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3b0994a74e"><code>3b0994a</code></a>
2.0.1</li>
<li><a
href="32f468f124"><code>32f468f</code></a>
lib: fixed CVE-2023-42282 and added unit test</li>
<li>See full diff in <a
href="https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ip&package-manager=npm_and_yarn&previous-version=2.0.0&new-version=2.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 07:50:57 +05:30
Goutham Pratapa
d3acb4ba8f
feat: add ability to change application logs location (#31926)
Fixes [31877](https://github.com/appsmithorg/appsmith/issues/31877) 

```
sudo docker run -it -d --name ap -e APPSMITH_LOG_DIR=/logs --pull always appsmith/appsmith-dp:ce-31926


(base) ➜  appsmith-ee git:(release) ✗ docker exec -it -u root ap bash
root@3d17510be0d7:/opt/appsmith# ls /logs/*
/logs/backend:
backend-3d17510be0d7.log

/logs/editor:
access-3d17510be0d7.log  error-3d17510be0d7.log

/logs/rts:
rts-3d17510be0d7.log
root@3d17510be0d7:/opt/appsmith#

```
2024-03-20 19:45:48 +05:30
Shrikant Sharat Kandula
5827b0de92
chore: Change default rate-limiting threshold to 100 2024-03-08 12:22:56 +05:30
Goutham Pratapa
c79947a3fc
feat: Rate limiting on Caddy (#31496) 2024-03-07 16:22:29 +05:30
Goutham Pratapa
9b00b299f0
feat: add ratelimiting for caddy (#30897)
Fixes: [31031](https://github.com/appsmithorg/appsmith/issues/31031)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **New Features**
- Added rate-limiting functionality to enhance security and prevent
abuse.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2024-03-05 15:07:22 +05:30
Shrikant Sharat Kandula
93b1324335
chore: Support configurable body max size in Caddyfile (#31461)
Fixes #31454.
2024-03-04 16:10:07 +05:30
Shrikant Sharat Kandula
ae0f2a9529
chore: Don't break on missing info.json (#31287)
The `caddy-reconfigure.mjs` script fails to gracefully continue when
`info.json` is missing. This PR brings back that grace.
2024-02-27 16:07:57 +05:30
Shrikant Sharat Kandula
443d7eeb70
chore: Remove CA bundle env variable for certbot (#30879)
We don't use certbot anymore, so this isn't needed anymore.
2024-02-07 11:41:39 +05:30
dependabot[bot]
0c0d9a5286
chore: bump nodemailer from 6.7.5 to 6.9.9 in /deploy/docker/fs/opt/appsmith/utils (#30852)
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.7.5
to 6.9.9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodemailer/nodemailer/releases">nodemailer's
releases</a>.</em></p>
<blockquote>
<h2>v6.9.9</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.8...v6.9.9">6.9.9</a>
(2024-02-01)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> Fix issues described in
GHSA-9h6g-pr28-7cqp. Do not use eternal matching pattern if only a few
occurences are expected (<a
href="dd8f5e8a4d">dd8f5e8</a>)</li>
<li><strong>tests:</strong> Use native node test runner, added code
coverage support, removed grunt (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1604">#1604</a>)
(<a
href="be45c1b299">be45c1b</a>)</li>
</ul>
<h2>v6.9.8</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.7...v6.9.8">6.9.8</a>
(2023-12-30)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>punycode:</strong> do not use native punycode module (<a
href="b4d0e0c7cc">b4d0e0c</a>)</li>
</ul>
<h2>v6.9.7</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.6...v6.9.7">6.9.7</a>
(2023-10-22)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>customAuth:</strong> Do not require user and pass to be set
for custom authentication schemes (fixes <a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1584">#1584</a>)
(<a
href="41d482c3f0">41d482c</a>)</li>
</ul>
<h2>v6.9.6</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.5...v6.9.6">6.9.6</a>
(2023-10-09)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>inline:</strong> Use 'inline' as the default Content
Dispostion value for embedded images (<a
href="db32c93fef">db32c93</a>)</li>
<li><strong>tests:</strong> Removed Node v12 from test matrix as it is
not compatible with the test framework anymore (<a
href="7fe0a608ed">7fe0a60</a>)</li>
</ul>
<h2>v6.9.5</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.4...v6.9.5">6.9.5</a>
(2023-09-06)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>license:</strong> Updated license year (<a
href="da4744e491">da4744e</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md">nodemailer's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.8...v6.9.9">6.9.9</a>
(2024-02-01)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> Fix issues described in
GHSA-9h6g-pr28-7cqp. Do not use eternal matching pattern if only a few
occurences are expected (<a
href="dd8f5e8a4d">dd8f5e8</a>)</li>
<li><strong>tests:</strong> Use native node test runner, added code
coverage support, removed grunt (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1604">#1604</a>)
(<a
href="be45c1b299">be45c1b</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.7...v6.9.8">6.9.8</a>
(2023-12-30)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>punycode:</strong> do not use native punycode module (<a
href="b4d0e0c7cc">b4d0e0c</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.6...v6.9.7">6.9.7</a>
(2023-10-22)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>customAuth:</strong> Do not require user and pass to be set
for custom authentication schemes (fixes <a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1584">#1584</a>)
(<a
href="41d482c3f0">41d482c</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.5...v6.9.6">6.9.6</a>
(2023-10-09)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>inline:</strong> Use 'inline' as the default Content
Dispostion value for embedded images (<a
href="db32c93fef">db32c93</a>)</li>
<li><strong>tests:</strong> Removed Node v12 from test matrix as it is
not compatible with the test framework anymore (<a
href="7fe0a608ed">7fe0a60</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.4...v6.9.5">6.9.5</a>
(2023-09-06)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>license:</strong> Updated license year (<a
href="da4744e491">da4744e</a>)</li>
</ul>
<h2>6.9.4 2023-07-19</h2>
<ul>
<li>Renamed SendinBlue to Brevo</li>
</ul>
<h2>6.9.3 2023-05-29</h2>
<ul>
<li>Specified license identifier (was defined as MIT, actual value
MIT-0)</li>
<li>If SMTP server disconnects with a message, process it and include as
part of the response error</li>
</ul>
<h2>6.9.2 2023-05-11</h2>
<ul>
<li>Fix uncaught exception on invalid attachment content payload</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5a2e10f454"><code>5a2e10f</code></a>
chore(master): release 6.9.9 [skip-ci] (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1606">#1606</a>)</li>
<li><a
href="dd8f5e8a4d"><code>dd8f5e8</code></a>
fix(security): Fix issues described in GHSA-9h6g-pr28-7cqp. Do not use
eterna...</li>
<li><a
href="2c2b46ae4c"><code>2c2b46a</code></a>
chore: do not use caret in version specifier</li>
<li><a
href="be45c1b299"><code>be45c1b</code></a>
fix(tests): Use native node test runner, added code coverage support,
removed...</li>
<li><a
href="4233f6f89e"><code>4233f6f</code></a>
chore(master): release 6.9.8 [skip-ci] (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1605">#1605</a>)</li>
<li><a
href="09d502f979"><code>09d502f</code></a>
chore: removed double file</li>
<li><a
href="b4d0e0c7cc"><code>b4d0e0c</code></a>
fix(punycode): do not use native punycode module</li>
<li><a
href="8376c024f8"><code>8376c02</code></a>
Test new github notice syntax for README</li>
<li><a
href="bc46a3b7d4"><code>bc46a3b</code></a>
Updated stale github action</li>
<li><a
href="78bdaf8c9e"><code>78bdaf8</code></a>
chore: remove redundant AWS SDK for JavaScript v2 (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1593">#1593</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/nodemailer/nodemailer/compare/v6.7.5...v6.9.9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nodemailer&package-manager=npm_and_yarn&previous-version=6.7.5&new-version=6.9.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/appsmithorg/appsmith/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-02 11:56:19 +05:30
Shrikant Sharat Kandula
67c444e2a5
chore: Show commit SHA instead of SNAPSHOT version (#30850)
Show the commit SHA in the version popup, instead of a snapshot version
number like `v1.11-SNAPSHOT`. But if the version number doesn't have a
`-SNAPSHOT` at the end, we show the version number as is. So if it's
`v1.12`, we show that instead of the commit SHA.


![shot-2024-02-02-02-09-14](https://github.com/appsmithorg/appsmith/assets/120119/c0fe70f7-5c49-4191-8cb8-262e6c7710bc)
2024-02-02 09:52:34 +05:30
Shrikant Sharat Kandula
82c24a1190
chore: Render env vars in caddy-reconfigure script (#30673)
Move more logic in managing Caddy into Javascript from the shell script.
2024-01-31 11:38:49 +05:30
Shrikant Sharat Kandula
85bd78674c
fix: Allow incoming TLS traffic without restricting the domain (#30571)
This is a fix for a user's problem. They have custom domain set, a
custom cert in the `stacks/ssl` folder, but because a different team
operates a reverse-proxy, they aren't sure which _host_ is actually used
by the reverse proxy. And the way we bind to port 443 requires that that
puzzle be solved, for very little extra value.

This change makes it so that we accept any incoming TLS connections, if
a custom domain is set, which should be much more convenient.

[Slack
Thread](https://theappsmith.slack.com/archives/C0341RERY4R/p1705700120412079).

Already deployed on users' system, and they've confirmed its working.
2024-01-24 15:19:17 +05:30
Shrikant Sharat Kandula
51c91f8a67
chore: Changes to Postgres to support readonly root FS (#30517) 2024-01-23 10:42:18 +05:30
Shrikant Sharat Kandula
92993cccef
chore: Remove unused services (#30292)
I've been doing this in pieces bit by bit, not to rock the boat too much
too fast, but it's taking too long, and too much effort. Instead opting
for a rip-the-bandaid style, hopefully without the pain.
2024-01-23 05:43:16 +05:30
Shrikant Sharat Kandula
d25b94fe50
chore: Remove unneeded exposing of 9001 port (#30499)
We're already using `/supervisor` for this, and don't expect anyone to
hit the port directly.
2024-01-22 15:06:08 +05:30
Shrikant Sharat Kandula
fda15a9d6f
chore: Remove pip and git from base image (#30318)
We don't need these anymore, after changes from
https://github.com/appsmithorg/appsmith/pull/30252.
2024-01-22 09:15:56 +05:30
Shrikant Sharat Kandula
ae31d77905
fix: Include loopback by default in NO_PROXY (#30284)
Fixes https://github.com/appsmithorg/appsmith/issues/21900

Recently surfaced with a customer. [Relevant Slack
conversation](https://theappsmith.slack.com/archives/C0341RERY4R/p1705066329009749?thread_ts=1702568797.080409&cid=C0341RERY4R).

# Tests

![shot-2024-01-12-15-34-11](https://github.com/appsmithorg/appsmith/assets/120119/66076399-304e-45f1-9030-60176cedf913)
2024-01-13 06:24:02 +05:30
Shrikant Sharat Kandula
74084eda0c
chore: Vendor supervisor_stdout extension (#30252)
Instead of downloading it from the github repo on every build (in
`base.dockerfile`), we vendor the supervisor extension so we can look to
fix the buffer overflow problem in supervisor logs.

After this is merged, after a day/two, we'll be removing `git`,
`python3-pip` and the supervisor-stdout extension from
`base.dockerfile`.
2024-01-12 10:06:28 +05:30
Shrikant Sharat Kandula
88e690f10b
chore: Ensure ssl folder is created in stacks 2024-01-12 07:28:13 +05:30
Shrikant Sharat Kandula
ecfa5eba78
chore: Remove unneeded letsencrypt symlink (#30221) 2024-01-11 09:58:52 +05:30
Shrikant Sharat Kandula
4c4cd65919
chore: Refactoring base image for smaller image size 2024-01-09 07:10:46 +05:30
Shrikant Sharat Kandula
93614ee30c
chore: Remove cron in base image 2024-01-08 07:46:21 +05:30
Shrikant Sharat Kandula
8d0cad085e
chore: Remove cron, unused (#29937) 2023-12-29 10:33:23 +05:30
Trisha Anand
0331d987de
feat: Databricks plugin (#29746)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a Databricks plugin for executing queries and managing
database connections.
- Added a migration to incorporate the Databricks plugin into existing
workspaces.

- **Bug Fixes**
- Ensured robust error handling in the Databricks plugin with clear
messaging for query execution failures.

- **Tests**
- Implemented tests to validate the behavior of the Databricks plugin
under various connection scenarios.

- **Documentation**
	- Included configuration properties for the Databricks plugin setup.

- **Refactor**
- Added specific error types and messages for the Databricks plugin to
improve debugging and user feedback.

- **Chores**
- Modified the Java runtime environment settings to support the new
plugin's requirements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Arpit Mohan <arpit@appsmith.com>
2023-12-26 10:04:09 +05:30
Shrikant Sharat Kandula
433a72134f
test: Fix CI env variable value 2023-12-23 12:08:04 +05:30
Shrikant Sharat Kandula
5630a3fb70 ci: Fix Caddy tests workflow 2023-12-23 08:11:12 +05:30
Shrikant Sharat Kandula
3635677a5f
ci: Add workflow for Caddy routes test 2023-12-23 06:54:10 +05:30
Shrikant Sharat Kandula
502f4d79e1
chore: Remove NGINX from Docker image (#29668)
Now that we've moved to Caddy.
2023-12-21 11:22:41 +05:30
Shrikant Sharat Kandula
19cc5040f3 test: More test for frame ancestors config 2023-12-19 17:09:58 +05:30
Shrikant Sharat Kandula
ea4079da4b test: Route tests for frame ancestors config 2023-12-19 17:01:28 +05:30
Shrikant Sharat Kandula
e6ebfbaea1
fix: Remove Server header and allow all on port 80 (#29585)
Another attempt at #29550, which was reverted. Fallback is not happening
if cert provisioning fails _despite_ having the correct header. But with
the changes in this PR, since we'll listen on `:80`, fallback _will_
happen when cert provisioning fails due to incorrect domain
configuration.

We're also adding [Hurl](https://hurl.dev) based tests. They're not run
in any CI yet. That'll come in soon.
2023-12-18 09:44:31 +05:30
Shrikant Sharat Kandula
bf07dc591d
fix: Revert bind changes in Caddyfile 2023-12-13 20:14:36 +05:30
Shrikant Sharat Kandula
5cb146a088
fix: regression in caddy config binding 2023-12-13 18:53:08 +05:30
Shrikant Sharat Kandula
60692629c5
chore: Fix starting page checker scrpit refering to missing file 2023-12-13 13:53:53 +05:30
Shrikant Sharat Kandula
caf1d3f95c
chore: Auto-fix invalid custom domain (#29550)
Defining custom domain as `https://example.com/` is invalid.

It should be just the domain, just `example.com`. But turns out a lot of
our users have the incorrect configuration, and our previous stack of
NGINX+Certbot was able to ignore this and serve without HTTPS. This PR
brings that behaviour back.


## Test performed

Have Appsmith running on an EC2 instance, and a domain `correct.com`
with an A-record pointed to this EC2 instance.

In the instance, we run Appsmith with `APPSMITH_CUSTOM_DOMAIN` set to
`wrong.com`. Caddy will obviously fail to provision the cert, and so we
expect it to accept connections on just HTTP.

So hitting `curl -i http://correct.com` produced a 200 with the HTML
response, and not a 308 with a redirect. Before the changes from this
PR, the same curl command produced a 308 with a redirect to
`https://correct.com`, which fails with a certificate error.

Next up, we run Appsmith with `APPSMITH_CUSTOM_DOMAIN` set to
`correct.com`. Caddy will succeed in provisioning a cert, and so we
expect HTTP URLs to be redirected to HTTPS.

So hitting `curl -i http://correct.com` produces a 308 redirect to
`http://correct.com` which then works fine, since Caddy now has the cert
for the domain.
2023-12-13 13:45:04 +05:30
Shrikant Sharat Kandula
47d9a5e99e
fix: frame-ancestors env variable being overridden (#29521)
We're setting the default value for `APPSMITH_ALLOWED_FRAME_ANCESTORS`
before we initialize env variables from `docker.env`. This make the
default value take a higher precedence over the value configured in
`docker.env`. And since the value in `docker.env` is the one configured
from Admin Settings, it feels like the value configured from the UI is
being ignored.

This fixes the problem by moving the check for this env variable to
_inside_ the reconfigure script, and so doesn't affect any env
variables.
2023-12-11 19:25:12 +05:30
Rajat Agrawal
7d7774760d
chore: Fix auto heal script crash if curl times out (#29472)
Fixes #29116
2023-12-08 15:22:26 +05:30
Rajat Agrawal
5c451badea
chore: Improve log formatting for verbose logs (#29429)
Fixes #29114

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Performance Improvements**
- Enhanced logging capabilities to include memory footprint and context
details for better performance monitoring.

- **Configuration Updates**
- Increased the number of log file backups from 2 to 10, allowing for
more historical log retention.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-07 19:56:30 +05:30
Goutham Pratapa
64cd315262
chore: Remove extra unneeded sleep in auto heal script (#29422)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Optimized auto-healing script by removing an unnecessary 60-second
delay.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-07 15:10:50 +05:30
Goutham Pratapa
2f603e444c
add auto heal to cron (#29175)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced auto-healing functionality to automatically restart
unresponsive backend services.
  - Added SSL configuration support for custom domains.

- **Chores**
  - Implemented periodic backend service status checks.
- Enhanced startup scripts to support new auto-healing feature based on
environment configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-07 09:51:29 +05:30
Shrikant Sharat Kandula
689d29065a
fix: Incorrect status code for missing static files (#29374)
I think the route precedence in Caddy is different when using `handle`
directive, vs when directly using the `error` directive.

This is causing the file `handle {` route, which is a catch-all route is
handling `/static/*` requests that don't have a corresponding file. This
handler however, doesn't respond with 404 status, it responds with 200
status for missing files, and render the `index.html` for our SPA
behaviour.

Now, the CDN we have on release.app.appsmith.com caches responses from
upstream when the status is 200. If it is 404, it won't cache and retry
next time. This is why it's essential that we respond with 404 for files
that don't exist, irrespective of the content of the response.

When the container is starting up, Caddy doesn't have all the
information yet, and may have responded with not-found for one of the
assets. But since this went out with 200 status, our CDN cached it, and
once the file _was_ available with Caddy, the CDN wouldn't retry ever.

This fix will ensure we get 404 status code for requests to `/static/*`
that point to files that don't exist.
2023-12-06 14:42:25 +05:30
Trisha Anand
907a1d4a1e
Revert "chore: Improve logging format for debugging OOM issues" (#29368)
Reverts appsmithorg/appsmith#29330
2023-12-06 11:43:31 +05:30
Shrikant Sharat Kandula
18eb6790bf
chore: Set client's version in index.html at runtime (#29318)
[Slack thread with a lot more details and
discussion](https://theappsmith.slack.com/archives/C02MUD8DNUR/p1701759438660509).

This will help us move towards having `info.json` as the one source of
truth for Appsmith version.
2023-12-06 06:57:22 +05:30
Rajat Agrawal
81bebcd914
chore: Improve logging format for debugging OOM issues (#29330)
Fixes #29114

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - Enhanced logging capabilities for better performance insights.

- **Improvements**
- Increased the number of log file backups to ensure more historical
data is preserved.

- **Documentation**
- Updated internal documentation to reflect new logging and performance
monitoring features.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-05 19:05:22 +05:30
Shrikant Sharat Kandula
16b1ed425d
chore: Remove cron job to renew cert from certbot 2023-12-05 15:01:14 +05:30
Shrikant Sharat Kandula
4d24aba331
feat: Caddy (#28081)
This PR replaces NGINX and Certbot with Caddy.

1. Auto-HTTPS when custom domain is set, is handled by Caddy.
2. If past certs exist, that were provisioned by Certbot in older
Appsmith versions, we configure Caddy to make use of them. But this only
applies if the certs aren't already expired. If they're expired, point 1
applies.
3. If custom certs are provided in `ssl` folder, Caddy will be
configured to use them.
4. Incoming `Forwarded` header is not passed to any reverse proxies. So
redirect URL is correctly computed on Google Cloud Run.
5. All other route configurations are exactly as they are in NGINX
today.

Caddy configuration file is generated in the `caddy-reconfigure.mjs`
script, which will also reload Caddy with the new configuration.
2023-12-05 10:47:36 +05:30
Shrikant Sharat Kandula
72e40c25fe
chore: Add WWW_PATH for Caddy 2023-12-01 17:42:03 +05:30
Shrikant Sharat Kandula
fa01d10bf5
chore: Install Caddy ahead of PR to enable Caddy support (#29256)
This will install Caddy into the base image, ahead of incoming changes
to replace NGINX and Certbot with Caddy.
2023-12-01 16:24:37 +05:30
Anagh Hegde
c764d4471b
chore: remove the redirection for mockdb to localhost (#28998)
## Description
This PR fixes the experience of Templates forking in self hosted
instances. And also for to Set up a process to keep the embedded DB up
to date with template db schemas.
We have removed the redirection of mockdb end point used in templates
App when forked in self hosted instance from localhost/internal postgres
db.
This also has a migration which is to make sure that none of existing
apps using the internal postgres does not break due to the removal of
redirection. The migration will make sure that existing self hosted
instances using the posgress db and has a datasource with mockdb end
point will be replaces with localhost.


#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/28924

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing

#### How Has This Been Tested?
- [ ] Manual

#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-11-24 17:32:09 +05:30
Shrikant Sharat Kandula
b78dce1c53
chore: Fix content-type header on /info 2023-11-24 15:58:03 +05:30
Rajat Agrawal
04571274d1
chore: Increase buffer size for supervisor events to 10000 (#29030) 2023-11-22 17:43:17 +05:30
Shrikant Sharat Kandula
c467090c56
fix: Adding multiple certs in ca-certs folder (#28904)
Fix issue with alias names clashing in `keytool -import` command, when
there's more than one cert file in the `ca-certs` folder.

The fix is to explicitly set the alias for each `keytool -import` run,
to the file itself, so clashes don't happen.
2023-11-16 19:19:04 +05:30
Shrikant Sharat Kandula
2774f97d57
feat: Support running as a non-root user (#28290)
Running an Appsmith as a non-root user:

```sh
docker run --name appsmith --user 70:70
```

The `70:70` figures are the UID and GID respectively. It can mostly be
any number, safe to user figures are 70 to 79, or anything above 200 and
below 65000. The important bit, is that it shouldn't change on restart
or manual updates etc.

No product functionality should be affected when running as a non-root
user.
2023-11-15 11:28:25 +05:30
Shrikant Sharat Kandula
989429f2af
chore: Java download URL in base image dockerfile (#28664)
The current latest release at
https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.9%2B9.1,
doesn't include binaries for Linux, and so the Java download step fails
in our base Docker image build. This PR fixes that.

Sidenote, had we not had this base image and application image
separation, this bug would've blocked all our CI pipelines and the whole
team. 🙂
2023-11-07 10:35:50 +05:30
dependabot[bot]
e9b131d650
chore(deps-dev): bump @babel/traverse from 7.19.4 to 7.23.2 in /deploy/docker/fs/opt/appsmith/utils (#28168)
Bumps
[@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse)
from 7.19.4 to 7.23.2.


Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 16:32:16 +05:30
Shrikant Sharat Kandula
b6b64f2f1f
chore: Remove RTS Health check in Docker container 2023-10-21 09:58:40 +05:30