mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Postinstall bugfix
This commit is contained in:
parent
cf9a6bfc43
commit
5e435452c3
2 changed files with 7 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Loading…
Reference in a new issue