mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Generated doc
This commit is contained in:
parent
aa2f87d70a
commit
65579bbeb8
8 changed files with 66 additions and 52 deletions
|
@ -65,8 +65,8 @@ def app_fetchlist(url=None, name=None):
|
||||||
Fetch application list from app server
|
Fetch application list from app server
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
url -- URL of remote JSON list (default http://app.yunohost.org/list.json)
|
name -- Name of the list (default fapp)
|
||||||
name -- Name of the list (default yunohost)
|
url -- URL of remote JSON list (default http://fapp.yunohost.org/app/list/raw)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Create app path if not exists
|
# Create app path if not exists
|
||||||
|
@ -110,9 +110,9 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
|
||||||
List apps
|
List apps
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
limit -- Maximum number of app fetched
|
|
||||||
offset -- Starting number for app fetching
|
|
||||||
filter -- Name filter of app_id or app_name
|
filter -- Name filter of app_id or app_name
|
||||||
|
offset -- Starting number for app fetching
|
||||||
|
limit -- Maximum number of app fetched
|
||||||
raw -- Return the full app_dict
|
raw -- Return the full app_dict
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -180,10 +180,10 @@ def app_list(offset=None, limit=None, filter=None, raw=False):
|
||||||
|
|
||||||
def app_info(app, raw=False):
|
def app_info(app, raw=False):
|
||||||
"""
|
"""
|
||||||
Get app informations
|
Get app info
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
app -- App ID
|
app -- Specific app ID
|
||||||
raw -- Return the full app_dict
|
raw -- Return the full app_dict
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -211,9 +211,9 @@ def app_map(app=None, raw=False, user=None):
|
||||||
List apps by domain
|
List apps by domain
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
app -- Specific app to map
|
user -- Allowed app map for a user
|
||||||
raw -- Return complete dict
|
raw -- Return complete dict
|
||||||
user -- Only accessible app for user
|
app -- Specific app to map
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -253,9 +253,9 @@ def app_upgrade(app, url=None, file=None):
|
||||||
Upgrade app
|
Upgrade app
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
url -- Git url to fetch for upgrade
|
|
||||||
app -- App(s) to upgrade (default all)
|
|
||||||
file -- Folder or tarball for upgrade
|
file -- Folder or tarball for upgrade
|
||||||
|
app -- App(s) to upgrade (default all)
|
||||||
|
url -- Git url to fetch for upgrade
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with YunoHostLDAP() as yldap:
|
with YunoHostLDAP() as yldap:
|
||||||
|
@ -336,8 +336,8 @@ def app_install(app, label=None):
|
||||||
Install apps
|
Install apps
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
app -- App ID to install
|
|
||||||
label
|
label
|
||||||
|
app -- App to install
|
||||||
|
|
||||||
"""
|
"""
|
||||||
#TODO: Create tool for nginx (check path availability & stuff)
|
#TODO: Create tool for nginx (check path availability & stuff)
|
||||||
|
@ -521,6 +521,12 @@ def app_removeaccess(apps, users):
|
||||||
|
|
||||||
def app_setting(app, key, value=None):
|
def app_setting(app, key, value=None):
|
||||||
"""
|
"""
|
||||||
|
Set ou get an app setting value
|
||||||
|
|
||||||
|
Keyword argument:
|
||||||
|
value -- Value to set
|
||||||
|
app -- App ID
|
||||||
|
key -- Key to get/set
|
||||||
|
|
||||||
"""
|
"""
|
||||||
settings_file = apps_setting_path + app +'/settings.yml'
|
settings_file = apps_setting_path + app +'/settings.yml'
|
||||||
|
@ -551,6 +557,10 @@ def app_setting(app, key, value=None):
|
||||||
|
|
||||||
def app_checkport(port):
|
def app_checkport(port):
|
||||||
"""
|
"""
|
||||||
|
Check availability of a local port
|
||||||
|
|
||||||
|
Keyword argument:
|
||||||
|
port -- Port to check
|
||||||
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
@ -567,6 +577,11 @@ def app_checkport(port):
|
||||||
|
|
||||||
def app_checkurl(url, app=None):
|
def app_checkurl(url, app=None):
|
||||||
"""
|
"""
|
||||||
|
Check availability of a web path
|
||||||
|
|
||||||
|
Keyword argument:
|
||||||
|
url -- Url to check
|
||||||
|
app -- Write domain & path to app settings for further checks
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if "https://" == url[:8]:
|
if "https://" == url[:8]:
|
||||||
|
@ -605,11 +620,11 @@ def app_initdb(user, password=None, db=None, sql=None):
|
||||||
"""
|
"""
|
||||||
Create database and initialize it with optionnal attached script
|
Create database and initialize it with optionnal attached script
|
||||||
|
|
||||||
Keyword arguments:
|
Keyword argument:
|
||||||
user -- Name of the DB user
|
db -- DB name (user unless set)
|
||||||
password -- Password for the user
|
user -- Name of the DB user
|
||||||
db -- Database name (optionnal)
|
password -- Password of the DB (generated unless set)
|
||||||
sql -- Initial SQL file
|
sql -- Initial SQL file
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if db is None:
|
if db is None:
|
||||||
|
@ -635,9 +650,8 @@ def app_initdb(user, password=None, db=None, sql=None):
|
||||||
|
|
||||||
def app_ssowatconf():
|
def app_ssowatconf():
|
||||||
"""
|
"""
|
||||||
Regenerate SSOwat conf from YunoHost settings
|
Regenerate SSOwat configuration file
|
||||||
|
|
||||||
Keyword argument:
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,9 @@ def domain_list(filter=None, limit=None, offset=None):
|
||||||
List domains
|
List domains
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
limit -- Maximum number of domain fetched
|
|
||||||
offset -- Starting number for domain fetching
|
|
||||||
filter -- LDAP filter used to search
|
filter -- LDAP filter used to search
|
||||||
|
offset -- Starting number for domain fetching
|
||||||
|
limit -- Maximum number of domain fetched
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with YunoHostLDAP() as yldap:
|
with YunoHostLDAP() as yldap:
|
||||||
|
|
|
@ -37,8 +37,8 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
domain -- Full domain to subscribe with
|
domain -- Full domain to subscribe with
|
||||||
subscribe_host -- Dynette HTTP API to subscribe to
|
|
||||||
key -- Public DNS key
|
key -- Public DNS key
|
||||||
|
subscribe_host -- Dynette HTTP API to subscribe to
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if domain is None:
|
if domain is None:
|
||||||
|
@ -77,10 +77,10 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non
|
||||||
Update IP on DynDNS platform
|
Update IP on DynDNS platform
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
dyn_host -- Dynette DNS server to inform
|
|
||||||
domain -- Full domain to subscribe with
|
domain -- Full domain to subscribe with
|
||||||
ip -- IP address to send
|
dyn_host -- Dynette DNS server to inform
|
||||||
key -- Public DNS key
|
key -- Public DNS key
|
||||||
|
ip -- IP address to send
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if domain is None:
|
if domain is None:
|
||||||
|
|
|
@ -44,10 +44,10 @@ def firewall_allow(protocol=None, port=None, ipv6=None, upnp=False):
|
||||||
Allow connection port/protocol
|
Allow connection port/protocol
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
upnp -- upnp
|
|
||||||
protocol -- Protocol associated with port
|
|
||||||
ipv6 -- ipv6
|
|
||||||
port -- Port to open
|
port -- Port to open
|
||||||
|
protocol -- Protocol associated with port
|
||||||
|
upnp -- upnp
|
||||||
|
ipv6 -- ipv6
|
||||||
|
|
||||||
"""
|
"""
|
||||||
port = int(port)
|
port = int(port)
|
||||||
|
@ -75,10 +75,10 @@ def firewall_disallow(protocol=None, port=None, ipv6=None, upnp=False):
|
||||||
Disallow connection
|
Disallow connection
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
upnp -- upnp
|
|
||||||
protocol -- Protocol associated with port
|
|
||||||
ipv6 -- ipv6
|
|
||||||
port -- Port to open
|
port -- Port to open
|
||||||
|
protocol -- Protocol associated with port
|
||||||
|
upnp -- upnp
|
||||||
|
ipv6 -- ipv6
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ hook_folder = '/user/share/yunohost/hooks/'
|
||||||
|
|
||||||
def hook_add(action, file):
|
def hook_add(action, file):
|
||||||
"""
|
"""
|
||||||
Store hook script to fs
|
Store hook script to filsystem
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
|
file -- Script to check
|
||||||
action -- Action folder to store into
|
action -- Action folder to store into
|
||||||
file -- Script file to store
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
try: os.listdir(hook_folder + action)
|
try: os.listdir(hook_folder + action)
|
||||||
|
|
|
@ -118,13 +118,13 @@ def monitor_info(memory=False, swap=False, cpu=False, disk=False, ifconfig=False
|
||||||
Check System
|
Check System
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
uptime -- Show Uptime
|
memory -- Check Memory
|
||||||
|
ifconfig -- Show Ip and MAC Adress
|
||||||
disk -- Check Disk
|
disk -- Check Disk
|
||||||
|
uptime -- Show Uptime
|
||||||
|
swap -- Check Swap
|
||||||
public -- Show IP public
|
public -- Show IP public
|
||||||
cpu -- Check CPU
|
cpu -- Check CPU
|
||||||
memory -- Check Memory
|
|
||||||
swap -- Check Swap
|
|
||||||
ifconfig -- Show Ip and MAC Adress
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if memory:
|
if memory:
|
||||||
|
@ -177,12 +177,12 @@ def monitor_process(enable=None, disable=None, start=None, stop=None, check=Fals
|
||||||
Check Process
|
Check Process
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
enable -- Enable process
|
|
||||||
disable -- Disable process
|
|
||||||
stop -- Stop process
|
|
||||||
check -- Check process
|
|
||||||
info -- Process info
|
info -- Process info
|
||||||
|
disable -- Disable process
|
||||||
|
enable -- Enable process
|
||||||
start -- Start process
|
start -- Start process
|
||||||
|
check -- Check process
|
||||||
|
stop -- Stop process
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if enable:
|
if enable:
|
||||||
|
|
|
@ -95,8 +95,8 @@ def tools_adminpw(old_password, new_password):
|
||||||
Change admin password
|
Change admin password
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
old_password
|
|
||||||
new_password
|
new_password
|
||||||
|
old_password
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Validate password length
|
# Validate password length
|
||||||
|
@ -131,8 +131,8 @@ def tools_maindomain(old_domain, new_domain, dyndns=False):
|
||||||
Main domain change tool
|
Main domain change tool
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
old_domain
|
|
||||||
new_domain
|
new_domain
|
||||||
|
old_domain
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -203,8 +203,8 @@ def tools_postinstall(domain, password, dyndns=False):
|
||||||
YunoHost post-install
|
YunoHost post-install
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
dyndns -- Subscribe domain to a DynDNS service
|
|
||||||
domain -- YunoHost main domain
|
domain -- YunoHost main domain
|
||||||
|
dyndns -- Subscribe domain to a DynDNS service
|
||||||
password -- YunoHost admin password
|
password -- YunoHost admin password
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -38,10 +38,10 @@ def user_list(fields=None, filter=None, limit=None, offset=None):
|
||||||
List users
|
List users
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
fields -- fields to fetch
|
|
||||||
offset -- Starting number for user fetching
|
|
||||||
filter -- LDAP filter used to search
|
filter -- LDAP filter used to search
|
||||||
|
offset -- Starting number for user fetching
|
||||||
limit -- Maximum number of user fetched
|
limit -- Maximum number of user fetched
|
||||||
|
fields -- fields to fetch
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with YunoHostLDAP() as yldap:
|
with YunoHostLDAP() as yldap:
|
||||||
|
@ -91,11 +91,11 @@ def user_create(username, firstname, lastname, mail, password):
|
||||||
Create user
|
Create user
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
username -- Must be unique
|
|
||||||
lastname
|
|
||||||
firstname
|
firstname
|
||||||
password
|
lastname
|
||||||
|
username -- Must be unique
|
||||||
mail -- Main mail address must be unique
|
mail -- Main mail address must be unique
|
||||||
|
password
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with YunoHostLDAP() as yldap:
|
with YunoHostLDAP() as yldap:
|
||||||
|
@ -160,15 +160,15 @@ def user_update(username, firstname=None, lastname=None, mail=None, change_passw
|
||||||
Update user informations
|
Update user informations
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
username -- Username of user to update
|
lastname
|
||||||
|
mail
|
||||||
firstname
|
firstname
|
||||||
add_mailalias -- Mail aliases to add
|
add_mailalias -- Mail aliases to add
|
||||||
mail
|
remove_mailforward -- Mailforward addresses to remove
|
||||||
lastname
|
username -- Username of user to update
|
||||||
|
add_mailforward -- Mailforward addresses to add
|
||||||
change_password -- New password to set
|
change_password -- New password to set
|
||||||
remove_mailalias -- Mail aliases to remove
|
remove_mailalias -- Mail aliases to remove
|
||||||
add_mailforward -- Mailforward addresses to add
|
|
||||||
remove_mailforward -- Mailforward addresses to remove
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with YunoHostLDAP() as yldap:
|
with YunoHostLDAP() as yldap:
|
||||||
|
|
Loading…
Reference in a new issue