Merge branch 'master' of github.com:appsmithorg/appsmith

# Conflicts:
#	.github/workflows/client.yml
This commit is contained in:
Nikhil Nandagopal 2020-10-30 20:13:49 +05:30
commit 3829ccbbd0
4 changed files with 151 additions and 64 deletions

View File

@ -29,6 +29,8 @@ export const TableWrapper = styled.div<{
color: ${Colors.THUNDER};
position: relative;
background: ${Colors.ATHENS_GRAY_DARKER};
display: table;
width: 100%;
.thead,
.tbody {
overflow: hidden;

View File

@ -76,17 +76,18 @@ export const EntityProperties = (props: {
config = entityDefinitions[type];
if (config) {
if (isFunction(config)) config = config(entity);
entityProperties = Object.keys(config)
.filter(k => k.indexOf("!") === -1)
.map(widgetProperty => {
return {
propertyName: widgetProperty,
entityName: entity.widgetName,
value: entity[widgetProperty],
step: props.step,
};
});
if (config) {
entityProperties = Object.keys(config)
.filter(k => k.indexOf("!") === -1)
.map(widgetProperty => {
return {
propertyName: widgetProperty,
entityName: entity.widgetName,
value: entity[widgetProperty],
step: props.step,
};
});
}
}
break;
}

View File

@ -98,17 +98,20 @@ export const getWidgetProperies = (
];
if (isFunction(config)) config = config(widgetProps);
return Object.keys(config)
.filter(k => k.indexOf("!") === -1)
.map(widgetProperty => {
return {
propertyName: widgetProperty,
entityName: widgetProps.widgetName,
value: widgetProps[widgetProperty],
step,
};
});
if (config) {
return Object.keys(config)
.filter(k => k.indexOf("!") === -1)
.map(widgetProperty => {
return {
propertyName: widgetProperty,
entityName: widgetProps.widgetName,
value: widgetProps[widgetProperty],
step,
};
});
} else {
return [];
}
};
export type WidgetEntityProps = {

View File

@ -27,11 +27,21 @@ check_ports_occupied() {
fi
if [[ -n $port_check_output ]]; then
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "port taken"
}
}' > /dev/null
echo "+++++++++++ ERROR ++++++++++++++++++++++"
echo "Appsmith requires ports 80 & 443 to be open. Please shut down any other service(s) that may be running on these ports."
echo "++++++++++++++++++++++++++++++++++++++++"
echo ""
bye
exit 1
fi
}
@ -49,7 +59,16 @@ install_docker() {
$apt_cmd update
echo "Installing docker"
$apt_cmd install docker-ce docker-ce-cli containerd.io
elif [[ $package_manager == zypper ]]; then
zypper_cmd="sudo zypper --quiet --no-gpg-checks --non-interactive"
echo "Installing docker"
if [[ $os == sles ]]; then
os_sp="$(cat /etc/*-release | awk -F= '$1 == "VERSION_ID" { gsub(/"/, ""); print $2; exit }')"
os_arch="$(uname -i)"
sudo SUSEConnect -p sle-module-containers/$os_sp/$os_arch -r ''
fi
$zypper_cmd install docker docker-runc containerd
sudo systemctl enable docker.service
else
yum_cmd="sudo yum --assumeyes --quiet"
$yum_cmd install yum-utils
@ -62,7 +81,7 @@ install_docker() {
}
install_docker_compose() {
if [[ $package_manager == "apt-get" || $package_manager == "yum" ]]; then
if [[ $package_manager == "apt-get" || $package_manager == "zypper" || $package_manager == "yum" ]]; then
if [[ ! -f /usr/bin/docker-compose ]];then
echo "++++++++++++++++++++++++"
echo "Installing docker-compose"
@ -73,11 +92,21 @@ install_docker_compose() {
echo ""
fi
else
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Docker Compose Not Found"
}
}' > /dev/null
echo "+++++++++++ IMPORTANT READ ++++++++++++++++++++++"
echo "docker-compose not found! Please install docker-compose first and then continue with this installation."
echo "Refer https://docs.docker.com/compose/install/ for installing docker-compose."
echo "+++++++++++++++++++++++++++++++++++++++++++++++++"
bye
exit 1
fi
}
@ -119,6 +148,16 @@ check_os() {
os="centos"
package_manager="yum"
;;
SLES*)
desired_os=1
os="sles"
package_manager="zypper"
;;
openSUSE*)
desired_os=1
os="opensuse"
package_manager="zypper"
;;
*)
desired_os=0
os="Not Found"
@ -313,22 +352,25 @@ echo_contact_support() {
}
bye() { # Prints a friendly good bye message and exits the script.
set +o errexit
echo "Please share your email to receive support with the installation"
read -rp 'Email: ' email
if [ "$?" -ne 0 ]; then
set +o errexit
echo "Please share your email if you wish to receive support with the installation"
read -rp 'Email: ' email
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Support",
"data": {
"os": "'"$os"'",
"email": "'"$email"'"
}
}' > /dev/null
echo -e "\nExiting for now. Bye! 👋 \n"
exit 1
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Support",
"data": {
"os": "'"$os"'",
"email": "'"$email"'"
}
}' > /dev/null
echo ""
echo -e "\nWe will reach out to you at the email provided shortly, Exiting for now. Bye! 👋 \n"
exit 0
fi
}
echo -e "👋 Thank you for trying out Appsmith! "
@ -358,18 +400,39 @@ curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30o
if [[ $desired_os -eq 0 ]];then
echo ""
echo "This script is currently meant to install Appsmith on Mac OS X | Ubuntu machines."
echo "This script is currently meant to install Appsmith on Mac OS X, Ubuntu, SLES or openSUSE machines."
echo_contact_support " if you wish to extend this support."
bye
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "OS Not Supported"
}
}' > /dev/null
exit 1
else
echo "🙌 You're on an OS that is supported by this installation script."
echo ""
fi
if [[ $EUID -eq 0 ]]; then
echo "+++++++++++ ERROR ++++++++++++++++++++++"
echo "Please do not run this script as root/sudo."
echo_contact_support
bye
echo "++++++++++++++++++++++++++++++++++++++++"
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Running as Root"
}
}' > /dev/null
exit 1
fi
check_ports_occupied
@ -385,19 +448,39 @@ if [[ -e "$install_dir" ]]; then
echo "The path '$install_dir' is already present. Please run the script again with a different path to install new."
echo "If you're trying to update your existing installation, that happens automatically through WatchTower."
echo_contact_support " if you're facing problems with the auto-updates."
exit
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Directory Exists"
}
}' > /dev/null
exit 1
fi
# Check is Docker daemon is installed and available. If not, the install & start Docker for Linux machines. We cannot automatically install Docker Desktop on Mac OS
if ! is_command_present docker; then
if [[ $package_manager == "apt-get" || $package_manager == "yum" ]]; then
if [[ $package_manager == "apt-get" || $package_manager == "zypper" || $package_manager == "yum" ]]; then
install_docker
else
echo ""
echo "+++++++++++ IMPORTANT READ ++++++++++++++++++++++"
echo "Docker Desktop must be installed manually on Mac OS to proceed. Docker can only be installed automatically on Ubuntu / Redhat / Cent OS"
echo "Docker Desktop must be installed manually on Mac OS to proceed. Docker can only be installed automatically on Ubuntu / openSUSE / SLES / Redhat / Cent OS"
echo "https://docs.docker.com/docker-for-mac/install/"
echo "++++++++++++++++++++++++++++++++++++++++++++++++"
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Docker not installed"
}
}' > /dev/null
exit 1
fi
fi
@ -408,7 +491,7 @@ if ! is_command_present docker-compose; then
fi
# Starting docker service
if [[ $package_manager == "yum" || $package_manager == "apt-get" ]]; then
if [[ $package_manager == "yum" || $package_manager == "zypper" || $package_manager == "apt-get" ]]; then
start_docker
fi
@ -428,10 +511,11 @@ if confirm y "Is this a fresh installation?"; then
# Since the mongo was automatically setup, this must be the first time installation. Generate encryption credentials for this scenario
auto_generate_encryption="true"
else
read -rp 'Enter your current mongo db host: ' mongo_host
read -rp 'Enter your current mongo root user: ' mongo_root_user
read -srp 'Enter your current mongo password: ' mongo_root_password
read -rp 'Enter your current mongo database name: ' mongo_database
echo 'You are trying to connect to an existing appsmith installation. Abort if you want to install appsmith fresh'
read -rp 'Enter your existing appsmith mongo db host: ' mongo_host
read -rp 'Enter your existing appsmith mongo root user: ' mongo_root_user
read -srp 'Enter your existing appsmith mongo password: ' mongo_root_password
read -rp 'Enter your existing appsmith mongo database name: ' mongo_database
# It is possible that this isn't the first installation.
echo ""
# In this case be more cautious of auto generating the encryption keys. Err on the side of not generating the encryption keys
@ -574,19 +658,17 @@ if [[ $status_code -ne 401 ]]; then
echo -e "cd \"$install_dir\" && sudo docker-compose ps -a"
echo "For troubleshooting help, please reach out to us via our Discord server: https://discord.com/invite/rBTTVJp"
echo "++++++++++++++++++++++++++++++++++++++++"
echo ""
echo "Please share your email to receive help with the installation"
read -rp 'Email: ' email
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
--data-raw '{
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Support",
"data": {
"os": "'"$os"'",
"email": "'"$email"'"
}
"userId": "'"$APPSMITH_INSTALLATION_ID"'",
"event": "Installation Error",
"data": {
"os": "'"$os"'",
"error": "Containers not started"
}
}' > /dev/null
exit 1
else
curl -s --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \
--header 'Content-Type: text/plain' \
@ -598,7 +680,7 @@ else
}
}' > /dev/null
echo "+++++++++++ SUCCESS ++++++++++++++++++++++++++++++"
echo "++++++++++++++++++ SUCCESS ++++++++++++++++++++++"
echo "Your installation is complete!"
echo ""
if [[ -z $custom_domain ]]; then
@ -624,5 +706,4 @@ else
}
}' > /dev/null
fi
echo -e "\nPeace out ✌️\n"