Skip to content

Instantly share code, notes, and snippets.

@mattes
Last active June 4, 2022 06:43
Show Gist options
  • Save mattes/f941cdc95639e482060a86b9f7ad983b to your computer and use it in GitHub Desktop.
Save mattes/f941cdc95639e482060a86b9f7ad983b to your computer and use it in GitHub Desktop.
redash.io setup
upstream redash {
server redash:5000;
}
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name redash.example.com;
ssl on;
ssl_certificate /etc/nginx/conf.d/domain.crt;
ssl_certificate_key /etc/nginx/conf.d/domain.key;
ssl_dhparam /etc/nginx/conf.d/dhparam.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
gzip on;
gzip_types *;
gzip_proxied any;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://redash;
proxy_redirect off;
}
}
REDASH_COOKIE_SECRET=verysecretkey
REDASH_DATABASE_URL=postgresql://postgres@postgres/postgres
REDASH_REDIS_URL=redis://redis:6379/0
REDASH_NAME=Redash
REDASH_LOG_LEVEL=INFO
REDASH_HOST=https://redash.example.com
REDASH_MAIL_SERVER=smtp.sendgrid.net
REDASH_MAIL_PORT=2525
REDASH_MAIL_USE_TLS=true
REDASH_MAIL_USERNAME=apikey
REDASH_MAIL_PASSWORD=sendgridsecretapikey
[email protected]
REDASH_GOOGLE_CLIENT_ID=xxxx
REDASH_GOOGLE_CLIENT_SECRET=xxxx

Redash Setup

git clone https://github.com/getredash/redash

docker network create redash
docker run -d --name postgres -v /usr/var/run/redash/postgres:/var/lib/postgresql/data --restart unless-stopped --net redash postgres:9.3

docker run -d --name redis --restart unless-stopped --net redash redis:2.8

docker run -it --rm -p 5000:5000 --net redash --env-file redash-config redash/redash /opt/redash/current/manage.py database create_tables

docker run -it --rm -p 5000:5000 --net redash --env-file redash-config redash/redash /opt/redash/current/manage.py users create --admin --password admin "Admin" "admin"

docker inspect postgres # get container ip 172.17.02 and use below ...

docker run --rm -it postgres:9.3 psql -h 172.17.02 -p 5432 -U postgres -c "CREATE ROLE redash_reader WITH PASSWORD 'redash_reader' NOCREATEROLE NOCREATEDB NOSUPERUSER LOGIN"

docker run --rm -it postgres:9.3 psql -h 172.17.02 -p 5432 -U postgres -c "grant select(id,name,type) ON data_sources to redash_reader;"

docker run --rm -it postgres:9.3 psql -h 172.17.02 -p 5432 -U postgres -c "grant select(id,name) ON users to redash_reader;"

docker run --rm -it postgres:9.3 psql -h 172.17.02 -p 5432 -U postgres -c "grant select on events, queries, dashboards, widgets,visualizations, query_results to redash_reader;"

docker run -it --rm -p 5000:5000 --net redash --env-file redash-config redash/redash /opt/redash/current/manage.py ds new "re:dash metadata" --type "pg" --options "{\"user\": \"redash_reader\", \"password\": \"redash_reader\", \"host\": \"postgres\", \"dbname\": \"postgres\"}"

docker run -d --name redash --restart unless-stopped -p 5000:5000 --net redash --env-file redash-config redash/redash

docker run -d --name redash-nginx -v nginx-conf-dir:/etc/nginx/conf.d --restart unless-stopped --net redash -p 80:80 -p 443:443 redash/nginx:latest

docker exec -it redash ./manage.py set_google_apps_domains allowed-domain.com
@kaiwang0112006
Copy link

I follow your steps and the webui can start, but I cannot query. It seems that celery workers didn't start. Because if I check the page “system status”, the Celery status fail to load. Any idea how to fix it?

@mattes
Copy link
Author

mattes commented May 13, 2020

I'm no longer using redash and can't help unfortunately. Please use https://github.com/getredash/redash/issues for help. Thank you and good luck!

@susodapop
Copy link

susodapop commented May 13, 2020

Redash team member here: please don't use our GitHub repo for such issues 😃 . It's only for tracking bugs with Redash itself. You can write questions on our user forum for help setting up an environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment