Give user and organization geocoder quota

Also remove extra space so gecoder is configured correctly in user/org db
This commit is contained in:
Stefan Verhoeven 2017-07-01 21:50:13 +02:00
parent 79264da25c
commit 685c0f1f80
3 changed files with 8 additions and 3 deletions

View File

@ -227,7 +227,8 @@ RUN mkdir -p /cartodb/log && touch /cartodb/log/users_modifications && \
service postgresql start && service redis-server start && \ service postgresql start && service redis-server start && \
bash -l -c "cd /cartodb && bash script/create_dev_user && \ bash -l -c "cd /cartodb && bash script/create_dev_user && \
bash script/setup_organization.sh && bash script/geocoder.sh" && \ bash script/setup_organization.sh && bash script/geocoder.sh" && \
service postgresql stop && service redis-server stop service postgresql stop && service redis-server stop && \
chmod +x /cartodb/script/fill_geocoder.sh
EXPOSE 80 EXPOSE 80

View File

@ -1,3 +1,5 @@
#!/bin/bash
# See https://github.com/CartoDB/data-services/issues/228#issuecomment-280037353 # See https://github.com/CartoDB/data-services/issues/228#issuecomment-280037353
# Not run during Docker build phase as it would make the image too big # Not run during Docker build phase as it would make the image too big
cd /data-services/geocoder cd /data-services/geocoder

View File

@ -20,10 +20,12 @@ psql -U postgres $GEOCODER_DB < /cartodb/script/geocoder_server.sql
USER_DB=`echo "SELECT database_name FROM users WHERE username='dev'" | psql -U postgres -t carto_db_development` USER_DB=`echo "SELECT database_name FROM users WHERE username='dev'" | psql -U postgres -t carto_db_development`
echo "CREATE EXTENSION cdb_dataservices_client;" | psql -U postgres $USER_DB echo "CREATE EXTENSION cdb_dataservices_client;" | psql -U postgres $USER_DB
echo "SELECT CDB_Conf_SetConf('user_config', '{"'"is_organization"'": false, "'"entity_name"'": "'"dev"'"}');" | psql -U postgres $USER_DB echo "SELECT CDB_Conf_SetConf('user_config', '{"'"is_organization"'": false, "'"entity_name"'": "'"dev"'"}');" | psql -U postgres $USER_DB
echo -e "SELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=${GEOCODER_DB} user=postgres\"}');" | psql -U postgres $USER_DB echo -e "SELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=${GEOCODER_DB# } user=postgres\"}');" | psql -U postgres $USER_DB
rake cartodb:services:set_user_quota['dev',geocoding,100000]
# example organization # example organization
ORGANIZATION_DB=`echo "SELECT database_name FROM users WHERE username='admin4example'" | psql -A -U postgres -t carto_db_development` ORGANIZATION_DB=`echo "SELECT database_name FROM users WHERE username='admin4example'" | psql -A -U postgres -t carto_db_development`
echo "CREATE EXTENSION cdb_dataservices_client;" | psql -U postgres $ORGANIZATION_DB echo "CREATE EXTENSION cdb_dataservices_client;" | psql -U postgres $ORGANIZATION_DB
echo "SELECT CDB_Conf_SetConf('user_config', '{"'"is_organization"'": true, "'"entity_name"'": "'"example"'"}');" | psql -U postgres $ORGANIZATION_DB echo "SELECT CDB_Conf_SetConf('user_config', '{"'"is_organization"'": true, "'"entity_name"'": "'"example"'"}');" | psql -U postgres $ORGANIZATION_DB
echo -e "SELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=${GEOCODER_DB} user=postgres\"}');" | psql -U postgres $ORGANIZATION_DB echo -e "SELECT CDB_Conf_SetConf('geocoder_server_config', '{ \"connection_str\": \"host=localhost port=5432 dbname=${GEOCODER_DB# } user=postgres\"}');" | psql -U postgres $ORGANIZATION_DB
rake cartodb:services:set_org_quota['example',geocoding,100000]