示例#1
0
 def get_ip(self):
     if self.address:
         return self.address
     try:
         validate_ip_address(self.name)
     except ValidationError:
         return socket.gethostbyname(self.name)
     else:
         return self.name
示例#2
0
 def get_ip(self):
     address = self.get_address()
     try:
         return validate_ip_address(address)
     except ValidationError:
         return socket.gethostbyname(self.name)
示例#3
0
        'orchestra.contrib.saas.services.wordpress.WordPressService',
        'orchestra.contrib.saas.services.dokuwiki.DokuWikiService',
        'orchestra.contrib.saas.services.drupal.DrupalService',
        'orchestra.contrib.saas.services.owncloud.OwnCloudService',
#        'orchestra.contrib.saas.services.seafile.SeaFileService',
    ),
    # lazy loading
    choices=lambda: ((s.get_class_path(), s.get_class_path()) for s in saas.services.SoftwareService.get_plugins(all=True)),
    multiple=True,
)


SAAS_TRAFFIC_IGNORE_HOSTS = Setting('SAAS_TRAFFIC_IGNORE_HOSTS',
    ('127.0.0.1',),
    help_text=_("IP addresses to ignore during traffic accountability."),
    validators=[lambda hosts: (validate_ip_address(host) for host in hosts)]
)


# WordPress

SAAS_WORDPRESS_ALLOW_CUSTOM_URL = Setting('SAAS_WORDPRESS_ALLOW_CUSTOM_URL',
    True,
    help_text=_("Whether allow custom URL to be specified or not."),
    validators=[validators.validate_website_saas_directives('wordpress-saas')],
)

SAAS_WORDPRESS_LOG_PATH = Setting('SAAS_WORDPRESS_LOG_PATH',
    '',
    help_text=_('Filesystem path for the webserver access logs.<br>'
                '<tt>LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Host}i\"" host</tt>'),
示例#4
0
 def get_ip(self):
     address = self.get_address()
     try:
         return validate_ip_address(address)
     except ValidationError:
         return socket.gethostbyname(self.name)