Skip to content

Commit

Permalink
Merge pull request apache#2 in DATA-PLATFORM/caravel from mz-custom-c…
Browse files Browse the repository at this point in the history
…onfig to dev

* commit '3b44c159879b5628224ecf28197814f7a67c84ee':
  Add prod script and configurations
  • Loading branch information
the-dcruz committed Oct 18, 2016
2 parents 5eb5ce8 + 3b44c15 commit 9858b94
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ recursive-exclude caravel/static/spec *
recursive-exclude tests *
recursive-include caravel/data *
recursive-include caravel/migrations *
include run_prod.sh
22 changes: 11 additions & 11 deletions caravel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caravel import app

import json
import os

from dateutil import tz
from flask_appbuilder.security.manager import AUTH_DB
from flask_appbuilder.security.manager import AUTH_LDAP

BASE_DIR = os.path.abspath(os.path.dirname(__file__))
DATA_DIR = os.path.join(os.path.expanduser('~'), '.caravel')
Expand Down Expand Up @@ -43,9 +42,7 @@
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h' # noqa

# The SQLAlchemy connection string.
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'caravel.db')
# SQLALCHEMY_DATABASE_URI = 'mysql://myapp@localhost/myapp'
# SQLALCHEMY_DATABASE_URI = 'postgresql://root:password@localhost/myapp'
SQLALCHEMY_DATABASE_URI = 'mysql://druid_live:jhdftgh8674DDFGFsajdg@druiddata-1-001.renaissance.live.las1.mz-inc.com:3306/caravel?connect_timeout=600'

# The limit of queries fetched for query search
QUERY_SEARCH_LIMIT = 1000
Expand Down Expand Up @@ -86,22 +83,25 @@
# AUTH_DB : Is for database (username/password()
# AUTH_LDAP : Is for LDAP
# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server
AUTH_TYPE = AUTH_DB
AUTH_TYPE = AUTH_LDAP

# Uncomment to setup Full admin role name
# AUTH_ROLE_ADMIN = 'Admin'
AUTH_ROLE_ADMIN = 'Admin'

# Uncomment to setup Public role name, no authentication needed
# AUTH_ROLE_PUBLIC = 'Public'

# Will allow user self registration
# AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION = True

# The default user self registration role
# AUTH_USER_REGISTRATION_ROLE = "Public"
AUTH_USER_REGISTRATION_ROLE = "Public"

# When using LDAP Auth, setup the ldap server
# AUTH_LDAP_SERVER = "ldap://ldapserver.new"
AUTH_LDAP_SERVER = "ldap://hq-dc1.corpmz.com"
AUTH_LDAP_SEARCH = "dc=corpmz,dc=com"
AUTH_LDAP_UID_FIELD = "userPrincipalName"
AUTH_LDAP_APPEND_DOMAIN = "CORPMZ.com"

# Uncomment to setup OpenID providers example for OpenID authentication
# OPENID_PROVIDERS = [
Expand Down Expand Up @@ -241,4 +241,4 @@ class CeleryConfig(object):
pass

if not CACHE_DEFAULT_TIMEOUT:
CACHE_DEFAULT_TIMEOUT = CACHE_CONFIG.get('CACHE_DEFAULT_TIMEOUT')
CACHE_DEFAULT_TIMEOUT = CACHE_CONFIG.get('CACHE_DEFAULT_TIMEOUT')
8 changes: 8 additions & 0 deletions run_prod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/bash

python setup.py develop

caravel db upgrade
caravel init

/root/node_modules/pm2/bin/pm2 start `which caravel` --interpreter python -- runserver

0 comments on commit 9858b94

Please sign in to comment.