forked from sverhoeven/docker-cartodb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_dev_user
executable file
·48 lines (36 loc) · 1.85 KB
/
create_dev_user
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
set -e
SUBDOMAIN="prod"
PASSWORD="pass1234"
ADMIN_PASSWORD="pass1234"
EMAIL="[email protected]"
echo "--- Creating databases"
bundle exec rake cartodb:db:setup
echo "--- Create '${SUBDOMAIN}' user"
bundle exec rake cartodb:db:create_user --trace SUBDOMAIN="${SUBDOMAIN}" \
PASSWORD="${PASSWORD}" ADMIN_PASSWORD="${ADMIN_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
# Import limits here mirrored from https://github.com/mapcomm/mapping.community-carto_install_doc#a-create-users-and-organisations
bundle exec rake cartodb:db:set_user_quota["${SUBDOMAIN}",10240]
bundle exec rake cartodb:db:set_unlimited_table_quota["${SUBDOMAIN}"]
bundle exec rake cartodb:db:set_user_private_tables_enabled["${SUBDOMAIN}",'true']
bundle exec rake cartodb:db:set_user_account_type["${SUBDOMAIN}",'[DEDICATED]']
bundle exec rake cartodb:set_custom_limits_for_user["${SUBDOMAIN}",import_file_size,table_row_count,concurrent_imports]
bundle exec rake user:change:max_layers["${SUBDOMAIN}",25]
# Enable sync tables
echo "UPDATE users SET sync_tables_enabled=true WHERE username='${SUBDOMAIN}'" | psql -U postgres -t carto_db_production