• Python 99.4%
  • Dockerfile 0.4%
  • Shell 0.2%
Find a file
renovate 2cb1aec60f
All checks were successful
CI / tests (push) Successful in 1m7s
CI / pre-commit (push) Successful in 1m43s
CI / build (push) Successful in 4m54s
Update dependency pydiscourse to v1.7.0 (#5)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pydiscourse](https://github.com/bennylope/pydiscourse) | project.dependencies | minor | `==1.1.1` → `==1.7.0` |

---

### Release Notes

<details>
<summary>bennylope/pydiscourse (pydiscourse)</summary>

### [`v1.7.0`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#170)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.6.1...v1.7.0)

- Possible breaking change: Change `search()` term paramater from `term` to `q`,
  fixes search. Thanks [@&#8203;weber-s](https://github.com/weber-s)
- Add support for Python 3.12

### [`v1.6.1`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#161)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.6.0...v1.6.1)

- Adds `posts_by_number` endpoint from [@&#8203;Dettorer](https://github.com/Dettorer)

### [`v1.6.0`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#160)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.5.0...v1.6.0)

- Breaking: `toggle_gravatar`, `pick_avatar`, `create_group` now *require*
  keyword arguments where keyword arguments were used. This *may* break existing
  code if you have not referenced these by keyword!
- Introduced `ruff` and `black` into pre-commit hook
- Added `lint` job to GitHub Actions, tests will run if and only if lint job
  passes.
- Sundry code cleanup

### [`v1.5.0`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#150)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.3.0...v1.5.0)

- Owner creation endpoint update from [@&#8203;akhmerov](https://github.com/akhmerov)
- Python 3.11 support from [@&#8203;Dettorer](https://github.com/Dettorer)
- Group membership fixes from [@&#8203;inducer](https://github.com/inducer)
- Rate limiting fixes from [@&#8203;inducer](https://github.com/inducer)
- Latest posts endpoint from [@&#8203;max-lancaster](https://github.com/max-lancaster)

### [`v1.3.0`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#130)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.2.0...v1.3.0)

- Add fix for handling global Discourse timeouts
- Add group owners
- Update API for add\_group\_owner

### [`v1.2.0`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#120)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.1.2...v1.2.0)

- BREAKING? Dropped support for Python 2.7, 3.4, 3.5
- Added numerous new endpoint queries
- Updated category querying

### [`v1.1.2`](https://github.com/bennylope/pydiscourse/blob/HEAD/HISTORY.rst#112)

[Compare Source](https://github.com/bennylope/pydiscourse/compare/v1.1.1...v1.1.2)

- Fix for Discourse users API change

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My43Ni4zIiwidXBkYXRlZEluVmVyIjoiNDMuNzYuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Soeren Wegener <wegener92@gmail.com>
Reviewed-on: #5
Co-authored-by: renovate <bot+renovate@flipdot.org>
Co-committed-by: renovate <bot+renovate@flipdot.org>
2026-03-29 14:46:50 +00:00
.forgejo/workflows Fix CI to be forgejo compatible 2026-03-04 20:42:51 +01:00
.run Add idea run configuration 2026-02-24 23:48:19 +01:00
src Update dependency pydiscourse to v1.7.0 (#5) 2026-03-29 14:46:50 +00:00
templates Robust datetime formatting in templates 2026-02-28 17:17:11 +01:00
tests voucher-penalty (#1) 2026-03-04 20:06:59 +00:00
.env.example Build announcement post 2024-10-19 04:19:21 +02:00
.env.unittests Add dummy credentials 2026-02-08 17:17:04 +01:00
.flake8 pre-commit run --all-files 2024-10-19 03:25:36 +02:00
.gitignore pre-commit run --all-files 2024-10-19 03:25:36 +02:00
.pre-commit-config.yaml Replace black and flake8 with ruff. 2026-02-08 00:29:18 +01:00
build_docker.sh pre-commit run --all-files 2024-10-19 03:25:36 +02:00
compose.yaml pre-commit run --all-files 2024-10-19 03:25:36 +02:00
Dockerfile Fix build by copying README.md into container 2025-10-03 02:33:42 +02:00
pyproject.toml Update dependency pydiscourse to v1.7.0 (#5) 2026-03-29 14:46:50 +00:00
README.md Merge pull request #32 from flipdot/imap-support 2026-02-08 14:53:49 +01:00
renovate.json Add renovate.json 2026-03-29 14:08:45 +00:00
run_docker.sh pre-commit run --all-files 2024-10-19 03:25:36 +02:00
setup.cfg Lintfix, add pre-commit 2024-10-19 03:01:11 +02:00
uv.lock Update dependency pydiscourse to v1.7.0 (#5) 2026-03-29 14:46:50 +00:00

flipdot Discourse bot

Usage

docker run -d -e DISCOURSE_API_KEY=fefe flipdot/forumbot
# if you want to run on another discourse instance:
docker run -d -e DISCOURSE_API_KEY=fefe -e DISCOURSE_USERNAME=hello -e DISCOURSE_HOST=https://forum.example.com flipdot/forumbot

Deployment

Changes on the master branch are automatically build into a docker image and published at docker hub. After it is published, you need to adjust this ansible playbook

Checkout if a change to the ansible playbook is automatically deployed yet - at the time of writing this, you need to run the playbook manually. See details over at the other repository.

Developing

Compose setup

If you are not able to get an API key for forum.flipdot.org, try the compose setup:

docker compose up

Go to http://localhost:3000/ and login with user user@example.com and password bitnami123

Running

Clone this repo, make your changes, build a new container:

./build_docker.sh
DISCOURSE_API_KEY=fefe ./run_docker.sh
# or with the test user
DISCOURSE_API_KEY=fefe DISCOURSE_USERNAME=flipbot_test ./run_docker.sh

Or, if you want to develop without docker:

uv sync
DISCOURSE_API_KEY=fefe uv run python src/app.py
# or with the test user
DISCOURSE_API_KEY=fefe DISCOURSE_USERNAME=flipbot_test uv run python src/app.py

You can get the credentials of flipdot_test in our forum: https://forum.flipdot.org/t/api-key-fuer-flipbot-test/3755

Copy .env.example to .env and set the API key there, so you don't have to set it every time.

cp .env.example .env

Execute tests:

PYTHONPATH=src uv run pytest

How to add a job?

Start by copying src/tasks/hello_world.py. You can run your new task directly:

uv run python src/app.py --dry --run_task hello_world

...where "hello_world" is the name of the python file.

Modify the main() function:

def main(client: DiscourseClient) -> None:
    # Do your stuff here.
    # You can use the client object to interact with discourse
    pass

Next, open src/app.py. Add an import tasks.my_awesome_task to the top of the file. Schedule your task inside the function schedule_jobs:

schedule.every().day.at('13:37').do(tasks.my_awesome_task.main, client)

Take a look at schedule to see how to specify when to run your task.