diff --git a/yunohost.tac b/yunohost.tac index ca5f5ae5..c0dd5a35 100755 --- a/yunohost.tac +++ b/yunohost.tac @@ -28,6 +28,7 @@ action_dict = {} api = APIResource() def http_exec(request, **kwargs): + global installed request.setHeader('Access-Control-Allow-Origin', '*') # Allow cross-domain requests request.setHeader('Content-Type', 'application/json') # Return JSON anyway @@ -122,6 +123,8 @@ def http_exec(request, **kwargs): # Build response if request.method == 'POST': request.setResponseCode(201, 'Created') + if not installed: + installed = True elif request.method == 'DELETE': request.setResponseCode(204, 'No Content') else: diff --git a/yunohost_tools.py b/yunohost_tools.py index eea3c12b..34e04139 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -261,6 +261,10 @@ def tools_postinstall(domain, password, dyndns=False): try: os.listdir(folder) except OSError: os.makedirs(folder) + # Set hostname to avoid amavis bug + if os.system('hostname -d') != 0: + os.system('hostname yunohost.yunohost.org') + # Create SSL CA ssl_dir = '/usr/share/yunohost/yunohost-config/ssl/yunoCA' command_list = [