Now the inspect command can display informations about
different kind of objects including events and publications.
This patch also changes the cli to output columnar values
suitable for further processing with standard Unix
tool, such as awk.
$ mobilizon-reshare.sh inspect publication -s completed | awk '{ print }' | sort | uniq -c
[2021-12-01 01:05:55,321] [20] [INFO] Tortoise-ORM shutdown
2 mastodon
2 telegram
2 zulip
* scripts: Add mobilizon-reshare.sh.
This script lets you run mobilizon-reshare commands from your git
checkout. This is very useful for debugging new features or in general
just to have a quick feedback loop from your modifications.
Example usage:
$ scripts/mobilizon-reshare.sh inspect all
These tests somehow depend on the system timezone. While we try and make
them reproducible, they'll have to be disabled in prod since they
prevent the image from building.
* filtering publications with inactive publishers
* filtering publications with inactive publishers
* WIP: Generate publications at runtime.
TODO:
- change `MobilizonEvent.compute_status`'s contract and break everything
- while we're at it we should remove `PublicationStatus.WAITING`
- test `storage.query.create_publications_for_publishers`
* cli: inspect_events: Unnest if-then-else.
* publishers: abstract: Remove `EventPublication.make`.
* fixed tests
* split query.py file
* added tests for get_unpublished_events
* added tests
* more tests
* added start test
* refactored start test
* added test start with db event
* added test recap
* added failed publication test
* added format test
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
* Add [guix](https://guix.gnu.org/) package.
This enables:
- [direnv](https://direnv.net/) integration to setup and tear down
a suitable development environment;
- if you're not a direnv user you can always
`guix environment -l guix.scm` to spawn a shell
with all the necessary dependencies;
- Export of Mobilizon Reshare and its dependencies
to one of the formats supported by `guix pack`. Right now they are:
+ tarball Self-contained tarball, ready to run on another machine
+ squashfs Squashfs image suitable for Singularity
+ docker Docker image ready for 'docker load'
+ deb Debian archive installable via dpkg/apt
* Add docker image and docker-compose.yml.
* Add Github CI workflow.
* added basic recap feature (no error handling)
* introduced abstractpublication
* extracted base reports
* added error report to recap
* added test
* added docs
* implemented publisher and formatter
* fixed API for recap
* removed redundant config validation
* added config sample
* added mobilizon link to templates
* added link format to telegram
* added mobilizon link to recap
* fixed config and emoji
* refactored commands
* added help messages
* improved format
* Add Mastodon publisher.
This commit enables publishing on Mastodon and tries to define the
minimal requirements for adding a new platform to Mobilizon Reshare.
* publishers: exceptions: Add HTTPError.
* platforms: mastodon: Make toot length customizable.
* added basic recap feature (no error handling)
* introduced abstractpublication
* extracted base reports
* added error report to recap
* added test
* added docs
* implemented publisher and formatter
* fixed API for recap
* removed redundant config validation
* added config sample
* added mobilizon link to templates
* added link format to telegram
* added mobilizon link to recap
* fixed config and emoji
* decoupled notifiers from event
* stub
* publishers working
* fixed format CLI
* fixed unit tests
* renamed abstractnotifier
* added another excluded character
Configuration files are checked in this order:
1. CLI argument
2. `$MOBILIZION_RESHARE_SETTINGS_FILE` environment variable;
3. User configuration directory. On Linux that's `$XDG_CONFIG_HOME/mobilizon_reshare/<mobilizon-reshare-version>`;
4. System configuration directory. On Linux that's the first element in `$XDG_CONFIG_DIRS` + `/mobilizon_reshare/<mobilizon-reshare-version>`.
5. The default configuration distributed with the package.
The first available configuration file will be loaded. Secrets can be set either
via environment variables (such as `export MOBILIZON_RESHARE_PUBLISHER_TELEGRAM_TOKEN="my-telegram-token"` )
or by setting the `$SECRETS_FOR_DYNACONF` environment variable to a `secrets.(toml|yaml|ini|json)` file.
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
* Fix PublisherCoordinatorReport generation.
Without this patch we are given *either* the failed or the successful
publication reports. We actually need both, this patch implements the
merge.
* Reformat
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>