Commit Graph

36 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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