diff --git a/.github/workflows/sync-release-to-pg.yml b/.github/workflows/sync-release-to-pg.yml
index a962d28c9e2..e4cc227b29e 100644
--- a/.github/workflows/sync-release-to-pg.yml
+++ b/.github/workflows/sync-release-to-pg.yml
@@ -51,13 +51,13 @@ jobs:
if: env.MERGE_CONFLICT == 'false'
run: |
set -e
- git push origin pg || echo "PUSH_FAILURE=true" >> $GITHUB_ENV
+ git push https://${{ secrets.PAT_GITHUB }}@github.com/${{ github.repository }} HEAD:pg || echo "PUSH_FAILURE=true" >> $GITHUB_ENV
- name: Capture push failure message
if: env.PUSH_FAILURE == 'true'
run: |
# Capture the last git error message
- push_error_message=$(git push origin pg 2>&1 | tail -n 1)
+ push_error_message=$(git push https://${{ secrets.PAT_GITHUB }}@github.com/${{ github.repository }} HEAD:pg 2>&1 | tail -n 1)
echo "PUSH_ERROR_MESSAGE=$push_error_message" >> $GITHUB_ENV
- name: Notify on push failure
diff --git a/app/client/packages/design-system/ads/src/Documentation/components/CodeBlock.tsx b/app/client/packages/design-system/ads/src/Documentation/components/CodeBlock.tsx
index 320d52cda9b..8672d0f3266 100644
--- a/app/client/packages/design-system/ads/src/Documentation/components/CodeBlock.tsx
+++ b/app/client/packages/design-system/ads/src/Documentation/components/CodeBlock.tsx
@@ -16,7 +16,7 @@ function CodeBlock({ code }: CodeBlockProps) {
}}
>
{code}
-
+
);
}
diff --git a/app/client/src/ce/api/UserApi.tsx b/app/client/src/ce/api/UserApi.tsx
index 82697968b44..f8a8b7a55fa 100644
--- a/app/client/src/ce/api/UserApi.tsx
+++ b/app/client/src/ce/api/UserApi.tsx
@@ -57,7 +57,6 @@ export interface UpdateUserRequest {
name?: string;
email?: string;
proficiency?: string;
- role?: string;
useCase?: string;
intercomConsentGiven?: boolean;
}
@@ -70,19 +69,6 @@ export interface SendTestEmailPayload {
password?: string;
}
-export interface CreateSuperUserRequest {
- email: string;
- name: string;
- source: "FORM";
- state: "ACTIVATED";
- isEnabled: boolean;
- password: string;
- role: "Developer";
- companyName: string;
- allowCollectingAnonymousData: boolean;
- signupForNewsletter: boolean;
-}
-
export class UserApi extends Api {
static usersURL = "v1/users";
static productAlertURL = "v1/product-alert/alert";
@@ -99,7 +85,6 @@ export class UserApi extends Api {
static currentUserURL = "v1/users/me";
static photoURL = "v1/users/photo";
static featureFlagsURL = "v1/users/features";
- static superUserURL = "v1/users/super";
static adminSettingsURL = "v1/admin/env";
static restartServerURL = "v1/admin/restart";
static sendTestEmailURL = "/v1/admin/send-test-email";
@@ -214,12 +199,6 @@ export class UserApi extends Api {
return Api.get(UserApi.featureFlagsURL);
}
- static async createSuperUser(
- request: CreateSuperUserRequest,
- ): Promise> {
- return Api.post(UserApi.superUserURL, request);
- }
-
/*
* Super user endpoints
*/
diff --git a/app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx b/app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx
index 7eeba362e2e..9d58eceb7a9 100644
--- a/app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx
+++ b/app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx
@@ -51,18 +51,16 @@ export const useQueryAdd = () => {
return;
}
- let url = "";
+ const url = getQueryUrl(currentEntityInfo);
- url = getQueryUrl(currentEntityInfo);
history.push(url);
- }, [currentEntityInfo]);
+ }, [currentEntityInfo, dispatch, ideViewMode]);
const closeAddQuery = useCallback(() => {
- let url = "";
+ const url = getQueryUrl(currentEntityInfo, false);
- url = getQueryUrl(currentEntityInfo, false);
history.push(url);
- }, [currentEntityInfo, ideViewMode]);
+ }, [currentEntityInfo]);
return { openAddQuery, closeAddQuery };
};
@@ -113,6 +111,15 @@ export const useGroupedAddQueryOperations = (): GroupedAddOperations => {
return groups;
};
+const PluginActionEditor = lazy(async () =>
+ retryPromise(
+ async () =>
+ import(
+ /* webpackChunkName: "PluginActionEditor" */ "pages/Editor/AppPluginActionEditor"
+ ),
+ ),
+);
+
const ApiEditor = lazy(async () =>
retryPromise(
async () =>
@@ -145,13 +152,65 @@ const QueryEmpty = lazy(async () =>
);
export const useQueryEditorRoutes = (path: string): UseRoutes => {
- return useMemo(
+ const isActionRedesignEnabled = useFeatureFlag(
+ FEATURE_FLAG.release_actions_redesign_enabled,
+ );
+
+ const skeleton = useMemo(() => , []);
+
+ const newComponents = useMemo(
+ () => [
+ {
+ key: "PluginActionEditor",
+ component: () => {
+ return (
+
+
+
+ );
+ },
+ path: [
+ BUILDER_PATH + API_EDITOR_ID_PATH,
+ BUILDER_CUSTOM_PATH + API_EDITOR_ID_PATH,
+ BUILDER_PATH_DEPRECATED + API_EDITOR_ID_PATH,
+ BUILDER_PATH + SAAS_EDITOR_API_ID_PATH,
+ BUILDER_CUSTOM_PATH + SAAS_EDITOR_API_ID_PATH,
+ BUILDER_PATH_DEPRECATED + SAAS_EDITOR_API_ID_PATH,
+ path + "/:baseQueryId",
+ ],
+ exact: true,
+ },
+ {
+ key: "AddQuery",
+ exact: true,
+ component: () => (
+
+
+
+ ),
+ path: [`${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
+ },
+ {
+ key: "QueryEmpty",
+ component: () => (
+
+
+
+ ),
+ exact: true,
+ path: [path],
+ },
+ ],
+ [path, skeleton],
+ );
+
+ const oldComponents = useMemo(
() => [
{
key: "ApiEditor",
- component: (args) => {
+ component: (args: object) => {
return (
- }>
+
);
@@ -166,18 +225,18 @@ export const useQueryEditorRoutes = (path: string): UseRoutes => {
{
key: "AddQuery",
exact: true,
- component: (args) => (
- }>
-
+ component: () => (
+
+
),
path: [`${path}${ADD_PATH}`, `${path}/:baseQueryId${ADD_PATH}`],
},
{
key: "SAASEditor",
- component: (args) => {
+ component: (args: object) => {
return (
- }>
+
);
@@ -191,9 +250,9 @@ export const useQueryEditorRoutes = (path: string): UseRoutes => {
},
{
key: "QueryEditor",
- component: (args) => {
+ component: (args: object) => {
return (
- }>
+
);
@@ -203,17 +262,23 @@ export const useQueryEditorRoutes = (path: string): UseRoutes => {
},
{
key: "QueryEmpty",
- component: (args) => (
- }>
-
+ component: () => (
+
+
),
exact: true,
path: [path],
},
],
- [path],
+ [path, skeleton],
);
+
+ if (isActionRedesignEnabled) {
+ return newComponents;
+ }
+
+ return oldComponents;
};
export const useAddQueryListItems = () => {
diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx
index 42f5cfa8379..51baf293170 100644
--- a/app/client/src/ce/sagas/userSagas.tsx
+++ b/app/client/src/ce/sagas/userSagas.tsx
@@ -417,14 +417,13 @@ export function* inviteUsers(
export function* updateUserDetailsSaga(action: ReduxAction) {
try {
- const { email, intercomConsentGiven, name, proficiency, role, useCase } =
+ const { email, intercomConsentGiven, name, proficiency, useCase } =
action.payload;
const response: ApiResponse = yield callAPI(UserApi.updateUser, {
email,
name,
proficiency,
- role,
useCase,
intercomConsentGiven,
});
diff --git a/app/client/src/components/editorComponents/CodeEditor/index.tsx b/app/client/src/components/editorComponents/CodeEditor/index.tsx
index bd236a5e3d2..8c9027dc647 100644
--- a/app/client/src/components/editorComponents/CodeEditor/index.tsx
+++ b/app/client/src/components/editorComponents/CodeEditor/index.tsx
@@ -1710,6 +1710,7 @@ class CodeEditor extends Component {
"commands-button invisible",
!showSlashCommandButton && "!hidden",
)}
+ isIconButton
kind="tertiary"
onClick={() => {
const newValue =
diff --git a/app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx b/app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx
deleted file mode 100644
index 2d974cc9858..00000000000
--- a/app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-import { default as CE_AppPluginActionEditor } from "ce/pages/Editor/AppPluginActionEditor/AppPluginActionEditor";
-
-export default CE_AppPluginActionEditor;
diff --git a/app/client/src/pages/AppViewer/Navigation/TopStacked.tsx b/app/client/src/pages/AppViewer/Navigation/TopStacked.tsx
index 728dce23ce1..0931df56b1b 100644
--- a/app/client/src/pages/AppViewer/Navigation/TopStacked.tsx
+++ b/app/client/src/pages/AppViewer/Navigation/TopStacked.tsx
@@ -112,6 +112,7 @@ export function TopStacked(props: NavigationProps) {
{tabsScrollable && (
startScrolling(true)}
onMouseLeave={stopScrolling}
@@ -153,6 +154,7 @@ export function TopStacked(props: NavigationProps) {
{tabsScrollable && (
startScrolling(false)}
onMouseLeave={stopScrolling}
diff --git a/app/client/src/pages/Editor/APIEditor/index.tsx b/app/client/src/pages/Editor/APIEditor/index.tsx
index 568fca9c019..8e97ac8ec2c 100644
--- a/app/client/src/pages/Editor/APIEditor/index.tsx
+++ b/app/client/src/pages/Editor/APIEditor/index.tsx
@@ -38,7 +38,6 @@ import { resolveIcon } from "../utils";
import { ENTITY_ICON_SIZE, EntityIcon } from "../Explorer/ExplorerIcons";
import { getIDEViewMode } from "selectors/ideSelectors";
import { EditorViewMode } from "ee/entities/IDE/constants";
-import { AppPluginActionEditor } from "pages/Editor/AppPluginActionEditor";
type ApiEditorWrapperProps = RouteComponentProps;
@@ -164,14 +163,6 @@ function ApiEditorWrapper(props: ApiEditorWrapperProps) {
return ;
}, [action?.name, isConverting, icon]);
- const isActionRedesignEnabled = useFeatureFlag(
- FEATURE_FLAG.release_actions_redesign_enabled,
- );
-
- if (isActionRedesignEnabled) {
- return ;
- }
-
return (
-
+
;
@@ -187,14 +186,6 @@ function QueryEditor(props: QueryEditorProps) {
);
}, [action?.name, isConverting, icon]);
- const isActionRedesignEnabled = useFeatureFlag(
- FEATURE_FLAG.release_actions_redesign_enabled,
- );
-
- if (isActionRedesignEnabled) {
- return ;
- }
-
return (
createFormEncoded(ServerWebExchange exchange) {
return userSignup.signupAndLoginFromFormData(exchange);
}
- @JsonView(Views.Public.class)
- @PostMapping(
- value = "/super",
- consumes = {MediaType.APPLICATION_JSON_VALUE})
- public Mono> createSuperUser(
- @Valid @RequestBody UserSignupRequestDTO resource,
- @RequestHeader("Origin") String originHeader,
- ServerWebExchange exchange) {
- return userSignup
- .signupAndLoginSuper(resource, originHeader, exchange)
- .map(created -> new ResponseDTO<>(HttpStatus.CREATED.value(), created, null));
- }
-
@JsonView(Views.Public.class)
@PostMapping(
value = "/super",
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java
index c7e8362a9be..6daca744576 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/domains/UserData.java
@@ -33,11 +33,6 @@ public class UserData extends BaseDomain {
@JsonView(Views.Internal.class)
String userId;
- // Role of the user in their workspace, example, Designer, Developer, Product Lead etc.
- @JsonView(Views.Public.class)
- @Deprecated
- private String role;
-
// The development proficiency of the user for example, Beginner, Novice, Intermediate, Advanced.
@JsonView(Views.Public.class)
private String proficiency;
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java
index 1ef47a48882..e37213905b2 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/UserSignupRequestDTO.java
@@ -19,9 +19,6 @@ public class UserSignupRequestDTO {
private String password;
- @Deprecated
- private String role;
-
private String proficiency;
private String useCase;
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java
index be2ae09ee4c..9a289ea1dc5 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/UserUpdateCE_DTO.java
@@ -9,8 +9,6 @@
public class UserUpdateCE_DTO {
private String name;
- private String role;
-
private String proficiency;
private String useCase;
@@ -22,6 +20,6 @@ public boolean hasUserUpdates() {
}
public boolean hasUserDataUpdates() {
- return role != null || proficiency != null || useCase != null || isIntercomConsentGiven;
+ return proficiency != null || useCase != null || isIntercomConsentGiven;
}
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java
index 3dcd578b4c3..8c6153f9488 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCE.java
@@ -17,13 +17,7 @@ public interface AnalyticsServiceCE {
Mono identifyUser(User user, UserData userData, String recentlyUsedWorkspaceId);
void identifyInstance(
- String instanceId,
- String role,
- String proficiency,
- String useCase,
- String adminEmail,
- String adminFullName,
- String ip);
+ String instanceId, String proficiency, String useCase, String adminEmail, String adminFullName, String ip);
Mono sendEvent(String event, String userId, Map properties);
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java
index 8c41a2fc851..6887c468d16 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/AnalyticsServiceCEImpl.java
@@ -141,7 +141,7 @@ public Mono identifyUser(User user, UserData userData, String recentlyUsed
"isSuperUser", isSuperUser,
"instanceId", instanceId,
"mostRecentlyUsedWorkspaceId", tuple.getT4(),
- "role", ObjectUtils.defaultIfNull(userData.getRole(), ""),
+ "role", "",
"proficiency", ObjectUtils.defaultIfNull(userData.getProficiency(), ""),
"goal", ObjectUtils.defaultIfNull(userData.getUseCase(), ""))));
analytics.flush();
@@ -150,13 +150,7 @@ public Mono identifyUser(User user, UserData userData, String recentlyUsed
}
public void identifyInstance(
- String instanceId,
- String role,
- String proficiency,
- String useCase,
- String adminEmail,
- String adminFullName,
- String ip) {
+ String instanceId, String proficiency, String useCase, String adminEmail, String adminFullName, String ip) {
if (!isActive()) {
return;
}
@@ -167,7 +161,7 @@ public void identifyInstance(
"isInstance",
true, // Is this "identify" data-point for a user or an instance?
ROLE,
- ObjectUtils.defaultIfNull(role, ""),
+ "",
PROFICIENCY,
ObjectUtils.defaultIfNull(proficiency, ""),
GOAL,
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java
index 1589daf14bd..9cede7c2f62 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/UserServiceCEImpl.java
@@ -618,9 +618,6 @@ public Mono updateCurrentUser(final UserUpdateDTO allUpdates, ServerWebExc
if (allUpdates.hasUserDataUpdates()) {
final UserData updates = new UserData();
- if (StringUtils.hasLength(allUpdates.getRole())) {
- updates.setRole(allUpdates.getRole());
- }
if (StringUtils.hasLength(allUpdates.getProficiency())) {
updates.setProficiency(allUpdates.getProficiency());
}
diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java
index 75133d866d0..b60a7faae79 100644
--- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java
+++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/UserSignupCEImpl.java
@@ -300,7 +300,6 @@ public Mono signupAndLoginSuper(
})
.flatMap(user -> {
final UserData userData = new UserData();
- userData.setRole(userFromRequest.getRole());
userData.setProficiency(userFromRequest.getProficiency());
userData.setUseCase(userFromRequest.getUseCase());
@@ -380,9 +379,6 @@ public Mono signupAndLoginSuperFromFormData(String originHeader, ServerWeb
if (formData.containsKey(FieldName.NAME)) {
user.setName(formData.getFirst(FieldName.NAME));
}
- if (formData.containsKey("role")) {
- user.setRole(formData.getFirst("role"));
- }
if (formData.containsKey("proficiency")) {
user.setProficiency(formData.getFirst("proficiency"));
}
@@ -446,7 +442,7 @@ private Mono sendInstallationSetupAnalytics(
analyticsProps.put(DISABLE_TELEMETRY, !userFromRequest.isAllowCollectingAnonymousData());
analyticsProps.put(SUBSCRIBE_MARKETING, userFromRequest.isSignupForNewsletter());
analyticsProps.put(EMAIL, newsletterSignedUpUserEmail);
- analyticsProps.put(ROLE, ObjectUtils.defaultIfNull(userData.getRole(), ""));
+ analyticsProps.put(ROLE, "");
analyticsProps.put(PROFICIENCY, ObjectUtils.defaultIfNull(userData.getProficiency(), ""));
analyticsProps.put(GOAL, ObjectUtils.defaultIfNull(userData.getUseCase(), ""));
// ip is a reserved keyword for tracking events in Mixpanel though this is allowed in
@@ -460,7 +456,6 @@ private Mono sendInstallationSetupAnalytics(
analyticsService.identifyInstance(
instanceId,
- userData.getRole(),
userData.getProficiency(),
userData.getUseCase(),
newsletterSignedUpUserEmail,
diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java
index 6975f764cd6..6d29deb3eb3 100644
--- a/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java
+++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java
@@ -22,7 +22,6 @@ public class CommonConfigTest {
@Test
public void objectMapper_BeanCreated_WithPublicJsonViewAsDefault() throws JsonProcessingException {
UserData userData = new UserData();
- userData.setRole("new_role");
userData.setProficiency("abcd"); // this is public field
userData.setUserId("userId"); // this is internal field
userData.setUserPermissions(null);
diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java
index 03b2cdd7105..7edad2e1283 100644
--- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java
+++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserServiceTest.java
@@ -425,21 +425,6 @@ public void updateNameOfUser_WithAccentedCharacters_IsValid() {
.verifyComplete();
}
- @Test
- @WithUserDetails(value = "api_user")
- public void updateRoleOfUser() {
- UserUpdateDTO updateUser = new UserUpdateDTO();
- updateUser.setRole("New role of user");
- final Mono resultMono =
- userService.updateCurrentUser(updateUser, null).then(userDataService.getForUserEmail("api_user"));
- StepVerifier.create(resultMono)
- .assertNext(userData -> {
- assertNotNull(userData);
- assertThat(userData.getRole()).isEqualTo("New role of user");
- })
- .verifyComplete();
- }
-
@Test
@WithUserDetails(value = "api_user")
public void updateIntercomConsentOfUser() {
@@ -499,10 +484,9 @@ public void getIntercomConsentOfUserOnCloudHosting_AlwaysTrue() {
@Test
@WithUserDetails(value = "api_user")
- public void updateNameRoleAndUseCaseOfUser() {
+ public void updateNameAndUseCaseOfUser() {
UserUpdateDTO updateUser = new UserUpdateDTO();
updateUser.setName("New name of user here");
- updateUser.setRole("New role of user");
updateUser.setUseCase("New use case");
final Mono> resultMono = userService
.updateCurrentUser(updateUser, null)
@@ -514,7 +498,6 @@ public void updateNameRoleAndUseCaseOfUser() {
assertNotNull(user);
assertNotNull(userData);
assertEquals("New name of user here", user.getName());
- assertEquals("New role of user", userData.getRole());
assertEquals("New use case", userData.getUseCase());
})
.verifyComplete();
diff --git a/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh b/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh
index 72acbe17a81..0bda58015f3 100644
--- a/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh
+++ b/deploy/ansible/appsmith_playbook/roles/setup-appsmith/templates/appsmith/scripts/first-time-setup.sh
@@ -111,16 +111,13 @@ if [[ $status_code -eq 401 ]]; then
default_user_name="${tokens[0]}"
default_user_password="${tokens[1]}"
- curl -k -X POST 'http://localhost/api/v1/users/super' \
- --header 'Content-Type: application/json' \
- --data-raw '{
- "name" : "'"$default_user_name"'",
- "email" : "'"$default_user_name"'",
- "source" : "FORM",
- "state" : "ACTIVATED",
- "isEnabled" : "true",
- "password": "'"$default_user_password"'"
- }'
+ curl http://localhost/api/v1/users/super \
+ --data-urlencode "name=$default_user_name" \
+ --data-urlencode "email=$default_user_name" \
+ --data-urlencode "password=$default_user_password" \
+ -d source=FORM \
+ -d state=ACTIVATED \
+ -d isEnabled=true
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
diff --git a/deploy/aws_ami/first-time-setup.sh b/deploy/aws_ami/first-time-setup.sh
index 1299e0915de..32a714bf997 100755
--- a/deploy/aws_ami/first-time-setup.sh
+++ b/deploy/aws_ami/first-time-setup.sh
@@ -110,16 +110,13 @@ if [[ $status_code -eq 401 ]]; then
default_user_name="${tokens[0]}"
default_user_password="${tokens[1]}"
- curl -k -X POST 'http://localhost/api/v1/users/super' \
- --header 'Content-Type: application/json' \
- --data-raw '{
- "name" : "'"$default_user_name"'",
- "email" : "'"$default_user_name"'",
- "source" : "FORM",
- "state" : "ACTIVATED",
- "isEnabled" : "true",
- "password": "'"$default_user_password"'"
- }'
+ curl http://localhost/api/v1/users/super \
+ --data-urlencode "name=$default_user_name" \
+ --data-urlencode "email=$default_user_name" \
+ --data-urlencode "password=$default_user_password" \
+ -d source=FORM \
+ -d state=ACTIVATED \
+ -d isEnabled=true
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
diff --git a/deploy/docker/base.dockerfile b/deploy/docker/base.dockerfile
index 8549406ebc3..5ea5ec48541 100644
--- a/deploy/docker/base.dockerfile
+++ b/deploy/docker/base.dockerfile
@@ -10,8 +10,8 @@ LABEL maintainer="tech@appsmith.com"
WORKDIR /opt/appsmith
# The env variables are needed for Appsmith server to correctly handle non-roman scripts like Arabic.
-ENV LANG C.UTF-8
-ENV LC_ALL C.UTF-8
+ENV LANG=C.UTF-8
+ENV LC_ALL=C.UTF-8
# Install dependency packages
RUN set -o xtrace \
@@ -44,10 +44,21 @@ RUN set -o xtrace \
| tar -xz -C /opt/java --strip-components 1
# Install NodeJS
-RUN set -o xtrace \
- && mkdir -p /opt/node \
- && file="$(curl -sS 'https://nodejs.org/dist/latest-v20.x/' | awk -F\" '$2 ~ /linux-'"$(uname -m | sed 's/x86_64/x64/; s/aarch64/arm64/')"'.tar.gz/ {print $2}')" \
- && curl "https://nodejs.org/dist/latest-v20.x/$file" | tar -xz -C /opt/node --strip-components 1
+RUN < 0) {
- shell.echo('application is not running, starting supervisord');
- shell.exec('/usr/bin/supervisord');
- }
- });
+ await utils.execCommandSilent(["/usr/bin/supervisorctl"]);
+ } catch (e) {
+ console.error('Supervisor is not running, exiting.');
+ process.exitCode = 1;
+ return;
+ }
+ try {
console.log('Available free space at /appsmith-stacks');
- const availSpaceInBytes = getAvailableBackupSpaceInBytes();
+ const availSpaceInBytes = getAvailableBackupSpaceInBytes("/appsmith-stacks");
console.log('\n');
checkAvailableBackupSpace(availSpaceInBytes);
@@ -244,13 +244,14 @@ function getTimeStampInISO() {
return new Date().toISOString().replace(/:/g, '-')
}
-function getAvailableBackupSpaceInBytes() {
- return parseInt(shell.exec('df --output=avail -B 1 /appsmith-stacks | tail -n 1'), 10)
+async function getAvailableBackupSpaceInBytes(path) {
+ const stat = await fsPromises.statfs(path);
+ return stat.bsize * stat.bfree;
}
function checkAvailableBackupSpace(availSpaceInBytes) {
if (availSpaceInBytes < Constants.MIN_REQUIRED_DISK_SPACE_IN_BYTES) {
- throw new Error('Not enough space avaliable at /appsmith-stacks. Please ensure availability of atleast 2GB to backup successfully.');
+ throw new Error("Not enough space available at /appsmith-stacks. Please ensure availability of at least 2GB to backup successfully.");
}
}
@@ -272,4 +273,4 @@ module.exports = {
removeOldBackups,
getEncryptionPasswordFromUser,
encryptBackupArchive,
-};
\ No newline at end of file
+};
diff --git a/deploy/docker/fs/opt/appsmith/utils/bin/backup.test.js b/deploy/docker/fs/opt/appsmith/utils/bin/backup.test.js
index a7f72ee8396..1efddd66217 100644
--- a/deploy/docker/fs/opt/appsmith/utils/bin/backup.test.js
+++ b/deploy/docker/fs/opt/appsmith/utils/bin/backup.test.js
@@ -3,7 +3,6 @@ const Constants = require('./constants');
const os = require('os');
const fsPromises = require('fs/promises');
const utils = require('./utils');
-const shell = require('shelljs');
const readlineSync = require('readline-sync');
describe('Backup Tests', () => {
@@ -13,19 +12,19 @@ test('Timestamp string in ISO format', () => {
expect(backup.getTimeStampInISO()).toMatch(/(\d{4})-(\d{2})-(\d{2})T(\d{2})\-(\d{2})\-(\d{2})\.(\d{3})Z/)
});
-test('Available Space in /appsmith-stacks volume in Bytes', () => {
- shell.exec = jest.fn((format) => '20');
- const res = expect(backup.getAvailableBackupSpaceInBytes())
- res.toBe(20)
-
+test('Available Space in /appsmith-stacks volume in Bytes', async () => {
+ const res = expect(await backup.getAvailableBackupSpaceInBytes("/"))
+ res.toBeGreaterThan(1024 * 1024)
});
+
it('Checkx the constant is 2 GB', () => {
let size = 2 * 1024 * 1024 * 1024
expect(Constants.MIN_REQUIRED_DISK_SPACE_IN_BYTES).toBe(size)
});
+
it('Should throw Error when the available size is below MIN_REQUIRED_DISK_SPACE_IN_BYTES', () => {
let size = Constants.MIN_REQUIRED_DISK_SPACE_IN_BYTES - 1;
- expect(() => {backup.checkAvailableBackupSpace(size)}).toThrow('Not enough space avaliable at /appsmith-stacks. Please ensure availability of atleast 2GB to backup successfully.');
+ expect(() => backup.checkAvailableBackupSpace(size)).toThrow();
});
it('Should not hould throw Error when the available size is >= MIN_REQUIRED_DISK_SPACE_IN_BYTES', () => {
diff --git a/deploy/docker/fs/opt/appsmith/utils/bin/constants.js b/deploy/docker/fs/opt/appsmith/utils/bin/constants.js
index 369fd5042e4..ae44158c82e 100644
--- a/deploy/docker/fs/opt/appsmith/utils/bin/constants.js
+++ b/deploy/docker/fs/opt/appsmith/utils/bin/constants.js
@@ -11,9 +11,9 @@ const LAST_ERROR_MAIL_TS = "/appsmith-stacks/data/backup/last-error-mail-ts"
const ENV_PATH = "/appsmith-stacks/configuration/docker.env"
-const MIN_REQUIRED_DISK_SPACE_IN_BYTES = 2147483648 // 2GB
+const MIN_REQUIRED_DISK_SPACE_IN_BYTES = 2_147_483_648 // 2GB
-const DURATION_BETWEEN_BACKUP_ERROR_MAILS_IN_MILLI_SEC = 21600000 // 6 hrs
+const DURATION_BETWEEN_BACKUP_ERROR_MAILS_IN_MILLI_SEC = 21_600_000 // 6 hrs
const APPSMITH_DEFAULT_BACKUP_ARCHIVE_LIMIT = 4 // 4 backup archives
@@ -27,4 +27,4 @@ module.exports = {
DURATION_BETWEEN_BACKUP_ERROR_MAILS_IN_MILLI_SEC,
APPSMITH_DEFAULT_BACKUP_ARCHIVE_LIMIT,
ENV_PATH
-}
\ No newline at end of file
+}
diff --git a/deploy/docker/fs/opt/appsmith/utils/bin/utils.js b/deploy/docker/fs/opt/appsmith/utils/bin/utils.js
index 98522cac9bf..44ce84f5276 100644
--- a/deploy/docker/fs/opt/appsmith/utils/bin/utils.js
+++ b/deploy/docker/fs/opt/appsmith/utils/bin/utils.js
@@ -154,9 +154,10 @@ function execCommandSilent(cmd, options) {
const p = childProcess.spawn(cmd[0], cmd.slice(1), {
...options,
+ stdio: "ignore",
});
- p.on("exit", (code) => {
+ p.on("close", (code) => {
if (isPromiseDone) {
return;
}
@@ -173,8 +174,7 @@ function execCommandSilent(cmd, options) {
return;
}
isPromiseDone = true;
- console.error("Error running command", err);
- reject();
+ reject(err);
});
});
}
diff --git a/deploy/docker/fs/opt/appsmith/utils/bin/utils.test.js b/deploy/docker/fs/opt/appsmith/utils/bin/utils.test.js
new file mode 100644
index 00000000000..f707f2778c5
--- /dev/null
+++ b/deploy/docker/fs/opt/appsmith/utils/bin/utils.test.js
@@ -0,0 +1,22 @@
+const { describe, test, expect } = require("@jest/globals");
+const utils = require("./utils");
+
+describe("execCommandSilent", () => {
+
+ test("Runs a command", async () => {
+ await utils.execCommandSilent(["echo"]);
+ });
+
+ test("silences stdout and stderr", async () => {
+ const consoleSpy = jest.spyOn(console, "log");
+ await utils.execCommandSilent(["node", "--eval", "console.log('test')"]);
+ expect(consoleSpy).not.toHaveBeenCalled();
+ consoleSpy.mockRestore();
+ });
+
+ test("handles errors silently", async () => {
+ await expect(utils.execCommandSilent(["nonexistentcommand"]))
+ .rejects.toThrow();
+ });
+
+});