mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
commit
b133d13469
2 changed files with 33 additions and 0 deletions
|
@ -505,6 +505,14 @@ app:
|
||||||
full: --sql
|
full: --sql
|
||||||
help: Initial SQL file
|
help: Initial SQL file
|
||||||
|
|
||||||
|
### app_debug()
|
||||||
|
debug:
|
||||||
|
action_help: Display all debug informations for an application
|
||||||
|
api: GET /apps/<app>/debug
|
||||||
|
arguments:
|
||||||
|
app:
|
||||||
|
help: App name
|
||||||
|
|
||||||
### app_makedefault()
|
### app_makedefault()
|
||||||
makedefault:
|
makedefault:
|
||||||
action_help: Redirect domain root to an app
|
action_help: Redirect domain root to an app
|
||||||
|
|
|
@ -39,6 +39,8 @@ import subprocess
|
||||||
from moulinette.core import MoulinetteError
|
from moulinette.core import MoulinetteError
|
||||||
from moulinette.utils.log import getActionLogger
|
from moulinette.utils.log import getActionLogger
|
||||||
|
|
||||||
|
from .service import service_log
|
||||||
|
|
||||||
logger = getActionLogger('yunohost.app')
|
logger = getActionLogger('yunohost.app')
|
||||||
|
|
||||||
repo_path = '/var/cache/yunohost/repo'
|
repo_path = '/var/cache/yunohost/repo'
|
||||||
|
@ -722,6 +724,29 @@ def app_clearaccess(auth, apps):
|
||||||
app_ssowatconf(auth)
|
app_ssowatconf(auth)
|
||||||
|
|
||||||
|
|
||||||
|
def app_debug(app):
|
||||||
|
"""
|
||||||
|
Display debug informations for an app
|
||||||
|
|
||||||
|
Keyword argument:
|
||||||
|
app
|
||||||
|
"""
|
||||||
|
with open(apps_setting_path + app + '/manifest.json') as f:
|
||||||
|
manifest = json.loads(f.read())
|
||||||
|
|
||||||
|
return {
|
||||||
|
'name': manifest['id'],
|
||||||
|
'label': manifest['name'],
|
||||||
|
'services': [{
|
||||||
|
"name": x,
|
||||||
|
"logs": [{
|
||||||
|
"file_name": y,
|
||||||
|
"file_content": "\n".join(z),
|
||||||
|
} for (y, z) in sorted(service_log(x).items(), key=lambda x: x[0])],
|
||||||
|
} for x in sorted(manifest.get("services", []))]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def app_makedefault(auth, app, domain=None):
|
def app_makedefault(auth, app, domain=None):
|
||||||
"""
|
"""
|
||||||
Redirect domain root to an app
|
Redirect domain root to an app
|
||||||
|
|
Loading…
Add table
Reference in a new issue