From 2b74fe99e04054d86d5e7a23140888ec62551c7a Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 6 Feb 2016 14:25:22 +0100 Subject: [PATCH 01/21] Initial vagrant setup --- .gitignore | 1 + Vagrantfile | 24 ++++++++++++++++++++++++ salt/bootstrap.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 Vagrantfile create mode 100755 salt/bootstrap.sh diff --git a/.gitignore b/.gitignore index 79f6256..e7d8648 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ Desktop.ini .ropeproject _build/ *.sqlite3 +.vagrant/ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..8f090c5 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,24 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + config.vm.box = "debian/jessie64" + config.vm.hostname = "gvafile.local" + config.vm.network "private_network", ip: "172.16.3.4" + config.vm.synced_folder "../gvasalt/states/", "/srv/salt/" + config.vm.synced_folder "../gvasalt/pillar/", "/srv/pillar/" + config.vm.provider "virtualbox" do |vb| + # vb.gui = true + vb.memory = "512" + end + + config.vm.provision :salt do |salt| + salt.bootstrap_script = "salt/bootstrap.sh" + salt.minion_id = "gvafile" + salt.masterless = true + salt.run_highstate = true + salt.verbose = true + salt.colorize = true + salt.log_level = "warning" + end +end diff --git a/salt/bootstrap.sh b/salt/bootstrap.sh new file mode 100755 index 0000000..61a103a --- /dev/null +++ b/salt/bootstrap.sh @@ -0,0 +1,32 @@ +#!/bin/sh - + +# We just download the bootstrap script by default and execute that. +if [ -x /usr/bin/fetch ]; then + /usr/bin/fetch -o - https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | sh -s -- "$@" +elif [ -x /usr/bin/curl ]; then + /usr/bin/curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | sh -s -- "$@" +else + python \ + -c 'import urllib; print urllib.urlopen("https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh").read()' \ + | sh -s -- "$@" +fi + +cat >/etc/salt/minion </etc/salt/grains < Date: Sat, 6 Feb 2016 20:48:17 +0100 Subject: [PATCH 02/21] Replace internal gvacommon copy with external requirement --- gvafile/gvacommon/.gitignore | 3 --- gvafile/gvacommon/__init__.py | 0 gvafile/gvacommon/celeryrouters.py | 15 ----------- gvafile/gvacommon/viewmixins.py | 42 ------------------------------ requirements/base.txt | 1 + 5 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 gvafile/gvacommon/.gitignore delete mode 100644 gvafile/gvacommon/__init__.py delete mode 100644 gvafile/gvacommon/celeryrouters.py delete mode 100644 gvafile/gvacommon/viewmixins.py diff --git a/gvafile/gvacommon/.gitignore b/gvafile/gvacommon/.gitignore deleted file mode 100644 index 5f1ace6..0000000 --- a/gvafile/gvacommon/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.*.swp -*.pyc -.ropeproject/ diff --git a/gvafile/gvacommon/__init__.py b/gvafile/gvacommon/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/gvafile/gvacommon/celeryrouters.py b/gvafile/gvacommon/celeryrouters.py deleted file mode 100644 index 44c4b4f..0000000 --- a/gvafile/gvacommon/celeryrouters.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - - -class GvaRouter(object): - - def route_for_task(self, task, args=None, kwargs=None): - for route in ['ldap', 'file', 'mysql', 'pgsql', 'web']: - if route in task: - return { - 'exchange': route, - 'exchange_type': 'direct', - 'queue': route, - } - return None diff --git a/gvafile/gvacommon/viewmixins.py b/gvafile/gvacommon/viewmixins.py deleted file mode 100644 index fc7f106..0000000 --- a/gvafile/gvacommon/viewmixins.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -This module defines mixins for gnuviechadmin views. - -""" -from __future__ import unicode_literals - -from django.http import HttpResponseForbidden -from django.utils.translation import ugettext as _ - -from braces.views import LoginRequiredMixin - - -class StaffOrSelfLoginRequiredMixin(LoginRequiredMixin): - """ - Mixin that makes sure that a user is logged in and matches the current - customer or is a staff user. - - """ - - def dispatch(self, request, *args, **kwargs): - if ( - request.user.is_staff or - request.user == self.get_customer_object() - ): - return super(StaffOrSelfLoginRequiredMixin, self).dispatch( - request, *args, **kwargs - ) - return HttpResponseForbidden( - _('You are not allowed to view this page.') - ) - - def get_customer_object(self): - """ - Views based on this mixin have to implement this method to return - the customer that must be an object of the same class as the - django.contrib.auth user type. - - :return: customer - :rtype: settings.AUTH_USER_MODEL - - """ - raise NotImplemented("subclass has to implement get_customer_object") diff --git a/requirements/base.txt b/requirements/base.txt index d83710b..7cef374 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -8,3 +8,4 @@ kombu==3.0.24 pytz==2014.10 wsgiref==0.1.2 PyYAML==3.11 +-e git+https://git.gnuviech-server.de/gvacommon.git@0.3.0#egg=gvacommon From 62e1e8bad74b292102a5bbd4b2d500ea43ca4c66 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 6 Feb 2016 20:50:06 +0100 Subject: [PATCH 03/21] Derive local requirements from test requirements --- requirements/local.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements/local.txt b/requirements/local.txt index aeaec92..1780235 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -1,5 +1,4 @@ # Local development dependencies go here --r base.txt -coverage==3.7.1 +-r test.txt Sphinx==1.2.3 releases==0.7.0 From f64a87714d3afae213feef002b4f68363da69b7a Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 6 Feb 2016 21:34:27 +0100 Subject: [PATCH 04/21] Update dependency versions --- requirements/base.txt | 15 ++++++--------- requirements/local.txt | 4 ++-- requirements/test.txt | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 7cef374..9db1684 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,11 +1,8 @@ -amqp==1.4.6 -bpython==0.13.1 -anyjson==0.3.3 -argparse==1.2.1 -billiard==3.3.0.19 -celery==3.1.17 -kombu==3.0.24 -pytz==2014.10 -wsgiref==0.1.2 +amqp==1.4.9 +bpython==0.15.0 +billiard==3.3.0.22 +celery==3.1.20 +kombu==3.0.33 +pytz==2015.7 PyYAML==3.11 -e git+https://git.gnuviech-server.de/gvacommon.git@0.3.0#egg=gvacommon diff --git a/requirements/local.txt b/requirements/local.txt index 1780235..905558b 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -1,4 +1,4 @@ # Local development dependencies go here -r test.txt -Sphinx==1.2.3 -releases==0.7.0 +Sphinx==1.3.5 +releases==1.0.0 diff --git a/requirements/test.txt b/requirements/test.txt index bb78fde..47897db 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,3 +1,3 @@ # Test dependencies go here. -r base.txt -coverage==3.7.1 +coverage==4.0.3 From cbb695137c56710b3be2ddaf8d3a106cdc5431f9 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 7 Feb 2016 22:43:42 +0100 Subject: [PATCH 05/21] Add redis result backend support This commit changes the Celery result backend to redis as it has already been done for the webinterface and gvaldap parts of gnuviechadmin. --- gvafile/gvafile/settings.py | 12 ++++++------ requirements/base.txt | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gvafile/gvafile/settings.py b/gvafile/gvafile/settings.py index 71d43f7..c099c38 100644 --- a/gvafile/gvafile/settings.py +++ b/gvafile/gvafile/settings.py @@ -8,7 +8,7 @@ Common settings and globals. from os import environ -def get_env_setting(setting): +def get_env_variable(setting): """ Get the environment setting or return exception. @@ -27,7 +27,7 @@ def get_env_setting(setting): ########## CELERY CONFIGURATION CELERY_TIMEZONE = 'Europe/Berlin' CELERY_ENABLE_UTC = True -CELERY_RESULT_BACKEND = 'amqp' +CELERY_RESULT_BACKEND = get_env_variable('GVAFILE_RESULTS_REDIS_URL') CELERY_RESULT_PERSISTENT = True CELERY_TASK_RESULT_EXPIRES = None CELERY_ROUTES = ( @@ -36,12 +36,12 @@ CELERY_ROUTES = ( CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' -BROKER_URL = get_env_setting('GVAFILE_BROKER_URL') +BROKER_URL = get_env_variable('GVAFILE_BROKER_URL') ########## END CELERY CONFIGURATION ########## GVAFILE CONFIGURATION -GVAFILE_SFTP_DIRECTORY = get_env_setting('GVAFILE_SFTP_DIRECTORY') -GVAFILE_MAIL_DIRECTORY = get_env_setting('GVAFILE_MAIL_DIRECTORY') -GVAFILE_SFTP_AUTHKEYS_DIRECTORY = get_env_setting( +GVAFILE_SFTP_DIRECTORY = get_env_variable('GVAFILE_SFTP_DIRECTORY') +GVAFILE_MAIL_DIRECTORY = get_env_variable('GVAFILE_MAIL_DIRECTORY') +GVAFILE_SFTP_AUTHKEYS_DIRECTORY = get_env_variable( 'GVAFILE_SFTP_AUTHKEYS_DIRECTORY') ########## END GVAFILE CONFIGURATION diff --git a/requirements/base.txt b/requirements/base.txt index 9db1684..a932d8a 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,3 +6,4 @@ kombu==3.0.33 pytz==2015.7 PyYAML==3.11 -e git+https://git.gnuviech-server.de/gvacommon.git@0.3.0#egg=gvacommon +redis==2.10.5 From 20d5a86a718424361ef6f059783e77672245177f Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 7 Feb 2016 22:44:45 +0100 Subject: [PATCH 06/21] Add code QA tools to local requirements --- requirements/local.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/requirements/local.txt b/requirements/local.txt index 905558b..6cbfc0e 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -2,3 +2,7 @@ -r test.txt Sphinx==1.3.5 releases==1.0.0 +flake8==2.5.2 +mccabe==0.4.0 +pep8==1.7.0 +pyflakes==1.0.0 From 88d8a29a1462a602fb2dad21292d33bb639fc288 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 24 Sep 2016 21:59:01 +0200 Subject: [PATCH 07/21] Improve documentation --- gvafile/fileservertasks/tasks.py | 420 +++++++++++++++++++++++++++---- salt/bootstrap.sh | 1 + 2 files changed, 367 insertions(+), 54 deletions(-) diff --git a/gvafile/fileservertasks/tasks.py b/gvafile/fileservertasks/tasks.py index 3f4473a..2c02c4a 100644 --- a/gvafile/fileservertasks/tasks.py +++ b/gvafile/fileservertasks/tasks.py @@ -6,6 +6,7 @@ This module defines `Celery`_ tasks to manage file system entities. """ from __future__ import absolute_import, unicode_literals +from copy import deepcopy import os import subprocess from tempfile import mkstemp @@ -68,15 +69,25 @@ def _build_mail_directory_name(username): @shared_task -def setup_file_sftp_userdir(username): +def setup_file_sftp_userdir(username, *args, **kwargs): """ This task creates the home directory for an SFTP user if it does not exist yet. - :param str username: the user name + :param str username: the username :raises Exception: if the SFTP directory of the user cannot be created - :return: the created directory name - :rtype: str + :return: a dictionary with the key :py:const:`username` set to the + username value and a new key :py:const:`sftp_directory` set to the + path of the created SFTP directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use :py:func:`fileservertasks.tasks.setup_file_sftp_userdir_chained` + at other positions in the task chain. """ sftp_directory = _build_sftp_directory_name(username) @@ -89,22 +100,54 @@ def setup_file_sftp_userdir(username): sftp_directory], stderr=subprocess.STDOUT) except subprocess.CalledProcessError as cpe: log_and_raise( - cpe, 'cold not create SFTP directory for user %s', username) + cpe, 'could not create SFTP directory for user %s', username) _LOGGER.info( 'created sftp directory %s for user %s', sftp_directory, username) - return sftp_directory + return {'username': username, 'sftp_directory': sftp_directory} @shared_task -def delete_file_sftp_userdir(username): +def setup_file_sftp_userdir_chained(previous_result, *args, **kwargs): + """ + This task creates the home directory for an SFTP user if it does not exist + yet. + + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` key + :raises Exception: if the SFTP directory of the user cannot be created + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`sftp_directory` key set to the path of the created SFTP + directory + :rtype: dict + + """ + username = previous_result['username'] + retval = deepcopy(previous_result) + retval.update(setup_file_sftp_userdir(username)) + return retval + + +@shared_task +def delete_file_sftp_userdir(username, *args, **kwargs): """ This task recursively deletes the home directory of an SFTP user if it - does not exist yet. + exists. - :param str username: the user name + :param str username: the username :raises Exception: if the SFTP directory of the user cannot be removed - :return: the removed directory name - :rtype: str + :return: a dictionary with the key :py:const:`username` set to the username + value and the new key :py:const:`sftp_directory` set to the path of the + deleted SFTP directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use :py:func:`fileservertasks.tasks.delete_file_sftp_userdir_chained` + at other positions in the task chain. """ sftp_directory = _build_sftp_directory_name(username) @@ -117,20 +160,52 @@ def delete_file_sftp_userdir(username): cpe, 'could not remove SFTP directory for user %s', username) _LOGGER.info( "deleted sftp directory %s of user %s", sftp_directory, username) - return sftp_directory + return {'username': username, 'sftp_directory': sftp_directory} @shared_task -def setup_file_mail_userdir(username): +def delete_file_sftp_userdir_chained(previous_result, *args, **kwargs): + """ + This task recursively deletes the home directory of an SFTP user if it + exists. + + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` key + :raises Exception: if the SFTP directory of the user cannot be removed + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`sftp_directory` key set to the path of the removed SFTP + directory + :rtype: dict + + """ + username = previous_result['username'] + retval = deepcopy(previous_result) + retval.update(delete_file_sftp_userdir(username)) + return retval + + +@shared_task +def setup_file_mail_userdir(username, *args, **kwargs): """ This task creates the mail base directory for a user if it does not exist yet. - :param str username: the user name + :param str username: the username :raises Exception: if the mail base directory for the user cannot be created - :return: the created directory name - :rtype: str + :return: a dictionary with the key :py:const:`username` set to the + username value and a new key :py:const:`mail_directory` set to the path + of the created mail directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use :py:func:`fileservertasks.tasks.setup_file_mail_userdir_chained` + at other positions in the task chain. """ mail_directory = _build_mail_directory_name(username) @@ -143,19 +218,52 @@ def setup_file_mail_userdir(username): cpe, 'could not create mail base directory for user %s', username) _LOGGER.info( 'created mail directory %s for user %s', mail_directory, username) - return mail_directory + return {'username': username, 'mail_directory': mail_directory} @shared_task -def delete_file_mail_userdir(username): +def setup_file_mail_userdir_chained(previous_result, *args, **kwargs): + """ + This task creates the mail base directory for a user if it does not exist + yet. + + :param dict previous_result: a dictionary containing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` key + :raises Exception: if the mail base directory for the user cannot be + created + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`mail_directory` key set to the path of the created mail + directory + :rtype: dict + + """ + username = previous_result['username'] + retval = deepcopy(previous_result) + retval.update(setup_file_mail_userdir(username)) + return retval + + +@shared_task +def delete_file_mail_userdir(username, *args, **kwargs): """ This task recursively deletes the mail base directory for a user if it does not exist yet. - :param str username: the user name - :raises Exception: if the mail base directory of the user cannot be removed - :return: the removed directory name - :rtype: str + :param str username: the username + :raises Exception: if the mail base directory of the user cannot be deleted + :return: a dictionary with the key :py:const:`username` set to the + username value and a new key :py:const:`mail_directory` set to the path + of the deleted mail directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use :py:func:`fileservertasks.tasks.delete_file_mail_userdir_chained` + at other positions in the task chain. """ mail_directory = _build_mail_directory_name(username) @@ -168,20 +276,52 @@ def delete_file_mail_userdir(username): cpe, 'could not remove mail base directory of user %s', username) _LOGGER.info( 'deleted mail directory %s of user %s', mail_directory, username) - return mail_directory + return {'username': username, 'mail_directory': mail_directory} + +@shared_task +def delete_file_mail_userdir_chained(previous_result, *args, **kwargs): + """ + This task recursively deletes the mail base directory for a user if it + does not exist yet. + + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` key + :raises Exception: if the mail base directory of the user cannot be deleted + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`mail_directory` key set to the path of the deleted mail + directory + :rtype: str + + """ + username = previous_result['username'] + retval = deepcopy(previous_result) + retval.update(delete_file_mail_userdir(username)) + return retval @shared_task -def create_file_mailbox(username, mailboxname): +def create_file_mailbox(username, mailboxname, *args, **kwargs): """ This task creates a new mailbox directory for the given user and mailbox name. - :param str username: the user name + :param str username: the username :param str mailboxname: the mailbox name :raises Exception: if the mailbox directory cannot be created - :return: the created mailbox directory name - :rtype: str + :return: a dictionary with the keys :py:const:`username` and + :py:const:`mailboxname` set to the values of username and mailboxname + and a new key :py:const:`mailbox_directory` set to the path of the + created mailbox directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use :py:func:`fileservertasks.tasks.create_file_mailbox_chained` at + other positions in the task chain. """ mailbox_directory = os.path.join( @@ -197,19 +337,56 @@ def create_file_mailbox(username, mailboxname): _LOGGER.info( 'created mailbox directory %s for user %s', mailbox_directory, username) - return mailbox_directory + return { + 'username': username, 'mailboxname': mailboxname, + 'mailbox_directory': mailbox_directory + } @shared_task -def delete_file_mailbox(username, mailboxname): +def create_file_mailbox_chained(previous_result, *args, **kwargs): + """ + This task creates a new mailbox directory for the given user and mailbox + name. + + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` and a :py:const:`mailboxname` key + :raises Exception: if the mailbox directory cannot be created + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`mailbox_directory` key set to the path of the created + mailbox directory + :rtype: dict + + """ + username = previous_result['username'] + mailboxname = previous_result['mailboxname'] + retval = deepcopy(previous_result) + retval.update(create_file_mailbox(username, mailboxname)) + return retval + + +@shared_task +def delete_file_mailbox(username, mailboxname, *args, **kwargs): """ This task deletes the given mailbox of the given user. - :param str username: the user name + :param str username: the username :param str mailboxname: the mailbox name :raises Exception: if the mailbox directory cannot be deleted - :return: the deleted mailbox directory name - :rtype: str + :return: a dictionary with the keys :py:const:`username` and + :py:const:`mailboxname` set to the values of username and mailboxname + and a new key :py:const:`mailbox_directory` set to the path of the + deleted mailbox directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use :py:func:`fileservertasks.tasks.delete_file_mailbox_chained` for + other positions in the task chain. """ mailbox_directory = os.path.join( @@ -224,20 +401,56 @@ def delete_file_mailbox(username, mailboxname): username) _LOGGER.info( 'deleted mailbox directory %s of user %s', mailbox_directory, username) - return mailbox_directory + return { + 'username': username, 'mailboxname': mailboxname, + 'mailbox_directory': mailbox_directory + } + +@shared_task +def delete_file_mailbox_chained(previous_result, *args, **kwargs): + """ + This task deletes the given mailbox of the given user. + + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` and a :py:const:`mailboxname` key + :raises Exception: if the mailbox directory cannot be deleted + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`mailbox_directory` key set to the path of the deleted + mailbox directory + :rtype: dict + + """ + username = previous_result['username'] + mailboxname = previous_result['mailboxname'] + retval = deepcopy(previous_result) + retval.update(delete_file_mailbox(username, mailboxname)) + return retval @shared_task -def create_file_website_hierarchy(username, sitename): +def create_file_website_hierarchy(username, sitename, *args, **kwargs): """ This task creates the directory hierarchy for a website. - :param str username: the user name - :param str sitename: name of the website + :param str username: the username + :param str sitename: the sitename :raises Exception: if the website directory hierarchy directory cannot be created - :return: the directory name - :rtype: str + :return: a dictionary with the keys :py:const:`username` and + :py:const:`sitename` set to the values of username and sitename and a + new key :py:const:`website_directory` set to the path of the created + website directory + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use + :py:func:`fileservertasks.tasks.create_file_website_hierarchy_chained` + at other positions in the task chain """ website_directory = os.path.join( @@ -271,20 +484,55 @@ def create_file_website_hierarchy(username, sitename): _LOGGER.info( 'created website directory %s for user %s', website_directory, username) - return website_directory + return { + 'username': username, 'sitename': sitename, + 'website_directory': website_directory, + } @shared_task -def delete_file_website_hierarchy(username, sitename): +def create_file_website_hierarchy_chained(previous_result, *args, **kwargs): """ - This task deletes the website hierarchy recursively. + This task creates the directory hierarchy for a website. - :param str username: the user name - :param str sitename: name of the website + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` and a :py:const:`sitename` key :raises Exception: if the website directory hierarchy directory cannot be - deleted - :return: the directory name - :rtype: str + created + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`website_directory` key set to the path of the created + website directory + :rtype: dict + + """ + username = previous_result['username'] + sitename = previous_result['sitename'] + retval = deepcopy(previous_result) + retval.update(create_file_website_hierarchy(username, sitename)) + return retval + + +@shared_task +def delete_file_website_hierarchy(username, sitename, *args, **kwargs): + """ + This task deletes a website hierarchy recursively. + + :param str username: a username + :param str sitename: a site name + :return: a dictionary with the keys :py:const:`username` and + :py:const:`sitename` set to their original values and a new key + :py:const:`website_directory` set to the path of the deleted website + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use + :py:func:`fileservertasks.tasks.delete_file_website_hierarchy_chained` + at other positions in the task chain """ website_directory = os.path.join( @@ -300,20 +548,58 @@ def delete_file_website_hierarchy(username, sitename): "website %s"), username, sitename) _LOGGER.info( 'deleted website directory %s of user %s', website_directory, username) - return website_directory + return { + 'username': username, 'sitename': sitename, + 'website_directory': website_directory, + } @shared_task -def set_file_ssh_authorized_keys(username, ssh_keys): +def delete_file_website_hierarchy_chained(previous_result, *args, **kwargs): """ - This task sets the authorized keys for ssh logins. + This task deletes the website hierarchy recursively. - :param str username: the user name - :param list ssh_key: an ssh_key + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` and a :py:const:`sitename` key + :raises Exception: if the website directory hierarchy directory cannot be + deleted + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`website_directory` set to the path of the deleted website + directory + :rtype: dict + + """ + username = previous_result['username'] + sitename = previous_result['sitename'] + retval = deepcopy(previous_result) + retval.update(delete_file_website_hierarchy(username, sitename)) + return retval + + +@shared_task +def set_file_ssh_authorized_keys(username, ssh_keys, *args, **kwargs): + """ + This task set the authorized keys for ssh logins. + + :param str username: a username + :param list ssh_keys: a list of ssh keys :raises Exception: if the update of the creation or update of ssh authorized_keys failed - :return: the name of the authorized_keys file - :rtype: str + :return: a dictionary with the keys :py:const:`username` and + :py:const:`ssh_keys` set to their original values and a new key + :py:const:`ssh_authorized_keys` set to the path of the SSH + authorized_keys file + :rtype: dict + + .. note:: + + This variant can only be used at the beginning of a Celery task chain + or as a standalone task. + + Use + :py:func:`fileservertasks.tasks.set_file_ssh_authorized_keys_chained` + at other positions in the task chain """ ssh_authorized_keys_file = _build_authorized_keys_path(username) @@ -354,4 +640,30 @@ def set_file_ssh_authorized_keys(username, ssh_keys): log_and_raise( cpe, 'could not remove the authorized_keys file of user %s', username) - return ssh_authorized_keys_file + return { + 'username': username, 'ssh_keys': ssh_keys, + 'ssh_authorized_keys': ssh_authorized_keys_file, + } + + +@shared_task +def set_file_ssh_authorized_keys_chained(previous_result, *args, **kwargs): + """ + This task sets the authorized keys for ssh logins. + + :param dict previous_result: a dictionary describing the result of the + previous step in the Celery task chain. This dictionary must contain a + :py:const:`username` and a :py:const:`ssh_keys` key + :raises Exception: if the update of the creation or update of ssh + authorized_keys failed + :return: a copy of the :py:obj:`previous_result` dictionary with a new + :py:const:`ssh_authorized_keys` set to the path of the SSH + authorized_keys file + :rtype: dict + + """ + username = previous_result['username'] + ssh_keys = previous_result['ssh_keys'] + retval = deepcopy(previous_result) + retval.update(set_file_ssh_authorized_keys(username, ssh_keys)) + return retval diff --git a/salt/bootstrap.sh b/salt/bootstrap.sh index 61a103a..c24ee37 100755 --- a/salt/bootstrap.sh +++ b/salt/bootstrap.sh @@ -28,5 +28,6 @@ EOF cat >/etc/salt/grains < Date: Sun, 25 Sep 2016 01:10:17 +0200 Subject: [PATCH 08/21] Improve Vagrant setup Use debian/contrib-jessie64 base box, install python-cryptography before saltstack bootstrap. --- Vagrantfile | 7 +++++-- salt/bootstrap.sh | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 8f090c5..830f1ae 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,13 +2,16 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| - config.vm.box = "debian/jessie64" + config.vm.box = "debian/contrib-jessie64" + config.vm.hostname = "gvafile.local" config.vm.network "private_network", ip: "172.16.3.4" + config.vm.synced_folder "../gvasalt/states/", "/srv/salt/" config.vm.synced_folder "../gvasalt/pillar/", "/srv/pillar/" + config.vm.provider "virtualbox" do |vb| - # vb.gui = true + # vb.gui = true vb.memory = "512" end diff --git a/salt/bootstrap.sh b/salt/bootstrap.sh index c24ee37..9db2a28 100755 --- a/salt/bootstrap.sh +++ b/salt/bootstrap.sh @@ -1,5 +1,10 @@ #!/bin/sh - +echo "deb http://httpredir.debian.org/debian jessie-backports main" >/etc/apt/sources.list.d/backports.list + +apt-get update +apt-get install -y -t jessie-backports python-cryptography + # We just download the bootstrap script by default and execute that. if [ -x /usr/bin/fetch ]; then /usr/bin/fetch -o - https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | sh -s -- "$@" From 4eb3a1c3f347a3d5ca830a24fcdee5830be30a3e Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 25 Sep 2016 01:10:45 +0200 Subject: [PATCH 09/21] Ignore PyCharm files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e7d8648..36ae448 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ Desktop.ini _build/ *.sqlite3 .vagrant/ +.idea/ From d5a275dbbedbf73510fdcc9d98657c5dcc00dcc7 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 25 Sep 2016 16:33:02 +0200 Subject: [PATCH 10/21] Log directory path for exceptions Improve the log message of setup_file_sftp_userdir to include the path that has been attempted to create. --- gvafile/fileservertasks/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gvafile/fileservertasks/tasks.py b/gvafile/fileservertasks/tasks.py index 2c02c4a..432163f 100644 --- a/gvafile/fileservertasks/tasks.py +++ b/gvafile/fileservertasks/tasks.py @@ -100,7 +100,8 @@ def setup_file_sftp_userdir(username, *args, **kwargs): sftp_directory], stderr=subprocess.STDOUT) except subprocess.CalledProcessError as cpe: log_and_raise( - cpe, 'could not create SFTP directory for user %s', username) + cpe, 'could not create SFTP directory %s for user %s', + sftp_directory, username) _LOGGER.info( 'created sftp directory %s for user %s', sftp_directory, username) return {'username': username, 'sftp_directory': sftp_directory} From 821e84f60845ca38d05f5f4e9791037c702eea19 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 25 Sep 2016 17:27:42 +0200 Subject: [PATCH 11/21] Protect /etc/salt/grains Make sure that the permissions of /etc/salt/grains only allow access for the root user. --- salt/bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/bootstrap.sh b/salt/bootstrap.sh index 9db2a28..ecc211a 100755 --- a/salt/bootstrap.sh +++ b/salt/bootstrap.sh @@ -30,6 +30,7 @@ pillar_roots: log_file: file:///dev/log EOF +umask 077 cat >/etc/salt/grains < Date: Wed, 26 Jun 2019 22:50:28 +0200 Subject: [PATCH 12/21] Change gvacommon dependency URL --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index a932d8a..850ec64 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -5,5 +5,5 @@ celery==3.1.20 kombu==3.0.33 pytz==2015.7 PyYAML==3.11 --e git+https://git.gnuviech-server.de/gvacommon.git@0.3.0#egg=gvacommon +-e git+https://git.dittberner.info/gnuviech/gvacommon.git@0.3.0#egg=gvacommon redis==2.10.5 From cbd8e37e8e198fd4eaa2ec51944ae18c21bde27a Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 4 Mar 2020 16:52:11 +0100 Subject: [PATCH 13/21] Switch dependency management to Pipenv Fixes #2 --- Pipfile | 20 ++ Pipfile.lock | 351 ++++++++++++++++++++++++++++++++++++ docs/changelog.rst | 2 + docs/install.rst | 63 +------ requirements.txt | 3 - requirements/base.txt | 9 - requirements/local.txt | 8 - requirements/production.txt | 3 - requirements/test.txt | 3 - 9 files changed, 381 insertions(+), 81 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock delete mode 100644 requirements.txt delete mode 100644 requirements/base.txt delete mode 100644 requirements/local.txt delete mode 100644 requirements/production.txt delete mode 100644 requirements/test.txt diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..f7dcf52 --- /dev/null +++ b/Pipfile @@ -0,0 +1,20 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +coverage = "*" +releases = "*" +Sphinx = "*" + +[packages] +amqp = "*" +anyjson = "*" +celery = "*" +kombu = "*" +pytz = "*" +redis = "*" + +[requires] +python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..831ef4e --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,351 @@ +{ + "_meta": { + "hash": { + "sha256": "3af06993def20da8657b69e535b6c7a3e2282f9277b45ca5ae11289ea78a51b0" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "amqp": { + "hashes": [ + "sha256:6e649ca13a7df3faacdc8bbb280aa9a6602d22fd9d545336077e573a1f4ff3b8", + "sha256:77f1aef9410698d20eaeac5b73a87817365f457a507d82edf292e12cbb83b08d" + ], + "index": "pypi", + "version": "==2.5.2" + }, + "anyjson": { + "hashes": [ + "sha256:37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba" + ], + "index": "pypi", + "version": "==0.3.3" + }, + "billiard": { + "hashes": [ + "sha256:bff575450859a6e0fbc2f9877d9b715b0bbc07c3565bb7ed2280526a0cdf5ede", + "sha256:d91725ce6425f33a97dfa72fb6bfef0e47d4652acd98a032bd1a7fbf06d5fa6a" + ], + "version": "==3.6.3.0" + }, + "celery": { + "hashes": [ + "sha256:3c5fcd6bfcf9a6323cb742cfc121d1790d50cfeddf300ba723cfa0b356413f07", + "sha256:a650525303ee866fb0c62c82f68681fcc2183eebbfafae552c27d30125fe518b" + ], + "index": "pypi", + "version": "==4.4.1" + }, + "importlib-metadata": { + "hashes": [ + "sha256:06f5b3a99029c7134207dd882428a66992a9de2bef7c2b699b5641f9886c3302", + "sha256:b97607a1a18a5100839aec1dc26a1ea17ee0d93b20b0f008d80a5a050afb200b" + ], + "markers": "python_version < '3.8'", + "version": "==1.5.0" + }, + "kombu": { + "hashes": [ + "sha256:2d1cda774126a044d91a7ff5fa6d09edf99f46924ab332a810760fe6740e9b76", + "sha256:598e7e749d6ab54f646b74b2d2df67755dee13894f73ab02a2a9feb8870c7cb2" + ], + "index": "pypi", + "version": "==4.6.8" + }, + "pytz": { + "hashes": [ + "sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d", + "sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be" + ], + "index": "pypi", + "version": "==2019.3" + }, + "redis": { + "hashes": [ + "sha256:0dcfb335921b88a850d461dc255ff4708294943322bd55de6cfd68972490ca1f", + "sha256:b205cffd05ebfd0a468db74f0eedbff8df1a7bfc47521516ade4692991bb0833" + ], + "index": "pypi", + "version": "==3.4.1" + }, + "vine": { + "hashes": [ + "sha256:133ee6d7a9016f177ddeaf191c1f58421a1dcc6ee9a42c58b34bed40e1d2cd87", + "sha256:ea4947cc56d1fd6f2095c8d543ee25dad966f78692528e68b4fada11ba3f98af" + ], + "version": "==1.3.0" + }, + "zipp": { + "hashes": [ + "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b", + "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96" + ], + "version": "==3.1.0" + } + }, + "develop": { + "alabaster": { + "hashes": [ + "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", + "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02" + ], + "version": "==0.7.12" + }, + "babel": { + "hashes": [ + "sha256:1aac2ae2d0d8ea368fa90906567f5c08463d98ade155c0c4bfedd6a0f7160e38", + "sha256:d670ea0b10f8b723672d3a6abeb87b565b244da220d76b4dba1b66269ec152d4" + ], + "version": "==2.8.0" + }, + "certifi": { + "hashes": [ + "sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3", + "sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f" + ], + "version": "==2019.11.28" + }, + "chardet": { + "hashes": [ + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + ], + "version": "==3.0.4" + }, + "coverage": { + "hashes": [ + "sha256:15cf13a6896048d6d947bf7d222f36e4809ab926894beb748fc9caa14605d9c3", + "sha256:1daa3eceed220f9fdb80d5ff950dd95112cd27f70d004c7918ca6dfc6c47054c", + "sha256:1e44a022500d944d42f94df76727ba3fc0a5c0b672c358b61067abb88caee7a0", + "sha256:25dbf1110d70bab68a74b4b9d74f30e99b177cde3388e07cc7272f2168bd1477", + "sha256:3230d1003eec018ad4a472d254991e34241e0bbd513e97a29727c7c2f637bd2a", + "sha256:3dbb72eaeea5763676a1a1efd9b427a048c97c39ed92e13336e726117d0b72bf", + "sha256:5012d3b8d5a500834783689a5d2292fe06ec75dc86ee1ccdad04b6f5bf231691", + "sha256:51bc7710b13a2ae0c726f69756cf7ffd4362f4ac36546e243136187cfcc8aa73", + "sha256:527b4f316e6bf7755082a783726da20671a0cc388b786a64417780b90565b987", + "sha256:722e4557c8039aad9592c6a4213db75da08c2cd9945320220634f637251c3894", + "sha256:76e2057e8ffba5472fd28a3a010431fd9e928885ff480cb278877c6e9943cc2e", + "sha256:77afca04240c40450c331fa796b3eab6f1e15c5ecf8bf2b8bee9706cd5452fef", + "sha256:7afad9835e7a651d3551eab18cbc0fdb888f0a6136169fbef0662d9cdc9987cf", + "sha256:9bea19ac2f08672636350f203db89382121c9c2ade85d945953ef3c8cf9d2a68", + "sha256:a8b8ac7876bc3598e43e2603f772d2353d9931709345ad6c1149009fd1bc81b8", + "sha256:b0840b45187699affd4c6588286d429cd79a99d509fe3de0f209594669bb0954", + "sha256:b26aaf69713e5674efbde4d728fb7124e429c9466aeaf5f4a7e9e699b12c9fe2", + "sha256:b63dd43f455ba878e5e9f80ba4f748c0a2156dde6e0e6e690310e24d6e8caf40", + "sha256:be18f4ae5a9e46edae3f329de2191747966a34a3d93046dbdf897319923923bc", + "sha256:c312e57847db2526bc92b9bfa78266bfbaabac3fdcd751df4d062cd4c23e46dc", + "sha256:c60097190fe9dc2b329a0eb03393e2e0829156a589bd732e70794c0dd804258e", + "sha256:c62a2143e1313944bf4a5ab34fd3b4be15367a02e9478b0ce800cb510e3bbb9d", + "sha256:cc1109f54a14d940b8512ee9f1c3975c181bbb200306c6d8b87d93376538782f", + "sha256:cd60f507c125ac0ad83f05803063bed27e50fa903b9c2cfee3f8a6867ca600fc", + "sha256:d513cc3db248e566e07a0da99c230aca3556d9b09ed02f420664e2da97eac301", + "sha256:d649dc0bcace6fcdb446ae02b98798a856593b19b637c1b9af8edadf2b150bea", + "sha256:d7008a6796095a79544f4da1ee49418901961c97ca9e9d44904205ff7d6aa8cb", + "sha256:da93027835164b8223e8e5af2cf902a4c80ed93cb0909417234f4a9df3bcd9af", + "sha256:e69215621707119c6baf99bda014a45b999d37602cb7043d943c76a59b05bf52", + "sha256:ea9525e0fef2de9208250d6c5aeeee0138921057cd67fcef90fbed49c4d62d37", + "sha256:fca1669d464f0c9831fd10be2eef6b86f5ebd76c724d1e0706ebdff86bb4adf0" + ], + "index": "pypi", + "version": "==5.0.3" + }, + "docutils": { + "hashes": [ + "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af", + "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc" + ], + "version": "==0.16" + }, + "idna": { + "hashes": [ + "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb", + "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa" + ], + "version": "==2.9" + }, + "imagesize": { + "hashes": [ + "sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1", + "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1" + ], + "version": "==1.2.0" + }, + "jinja2": { + "hashes": [ + "sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250", + "sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49" + ], + "version": "==2.11.1" + }, + "markupsafe": { + "hashes": [ + "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473", + "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161", + "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235", + "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5", + "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42", + "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff", + "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b", + "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1", + "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e", + "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183", + "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66", + "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b", + "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1", + "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15", + "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1", + "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e", + "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b", + "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905", + "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735", + "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d", + "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e", + "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d", + "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c", + "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21", + "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2", + "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5", + "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b", + "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6", + "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f", + "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f", + "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2", + "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7", + "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be" + ], + "version": "==1.1.1" + }, + "packaging": { + "hashes": [ + "sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73", + "sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334" + ], + "version": "==20.1" + }, + "pygments": { + "hashes": [ + "sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b", + "sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe" + ], + "version": "==2.5.2" + }, + "pyparsing": { + "hashes": [ + "sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f", + "sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec" + ], + "version": "==2.4.6" + }, + "pytz": { + "hashes": [ + "sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d", + "sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be" + ], + "index": "pypi", + "version": "==2019.3" + }, + "releases": { + "hashes": [ + "sha256:555ae4c97a671a420281c1c782e9236be25157b449fdf20b4c4b293fe93db2f1", + "sha256:cb3435ba372a6807433800fbe473760cfa781171513f670f3c4b76983ac80f18" + ], + "index": "pypi", + "version": "==1.6.3" + }, + "requests": { + "hashes": [ + "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee", + "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6" + ], + "version": "==2.23.0" + }, + "semantic-version": { + "hashes": [ + "sha256:2a4328680073e9b243667b201119772aefc5fc63ae32398d6afafff07c4f54c0", + "sha256:2d06ab7372034bcb8b54f2205370f4aa0643c133b7e6dbd129c5200b83ab394b" + ], + "version": "==2.6.0" + }, + "six": { + "hashes": [ + "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a", + "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c" + ], + "version": "==1.14.0" + }, + "snowballstemmer": { + "hashes": [ + "sha256:209f257d7533fdb3cb73bdbd24f436239ca3b2fa67d56f6ff88e86be08cc5ef0", + "sha256:df3bac3df4c2c01363f3dd2cfa78cce2840a79b9f1c2d2de9ce8d31683992f52" + ], + "version": "==2.0.0" + }, + "sphinx": { + "hashes": [ + "sha256:776ff8333181138fae52df65be733127539623bb46cc692e7fa0fcfc80d7aa88", + "sha256:ca762da97c3b5107cbf0ab9e11d3ec7ab8d3c31377266fd613b962ed971df709" + ], + "index": "pypi", + "version": "==2.4.3" + }, + "sphinxcontrib-applehelp": { + "hashes": [ + "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a", + "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58" + ], + "version": "==1.0.2" + }, + "sphinxcontrib-devhelp": { + "hashes": [ + "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e", + "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4" + ], + "version": "==1.0.2" + }, + "sphinxcontrib-htmlhelp": { + "hashes": [ + "sha256:3c0bc24a2c41e340ac37c85ced6dafc879ab485c095b1d65d2461ac2f7cca86f", + "sha256:e8f5bb7e31b2dbb25b9cc435c8ab7a79787ebf7f906155729338f3156d93659b" + ], + "version": "==1.0.3" + }, + "sphinxcontrib-jsmath": { + "hashes": [ + "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", + "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8" + ], + "version": "==1.0.1" + }, + "sphinxcontrib-qthelp": { + "hashes": [ + "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72", + "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6" + ], + "version": "==1.0.3" + }, + "sphinxcontrib-serializinghtml": { + "hashes": [ + "sha256:eaa0eccc86e982a9b939b2b82d12cc5d013385ba5eadcc7e4fed23f4405f77bc", + "sha256:f242a81d423f59617a8e5cf16f5d4d74e28ee9a66f9e5b637a18082991db5a9a" + ], + "version": "==1.1.4" + }, + "urllib3": { + "hashes": [ + "sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc", + "sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc" + ], + "version": "==1.25.8" + } + } +} diff --git a/docs/changelog.rst b/docs/changelog.rst index 36c3984..b1fc443 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :support:`2` use Pipenv for dependency management + * :release:`0.5.0 <2015-01-29>` * :feature:`-` add new task set_file_ssh_authorized_keys to add SSH keys for users diff --git a/docs/install.rst b/docs/install.rst index ced96ae..420f3b2 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -7,77 +7,30 @@ Install Working Environment =================== -You have several options in setting up your working environment. We recommend -using virtualenv to separate the dependencies of your project from your -system's python environment. If on Linux or Mac OS X, you can also use -virtualenvwrapper to help manage multiple virtualenvs across different -projects. +To get a running work environment use `pipenv`_. -.. index:: virtualenv +.. _pipenv: https://pipenv.kennethreitz.org/en/latest/ -Virtualenv Only ---------------- - -First, make sure you are using `virtualenv`_. Once that's installed, create -your virtualenv: +To get started install `pip` and `pipenv` and use `pipenv install --dev`: .. code-block:: sh - $ virtualenv --distribute gvafile - -.. _virtualenv: https://virtualenv.pypa.io/en/latest/ - -You will also need to ensure that the virtualenv has the project directory -added to the path. - -.. index:: virtualenvwrapper - -Virtualenv with virtualenvwrapper ------------------------------------- - -In Linux and Mac OSX, you can install `virtualenvwrapper -`_, which will take care -of managing your virtual environments and adding the project path to the -`site-directory` for you: - -.. code-block:: sh - - $ mkdir gvafile - $ mkvirtualenv -a gvafile gvafile-dev - $ cd gvafile && add2virtualenv `pwd` - - -.. index:: pip, requirements, dependencies - -Installation of Dependencies -============================= - -Depending on where you are installing dependencies: - -In development: - -.. code-block:: sh - - $ pip install -r requirements/local.txt - -For production: - -.. code-block:: sh - - $ pip install -r requirements.txt + $ apt install python3-pip + $ python3 -m pip install --user -U pipenv + $ pipenv install --dev .. index:: celery, worker, file queue Running the Celery worker ========================= -gvafile uses the `Celery`_ distributed task queue system. The gvafile logix is +gvafile uses the `Celery`_ distributed task queue system. The gvafile logic is executed by a celery worker. After all dependencies are installed you can go into the gvafile directory and run the celery worker with: .. code-block:: sh $ cd gvafile - $ celery -A gvafile worker -Q file -l info + $ pipenv run celery -A filerservertasks worker -Q web -l info .. _Celery: http://www.celeryproject.org/ diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0b95660..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -# This file is here because many Platforms as a Service look for -# requirements.txt in the root directory of a project. --r requirements/production.txt diff --git a/requirements/base.txt b/requirements/base.txt deleted file mode 100644 index 89ba34f..0000000 --- a/requirements/base.txt +++ /dev/null @@ -1,9 +0,0 @@ -amqp==1.4.9 -bpython==0.15.0 -billiard==3.3.0.23 -celery==3.1.26.post2 -kombu==3.0.37 -pytz==2019.2 -PyYAML==3.13 --e git+https://git.dittberner.info/gnuviech/gvacommon.git@0.3.0#egg=gvacommon -redis==2.10.5 diff --git a/requirements/local.txt b/requirements/local.txt deleted file mode 100644 index 6cbfc0e..0000000 --- a/requirements/local.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Local development dependencies go here --r test.txt -Sphinx==1.3.5 -releases==1.0.0 -flake8==2.5.2 -mccabe==0.4.0 -pep8==1.7.0 -pyflakes==1.0.0 diff --git a/requirements/production.txt b/requirements/production.txt deleted file mode 100644 index 696dc7c..0000000 --- a/requirements/production.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Pro-tip: Try not to put anything here. There should be no dependency in -# production that isn't in development. --r base.txt diff --git a/requirements/test.txt b/requirements/test.txt deleted file mode 100644 index 47897db..0000000 --- a/requirements/test.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test dependencies go here. --r base.txt -coverage==4.0.3 From 26aae0173d9a181f8a5ccb08cb6803f2937d8de0 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 4 Mar 2020 16:53:50 +0100 Subject: [PATCH 14/21] Refactor fileservertasks into top level module This change moves the fileservertasks module to the top level to allow keeping the same task names when running in a Python 3 environment. --- docs/changelog.rst | 2 + docs/code.rst | 34 ++-- docs/conf.py | 148 +++++++++--------- gvafile/fileservertasks/__init__.py | 5 + .../{gvafile => fileservertasks}/celery.py | 6 +- .../{gvafile => fileservertasks}/settings.py | 23 ++- gvafile/fileservertasks/tasks.py | 2 +- gvafile/{gvafile => gvacommon}/__init__.py | 0 gvafile/gvacommon/celeryrouters.py | 7 + 9 files changed, 118 insertions(+), 109 deletions(-) rename gvafile/{gvafile => fileservertasks}/celery.py (57%) rename gvafile/{gvafile => fileservertasks}/settings.py (59%) rename gvafile/{gvafile => gvacommon}/__init__.py (100%) create mode 100644 gvafile/gvacommon/celeryrouters.py diff --git a/docs/changelog.rst b/docs/changelog.rst index b1fc443..b24a5e9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,8 @@ Changelog ========= +* :support:`-` move fileservertasks to top level to keep the task names when + using Python 3 * :support:`2` use Pipenv for dependency management * :release:`0.5.0 <2015-01-29>` diff --git a/docs/code.rst b/docs/code.rst index bf27672..84346b5 100644 --- a/docs/code.rst +++ b/docs/code.rst @@ -7,32 +7,26 @@ gvafile is implemented as a set of `Celery`_ tasks. .. _Celery: http://www.celeryproject.org/ -The project module :py:mod:`gvafile` -==================================== - -.. automodule:: gvafile - - -:py:mod:`celery ` ---------------------------------- - -.. automodule:: gvafile.celery - :members: - - -:py:mod:`settings ` -------------------------------------- - -.. automodule:: gvafile.settings - :members: - - :py:mod:`fileservertasks` module ================================ .. automodule:: fileservertasks +:py:mod:`celery ` +----------------------------------------- + +.. automodule:: fileservertasks.celery + :members: + + +:py:mod:`settings ` +--------------------------------------------- + +.. automodule:: fileservertasks.settings + :members: + + :py:mod:`tasks ` --------------------------------------- diff --git a/docs/conf.py b/docs/conf.py index a9ea99c..b0fd370 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,164 +18,168 @@ import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath(os.path.join('..', 'gvafile'))) +sys.path.insert(0, os.path.abspath(os.path.join("..", "gvafile"))) -os.environ['GVAFILE_ALLOWED_HOSTS'] = 'localhost' -os.environ['GVAFILE_SERVER_EMAIL'] = 'root@localhost' -os.environ['GVAFILE_SFTP_DIRECTORY'] = '/home/www' -os.environ['GVAFILE_MAIL_DIRECTORY'] = '/home/mail' +os.environ["GVAFILE_BROKER_URL"] = "amqp://" +os.environ["GVAFILE_ALLOWED_HOSTS"] = "localhost" +os.environ["GVAFILE_MAIL_DIRECTORY"] = "/home/mail" +os.environ["GVAFILE_RESULTS_REDIS_URL"] = "redis://" +os.environ["GVAFILE_SERVER_EMAIL"] = "root@localhost" +os.environ["GVAFILE_SFTP_AUTHKEYS_DIRECTORY"] = "/srv/sftp/authorized_keys" +os.environ["GVAFILE_SFTP_DIRECTORY"] = "/home/www" # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['releases', 'sphinx.ext.autodoc', 'celery.contrib.sphinx'] +extensions = ["releases", "sphinx.ext.autodoc", "celery.contrib.sphinx"] + +# configuration for releases extension +releases_issue_uri = "https://git.dittberner.info/gnuviech/gvafile/issues/%s" +releases_release_uri = "https://git.dittberner.info/gnuviech/gvafile/src/tag/%s" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -releases_issue_uri = 'https://dev.gnuviech-server.de/gvafile/ticket/%s' - -releases_release_uri = 'https://dev.gnuviech-server.de/gvafile/milestone/%s' +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'gvafile' -copyright = u'2014, 2015 Jan Dittberner' +project = u"gvafile" +copyright = u"2014-2020, Jan Dittberner" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = '0.5' # The full version, including alpha/beta/rc tags. -release = '0.5.0' +from fileservertasks import __version__ as release + +# The short X.Y version. +version = ".".join(release.split(".")[:2]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = "alabaster" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'gvafiledoc' +htmlhelp_basename = "gvafiledoc" # -- Options for LaTeX output -------------------------------------------------- @@ -183,10 +187,8 @@ htmlhelp_basename = 'gvafiledoc' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. #'preamble': '', } @@ -194,42 +196,38 @@ latex_elements = { # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'gvafile.tex', u'gvafile Documentation', - u'Jan Dittberner', 'manual'), + ("index", "gvafile.tex", u"gvafile Documentation", u"Jan Dittberner", "manual") ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'gvafile', u'gvafile Documentation', - [u'Jan Dittberner'], 1) -] +man_pages = [("index", "gvafile", u"gvafile Documentation", [u"Jan Dittberner"], 1)] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ @@ -238,16 +236,22 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'gvafile', u'gvafile Documentation', - u'Jan Dittberner', 'gvafile', 'GNUViech admin fileserver tools.', - 'Miscellaneous'), + ( + "index", + "gvafile", + u"gvafile Documentation", + u"Jan Dittberner", + "gvafile", + "GNUViech admin fileserver tools.", + "Miscellaneous", + ) ] # Documents to append as an appendix to all manuals. -#texinfo_appendices = [] +# texinfo_appendices = [] # If false, no module index is generated. -#texinfo_domain_indices = True +# texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' +# texinfo_show_urls = 'footnote' diff --git a/gvafile/fileservertasks/__init__.py b/gvafile/fileservertasks/__init__.py index cb2d3eb..96a388b 100644 --- a/gvafile/fileservertasks/__init__.py +++ b/gvafile/fileservertasks/__init__.py @@ -2,3 +2,8 @@ This module contains :py:mod:`fileservertasks.tasks`. """ +__version__ = "0.6.0" + +from fileservertasks.celery import app as celery_app + +__all__ = ('celery_app',) \ No newline at end of file diff --git a/gvafile/gvafile/celery.py b/gvafile/fileservertasks/celery.py similarity index 57% rename from gvafile/gvafile/celery.py rename to gvafile/fileservertasks/celery.py index b3b21a2..79b0051 100644 --- a/gvafile/gvafile/celery.py +++ b/gvafile/fileservertasks/celery.py @@ -9,7 +9,7 @@ from __future__ import absolute_import from celery import Celery #: The Celery application -app = Celery('gvafile') +app = Celery('fileservertasks') -app.config_from_object('gvafile.settings') -app.autodiscover_tasks(['fileservertasks'], force=True) +app.config_from_object('fileservertasks.settings') +app.autodiscover_tasks(['fileservertasks.tasks'], force=True) diff --git a/gvafile/gvafile/settings.py b/gvafile/fileservertasks/settings.py similarity index 59% rename from gvafile/gvafile/settings.py rename to gvafile/fileservertasks/settings.py index c099c38..b1816e0 100644 --- a/gvafile/gvafile/settings.py +++ b/gvafile/fileservertasks/settings.py @@ -25,23 +25,20 @@ def get_env_variable(setting): ########## CELERY CONFIGURATION -CELERY_TIMEZONE = 'Europe/Berlin' +CELERY_TIMEZONE = "Europe/Berlin" CELERY_ENABLE_UTC = True -CELERY_RESULT_BACKEND = get_env_variable('GVAFILE_RESULTS_REDIS_URL') +CELERY_RESULT_BACKEND = get_env_variable("GVAFILE_RESULTS_REDIS_URL") CELERY_RESULT_PERSISTENT = True CELERY_TASK_RESULT_EXPIRES = None -CELERY_ROUTES = ( - 'gvacommon.celeryrouters.GvaRouter', -) -CELERY_ACCEPT_CONTENT = ['json'] -CELERY_TASK_SERIALIZER = 'json' -CELERY_RESULT_SERIALIZER = 'json' -BROKER_URL = get_env_variable('GVAFILE_BROKER_URL') +CELERY_ROUTES = ("gvacommon.celeryrouters.GvaRouter",) +CELERY_ACCEPT_CONTENT = ["json"] +CELERY_TASK_SERIALIZER = "json" +CELERY_RESULT_SERIALIZER = "json" +BROKER_URL = get_env_variable("GVAFILE_BROKER_URL") ########## END CELERY CONFIGURATION ########## GVAFILE CONFIGURATION -GVAFILE_SFTP_DIRECTORY = get_env_variable('GVAFILE_SFTP_DIRECTORY') -GVAFILE_MAIL_DIRECTORY = get_env_variable('GVAFILE_MAIL_DIRECTORY') -GVAFILE_SFTP_AUTHKEYS_DIRECTORY = get_env_variable( - 'GVAFILE_SFTP_AUTHKEYS_DIRECTORY') +GVAFILE_SFTP_DIRECTORY = get_env_variable("GVAFILE_SFTP_DIRECTORY") +GVAFILE_MAIL_DIRECTORY = get_env_variable("GVAFILE_MAIL_DIRECTORY") +GVAFILE_SFTP_AUTHKEYS_DIRECTORY = get_env_variable("GVAFILE_SFTP_AUTHKEYS_DIRECTORY") ########## END GVAFILE CONFIGURATION diff --git a/gvafile/fileservertasks/tasks.py b/gvafile/fileservertasks/tasks.py index 432163f..9ec26a8 100644 --- a/gvafile/fileservertasks/tasks.py +++ b/gvafile/fileservertasks/tasks.py @@ -11,7 +11,7 @@ import os import subprocess from tempfile import mkstemp -from gvafile import settings +from fileservertasks import settings from celery import shared_task from celery.utils.log import get_task_logger diff --git a/gvafile/gvafile/__init__.py b/gvafile/gvacommon/__init__.py similarity index 100% rename from gvafile/gvafile/__init__.py rename to gvafile/gvacommon/__init__.py diff --git a/gvafile/gvacommon/celeryrouters.py b/gvafile/gvacommon/celeryrouters.py new file mode 100644 index 0000000..c7f9db6 --- /dev/null +++ b/gvafile/gvacommon/celeryrouters.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +class GvaRouter(object): + def route_for_task(self, task, args=None, kwargs=None): + for route in ["ldap", "file", "mysql", "pgsql", "web"]: + if route in task: + return {"exchange": route, "exchange_type": "direct", "queue": route} + return None From adae20cc7d603b5739751a844224ecd8d6f98e01 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 4 Mar 2020 16:55:38 +0100 Subject: [PATCH 15/21] Update documentation Bump copyright years and document that we use systemd instead of supervisord to run the celery worker. --- LICENSE.txt | 2 +- docs/deploy.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 96e8baa..ec337c9 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2014, 2015 Jan Dittberner +Copyright (c) 2014-2020 Jan Dittberner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/docs/deploy.rst b/docs/deploy.rst index 124e75a..762770f 100644 --- a/docs/deploy.rst +++ b/docs/deploy.rst @@ -7,4 +7,4 @@ of the following steps: * installation of native dependencies * setup of a virtualenv * installation of gvafile production dependencies inside the virtualenv -* setup of celery worker under control of supervisord +* setup of celery worker under control of systemd From f2db400ed8697e4d81409efe4af2fbe7eda1ee32 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 4 Mar 2020 17:06:14 +0100 Subject: [PATCH 16/21] Update Vagrant setup to Debian Buster and libvirt --- Vagrantfile | 12 +++++---- change-vmdebootstrap-default-dhcp.sh | 15 +++++++++++ docs/changelog.rst | 1 + salt/bootstrap.sh | 39 ---------------------------- salt/grains | 12 +++++++++ salt/minion | 11 ++++++++ 6 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 change-vmdebootstrap-default-dhcp.sh delete mode 100755 salt/bootstrap.sh create mode 100644 salt/grains create mode 100644 salt/minion diff --git a/Vagrantfile b/Vagrantfile index 830f1ae..29fc338 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,7 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| - config.vm.box = "debian/contrib-jessie64" + config.vm.box = "debian/buster64" config.vm.hostname = "gvafile.local" config.vm.network "private_network", ip: "172.16.3.4" @@ -10,18 +10,20 @@ Vagrant.configure(2) do |config| config.vm.synced_folder "../gvasalt/states/", "/srv/salt/" config.vm.synced_folder "../gvasalt/pillar/", "/srv/pillar/" - config.vm.provider "virtualbox" do |vb| - # vb.gui = true - vb.memory = "512" + config.vm.provider :libvirt do |libvirt| + libvirt.memory = 1024 end + config.vm.provision :shell, path: "change-vmdebootstrap-default-dhcp.sh" + config.vm.provision :salt do |salt| - salt.bootstrap_script = "salt/bootstrap.sh" + salt.bootstrap_options = "-x python3" salt.minion_id = "gvafile" salt.masterless = true salt.run_highstate = true salt.verbose = true salt.colorize = true salt.log_level = "warning" + salt.grains_config = "salt/grains" end end diff --git a/change-vmdebootstrap-default-dhcp.sh b/change-vmdebootstrap-default-dhcp.sh new file mode 100644 index 0000000..a5f3c38 --- /dev/null +++ b/change-vmdebootstrap-default-dhcp.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +debootstrap_network=/etc/systemd/network/99-dhcp.network + +if grep -q '^Name=\\*' "${debootstrap_network}"; then + primary_nic=$(ls -1 /sys/class/net | grep -v lo |sort | head -1) + sed -i "s/^Name=e\\*/Name=${primary_nic}/" \ + "${debootstrap_network}" + systemctl restart systemd-networkd.service + echo "Changed systemd network configuration" +else + echo "Systemd network configuration has already been changed" +fi diff --git a/docs/changelog.rst b/docs/changelog.rst index b24a5e9..071691b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,7 @@ Changelog ========= +* :support:`-` update Vagrant setup to libvirt and Debian Buster * :support:`-` move fileservertasks to top level to keep the task names when using Python 3 * :support:`2` use Pipenv for dependency management diff --git a/salt/bootstrap.sh b/salt/bootstrap.sh deleted file mode 100755 index ecc211a..0000000 --- a/salt/bootstrap.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - - -echo "deb http://httpredir.debian.org/debian jessie-backports main" >/etc/apt/sources.list.d/backports.list - -apt-get update -apt-get install -y -t jessie-backports python-cryptography - -# We just download the bootstrap script by default and execute that. -if [ -x /usr/bin/fetch ]; then - /usr/bin/fetch -o - https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | sh -s -- "$@" -elif [ -x /usr/bin/curl ]; then - /usr/bin/curl -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh | sh -s -- "$@" -else - python \ - -c 'import urllib; print urllib.urlopen("https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh").read()' \ - | sh -s -- "$@" -fi - -cat >/etc/salt/minion </etc/salt/grains < Date: Wed, 4 Mar 2020 17:19:14 +0100 Subject: [PATCH 17/21] Add Docker setup for lightweight local testing --- .gitignore | 1 + Dockerfile | 45 +++++++++++++++++++++++++++++++++++++++++++++ docs/changelog.rst | 4 ++++ gvafile.sh | 7 +++++++ 4 files changed, 57 insertions(+) create mode 100644 Dockerfile create mode 100755 gvafile.sh diff --git a/.gitignore b/.gitignore index 36ae448..245cdad 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ _build/ *.sqlite3 .vagrant/ .idea/ +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7a82e3c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +ARG DEBIAN_RELEASE=buster +FROM debian:$DEBIAN_RELEASE +LABEL maintainer="Jan Dittberner " + +ENV LC_ALL=C.UTF-8 +ENV LANG=C.UTF-8 + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + dumb-init \ + gettext \ + git \ + python3-dev \ + python3-pip \ + python3-setuptools \ + python3-virtualenv \ + python3-wheel \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*.* + +RUN python3 -m pip install --prefix=/usr/local pipenv + +ARG GVAGID=2000 +ARG GVAUID=2000 + +ARG GVAAPP=gvafile + +WORKDIR /srv/$GVAAPP + +COPY Pipfile Pipfile.lock /srv/$GVAAPP/ + +RUN addgroup --gid $GVAGID $GVAAPP ; \ + adduser --home /home/$GVAAPP --shell /bin/bash --uid $GVAUID --gid $GVAGID --disabled-password --gecos "User for gnuviechadmin component $GVAAPP" $GVAAPP + +USER $GVAAPP +RUN python3 -m virtualenv --python=python3 /home/$GVAAPP/$GVAAPP-venv ; \ + /home/$GVAAPP/$GVAAPP-venv/bin/python3 -m pip install -U pip ; \ + VIRTUAL_ENV=/home/$GVAAPP/$GVAAPP-venv pipenv install --deploy --ignore-pipfile --dev + +VOLUME /srv/$GVAAPP + +COPY gvafile.sh /srv/ + +ENTRYPOINT ["dumb-init", "/srv/gvafile.sh"] diff --git a/docs/changelog.rst b/docs/changelog.rst index 071691b..ff1e1b2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,11 +1,15 @@ Changelog ========= +* :support:`-` add Docker setup for lightweight local testing * :support:`-` update Vagrant setup to libvirt and Debian Buster * :support:`-` move fileservertasks to top level to keep the task names when using Python 3 * :support:`2` use Pipenv for dependency management +* :release:`0.5.1 <>` +* :bug:`-` change dependency URLs + * :release:`0.5.0 <2015-01-29>` * :feature:`-` add new task set_file_ssh_authorized_keys to add SSH keys for users diff --git a/gvafile.sh b/gvafile.sh new file mode 100755 index 0000000..b9c1c82 --- /dev/null +++ b/gvafile.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +. /home/gvafile/gvafile-venv/bin/activate +cd /srv/gvafile/gvafile +celery -A fileservertasks worker -Q file -l info From c4e7e8c4976087d2948cbf8e8d830ec216e49c9a Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 4 Mar 2020 18:42:37 +0100 Subject: [PATCH 18/21] Unify celery config with gvaldap and gvaweb --- gvafile/fileservertasks/celery.py | 2 +- gvafile/fileservertasks/settings.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gvafile/fileservertasks/celery.py b/gvafile/fileservertasks/celery.py index 79b0051..f7f38ac 100644 --- a/gvafile/fileservertasks/celery.py +++ b/gvafile/fileservertasks/celery.py @@ -11,5 +11,5 @@ from celery import Celery #: The Celery application app = Celery('fileservertasks') -app.config_from_object('fileservertasks.settings') +app.config_from_object('fileservertasks.settings', namespace="CELERY") app.autodiscover_tasks(['fileservertasks.tasks'], force=True) diff --git a/gvafile/fileservertasks/settings.py b/gvafile/fileservertasks/settings.py index b1816e0..f83da5b 100644 --- a/gvafile/fileservertasks/settings.py +++ b/gvafile/fileservertasks/settings.py @@ -25,16 +25,16 @@ def get_env_variable(setting): ########## CELERY CONFIGURATION -CELERY_TIMEZONE = "Europe/Berlin" -CELERY_ENABLE_UTC = True +CELERY_BROKER_URL = get_env_variable("GVAFILE_BROKER_URL") CELERY_RESULT_BACKEND = get_env_variable("GVAFILE_RESULTS_REDIS_URL") CELERY_RESULT_PERSISTENT = True CELERY_TASK_RESULT_EXPIRES = None CELERY_ROUTES = ("gvacommon.celeryrouters.GvaRouter",) +CELERY_TIMEZONE = "Europe/Berlin" +CELERY_ENABLE_UTC = True CELERY_ACCEPT_CONTENT = ["json"] CELERY_TASK_SERIALIZER = "json" CELERY_RESULT_SERIALIZER = "json" -BROKER_URL = get_env_variable("GVAFILE_BROKER_URL") ########## END CELERY CONFIGURATION ########## GVAFILE CONFIGURATION From 4ad9b32f7e6239703ab4479d94ad3f0901248c31 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Fri, 10 Apr 2020 12:02:58 +0200 Subject: [PATCH 19/21] Update dependencies --- Pipfile.lock | 106 +++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 831ef4e..724afa1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -40,19 +40,19 @@ }, "celery": { "hashes": [ - "sha256:3c5fcd6bfcf9a6323cb742cfc121d1790d50cfeddf300ba723cfa0b356413f07", - "sha256:a650525303ee866fb0c62c82f68681fcc2183eebbfafae552c27d30125fe518b" + "sha256:108a0bf9018a871620936c33a3ee9f6336a89f8ef0a0f567a9001f4aa361415f", + "sha256:5b4b37e276033fe47575107a2775469f0b721646a08c96ec2c61531e4fe45f2a" ], "index": "pypi", - "version": "==4.4.1" + "version": "==4.4.2" }, "importlib-metadata": { "hashes": [ - "sha256:06f5b3a99029c7134207dd882428a66992a9de2bef7c2b699b5641f9886c3302", - "sha256:b97607a1a18a5100839aec1dc26a1ea17ee0d93b20b0f008d80a5a050afb200b" + "sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f", + "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e" ], "markers": "python_version < '3.8'", - "version": "==1.5.0" + "version": "==1.6.0" }, "kombu": { "hashes": [ @@ -110,10 +110,10 @@ }, "certifi": { "hashes": [ - "sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3", - "sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f" + "sha256:1d987a998c75633c40847cc966fcf5904906c920a7f17ef374f5aa4282abd304", + "sha256:51fcb31174be6e6664c5f69e3e1691a2d72a1a12e90f872cbdb1567eb47b6519" ], - "version": "==2019.11.28" + "version": "==2020.4.5.1" }, "chardet": { "hashes": [ @@ -124,40 +124,40 @@ }, "coverage": { "hashes": [ - "sha256:15cf13a6896048d6d947bf7d222f36e4809ab926894beb748fc9caa14605d9c3", - "sha256:1daa3eceed220f9fdb80d5ff950dd95112cd27f70d004c7918ca6dfc6c47054c", - "sha256:1e44a022500d944d42f94df76727ba3fc0a5c0b672c358b61067abb88caee7a0", - "sha256:25dbf1110d70bab68a74b4b9d74f30e99b177cde3388e07cc7272f2168bd1477", - "sha256:3230d1003eec018ad4a472d254991e34241e0bbd513e97a29727c7c2f637bd2a", - "sha256:3dbb72eaeea5763676a1a1efd9b427a048c97c39ed92e13336e726117d0b72bf", - "sha256:5012d3b8d5a500834783689a5d2292fe06ec75dc86ee1ccdad04b6f5bf231691", - "sha256:51bc7710b13a2ae0c726f69756cf7ffd4362f4ac36546e243136187cfcc8aa73", - "sha256:527b4f316e6bf7755082a783726da20671a0cc388b786a64417780b90565b987", - "sha256:722e4557c8039aad9592c6a4213db75da08c2cd9945320220634f637251c3894", - "sha256:76e2057e8ffba5472fd28a3a010431fd9e928885ff480cb278877c6e9943cc2e", - "sha256:77afca04240c40450c331fa796b3eab6f1e15c5ecf8bf2b8bee9706cd5452fef", - "sha256:7afad9835e7a651d3551eab18cbc0fdb888f0a6136169fbef0662d9cdc9987cf", - "sha256:9bea19ac2f08672636350f203db89382121c9c2ade85d945953ef3c8cf9d2a68", - "sha256:a8b8ac7876bc3598e43e2603f772d2353d9931709345ad6c1149009fd1bc81b8", - "sha256:b0840b45187699affd4c6588286d429cd79a99d509fe3de0f209594669bb0954", - "sha256:b26aaf69713e5674efbde4d728fb7124e429c9466aeaf5f4a7e9e699b12c9fe2", - "sha256:b63dd43f455ba878e5e9f80ba4f748c0a2156dde6e0e6e690310e24d6e8caf40", - "sha256:be18f4ae5a9e46edae3f329de2191747966a34a3d93046dbdf897319923923bc", - "sha256:c312e57847db2526bc92b9bfa78266bfbaabac3fdcd751df4d062cd4c23e46dc", - "sha256:c60097190fe9dc2b329a0eb03393e2e0829156a589bd732e70794c0dd804258e", - "sha256:c62a2143e1313944bf4a5ab34fd3b4be15367a02e9478b0ce800cb510e3bbb9d", - "sha256:cc1109f54a14d940b8512ee9f1c3975c181bbb200306c6d8b87d93376538782f", - "sha256:cd60f507c125ac0ad83f05803063bed27e50fa903b9c2cfee3f8a6867ca600fc", - "sha256:d513cc3db248e566e07a0da99c230aca3556d9b09ed02f420664e2da97eac301", - "sha256:d649dc0bcace6fcdb446ae02b98798a856593b19b637c1b9af8edadf2b150bea", - "sha256:d7008a6796095a79544f4da1ee49418901961c97ca9e9d44904205ff7d6aa8cb", - "sha256:da93027835164b8223e8e5af2cf902a4c80ed93cb0909417234f4a9df3bcd9af", - "sha256:e69215621707119c6baf99bda014a45b999d37602cb7043d943c76a59b05bf52", - "sha256:ea9525e0fef2de9208250d6c5aeeee0138921057cd67fcef90fbed49c4d62d37", - "sha256:fca1669d464f0c9831fd10be2eef6b86f5ebd76c724d1e0706ebdff86bb4adf0" + "sha256:03f630aba2b9b0d69871c2e8d23a69b7fe94a1e2f5f10df5049c0df99db639a0", + "sha256:046a1a742e66d065d16fb564a26c2a15867f17695e7f3d358d7b1ad8a61bca30", + "sha256:0a907199566269e1cfa304325cc3b45c72ae341fbb3253ddde19fa820ded7a8b", + "sha256:165a48268bfb5a77e2d9dbb80de7ea917332a79c7adb747bd005b3a07ff8caf0", + "sha256:1b60a95fc995649464e0cd48cecc8288bac5f4198f21d04b8229dc4097d76823", + "sha256:1f66cf263ec77af5b8fe14ef14c5e46e2eb4a795ac495ad7c03adc72ae43fafe", + "sha256:2e08c32cbede4a29e2a701822291ae2bc9b5220a971bba9d1e7615312efd3037", + "sha256:3844c3dab800ca8536f75ae89f3cf566848a3eb2af4d9f7b1103b4f4f7a5dad6", + "sha256:408ce64078398b2ee2ec08199ea3fcf382828d2f8a19c5a5ba2946fe5ddc6c31", + "sha256:443be7602c790960b9514567917af538cac7807a7c0c0727c4d2bbd4014920fd", + "sha256:4482f69e0701139d0f2c44f3c395d1d1d37abd81bfafbf9b6efbe2542679d892", + "sha256:4a8a259bf990044351baf69d3b23e575699dd60b18460c71e81dc565f5819ac1", + "sha256:513e6526e0082c59a984448f4104c9bf346c2da9961779ede1fc458e8e8a1f78", + "sha256:5f587dfd83cb669933186661a351ad6fc7166273bc3e3a1531ec5c783d997aac", + "sha256:62061e87071497951155cbccee487980524d7abea647a1b2a6eb6b9647df9006", + "sha256:641e329e7f2c01531c45c687efcec8aeca2a78a4ff26d49184dce3d53fc35014", + "sha256:65a7e00c00472cd0f59ae09d2fb8a8aaae7f4a0cf54b2b74f3138d9f9ceb9cb2", + "sha256:6ad6ca45e9e92c05295f638e78cd42bfaaf8ee07878c9ed73e93190b26c125f7", + "sha256:73aa6e86034dad9f00f4bbf5a666a889d17d79db73bc5af04abd6c20a014d9c8", + "sha256:7c9762f80a25d8d0e4ab3cb1af5d9dffbddb3ee5d21c43e3474c84bf5ff941f7", + "sha256:85596aa5d9aac1bf39fe39d9fa1051b0f00823982a1de5766e35d495b4a36ca9", + "sha256:86a0ea78fd851b313b2e712266f663e13b6bc78c2fb260b079e8b67d970474b1", + "sha256:8a620767b8209f3446197c0e29ba895d75a1e272a36af0786ec70fe7834e4307", + "sha256:922fb9ef2c67c3ab20e22948dcfd783397e4c043a5c5fa5ff5e9df5529074b0a", + "sha256:9fad78c13e71546a76c2f8789623eec8e499f8d2d799f4b4547162ce0a4df435", + "sha256:a37c6233b28e5bc340054cf6170e7090a4e85069513320275a4dc929144dccf0", + "sha256:c3fc325ce4cbf902d05a80daa47b645d07e796a80682c1c5800d6ac5045193e5", + "sha256:cda33311cb9fb9323958a69499a667bd728a39a7aa4718d7622597a44c4f1441", + "sha256:db1d4e38c9b15be1521722e946ee24f6db95b189d1447fa9ff18dd16ba89f732", + "sha256:eda55e6e9ea258f5e4add23bcf33dc53b2c319e70806e180aecbff8d90ea24de", + "sha256:f372cdbb240e09ee855735b9d85e7f50730dcfb6296b74b95a3e5dea0615c4c1" ], "index": "pypi", - "version": "==5.0.3" + "version": "==5.0.4" }, "docutils": { "hashes": [ @@ -227,24 +227,24 @@ }, "packaging": { "hashes": [ - "sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73", - "sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334" + "sha256:3c292b474fda1671ec57d46d739d072bfd495a4f51ad01a055121d81e952b7a3", + "sha256:82f77b9bee21c1bafbf35a84905d604d5d1223801d639cf3ed140bd651c08752" ], - "version": "==20.1" + "version": "==20.3" }, "pygments": { "hashes": [ - "sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b", - "sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe" + "sha256:647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44", + "sha256:ff7a40b4860b727ab48fad6360eb351cc1b33cbf9b15a0f689ca5353e9463324" ], - "version": "==2.5.2" + "version": "==2.6.1" }, "pyparsing": { "hashes": [ - "sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f", - "sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec" + "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", + "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" ], - "version": "==2.4.6" + "version": "==2.4.7" }, "pytz": { "hashes": [ @@ -292,11 +292,11 @@ }, "sphinx": { "hashes": [ - "sha256:776ff8333181138fae52df65be733127539623bb46cc692e7fa0fcfc80d7aa88", - "sha256:ca762da97c3b5107cbf0ab9e11d3ec7ab8d3c31377266fd613b962ed971df709" + "sha256:6a099e6faffdc3ceba99ca8c2d09982d43022245e409249375edf111caf79ed3", + "sha256:b63a0c879c4ff9a4dffcb05217fa55672ce07abdeb81e33c73303a563f8d8901" ], "index": "pypi", - "version": "==2.4.3" + "version": "==3.0.0" }, "sphinxcontrib-applehelp": { "hashes": [ From 7911df39fa428545d75b6402ec08476d3f962a35 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Fri, 10 Apr 2020 12:04:12 +0200 Subject: [PATCH 20/21] Update project page URL in README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 66d830e..eb9c78c 100644 --- a/README.rst +++ b/README.rst @@ -10,4 +10,4 @@ customer management at `Jan Dittberner IT-Consulting & -Solutions Read the :doc:`Installation instructions ` to get started locally. -The project page for gvafile is at http://dev.gnuviech-server.de/gvafile. +The project page for gvafile is at http://git.dittberner.info/gnuviech/gvafile. From 94705f26bd5245f2ff5c98d18143fae5f4070a3b Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Fri, 10 Apr 2020 12:05:55 +0200 Subject: [PATCH 21/21] Add release version to changelog --- docs/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ff1e1b2..71eda13 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,13 +1,14 @@ Changelog ========= +* :release:`0.6.0 <2020-04-10>` * :support:`-` add Docker setup for lightweight local testing * :support:`-` update Vagrant setup to libvirt and Debian Buster * :support:`-` move fileservertasks to top level to keep the task names when using Python 3 * :support:`2` use Pipenv for dependency management -* :release:`0.5.1 <>` +* :release:`0.5.1 <2019-09-08>` * :bug:`-` change dependency URLs * :release:`0.5.0 <2015-01-29>`