From a02f2d9e6863cc5f9a41a48d7f8c486dc2f93bd3 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 19 Dec 2023 08:31:26 +0100 Subject: [PATCH] feat: migrate from woodpecker to forgejo actions --- .forgejo/workflows/package.yml | 38 +++++ .forgejo/workflows/test.yml | 77 ++++++++++ .woodpecker.yml | 139 ------------------- CHANGELOG.md | 13 ++ README.md | 13 +- multischleuder/__init__.py | 2 +- package/debian/multischleuder/DEBIAN/control | 2 +- 7 files changed, 134 insertions(+), 150 deletions(-) create mode 100644 .forgejo/workflows/package.yml create mode 100644 .forgejo/workflows/test.yml delete mode 100644 .woodpecker.yml diff --git a/.forgejo/workflows/package.yml b/.forgejo/workflows/package.yml new file mode 100644 index 0000000..04ef8f6 --- /dev/null +++ b/.forgejo/workflows/package.yml @@ -0,0 +1,38 @@ +--- + +on: + push: + tags: + - "v*" + +jobs: + + build_wheel: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Build Python wheel + run: | + apt update; apt install -y python3-pip + pip3 install --break-system-packages -e .[test] + python3 setup.py egg_info bdist_wheel + - uses: https://git.kabelsalat.ch/s3lph/forgejo-action-wheel-package-upload@v3 + with: + username: ${{ secrets.API_USERNAME }} + password: ${{ secrets.API_PASSWORD }} + + build_debian: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://git.kabelsalat.ch/s3lph/forgejo-action-python-debian-package@v5 + with: + python_module: multischleuder + package_name: multischleuder + package_root: package/debian/multischleuder + package_output_path: package/debian + - uses: https://git.kabelsalat.ch/s3lph/forgejo-action-debian-package-upload@v2 + with: + username: ${{ secrets.API_USERNAME }} + password: ${{ secrets.API_PASSWORD }} + deb: "package/debian/*.deb" diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..d92d4f6 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,77 @@ +--- + +on: push + +jobs: + + test: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Unit Tests + run: | + apt update; apt install -y python3-pip + pip3 install --break-system-packages -e .[test] + python3 -m coverage run --rcfile=setup.cfg -m unittest discover multischleuder + python3 -m coverage combine + python3 -m coverage report --rcfile=setup.cfg + + codestyle: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Code Style + run: | + apt update; apt install -y python3-pip + pip3 install --break-system-packages -e .[test] + pycodestyle multischleuder + + mypy: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Static Type Checks + run: | + apt update; apt install -y python3-pip + pip3 install --break-system-packages -e .[test] + pip3 install --break-system-packages types-PyYAML types-python-dateutil + mypy multischleuder + + schleuder: + runs-on: docker + steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - name: Integration Test against schleuder + run: | + echo "postfix postfix/mailname string example.org" | debconf-set-selections + echo "postfix postfix/main_mailer_type string 'Local only'" | debconf-set-selections + apt update; apt install --yes python3-pip schleuder schleuder-cli postfix patch + pip3 install --break-system-packages -e .[test] + /usr/lib/postfix/configure-instance.sh - + echo "virtual_alias_maps = static:root" >> /etc/postfix/main.cf + /usr/sbin/postmulti -i - -p start + schleuder-cli lists list || true + export CERT_FPR=$(schleuder cert fingerprint | cut -d' ' -f4) + echo " - '00000000000000000000000000000000'" >> /etc/schleuder/schleuder.yml + cat > ~/.schleuder-cli/schleuder-cli.yml <> /etc/postfix/main.cf - - /usr/sbin/postmulti -i - -p start - - schleuder-cli lists list || true - - export CERT_FPR=$(schleuder cert fingerprint | cut -d' ' -f4) - - echo " - '00000000000000000000000000000000'" >> /etc/schleuder/schleuder.yml - - | - cat > ~/.schleuder-cli/schleuder-cli.yml < ~/.pypirc <" | grep -B 1000 "<"'!'"-- END CHANGES $${version} -->" | tail -n +2 | head -n -1 | sed -re 's/^-/ */g' - echo -e "\n -- s3lph $(date -R)\n" - done) > package/debian/multischleuder/usr/share/doc/multischleuder/changelog - - gzip -9n package/debian/multischleuder/usr/share/doc/multischleuder/changelog - - python3 setup.py egg_info install --root=package/debian/multischleuder/ --prefix=/usr --optimize=1 - - cd package/debian - - sed -re "s/__MULTISCHLEUDER_VERSION__/$${MULTISCHLEUDER_VERSION}/g" -i multischleuder/DEBIAN/control - - mkdir -p multischleuder/usr/lib/python3/dist-packages/ - - rsync -a multischleuder/usr/lib/python3.11/site-packages/ multischleuder/usr/lib/python3/dist-packages/ - - rm -rf multischleuder/usr/lib/python3.11/site-packages - - find multischleuder/usr/lib/python3/dist-packages -name __pycache__ -exec rm -r {} \; 2>/dev/null || true - - find multischleuder/usr/lib/python3/dist-packages -name '*.pyc' -exec rm {} \; - - find multischleuder/usr/lib/python3/dist-packages -name '*.pyo' -exec rm {} \; - - sed -re 's$#!/usr/local/bin/python3$#!/usr/bin/python3$' -i multischleuder/usr/bin/multischleuder - - find multischleuder -type f -exec chmod 0644 {} \; - - find multischleuder -type d -exec chmod 755 {} \; - - >- - chmod +x - multischleuder/usr/bin/multischleuder - multischleuder/DEBIAN/postinst - multischleuder/DEBIAN/prerm - multischleuder/DEBIAN/postrm - - dpkg-deb --build multischleuder - - mv multischleuder.deb "multischleuder_$${MULTISCHLEUDER_VERSION}-1_all.deb" - - sudo -u nobody lintian "multischleuder_$${MULTISCHLEUDER_VERSION}-1_all.deb" || true - - >- - curl - --user "$${GITEA_API_USERNAME}:$${GITEA_API_PASSWORD}" - --upload-file "multischleuder_$${MULTISCHLEUDER_VERSION}-1_all.deb" - $${GITEA_API_REPOSITORY_DEB} diff --git a/CHANGELOG.md b/CHANGELOG.md index 176a41a..040f9ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # MultiSchleuder Changelog + +## Version 0.1.9 + +Maintenance Release + +### Changes + + +- Migrate from Woodpecker to Forgejo Actions + + + + ## Version 0.1.8 diff --git a/README.md b/README.md index b2e9ebe..312121f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,5 @@ # MultiSchleuder -[![pipeline status](https://gitlab.com/s3lph/multischleuder/badges/main/pipeline.svg)](https://gitlab.com/s3lph/multischleuder/-/commits/main) -[![coverage report](https://gitlab.com/s3lph/multischleuder/badges/main/coverage.svg)](https://gitlab.com/s3lph/multischleuder/-/commits/main) -[![latest release](https://gitlab.com/s3lph/multischleuder/-/badges/release.svg)](https://gitlab.com/s3lph/multischleuder/-/releases) -[![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://gitlab.com/s3lph/multischleuder/-/blob/main/LICENSE) - Automatically and periodically merge subscribers and keys of multiple [Schleuder][schleuder] lists into one. ## Dependencies @@ -15,7 +10,7 @@ Automatically and periodically merge subscribers and keys of multiple [Schleuder ## Installation -You can find Debian packages and Python wheels over at [Releases][releases]. +You can find Debian packages and Python wheels over at [Packages][packages]. ## Configuration @@ -178,11 +173,11 @@ MultiSchleuder resolves conflicts in a simple, but primitive manner: 1. Then it checks whether a subscriber has more than one key. If so, the key used by the oldest subscription wins. This is by no means a perfect solution. -It does however yield consisitent results. +It does however yield consistent results. In both cases, if configured to do so, MultiSchleuder will send a notification message to all subscribers involved in a conflict, encrypting it with all keys involved in the conflict. If one or more keys are - for whatever reason - unusable, the message will not be encrypted. -This is a deliberate decision, since the amount of metadata possibly leaked from such a message is fairly small, and we consider it worth taking this risk, given that the other possibilty would be to not notify a subscriber when something potentially malicious is going on. +This is a deliberate decision, since the amount of metadata possibly leaked from such a message is fairly small, and we consider it worth taking this risk, given that the other possibility would be to not notify a subscriber when something potentially malicious is going on. [schleuder]: https://schleuder.org/ -[releases]: https://gitlab.com/s3lph/multischleuder/-/releases \ No newline at end of file +[packages]: https://git.kabelsalat.ch/s3lph/multischleuder/packages diff --git a/multischleuder/__init__.py b/multischleuder/__init__.py index e47a98e..2729a03 100644 --- a/multischleuder/__init__.py +++ b/multischleuder/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.1.8' +__version__ = '0.1.9' diff --git a/package/debian/multischleuder/DEBIAN/control b/package/debian/multischleuder/DEBIAN/control index a224d13..87c29fc 100644 --- a/package/debian/multischleuder/DEBIAN/control +++ b/package/debian/multischleuder/DEBIAN/control @@ -1,5 +1,5 @@ Package: multischleuder -Version: __MULTISCHLEUDER_VERSION__ +Version: __VERSION__ Maintainer: s3lph Section: web Priority: optional