Commit Graph

44 Commits

Author SHA1 Message Date
Shrikant Sharat Kandula
8b5c1cad87
chore(deps): Fix for Python CVEs in Docker Scout report (#26894)
This addresses 3 more CVEs reported on Appsmith Docker image, on
`setuptools`, another `setuptools`, and `urllib3` packages.
2023-09-04 15:57:04 +05:30
Sumesh Pradhan
ce130c36f5
chore: update dockerfile to install mongodb v6.x (#26856)
Updated Dockerfile to install mongo v6.x instead of v5.x.

#### Tested
Manually - Upgrade from v5.x to v6.x
CI
2023-09-04 15:56:07 +05:30
Shrikant Sharat Kandula
7c93d81c50
chore(deps): Update certbot from v0.40 to v2.6 (#26809) 2023-08-31 11:59:28 +05:30
Shrikant Sharat Kandula
444492b38b
fix: Add nginx-extras and remove Sever header (#26634)
Removes this `Server` header in all responses from Appsmith.

```
curl -sSI http://localhost | grep 'server:'
```

It currently shows this:

```
server: nginx
```
2023-08-25 09:46:01 +05:30
Sumesh Pradhan
0fe6145435
fix: moved jest to devdependencies for appsmithctl and updated dockerfile to exclude it during install (#26350)
Update:
- Mobed jest to` devDependenies` of package manifest.
- Updated Dockerfile to install utils with `--only=prod` arg for npm
install cmds.

Tested manually
2023-08-16 16:39:11 +05:30
Shrikant Sharat Kandula
4b8092d028
chore: Install latest MongoDB v5 (#26169)
We're pinning MongoDB to 5.0.14, but can just as well run 5.0.19. This
PR makes sure we install the latest v5 of MongoDB, every time we build
the image.
2023-08-08 20:59:10 +05:30
Shrikant Sharat Kandula
06092ea634
chore: Update NodeJS in Docker image to v18 (#26065)
We're currently running NodeJS v16, which is [end-of-support on
11-Sep-2023](https://endoflife.date/nodejs). This PR updates the NodeJS
used as runtime, for RTS and `appsmithctl`, in the Appsmith Docker
image.

We do not update the build-time NodeJS version, needed to build the
client code, and RTS. Depending on test results, we'll do it as part of
the same PR, or a separate one.
2023-08-08 05:53:17 +05:30
Shrikant Sharat Kandula
e8c3cc19a2
chore: Add info.json to Docker images (#25948)
This adds a `/opt/appsmith/info.json` file to Docker images, with the
following sample content:

```json
{
  "commitSha": "0521ba2c0d7a62cef3d4def66fc15b59cc34ceef",
  "commitUrl": "0521ba2c0d",
  "branch": "release",
  "date": "2023-08-02T12:52:53+00:00",
  "isCI": false
}
```

We're enabling this only for images built for DPs currently, and will
then extend to other workflows as well.

Notice that we copy `info.*json` instead of `info.json`. The reason is
so that the Docker build doesn't fail, even if the `info.json` file
doesn't exist. This lets us publish this to each workflow in turn,
slowly and carefully.

[Relevant Slack
conversation](https://theappsmith.slack.com/archives/C02MUD8DNUR/p1686197957141419).
2023-08-02 18:36:59 +05:30
Shrikant Sharat Kandula
fa36098f5e
chore: Graceful handling for empty CS URL (#25843)
This will allow us to

1. Bake different CS URLs for release and master builds.
2. Be resilient to the CS URL being set to empty string, as opposed to
not being set at all.
2023-07-31 16:55:46 +05:30
Shrikant Sharat Kandula
b3b9b57d4a
chore: Revert Dockerfile arg change that's breaking release 2023-07-31 14:44:03 +05:30
Shrikant Sharat Kandula
9986dbd235
chore: Add APPSMITH_CLOUD_SERVICES_BASE_URL as build arg (#25721)
This will allow us to set a separate cloud-services URL during build
time.
2023-07-31 10:17:46 +05:30
Goutham Pratapa
a25e02b621
chore: update entrypoint to deploy appsmith on cloudrun (#23829)
Fixes: [23522](https://github.com/appsmithorg/appsmith/issues/23522)

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-06-09 10:24:43 +05:30
Sumesh Pradhan
a359444556
fix: improve starting page removal script with error handling (#23392)
- Removed event listener python script, removed supervisor conf for the
same.
- Added new python script to handle the starting page init.
- Python script will be called via a shell script with a failsafe
removal of the loading page.
- The above shell script will be run as a child of the run java script

Tests:
The child script exits after execution, and does not create zombie
process even when the run java script is called multiple times with
restarts.
Verified exceptions and failsafe manually by introducing syntax errors
and uninstalling requests module.

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-06-06 18:32:40 +05:30
Valera Melnikov
9f607d250d
chore: move local dependency to packages (#23395)
## Description
1. Move everything related to client from app folder to client folder
(`.yarn`, `yarn.lock`, package.json, .gitignore)
2. Move `ast` and `rst` to client packages
3. Fix running scripts in packages
4. Add running unit tests in packages in CI

TODO: It is necessary to consider enabling the `nmHoistingLimits:
workspaces` option, since now all packages are hoisted to the root,
there may be issues with dependencies in workspaces. Also, there is a
possibility of implicit use of packages.

https://yarnpkg.com/configuration/yarnrc#nmHoistingLimits

#### PR fixes following issue(s)
Fixes #23333

#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

## Testing

#### How Has This Been Tested?
- [x] Manual
- [x] Jest
- [x] Cypress

## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] 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
- [x] 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

Co-authored-by: Valera Melnikov <melnikov.vv@greendatasoft.ru>
2023-05-22 15:55:46 +03:00
Sumesh Pradhan
f1bf7b17dc
feat: Display loading message in browser when Appsmith is starting (#22215)
## Description
Added Appsmith Initializing and Starting pages to inform the users that
Appsmith is starting up and they will need to wait for a few minutes
before their Appsmith deployment is up and running, instead of
displaying the 503 error like it earlier.


## Type of change
- New feature (non-breaking change which adds functionality)

# Media
Initialization page

![image](https://user-images.githubusercontent.com/20785806/230869925-a342e327-c714-4cfa-8283-cf6f5bd225b5.png)

Starting page

![image](https://user-images.githubusercontent.com/20785806/230869770-67654c0a-e4de-4d18-83dd-9f68230648e9.png)

[Demo
Video](https://drive.google.com/file/d/1sjvfbtbWHRqVfg0Vvf2JM6W3y61-KrWm/view?usp=share_link)
## How Has This Been Tested?
- Manual

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2023-04-19 18:20:59 +05:30
Sumesh Pradhan
46465c3383
feat: Updated appsmithctl node version to v16.x (#21320)
Updated the container runtime node version (dockerfile service layer) to
v16.x
2023-03-14 17:04:52 +05:30
Sumesh Pradhan
c3c6218c0f
feat: Embeded PostgreSQL with mockdb data for self-hosted (#21084)
## Description
This PR includes changes for self-hosted instances to utilize an
embedded postgres database for the Template's mockdb.
After this change, by default Appsmith will always run the embedded
Postgres, and connect to it instead of the mockdb cloud instance.

**Solves:**
Issue[#20107](https://github.com/appsmithorg/appsmith/issues/20107)

**Changes:**
- [x] Install Postgresql in the Docker container using Dockerfile :-
_Updated Docker file to install PostgreSQL v13_

- [x] Add provision to stop/disable Postgresql from booting based on an
environment variable :- _To disable embedded postgres, set the **ENV**
var `APPSMITH_ENABLE_EMBEDDED_DB` to `0`; Configured supervisord to
control the lifecycle of the postgres server ( Supervisor uses user
postgres to start the server since root is not allowed)_

- [x] Seed data into the Postgresql DB during first container startup.
This ensures that we don't have to ship the Docker
container with data & bloat it unnecessarily. :- _Curretly, the SQL dump
is baked into the image._
      
- [x] Persist the Postgresql data in /appsmith-stacks. This ensures that
the data is persisted across version upgrades. :- _The postgres uses the
file system at` /stacks/data/postgres/main` ; note: The file system
owner is user/group postgres_

- [x] Update the mock db endpoint in the product to use the local DB by
default instead of the hosted DB for self-hosted instances. The cloud
instance should still use the hosted DB :- _The embedded postgres
authentication is set to the type `trust`, allowing the existing
template mockdb meta data to be used without any update to the existing
templates mockdb endpoint and credentials_

**Note: There is an additional table `mydb` added to the mockdb for
quickly verifying the db source is the embedded postgres, since the
cloud mockdb does not have that table.**

---------

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2023-03-07 15:22:41 +05:30
Shrikant Sharat Kandula
f65986c351
fix: Use mongosh instead of mongo in entrypoint (#20055)
Fixes #19969.

The previous PR that fixed this was failing with the way we were
creating the initial user on MongoDB. This PR addresses that.

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2023-01-27 16:05:00 +05:30
Nidhi
dfccd5a058
chore: Upgrade to Spring Boot 3.0.1 (#19044)
This upgrade takes care of our move to JDK 17, Spring Boot 3.0.1 and a
few other security upgrades along the way.

Fixes #18993 

TODO:

- [x] Check CI changes for Java 17
- [x] Check vulnerability report
- [x] Mongock needs an upgrade
- [x] Add JVM args at all possible places for exposing java.time module
- [x] Add type adapters everywhere / use the same config for type
adapters everywhere
2023-01-02 19:40:59 +07:00
Goutham Pratapa
349ed41e49
chore: refactor backend startup script (#19420)
Fixes: [19300](https://github.com/appsmithorg/appsmith/issues/19300)
2023-01-02 15:25:23 +05:30
Goutham Pratapa
1de045d9d8
chore: Add dependency to start backend only if rts is ready (#19218)
Fixes: [19207](https://github.com/appsmithorg/appsmith/issues/19207)

**By default on start-up**

```
root@ab348246fff8:/appsmith-stacks/logs# head backend/backend-ab348246fff8.log
Waiting for RTS to start ...
RTS started.
Starting Backend server...
Load environment configuration
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/appsmith/backend/server.jar!/BOOT-INF/lib/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/appsmith/backend/server.jar!/BOOT-INF/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[2022-12-26 11:39:34,962]  - Starting ServerApplication vv1.8.14.1 using Java 11.0.17 on ab348246fff8 with PID 1543 (/opt/appsmith/backend/server.jar started by root in /opt/appsmith/backend)
```
**Upon stopping RTS manually** 

```
root@ab348246fff8:/appsmith-stacks/logs# supervisorctl stop rts
rts: stopped
root@ab348246fff8:/appsmith-stacks/logs# supervisorctl status
backend                          RUNNING   pid 1497, uptime 0:01:21
cron                             RUNNING   pid 1505, uptime 0:01:21
editor                           RUNNING   pid 1502, uptime 0:01:21
mongodb                          RUNNING   pid 1491, uptime 0:01:21
redis                            RUNNING   pid 1490, uptime 0:01:21
rts                              STOPPED   Dec 26 11:40 AM
stdout                           RUNNING   pid 1489, uptime 0:01:21
```

**Restart Backend service to check if backend service starts** 

```
root@ab348246fff8:/appsmith-stacks/logs# supervisorctl restart backend
backend: stopped
backend: started
root@ab348246fff8:/appsmith-stacks/logs# supervisorctl status
backend                          RUNNING   pid 1802, uptime 0:00:12
cron                             RUNNING   pid 1505, uptime 0:01:43
editor                           RUNNING   pid 1502, uptime 0:01:43
mongodb                          RUNNING   pid 1491, uptime 0:01:43
redis                            RUNNING   pid 1490, uptime 0:01:43
rts                              STOPPED   Dec 26 11:40 AM
stdout                           RUNNING   pid 1489, uptime 0:01:43
root@ab348246fff8:/appsmith-stacks/logs# supervisorctl ^C
root@ab348246fff8:/appsmith-stacks/logs# tail -f backend/backend-ab348246fff8.log
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
Waiting for RTS to start ...
^C
```

**Upon starting RTS the behaviour of backend immediately**
 
```
root@ab348246fff8:/appsmith-stacks/logs# supervisorctl start rts
rts: started
root@ab348246fff8:/appsmith-stacks/logs# tail -f backend/backend-ab348246fff8.log
Starting Backend server...
Load environment configuration
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/appsmith/backend/server.jar!/BOOT-INF/lib/logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/appsmith/backend/server.jar!/BOOT-INF/lib/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[2022-12-26 11:41:33,796]  - Starting ServerApplication vv1.8.14.1 using Java 11.0.17 on ab348246fff8 with PID 1968 (/opt/appsmith/backend/server.jar started by root in /opt/appsmith/backend)
[2022-12-26 11:41:33,799]  - Running with Spring Boot v2.6.5, Spring v5.3.17
[2022-12-26 11:41:33,803]  - No active profile set, falling back to 1 default profile: "default"
[2022-12-26 11:41:34,615]  - Multiple Spring Data modules found, entering strict repository configuration mode!
[2022-12-26 11:41:34,616]  - Bootstrapping Spring Data Reactive MongoDB repositories in DEFAULT mode.
[2022-12-26 11:41:34,859]  - Finished Spring Data repository scanning in 239 ms. Found 55 Reactive MongoDB repository interfaces.
[2022-12-26 11:41:35,220]  - Multiple Spring Data modules found, entering strict repository configuration mode!
[2022-12-26 11:41:35,221]  - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
```
2022-12-29 14:22:41 +05:30
Sumesh Pradhan
60806f7761
Dockerfile mongodb 4.4 to 5.0.14 upgrade (#18773) 2022-12-19 15:00:24 +05:30
Alexey Palazhchenko
e6a9fc3092
chore: Fix outdated comment in Dockerfile (#17363) 2022-10-07 10:16:15 +05:30
Goutham Pratapa
8e60ab4649
Use jdk instead of jre to generate heapdumps (#16989) 2022-09-26 11:04:12 +05:30
Ayangade Adeoluwa
b3c4f7c392
feat: AST apis for parsing script and returning identifiers (#16252)
* rts configurations for ast

* update shared dependencies.json for shared ast module

* feat: api for script to identifiers

* fix: typo for identifiers

* feat: api for multiple scripts to get identifiers

* fix: rts config, apis for ast

* fix: removed unnecessary changes for ast modules

* fix: docker image for rts including ast shared module, rts file alias ref

* fix: added comments in build.sh file

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2022-09-12 14:45:47 +05:30
Aman Agarwal
8940726ed1
fix: rts fat container docker image (#16092)
## Description

- Added the removal of rts previous build before building new image
- Fixed Fat container copying of dist folder to rts image directory path in docker container

Fixes #16091

## Type of change

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

## How Has This Been Tested?

> Please describe the tests that you ran to verify your changes. Provide instructions, so we can reproduce.
> Please also list any relevant details for your test configuration.

- Test A
- Test B

## Checklist:

- [ ] 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
2022-08-17 19:10:10 +05:30
Sumesh Pradhan
edbfef7d51
Auto-backup and cleanup with appsmithctl (#15203)
- Auto-cleanup of backup files using env variable APPSMITH_BACKUP_ARCHIVE_LIMIT (default value is 4) after every backup.
- Updated docker file to include watchtower hook scripts.
- Error mail interval to 6hrs.
2022-07-28 17:45:28 +05:30
Shrikant Sharat Kandula
73e43fadbd
Support for custom CA certificates (#14207)
Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2022-06-01 11:14:27 +05:30
Sumesh Pradhan
5e92d48037
Add healthcheck to docker (#13154) 2022-05-06 11:45:56 +05:30
Shrikant Sharat Kandula
62ba607559
Fix Redis installation in Dockerfile (#13428) 2022-04-29 09:01:27 +05:30
Shrikant Sharat Kandula
5cdb4426a4
Revert setuid/setgid cleanup in fat image 2022-04-28 19:56:09 +05:30
Shrikant Sharat Kandula
63c6c75073
Disable uid/gid bits for fat container (#13277) 2022-04-27 12:57:57 +05:30
geekup-legodevops
c210857791
Redis running on 64k pagesize (#12264) 2022-04-01 12:28:03 +05:30
Shrikant Sharat Kandula
e013c562a0
chore: Run apt upgrade in appsmith image (#12431) 2022-03-31 16:35:11 +05:30
geekup-legodevops
382ea53ab3
Refactor to deploy Heroku using new Docker image (#9127) 2022-03-24 13:17:36 +05:30
geekup-legodevops
e85b34d66e
Add Helm configMap to update application configuration (#10157) 2022-01-31 13:27:01 +05:30
geekup-legodevops
daf60fab72
Add appsmithctl command to migrate instance to new server (#9508) 2021-12-17 10:39:20 +05:30
geekup-legodevops
5ec733e5a2
Refactor to generate nginx config file with auto-redirect HTTPS (#9256)
Refactor flow to generate nginx configuration file corresponding Custom domain set up

Add 2 template for Nginx template for HTTP and HTTPS. HTTPS contains new block for auto-redirect for HTTPS
2021-11-23 11:22:09 +05:30
geekup-legodevops
6cbe4b8faf
Config supervisord to write logs into log files (#8145) 2021-10-19 12:59:55 +05:30
geekup-legodevops
f37f9451ef
feat: Support building Docker image for ARM arch (#7832) 2021-09-29 14:33:27 +05:30
Nidhi
1660ade6fb
fix: Added specific locale to root Dockerfile (#7873)
* Added specific locale to root Dockerfile

* Update Dockerfile

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2021-09-28 10:34:33 +05:30
Shrikant Sharat Kandula
d252554867
ci: Fix server jar paths in fat container image (#7771) 2021-09-23 19:58:53 +05:30
Shrikant Sharat Kandula
f0a61285a6
docs: Fat container documentation fixes (#7207)
Added additional details about how to use the fat container, and how to manage / maintain it.

Also includes some refactorings that shouldn't affect the functionality significantly.
2021-09-14 19:01:06 +05:30
geekup-legodevops
8119a74054
feat: Implement fat container for appsmith application (#6678)
Adds a Dockerfile along with accompanying scripts and definitions for building a fat Docker image. This image, when run as a container, will include the server, client, RTS, and necessary vendor services running all within.
2021-09-01 11:02:08 +05:30