Skip to content

Commit

Permalink
Add CherryPy SSL Support (#4)
Browse files Browse the repository at this point in the history
* Add CherryPy SSL Support

This adds features to support CherryPy SSL Server configurations
and command line options to set the keys.

Signed-off-by: David Brown <dmlb2000@gmail.com>

* Remove some old pipeline stuff

Signed-off-by: David Brown <dmlb2000@gmail.com>
  • Loading branch information
dmlb2000 committed Oct 26, 2020
1 parent 93b4419 commit 03d212f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 87 deletions.
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Pacifica Template Repository
![PyPi](https://img.shields.io/pypi/v/pacifica-auth.svg)
[![Read the Docs](https://readthedocs.org/projects/pacifica-auth/badge/?version=latest)](https://pacifica-auth.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/pacifica/pacifica-auth.svg?branch=master)](https://travis-ci.org/pacifica/pacifica-auth)
[![Build status](https://ci.appveyor.com/api/projects/status/0fnidqshlmhgufpl?svg=true)](https://ci.appveyor.com/project/dmlb2000/pacifica-auth)


This is a generalized authentication library built around CherryPy,
Expand Down
30 changes: 0 additions & 30 deletions appveyor.yml

This file was deleted.

15 changes: 15 additions & 0 deletions pacifica/auth/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ def pacifica_auth_arguments(parser):
'--app-dir', dest='app_dir', type=str, default='app',
help='ReactJS App directory to serve'
)
parser.add_argument(
'--ssl-private-key', dest='ssl_private_key', type=str, default=None,
help='OpenSSL private key file.'
)
parser.add_argument(
'--ssl-certificate', dest='ssl_certificate', type=str, default=None,
help='OpenSSL certificate file.'
)
parser.add_argument(
'--ssl-certificate-chain', dest='ssl_certificate_chain', type=str,
default=None, help='OpenSSL certificate chain file.'
)


def social_settings(args, user_class, user_import_path):
Expand Down Expand Up @@ -103,6 +115,9 @@ def load_user():
'tools.db.on': True,
'tools.authenticate.on': True,
})
for ssl_config_key in ['ssl_private_key', 'ssl_certificate', 'ssl_certificate_chain']:
if getattr(args, ssl_config_key, False):
cherrypy.config.update({'cherrypy.server.{}'.format(ssl_config_key): getattr(args, ssl_config_key)})
cherrypy.tools.jinja2env = Environment(
loader=FileSystemLoader(join(dirname(__file__), 'templates'))
)
Expand Down

0 comments on commit 03d212f

Please sign in to comment.