From 277599f0e558a6bb01cb40fab54d339d5360b05c Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sat, 4 Jul 2015 12:50:41 -0700 Subject: [PATCH 1/3] fixing an a small typo --- lemur/manage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/manage.py b/lemur/manage.py index 2f4aee15..1680ed2f 100755 --- a/lemur/manage.py +++ b/lemur/manage.py @@ -333,7 +333,7 @@ class InitializeApp(Command): else: sys.stdout.write("[-] Default user has already been created, skipping...!\n") - if current_app.app.config.get('AWS_ACCOUNT_MAPPINGS'): + if current_app.config.get('AWS_ACCOUNT_MAPPINGS'): for account_name, account_number in current_app.config.get('AWS_ACCOUNT_MAPPINGS').items(): account = account_service.get_by_account_number(account_number) From b04fb471e9fb80efb871c9582ac21472d0cd135f Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sat, 4 Jul 2015 12:55:28 -0700 Subject: [PATCH 2/3] Ensuring that path to to the default config is correct regardless of how the app was started. --- lemur/factory.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lemur/factory.py b/lemur/factory.py index e0470ae2..7dcb25b1 100644 --- a/lemur/factory.py +++ b/lemur/factory.py @@ -91,8 +91,7 @@ def configure_app(app, config=None): elif os.path.isfile(os.path.expanduser("~/.lemur/lemur.conf.py")): app.config.from_object(from_file(os.path.expanduser("~/.lemur/lemur.conf.py"))) else: - app.config.from_object(from_file(os.path.join(os.getcwd(), 'default.conf.py'))) - + app.config.from_object(from_file(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'default.conf.py'))) def configure_extensions(app): From 02bea85f85e28e65a114d54dd8c9d780999dd41b Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 6 Jul 2015 16:30:13 -0700 Subject: [PATCH 3/3] Docfixes --- docs/conf.py | 2 +- docs/production/index.rst | 4 +-- docs/quickstart/index.rst | 65 +++++++++++++++++++-------------------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7cbbc653..e27ea078 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,7 +48,7 @@ master_doc = 'index' # General information about the project. project = u'lemur' -copyright = u'2015, Kevin Glisson' +copyright = u'2015, Netflix Inc.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/production/index.rst b/docs/production/index.rst index 2f788cfa..c1d8f4ae 100644 --- a/docs/production/index.rst +++ b/docs/production/index.rst @@ -106,7 +106,7 @@ You can make some adjustments to get a better user experience:: } location / { - root /apps/lemur/lemur/static/dist; + root /www/lemur/lemur/static/dist; index index.html; } @@ -171,7 +171,7 @@ sensitive nature of Lemur and what it controls makes this essential. This is a s } location / { - root /apps/lemur/lemur/static/dist; + root /www/lemur/lemur/static/dist; index index.html; } diff --git a/docs/quickstart/index.rst b/docs/quickstart/index.rst index 2e39a645..60afa6dd 100644 --- a/docs/quickstart/index.rst +++ b/docs/quickstart/index.rst @@ -92,6 +92,8 @@ that be easier to setup in your environment. Once created you will need to update the configuration file with information about your environment, such as which database to talk to, where keys are stores etc.. +.. _InitializingLemur: + Initializing Lemur ------------------ @@ -119,22 +121,6 @@ administer Lemur. for details. -Starting the Web Service ------------------------- - -Lemur provides a built-in webserver (powered by gunicorn and eventlet) to get you off the ground quickly. - -To start the webserver, you simply use ``lemur start``. If you opted to use an alternative configuration path -you can pass that via the --config option. - -:: - - # Lemur's server runs on port 5000 by default. Make sure your client reflects - # the correct host and port! - lemur --config=/etc/lemur.conf.py start - -You should now be able to test the web service by visiting `http://localhost:5000/`. - Setup a Reverse Proxy --------------------- @@ -145,34 +131,47 @@ you setup a simple web proxy. Proxying with Nginx ~~~~~~~~~~~~~~~~~~~ -You'll use the builtin HttpProxyModule within Nginx to handle proxying:: +You'll use the builtin HttpProxyModule within Nginx to handle proxying + +:: + + location /api { + proxy_pass http://127.0.0.1:5000; + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; + proxy_redirect off; + proxy_buffering off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } location / { - proxy_pass http://localhost:5000; - proxy_redirect off; - - proxy_set_header Host $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; + root /www/lemur/lemur/static/dist; + index index.html; } See :doc:`../production/index` for more details on using Nginx. -Proxying with Apache -~~~~~~~~~~~~~~~~~~~~ -Apache requires the use of mod_proxy for forwarding requests:: +Starting the Web Service +------------------------ - ProxyPass / http://localhost:5000/ - ProxyPassReverse / http://localhost:5000/ - ProxyPreserveHost On - RequestHeader set X-Forwarded-Proto "https" env=HTTPS +Lemur provides a built-in webserver (powered by gunicorn and eventlet) to get you off the ground quickly. -You will need to enable ``headers``, ``proxy``, and ``proxy_http`` apache modules to use these settings. +To start the webserver, you simply use ``lemur start``. If you opted to use an alternative configuration path +you can pass that via the --config option. -See :doc:`../production/index` for more details on using Apache. +.. note:: + You can login with the default user created during :ref:`Initializing Lemur ` or any other + user you may have created. +:: + + # Lemur's server runs on port 5000 by default. Make sure your client reflects + # the correct host and port! + lemur --config=/etc/lemur.conf.py start -b 127.0.0.1:5000 + +You should now be able to test the web service by visiting `http://localhost:5000/`. Running Lemur as a Service ---------------------------