diff options
Diffstat (limited to 'src')
-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) |