Пример #1
0
def setup_website(insider):
    tools = Facade()
    apache_conf_dir = join(tools.usr_local_dir(), "syncloud-image-ci", "apache")
    apache_conf = join(apache_conf_dir, "syncloud-image-ci.conf")
    apache = ApacheFacade()
    add_site(apache, "https", apache_conf_dir, apache_conf)
    http_port = add_site(apache, "http", apache_conf_dir, apache_conf)
    apache.restart()
    insider.add_service("image-ci", "http", "image-ci", http_port, "image-ci")
Пример #2
0
from os.path import join
from syncloud.tools.facade import Facade

from port_config import PortConfig
from service_config import ServiceConfig

from syncloud.insider.config import InsiderConfig
from syncloud.insider import config
import upnpc
import upnpc_mock
import port_mapper
import dns
import cron


tools_facade = Facade()
LOCAL_DIR = tools_facade.usr_local_dir()
default_bin_path = join(LOCAL_DIR, 'bin')
default_config_path = join(LOCAL_DIR, 'insider', 'config')
default_logs_path = '/var/log'


class Insider:

    def __init__(self, port_mapper, dns, cron, insider_config, service_config):
        self.insider_config = insider_config
        self.port_mapper = port_mapper
        self.dns = dns
        self.cron = cron
        self.service_config = service_config