diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3385bbc5cb858f46142c1640f89c353e498ed47..3d612b62830e11e45dc1f222dc08976c3aa0c673 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,3 +81,20 @@ publish-pip: - TWINE_USERNAME="${PYPI_USERNAME}" TWINE_PASSWORD="${PYPI_PASSWORD}" python3 -m twine upload dist/* rules: - if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/' + +publish-apt: + stage: deploy + script: + - apt update + - apt-get install -y python3-all debhelper python3-pip git-buildpackage + - export PYBUILD_INSTALL_ARGS="--install-lib=/usr/share/uffd/ --install-scripts=/usr/share/uffd/" + - gbp dch --ignore-branch --debian-tag=v%\(version\)s + - dpkg-buildpackage -us -uc + - mkdir build + - mv ../*.deb build/ + artifacts: + paths: + - build/* + - debian/changelog + rules: + - if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/' diff --git a/README.md b/README.md index a4ded7a174b281ddf4c57da2fcb8c8262458e80f..fbbaf3266ca2fd9f8fc51b3ad610b30f70c5c917 100644 --- a/README.md +++ b/README.md @@ -41,27 +41,7 @@ Please note that the mocked LDAP functionality is very limited and many uffd fea ## deployment Use uwsgi. Make sure to run `flask db upgrade` after every update! - -### example uwsgi config - -``` -[uwsgi] -plugin = python3 -env = PYTHONIOENCODING=UTF-8 -env = LANG=en_GB.utf8 -env = TZ=Europe/Berlin -manage-script-name = true -chdir = /var/www/uffd -module = uffd:create_app() - -uid = uffd -gid = uffd - -vacuum = true -die-on-term = true - -hook-pre-app = exec:FLASK_APP=uffd flask db upgrade -``` +For an example uwsgi config, see our [uswgi.ini](uwsgi.ini). ## python style conventions @@ -114,7 +94,7 @@ The userinfo endpoint returns json data with the following structure: ## Translation -The web frontend is translated in the following Languages: +The web frontend is initialy written in English and translated in the following Languages:  diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..8ec8f739601766e7ae19ea48b4213e6f0dcbdf49 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +uffd (0.1.2) unstable; urgency=medium + + * Initial release. + + -- Andreas Valder <nd@cccv.de> Fri, 31 Jul 2021 23:02:31 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000000000000000000000000000000000..19dd3786bb03c86be1498ba54a700fe094a481af --- /dev/null +++ b/debian/control @@ -0,0 +1,29 @@ +Source: uffd +Section: python +Priority: optional +Maintainer: CCCV <it@cccv.de> +Build-Depends: + debhelper-compat (= 12), + dh-python, + python3-all, + python3-setuptools, +Standards-Version: 4.5.0 +Homepage: https://git.cccv.de/uffd/uffd +Vcs-Git: https://git.cccv.de/uffd/uffd.git + +Package: uffd +Architecture: any +Depends: + ${misc:Depends}, + ${python3:Depends}, + python3-ldap3, + python3-flask, + python3-flask-sqlalchemy, + python3-flask-migrate, + python3-qrcode, + python3-fido2, + python3-flask-oauthlib, + python3-flask-babel, + uwsgi, + uwsgi-plugin-python3, +Description: UserFerwaltungsFrontend: Ldap based single sign on and user management web software diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000000000000000000000000000000000..51a9034e3c8913ad57ee436eff66e6672db65310 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f +export DH_VERBOSE = 1 + +export PYBUILD_NAME=uffd + +%: + dh $@ --with python3 --buildsystem pybuild diff --git a/debian/uffd.dirs b/debian/uffd.dirs new file mode 100644 index 0000000000000000000000000000000000000000..fe0717b32952f5901bbf6a2eedf34b63f4e32fb3 --- /dev/null +++ b/debian/uffd.dirs @@ -0,0 +1,3 @@ +/etc/uffd +/var/lib/uffd +/usr/share/uffd/uffd/instance diff --git a/debian/uffd.install b/debian/uffd.install new file mode 100644 index 0000000000000000000000000000000000000000..7bc97046356c8f4745448748b864ba59d8810f33 --- /dev/null +++ b/debian/uffd.install @@ -0,0 +1 @@ +uwsgi.ini /etc/uwsgi/apps-available/uffd.ini diff --git a/debian/uffd.links b/debian/uffd.links new file mode 100644 index 0000000000000000000000000000000000000000..d9fac40f8366c725a68a6d9a734298014bdf50f1 --- /dev/null +++ b/debian/uffd.links @@ -0,0 +1 @@ +/usr/share/uffd/uffd/instance/config.py /etc/uffd/config.py diff --git a/uwsgi.ini b/uwsgi.ini new file mode 100644 index 0000000000000000000000000000000000000000..1ccf819f936aecbd36dc5f21612b761d68967f76 --- /dev/null +++ b/uwsgi.ini @@ -0,0 +1,15 @@ +[uwsgi] +plugin = python3 +env = PYTHONIOENCODING=UTF-8 +env = LANG=en_GB.utf8 +env = TZ=Europe/Berlin +manage-script-name = true +chdir = /usr/share/uffd +module = uffd:create_app() + +uid = uffd +gid = uffd + +vacuum = true + +hook-pre-app = exec:FLASK_APP=uffd flask db upgrade