diff --git a/docs/changelog.rst b/docs/changelog.rst index b9e8097..ead7ebe 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,7 @@ Changelog ========= +* :support:`-` add webtasks interface * :support:`-` update to new fileservertasks interface (requires gvafile >= 0.4.0 on the fileserver) diff --git a/docs/code.rst b/docs/code.rst index e334f04..7cfbead 100644 --- a/docs/code.rst +++ b/docs/code.rst @@ -27,6 +27,7 @@ Celery task stubs code/ldaptasks code/mysqltasks code/pgsqltasks + code/webtasks Django app code diff --git a/docs/code/webtasks.rst b/docs/code/webtasks.rst new file mode 100644 index 0000000..68139bc --- /dev/null +++ b/docs/code/webtasks.rst @@ -0,0 +1,12 @@ +:py:mod:`webtasks` +================== + +.. automodule:: webtasks + + +:py:mod:`tasks ` +-------------------------------- + +.. automodule:: webtasks.tasks + :members: + :undoc-members: diff --git a/gnuviechadmin/gnuviechadmin/settings/base.py b/gnuviechadmin/gnuviechadmin/settings/base.py index 6d52afb..5effec9 100644 --- a/gnuviechadmin/gnuviechadmin/settings/base.py +++ b/gnuviechadmin/gnuviechadmin/settings/base.py @@ -258,6 +258,8 @@ LOCAL_APPS = ( 'taskresults', 'mysqltasks', 'pgsqltasks', + 'fileservertasks', + 'webtasks', 'domains', 'osusers', 'managemails', diff --git a/gnuviechadmin/webtasks/__init__.py b/gnuviechadmin/webtasks/__init__.py new file mode 100644 index 0000000..9e02bbf --- /dev/null +++ b/gnuviechadmin/webtasks/__init__.py @@ -0,0 +1,4 @@ +""" +This module contains :py:mod:`webtasks.tasks`. + +""" diff --git a/gnuviechadmin/webtasks/tasks.py b/gnuviechadmin/webtasks/tasks.py new file mode 100644 index 0000000..4f2cea3 --- /dev/null +++ b/gnuviechadmin/webtasks/tasks.py @@ -0,0 +1,80 @@ +""" +This module defines Celery_ tasks to manage website configurations. + +""" +from __future__ import absolute_import + +from celery import shared_task + + +@shared_task +def create_web_vhost_config(username, sitename): + """ + This task creates a virtual host configuration on an nginx web + server. + + :param str username: user who owns the site + :param str sitename: site name + :return: :py:const:`True` if the creation finished successfully + :rtype: boolean + + """ + + +@shared_task +def disable_web_vhost(sitename): + """ + This task disables a virtual host configuration on an nginx web server. + + :param str sitename: site name + :return: :py:const:`True` if the virtual host has been disabled + :rtype: boolean + + """ + + +@shared_task +def enable_web_vhost(sitename): + """ + This task enables an existing virtual host configuration on an nginx web + server. + + :param str sitename: site name + :return: :py:const:`True` if the virtual host has been enabled + :rtype: boolean + + """ + +@shared_task +def delete_web_vhost_config(sitename): + """ + This task removes a virtual host configuration on an nginx web server. + + :param str sitename: site name + :return: :py:const:`True` if the configuration has been deleted + :rtype: boolean + + """ + + +@shared_task +def create_web_php_fpm_pool_config(username): + """ + This task creates a PHP FPM pool configuration. + + :param str username: user name + :return: :py:const:`True` if the creation finished successfully + :rtype: boolean + + """ + +@shared_task +def delete_web_php_fpm_pool_config(username): + """ + This task deletes a PHP FPM pool configuration. + + :param str username: user name + :return: :py:const:`True` if the pool has been deleted + :rtype: boolean + + """