diff --git a/config.py b/config.py index b3e636f..30cff81 100644 --- a/config.py +++ b/config.py @@ -47,3 +47,7 @@ LDAP_BIND_PW = environ.get('PROXSTAR_LDAP_BIND_PW', '') # DB SQLALCHEMY_DATABASE_URI = environ.get('PROXSTAR_SQLALCHEMY_DATABASE_URI', '') + +# REDIS +REDIS_HOST = environ.get('PROXSTAR_REDIS_HOST', 'localhost') +REDIS_PORT = int(environ.get('PROXSTAR_REDIS_PORT', '6379')) diff --git a/proxstar/__init__.py b/proxstar/__init__.py index 1ebcb9f..10c4b17 100644 --- a/proxstar/__init__.py +++ b/proxstar/__init__.py @@ -14,9 +14,6 @@ from proxstar.starrs import * from proxstar.ldapdb import * from proxstar.proxmox import * -redis_conn = Redis('redis', 6789) -q = Queue(connection=redis_conn) - app = Flask(__name__) if os.path.exists( os.path.join( @@ -34,6 +31,9 @@ auth = OIDCAuthentication( client_registration_info=app.config['OIDC_CLIENT_CONFIG']) cache = SimpleCache() +redis_conn = Redis(app.config['REDIS_HOST'], app.config['REDIS_PORT']) +q = Queue(connection=redis_conn) + engine = create_engine(app.config['SQLALCHEMY_DATABASE_URI']) Base.metadata.bind = engine DBSession = sessionmaker(bind=engine)