Commit Graph

309 Commits

Author SHA1 Message Date
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
Shrikant Sharat Kandula
deb55d8b21
ci: Create separate base image so daily CI can cache better and run faster (#28182)
The layers in the Dockerfile that depend on downloading large files from
external sources, doesn't have to run every day, or at every PR. We
tried using Docker's caching configuration, but it's not as reliable as
we'd have liked.

A separate base image lends us much more control over the how long we
cache the downloaded files and how often we redo this.

This PR only _adds_ the base image. It doesn't change anything in the
build of the existing Docker image. That'll happen once we have the base
images for `release` and `master` already present on DockerHub.
2023-10-18 14:17:38 +05:30
Shrikant Sharat Kandula
1719d73ab6
fix: Fail startup when supervisor creds are missing 2023-10-18 07:58:56 +05:30
Shrikant Sharat Kandula
b414d0746b fix: Remove explicit stats directory for embedded Postgres 2023-10-17 15:00:12 +05:30
Shrikant Sharat Kandula
afd03a526d
chore: Update embedded MongoDB Schema version (#27985) 2023-10-17 06:28:45 +05:30
Shrikant Sharat Kandula
8ea3884632
chore: Support auto-SSL when running behind a forward proxy 2023-10-07 14:21:00 +05:30
Shrikant Sharat Kandula
53bcdafe91
fix: Get Java from GitHub release artifacts directly (#27862)
What are we solving here?

1. Installing Java in the `Dockerfile` by using Adoptium's package
repositories is fragile since they've started blocking some IP addresses
used by GitHub Actions runners. We see a message like this:
   ```
Failed to fetch
https://packages.adoptium.net/artifactory/deb/pool/main/t/temurin-17/temurin-17-jdk_17.0.8.1.0+1_amd64.deb
403 Forbidden [IP: 146.75.107.42 443]
   ```
We're seeing more and more cases of these and PRs are getting blocked.

2. Installing Java via `apt` also installs other packages like X11
libraries, that aren't really relevant to our usage of Java. Yet, these
packages are present in our Docker image, and are the source of several
CVEs to be reported by scanners on our Docker image.

3. This will give us control over trusted CA certificates, which we can
now perform under `$TMP`, which aligns with our move towards supporting
readonly root filesystem. Which is essentially not write to anything in
the Docker image at runtime, except for under `/tmp` and
`/appsmith-stacks`. This will help us move in that direction.
2023-10-06 19:38:19 +05:30
Digvijay Singh
ed3982e534
chore: replaced decommisioned urls with new ones (#27786)
Description:
I've Replaced the old URLs with the new URLs assigned to me provided in
the Spreadsheet.

PR fixes the following issue(s):
Fixes #25513
2023-10-05 12:07:18 +05:30
Shrikant Sharat Kandula
63322193d2
chore: Remove build-essential by default in the Docker image (#27813)
This removes ~70 medium/low severity CVEs reported on our Docker image,
by removing `build-essential` from being installed by default in the
Docker image.

We only need it when compiling Redis, which is needed on _some_ ARM
systems, that re configured with a page-size of greater than 4096. For
example, CentOS 8.
2023-10-05 10:26:39 +05:30
Shrikant Sharat Kandula
e6ca21c34a
fix: Route for HTTP-01 challenge, instead of redirecting (#27788)
In the NGINX configuration we generate, we're redirecting _all_ HTTP
requests to HTTPS, when HTTPS is enabled. But the HTTP-01 challenge
works on port 80 and is getting redirected to 443.

This usually fine, as Let's Encrypt respects that redirect and completes
the challenge on port 443. But, if port 443 is blocked to outside
access, the cert renewal will fail. This PR fixes that.

Tested on a server with port 80 open and 443 closed to outside Internet.
Cert renewal fails without this PR's changes, and works with this PR's
changes.
2023-10-04 15:37:32 +05:30
Shrikant Sharat Kandula
cc2ced886a
fix: Fix backup command getting version (#27780)
This broke when we changed the way RTS stores version information. This
was never the right way to get the version in the `backup` command and
this PR fixes it, by getting the version from `info.json`.

Failure error:

```
Error: ENOENT: no such file or directory, open '/opt/appsmith/rts/version.js'
```
2023-10-04 15:28:26 +05:30
Shrikant Sharat Kandula
164d2e6b65
ci: Use esbuild to build RTS (#27310)
This fixes RTS build to use `esbuild`.

1. This means the whole `node_modules` won't need to be copied over to
the Docker image. There's unused insignifant _test_ files in there, that
don't add any value, but are causing irrelevant CVEs to be reported on
our Docker image. See example at
https://github.com/appsmithorg/appsmith-ee/pull/2349.

2. Much faster. Not that RTS build is our slow point, but still. Perhaps
we can move client to `esbuild` too. 🙂

## Why are we doing this?

The current method of loading RTS into the Docker image means that _all_
contents of _all_ dependencies are copied over. The whole
`node_modules`. But several of these packages include _test_ files too,
that aren't needed at runtime at all. One of such test files is creating
a false alert for a CVE on our Docker image. Has absolutely no relevance
and impact, but it's there.

To fix that, I [had to `rm -rf /opt/appsmith/rts/node_modules/*/test` in
the Docker
image](https://github.com/appsmithorg/appsmith-ee/pull/2349/files). This
felt very hacky, and very dirty. It felt like we're introducing more
debt and more duct tape around the current build process.

So, `esbuild`.

## Where is `esbuild` coming from?

We're using `esbuild` v0.18.20 only, while the latest is v0.19.3. We
need to update `design-system`'s storybook dependency, I think, to get a
more recent version of `esbuild`. I'm yet to figure this out and can use
some help. 🙂
2023-10-03 07:00:40 +05:30
Shrikant Sharat Kandula
2f5405d86d
chore: Run NGINX with readonly root FS support (#27453)
Part of supporting readonly root filesystem, gets NGINX to start without
doing any writes to the filesystem, except for in `/tmp`.
2023-09-27 13:38:47 +05:30
Sumesh Pradhan
9964be125a
fix: Use temporary directory for embedded postgres stats data (#27455)
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-09-27 11:35:43 +05:30
Sumesh Pradhan
8e0d3544c9
feat: password updation for supervisor basic auth native (#27267) 2023-09-20 15:52:35 +05:30
Shrikant Sharat Kandula
1774557714
fix: Fix backend failing to start when running with a custom PORT (#27461)
When running with a custom `PORT` env variable, NGINX server will be
listening on this port. In the backend's startup script, `run-java.sh`,
we're checking for RTS being up or not, at `localhost`. So when the port
is not 80, then this will never succeed, because it'll be looking for
NGINX at the wrong port.

Instead, the fix here will make the backend startup script hit RTS
_directly_ on RTS server's own port, instead of going via NGINX. This
means it's independent of both the `PORT` env variable and the NGINX
server, and only dependent on RTS being up, which is really what we want
here.
2023-09-20 10:27:54 +05:30
Shrikant Sharat Kandula
b76e78e006
fix: Postgres permission error in creating the stats folder (#27454)
When PostgreSQL starts, we see the following errors in the logs:

```
mkdir: 
cannot create directory ‘/tmp/appsmith/postgres-stats’
: Permission denied
```

And then this over and over again:

```
postgres stdout | 2023-09-19 15:34:34.504 UTC [1759] LOG:  could not open temporary statistics file "/tmp/appsmith/postgres-stats/global.tmp": No such file or directory
```

The problem is that in `postgres.conf`, we set `user=postgres`, which
doesn't have access to create things in `/tmp`.

This PR removes this configuration and lets the default be, which will
be a temp folders _under_ the data directory.
2023-09-19 21:21:34 +05:30
Sumesh Pradhan
fd5d3a47b5
fix: clear postgres core dumps (#27152)
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-09-19 17:34:42 +05:30
Shrikant Sharat Kandula
0e4cd23c0e
fix: Fix escaping for _multiple_ single quotes in env variables (#27368)
[Slack
Conversation](https://theappsmith.slack.com/archives/C0341RERY4R/p1694794275962369).
2023-09-19 09:33:14 +05:30
Shrikant Sharat Kandula
9d68025fd9
feat: Add /info endpoint for details about the Appsmith version running (#27345)
This just responds with the contents of `/opt/appsmith/info.json` as is,
with a JSON content type.

This will enable showing the right date on the frontend, as well as on
Flow. See [this Slack
thread](https://theappsmith.slack.com/archives/C02MUD8DNUR/p1694762058953999?thread_ts=1694757060.520329&cid=C02MUD8DNUR)
for the confusion we're solving for.
2023-09-15 15:50:52 +05:30
Shrikant Sharat Kandula
e78aa1193e
chore: Include version in info.json and remove fields that aren't being useful (#27288) 2023-09-15 15:50:23 +05:30
Shrikant Sharat Kandula
ab5cc22a6d
chore: Readonly root FS for supervisord configuration (#27171)
This is part of supporting running Appsmith with readonly root FS. This
moves the supervisord configuration, and runtime files, like the unix
socket file, and the PID file, to `$TMP`.
2023-09-14 14:43:06 +05:30
Shrikant Sharat Kandula
1d15570298
chore: Move cleanup logs from cron to backend server (#27156)
This is moving the cleanup script to delete old log files, from being a
cron job, to being a scheduled task in the backend server. Why?

1. We want to support running Appsmith with readonly root, which is a
request from security teams at enterprise companies.
2. Cron doesn't play nice. It wants to save a `.pid` file under
`/var/run`, so it fails to start when running with readonly root. This
is not configurable.
3. Since our use of cron is minimal only, we're moving away from it,
especially since the backend server is already capable of running
scheduled tasks.
4. This moves one job, there's still another. Based on experience from
this, we'll work on the other.

Another advantage to doing this is that since this job is now running in
the backend server, which has access to MongoDB and Redis, we can
coordinate when running as a cluster, that only _one_ backend is running
the clean up job. This is for much later though.

---------

Co-authored-by: Nidhi <nidhi@appsmith.com>
2023-09-11 18:18:16 +05:30
Shrikant Sharat Kandula
55dea43b2d
chore: Place local MongoDB cluster key in /tmp instead of / (#26963)
This is another step towards supporting running with readonly root FS,
and only making runtime changes in the container in `/tmp` or in
`/appsmith-stacks`, and nowhere else.
2023-09-11 12:54:50 +05:30
Shrikant Sharat Kandula
c594699eac
chore: Use single COPY command in Dockerfile for constant/static files (#27127)
Move the files that are copied into the Docker image, into an `fs`
folder, that reflects the folder structure of that in the image. This
means two things right away:

1. A single `COPY` instruction in `Dockerfile` is enough to copy all the
files to their places.
2. The structure of files in the repo reflects that in the Docker image.
This makes working with the files/folders and troubleshooting with them
much easier.

 Note: **There's actually only 3 files changed, rest are just moved.**
2023-09-11 08:43:09 +05:30
Shrikant Sharat Kandula
8966bd5a76
chore: Remove python-requests from Docker image (#26967)
There's a few CVEs reported on the version of python-requests that's
being used in the image, which we don't need that badly anyway. This PR
removes `python-requests` altogather so we shouldn't see CVEs on it show
up on our image anymore.
2023-09-06 13:50:23 +05:30
Shrikant Sharat Kandula
fae3a4e7c7
chore: Redis config don't write to filesystem at runtime (#26788)
Step towards not changing anything in the filesystem at runtime, except
for things in `/tmp`.
2023-09-05 12:38:51 +05:30