[DockerAPI] Fix pathes, fixes #2820

master
andryyy 2019-07-30 11:32:38 +02:00
parent 2193378982
commit 67049a27e2
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 6 additions and 6 deletions

View File

@ -187,7 +187,7 @@ class container_post(Resource):
def container_post__exec__system__fts_rescan(self, container_id): def container_post__exec__system__fts_rescan(self, container_id):
if 'username' in request.json: if 'username' in request.json:
for container in docker_client.containers.list(filters={"id": container_id}): for container in docker_client.containers.list(filters={"id": container_id}):
rescan_return = container.exec_run(["/bin/bash", "-c", "/usr/local/bin/doveadm fts rescan -u '" + request.json['username'].replace("'", "'\\''") + "'"], user='vmail') rescan_return = container.exec_run(["/bin/bash", "-c", "/usr/bin/doveadm fts rescan -u '" + request.json['username'].replace("'", "'\\''") + "'"], user='vmail')
if rescan_return.exit_code == 0: if rescan_return.exit_code == 0:
return jsonify(type='success', msg='fts_rescan: rescan triggered') return jsonify(type='success', msg='fts_rescan: rescan triggered')
else: else:
@ -195,7 +195,7 @@ class container_post(Resource):
if 'all' in request.json: if 'all' in request.json:
for container in docker_client.containers.list(filters={"id": container_id}): for container in docker_client.containers.list(filters={"id": container_id}):
rescan_return = container.exec_run(["/bin/bash", "-c", "/usr/local/bin/doveadm fts rescan -A"], user='vmail') rescan_return = container.exec_run(["/bin/bash", "-c", "/usr/bin/doveadm fts rescan -A"], user='vmail')
if rescan_return.exit_code == 0: if rescan_return.exit_code == 0:
return jsonify(type='success', msg='fts_rescan: rescan triggered') return jsonify(type='success', msg='fts_rescan: rescan triggered')
else: else:
@ -233,7 +233,7 @@ class container_post(Resource):
# api call: container_post - post_action: exec - cmd: reload - task: dovecot # api call: container_post - post_action: exec - cmd: reload - task: dovecot
def container_post__exec__reload__dovecot(self, container_id): def container_post__exec__reload__dovecot(self, container_id):
for container in docker_client.containers.list(filters={"id": container_id}): for container in docker_client.containers.list(filters={"id": container_id}):
reload_return = container.exec_run(["/bin/bash", "-c", "/usr/local/sbin/dovecot reload"]) reload_return = container.exec_run(["/bin/bash", "-c", "/usr/sbin/dovecot reload"])
return exec_run_handler('generic', reload_return) return exec_run_handler('generic', reload_return)
@ -255,7 +255,7 @@ class container_post(Resource):
def container_post__exec__sieve__list(self, container_id): def container_post__exec__sieve__list(self, container_id):
if 'username' in request.json: if 'username' in request.json:
for container in docker_client.containers.list(filters={"id": container_id}): for container in docker_client.containers.list(filters={"id": container_id}):
sieve_return = container.exec_run(["/bin/bash", "-c", "/usr/local/bin/doveadm sieve list -u '" + request.json['username'].replace("'", "'\\''") + "'"]) sieve_return = container.exec_run(["/bin/bash", "-c", "/usr/bin/doveadm sieve list -u '" + request.json['username'].replace("'", "'\\''") + "'"])
return exec_run_handler('utf8_text_only', sieve_return) return exec_run_handler('utf8_text_only', sieve_return)
@ -263,7 +263,7 @@ class container_post(Resource):
def container_post__exec__sieve__print(self, container_id): def container_post__exec__sieve__print(self, container_id):
if 'username' in request.json and 'script_name' in request.json: if 'username' in request.json and 'script_name' in request.json:
for container in docker_client.containers.list(filters={"id": container_id}): for container in docker_client.containers.list(filters={"id": container_id}):
cmd = ["/bin/bash", "-c", "/usr/local/bin/doveadm sieve get -u '" + request.json['username'].replace("'", "'\\''") + "' '" + request.json['script_name'].replace("'", "'\\''") + "'"] cmd = ["/bin/bash", "-c", "/usr/bin/doveadm sieve get -u '" + request.json['username'].replace("'", "'\\''") + "' '" + request.json['script_name'].replace("'", "'\\''") + "'"]
sieve_return = container.exec_run(cmd) sieve_return = container.exec_run(cmd)
return exec_run_handler('utf8_text_only', sieve_return) return exec_run_handler('utf8_text_only', sieve_return)

View File

@ -398,7 +398,7 @@ services:
- watchdog - watchdog
dockerapi-mailcow: dockerapi-mailcow:
image: mailcow/dockerapi:1.31 image: mailcow/dockerapi:1.32
restart: always restart: always
build: ./data/Dockerfiles/dockerapi build: ./data/Dockerfiles/dockerapi
oom_kill_disable: true oom_kill_disable: true