2014-11-15 23:32:19 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-06-22 17:22:59 +08:00
|
|
|
export CARTO_HOSTNAME=${CARTO_HOSTNAME:=$HOSTNAME}
|
2018-06-22 16:27:27 +08:00
|
|
|
|
2019-07-19 07:16:45 +08:00
|
|
|
perl -pi -e 's/cartodb\.localhost/$ENV{"CARTO_HOSTNAME"}/g' /etc/nginx/nginx.conf /cartodb/config/app_config.yml /Windshaft-cartodb/config/environments/development.js
|
2017-04-07 02:02:07 +08:00
|
|
|
|
2018-08-06 22:34:17 +08:00
|
|
|
PGDATA=/var/lib/postgresql
|
|
|
|
if [ "$(stat -c %U $PGDATA)" != "postgres" ]; then
|
|
|
|
(>&2 echo "${PGDATA} not owned by postgres, updating permissions")
|
|
|
|
chown -R postgres $PGDATA
|
|
|
|
chmod 700 $PGDATA
|
|
|
|
fi
|
|
|
|
|
2014-11-15 23:32:19 +08:00
|
|
|
service postgresql start
|
|
|
|
service redis-server start
|
2017-04-04 04:46:52 +08:00
|
|
|
/opt/varnish/sbin/varnishd -a :6081 -T localhost:6082 -s malloc,256m -f /etc/varnish.vcl
|
|
|
|
service nginx start
|
2014-11-15 23:32:19 +08:00
|
|
|
|
|
|
|
cd /Windshaft-cartodb
|
|
|
|
node app.js development &
|
|
|
|
|
|
|
|
cd /CartoDB-SQL-API
|
|
|
|
node app.js development &
|
|
|
|
|
|
|
|
cd /cartodb
|
2015-02-13 21:59:26 +08:00
|
|
|
bundle exec script/restore_redis
|
2015-05-16 19:01:49 +08:00
|
|
|
bundle exec script/resque > resque.log 2>&1 &
|
2017-08-02 04:07:30 +08:00
|
|
|
script/sync_tables_trigger.sh &
|
2018-06-22 17:23:20 +08:00
|
|
|
|
|
|
|
# Recreate api keys in db and redis, so sql api is authenticated
|
|
|
|
echo 'delete from api_keys' | psql -U postgres -t carto_db_development
|
|
|
|
bundle exec rake carto:api_key:create_default
|
|
|
|
|
|
|
|
# bundle exec rake carto:api_key:create_default
|
2017-04-04 04:46:52 +08:00
|
|
|
bundle exec thin start --threaded -p 3000 --threadpool-size 5
|