Postinstall bugfix

This commit is contained in:
Kload 2013-10-06 10:13:25 +00:00
parent cf9a6bfc43
commit 5e435452c3
2 changed files with 7 additions and 0 deletions

View file

@ -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:

View file

@ -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 = [