Documentation update for server side set up, and a change to default
value in env variables for Mongo to comply with the one we are using in
the set up docs, to allow for a quick start and lower chance of failure.
## Description
Import application flow is a multi-stage process where we touch all the
mongo DB collections required to store the application in DB, which
today includes pages, actions, JSObjects, etc. When the flow is complete
then only we can say the application is successfully imported and DB
won't have any stale objects stored. But in a negative scenario where
the flow might break because of some unknown exceptions, objects stored
earlier become stale and reside in DB forever. With this PR we are
establishing the infra for transactions to avoid saving stale DB
objects. This is achieved by a rollback mechanism in case an exception
is thrown in the middle of execution.
Note: Since transactions are built on concepts of logical sessions they
require mecahnics (like oplog) which are only available in replica set
environment.
You can always convert a standalone to a single noded replica set and
transactions will work with this one node.
[https://docs.mongodb.com/manual/tutorial/convert-standalone-to-replica-set/](https://docs.mongodb.com/manual/tutorial/convert-standalone-to-replica-set/?_ga=2.53712296.1453502529.1669195955-2065030687.1664009965)
```
For local dev earlier we used to run the single node without replica set. Henceforth if we want to take the advantage of transactions please follow the steps to run mongod single node in local with replica set:
- Upgrade the MongoDB version to 4.4 or higher if it’s 4.2 or lower (https://www.mongodb.com/docs/manual/release-notes/4.4/#std-label-4.4-upgrade)
- Close the mongoDB instance running in your local
- Start the mongoDB in replica set mode and initiate the replica set
- mongod --port 27017 --dbpath <path/to/db> --replSet <replica-set-name> && mongo --eval “rs.initiate()”
- One can use following commands to check replica set status:
- mongo appsmith
- rs.status()
- By this time you should have the mongo running with replica set
```
<img width="1788" alt="Screenshot 2022-07-01 at 10 31 27 PM"
src="https://user-images.githubusercontent.com/41686026/176944386-f9d94715-c0cf-4900-93b7-f73647132d60.png">
This also means mongodb connection string used in env file will now
include the replica-set name if one wants to leverage transactions:
`mongodb://localhost:27017/appsmith?replicaSet={replica-set-name}`
Fixes https://github.com/appsmithorg/appsmith/issues/14543
## Type of change
- Bug fix (non-breaking change which fixes an issue)
- This change requires a documentation update
## How Has This Been Tested?
> JUnit
> Manual test
## Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] 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
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
---------
Co-authored-by: Anagh Hegde <anagh@appsmith.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
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
* fix: Added client side execution logic and on page load logic for js
* Revert dev env
* Revert dev env
* Updated tests expectation partly to break PR
* fix: Reverted test breakage for this PR
* Decryption for dbauth, basic and OAuth datasources added in exported file
* All authentications for datasources included while exporting as deserialization is done through json file otherwise cast is throwing error
* Content-Disposition header implemented
* MongoEscapedWidget names segregated for published and unpublished layout, to prevent overwrite while exporting
* Published pages and actions explicitly handled in cases where unpublished resources are deleted
* Encrypting the password stored in AuthenticationDTO for every db.
* Adding comment to the properties file to denote that adding encryption salt and password are mandatory to the server coming up.
* Added the encryption salt and password to server.yml to allow the github actions to succeed.
* Adding database migration to encrypt the existing passwords for authentication object (used for storing db connection username/password)
Changes to the installation script install.sh:
1. Instead of overwriting the existing encryption password or salt, giving the user an option to conserve the previous encryption credentials to ensure that the developer users do not lose access to their database configurations (passwords).
2. Added another file for writing encryption credentials (encryption.env) to ensure that we dont delete the encryption password and salt by mistake.
* Move application configuration to be loaded from environment variables
* Remove unused sentry.properties
* Make missing value sentinel a constant and ignore all *.env files
* Removed now-used ACL properties
* Prefix RapidAPI environment variable with APPSMITH_
* Fix application properties not being loaded into static fields
* Remove application-test.properties file
* Add required env variables for test in GitHub
* Quote URLs for MongoDB and Redis in test config
* Change RAPIDAPI to RAPID_API in environment variable names
* Source .env file in the root of repo in start script