diff options
author | drebs <drebs@riseup.net> | 2017-11-13 21:14:01 -0200 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2017-11-14 19:01:15 -0200 |
commit | 129f14dd59abf24f6f0801ee256dc5909850bc20 (patch) | |
tree | 9bb8b746dc1f3ca1fbdb4fb7ca926aa7f5591b4b /src/leap/soledad | |
parent | 96899cdf89463b884b16a3c0bc2f5b698c4c221c (diff) |
[refactor] rename entrypoints to match design docs
Diffstat (limited to 'src/leap/soledad')
-rw-r--r-- | src/leap/soledad/server/entrypoints.py | 15 | ||||
-rw-r--r-- | src/leap/soledad/server/server.tac | 4 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/leap/soledad/server/entrypoints.py b/src/leap/soledad/server/entrypoints.py index 9bccbcf4..fa8c3ff2 100644 --- a/src/leap/soledad/server/entrypoints.py +++ b/src/leap/soledad/server/entrypoints.py @@ -15,10 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ -The entrypoint for Soledad server. - -This is the entrypoint for the application that is loaded from the initscript -or the systemd script. +Entrypoints for the Soledad server. """ import os @@ -33,12 +30,11 @@ from ._config import get_config from ._wsgi import init_couch_state -# load configuration from file conf = get_config() log = Logger() -class SoledadEntrypoint(SoledadSession): +class UsersEntrypoint(SoledadSession): def __init__(self): pool = threadpool.ThreadPool(name='wsgi') @@ -48,15 +44,12 @@ class SoledadEntrypoint(SoledadSession): SoledadSession.__init__(self, portal) -class LocalServicesEntrypoint(SoledadSession): +class ServicesEntrypoint(SoledadSession): def __init__(self): portal = localPortal() SoledadSession.__init__(self, portal) -# see the comments in _wsgi.py recarding why couch state has to be -# initialized when the reactor is running - def check_conf(): path = conf['blobs_path'] @@ -75,4 +68,6 @@ def check_conf(): reactor.callWhenRunning(check_conf) reactor.callWhenRunning(check_schema_versions, conf['couch_url']) +# see the comments in _wsgi.py regarding why couch state has to be +# initialized when the reactor is running reactor.callWhenRunning(init_couch_state, conf) diff --git a/src/leap/soledad/server/server.tac b/src/leap/soledad/server/server.tac index 1a4e53ee..efaca790 100644 --- a/src/leap/soledad/server/server.tac +++ b/src/leap/soledad/server/server.tac @@ -12,7 +12,7 @@ application = service.Application('soledad-server') # local entrypoint local_port = os.getenv('LOCAL_SERVICES_PORT', 2525) local_description = 'tcp:%s:interface=127.0.0.1' % local_port -local_site = server.Site(entrypoints.LocalServicesEntrypoint()) +local_site = server.Site(entrypoints.ServicesEntrypoint()) local_server = strports.service(local_description, local_site) local_server.setServiceParent(application) @@ -39,7 +39,7 @@ else: log.err("HTTPS_PORT env var is required to be set!") sys.exit(20) -public_site = server.Site(entrypoints.SoledadEntrypoint()) +public_site = server.Site(entrypoints.UsersEntrypoint()) public_server = strports.service(public_description, public_site) public_server.setServiceParent(application) |