summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-11-14 19:21:50 -0200
committerdrebs <drebs@riseup.net>2017-11-14 19:21:53 -0200
commitb365fdc374fa0e54b28a4061811fc7ed0f69846a (patch)
tree85f5c62b608d02e46e1b46e92d641534ad6d0adf /src/leap/soledad
parent1aa09423eea6849a14cd0a36345ef088f34e469a (diff)
[style] comment fix and variable renaming
Diffstat (limited to 'src/leap/soledad')
-rw-r--r--src/leap/soledad/server/__init__.py2
-rw-r--r--src/leap/soledad/server/server.tac30
2 files changed, 16 insertions, 16 deletions
diff --git a/src/leap/soledad/server/__init__.py b/src/leap/soledad/server/__init__.py
index 2023ef5e..fe9c537c 100644
--- a/src/leap/soledad/server/__init__.py
+++ b/src/leap/soledad/server/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# server.py
+# __init__.py
# Copyright (C) 2013 LEAP
#
# This program is free software: you can redistribute it and/or modify
diff --git a/src/leap/soledad/server/server.tac b/src/leap/soledad/server/server.tac
index 16667df3..5ab4d6b6 100644
--- a/src/leap/soledad/server/server.tac
+++ b/src/leap/soledad/server/server.tac
@@ -33,7 +33,7 @@ logger = getLogger(__name__)
# necessary checks
#
-def _check_env(local_port, public_port):
+def check_env(local_port, public_port):
if local_port == public_port:
logger.error("LOCAL_SERVICES_PORT and HTTPS_PORT can't be the same!")
sys.exit(20)
@@ -43,7 +43,7 @@ def _check_env(local_port, public_port):
sys.exit(20)
-def _check_conf(conf):
+def check_conf(conf):
path = conf['blobs_path']
blobs_not_empty = bool(os.path.exists(path) and os.listdir(path))
if not conf['blobs'] and blobs_not_empty:
@@ -62,7 +62,7 @@ def _check_conf(conf):
# service creation functions
#
-def _create_local_service(port, application):
+def create_local_service(port, application):
logger.info('Starting local Services HTTP API')
desc = 'tcp:%s:interface=127.0.0.1' % port
site = server.Site(entrypoints.ServicesEntrypoint())
@@ -70,7 +70,7 @@ def _create_local_service(port, application):
service.setServiceParent(application)
-def _get_tls_service_description(port):
+def get_tls_service_description(port):
privateKey = os.getenv('PRIVKEY_PATH', '/etc/soledad/soledad-server.key')
certKey = os.getenv('CERT_PATH', '/etc/soledad/soledad-server.pem')
sslmethod = os.getenv('SSL_METHOD', 'SSLv23_METHOD')
@@ -83,10 +83,10 @@ def _get_tls_service_description(port):
return desc
-def _create_public_service(port, application):
+def create_public_service(port, application):
logger.info('Starting public Users HTTP API')
if port:
- desc = _get_tls_service_description(port)
+ desc = get_tls_service_description(port)
else:
logger.warn('Using plain HTTP on public Users API.')
desc = 'tcp:port=2424:interface=0.0.0.0'
@@ -96,25 +96,25 @@ def _create_public_service(port, application):
service.setServiceParent(application)
-def _create_services(local_port, public_port, application):
- _create_local_service(local_port, application)
- _create_public_service(public_port, application)
+def create_services(local_port, public_port, application):
+ create_local_service(local_port, application)
+ create_public_service(public_port, application)
#
# the application
#
-def _run(application):
+def run(application):
local_port = os.getenv('LOCAL_SERVICES_PORT', 2525)
public_port = os.getenv('HTTPS_PORT', None)
conf = get_config()
- _check_env(local_port, public_port)
- _check_conf(conf)
+ check_env(local_port, public_port)
+ check_conf(conf)
d = check_schema_versions(conf['couch_url'])
- d.addCallback(lambda _: _create_services(local_port, public_port,
- application))
+ d.addCallback(lambda _: create_services(local_port, public_port,
+ application))
application = service.Application('soledad-server')
-_run(application)
+run(application)