https://github.com/dsander/mattermost-privileged
https://github.com/dsander/mattermost-privileged
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dsander/mattermost-privileged
- Owner: dsander
- License: mit
- Created: 2024-01-02T23:02:22.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T23:06:21.000Z (over 2 years ago)
- Last Synced: 2025-03-21T04:31:08.486Z (over 1 year ago)
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Taken from https://git.somenet.org/pub/jan/mattermost-privileged.git
Added dockerfile to run the scripts on a dockerized mattermost instance
Except from my `docker-compose.yml`
```yaml
cleanup:
image: dsander/mattermost-cleanup
container_name: cleanup
depends_on:
- postgres-mattermost
networks:
- mattermost
volumes:
- "{{ appdata_path }}/mattermost/data:/mattermost/data:rw"
environment:
POSTGRES_HOST: postgres-mattermost
POSTGRES_USER: mattermost
POSTGRES_PASSWORD: mattermost
POSTGRES_DB: mattermost
```
Run with
```
docker compose run -it cleanup python3 -Bu db.py
docker compose run -it cleanup python3 -Bu fs.py
```
# Someone's privileged Mattermost scripts.
+ Copyright (c) 2016-2022 by Someone (aka. Jan Vales )
+ published under MIT-License
+ These scripts need DB- and Filesystem-access.
Beware: These scripts run regularily and are well tested. BUT by using these scripts, MM inc. may refuse to help you, if you run into (unrelated) issues with your MM.
It all started with me starting to write my own DB+FS cleaner, after posting this: [https://mattermost.uservoice.com/forums/306457/suggestions/15357861](https://mattermost.uservoice.com/forums/306457/suggestions/15357861)
But eventually grew to include other scripts too.
consider running as cronjobs:
00 23 * * * (cd /srv/mattermost/mattermost-privileged; git pull --recurse-submodules=yes; git gc) &>/dev/null
55 23 * * * (cd /srv/mattermost/mattermost-privileged/maintenance; python3 -Bu db.py |tee /tmp/maintenance_db.log; python3 -Bu fs.py echo ""; du -sch /srv/mattermost/data/* | tail)
59 11 * * MON (cd /srv/mattermost/mattermost-privileged/profile_badges; python3 -Bu main.py)
0 0 * * 2-7 (cd /srv/mattermost/mattermost-privileged/stats; python3 -Bu main.py)
0 0 * * MON (cd /srv/mattermost/mattermost-privileged/stats; python3 -Bu main.py week)
## maintenance
+ permanently deletes {"deleted",orphaned,old,unused} MM-db data and unreferenced files.
+ fix db-health degrading issues MM has (had?).
+ 'delete' System-Spam messages and "Posts marked for deletion"
+ enforce our system-policy (Can/must be enabled separately; Likely only makes sense for our instances)
+ Deleting inactive Channels + Users/Guests.
### **Beware: running this WILL break your instance's audit-trails. This IS intended behavior**
## profile_badges
+ Sets custom profile badges, needs DB access for post-count based badges.
## stats
+ various stats posted into channels.