This commit is contained in:
2021-01-24 16:18:54 +08:00
parent aeb8917aff
commit cd60625489
54 changed files with 105 additions and 157 deletions

View File

@@ -1,42 +1,25 @@
#!/bin/sh
set -e
if test -n "$1"; then
SUBDOMAIN="$1"
else
echo -n "Enter a subdomain: "; read SUBDOMAIN
fi
SUBDOMAIN="dev"
PASSWORD="pass1234"
ADMIN_PASSWORD="pass1234"
EMAIL="dev@contoso.com"
if test -n "$2"; then
PASSWORD="$2"
else
echo -n "Enter a password (cleartext!): "; read PASSWORD
fi
echo "--- Creating databases"
bundle exec rake cartodb:db:setup
if test -n "$3"; then
EMAIL="$3"
else
echo -n "Enter an email: "; read EMAIL
fi
echo "--- Create '${SUBDOMAIN}' user"
bundle exec rake cartodb:db:create_user --trace SUBDOMAIN="${SUBDOMAIN}" \
PASSWORD="${PASSWORD}" ADMIN_PASSWORD="${ADMIN_PASSWORD}" \
echo "--- Creating dev user"
bundle exec rake cartodb:db:create_dev_user --trace SUBDOMAIN="${SUBDOMAIN}" \
PASSWORD="${PASSWORD}" \
EMAIL="${EMAIL}"
# # Update your quota to 100GB
echo "--- Updating quota to 100GB"
bundle exec rake cartodb:db:set_user_quota["${SUBDOMAIN}",102400]
# # Allow unlimited tables to be created
echo "--- Allowing unlimited tables creation"
bundle exec rake cartodb:db:set_unlimited_table_quota["${SUBDOMAIN}"]
# # Allow user to create private tables in addition to public
echo "--- Allowing private tables creation"
bundle exec rake cartodb:db:set_user_private_tables_enabled["${SUBDOMAIN}",'true']
# # Set the account type
echo "--- Setting cartodb account type"
bundle exec rake cartodb:db:set_user_account_type["${SUBDOMAIN}",'[DEDICATED]']
# Set dataservices server
bundle exec rake cartodb:db:configure_geocoder_extension_for_non_org_users[$SUBDOMAIN]
# Set import limits
bundle exec rake cartodb:set_custom_limits_for_user["${SUBDOMAIN}",10240000000,100000000,1]
# Enable sync tables
echo "UPDATE users SET sync_tables_enabled=true WHERE username='${SUBDOMAIN}'" | psql -U postgres -t carto_db_development
if test $? -ne 0; then exit 1; fi