{"id":16935430,"url":"https://github.com/dsander/mattermost-privileged","last_synced_at":"2026-05-08T18:35:49.561Z","repository":{"id":215175816,"uuid":"738300688","full_name":"dsander/mattermost-privileged","owner":"dsander","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-02T23:06:21.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T04:31:08.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-02T23:02:22.000Z","updated_at":"2024-01-02T23:05:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"0cab6ed4-7223-450b-8b1f-47110123889e","html_url":"https://github.com/dsander/mattermost-privileged","commit_stats":null,"previous_names":["dsander/mattermost-privileged"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dsander/mattermost-privileged","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsander%2Fmattermost-privileged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsander%2Fmattermost-privileged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsander%2Fmattermost-privileged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsander%2Fmattermost-privileged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsander","download_url":"https://codeload.github.com/dsander/mattermost-privileged/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsander%2Fmattermost-privileged/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32792415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T20:54:31.038Z","updated_at":"2026-05-08T18:35:49.531Z","avatar_url":"https://github.com/dsander.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taken from https://git.somenet.org/pub/jan/mattermost-privileged.git\n\nAdded dockerfile to run the scripts on a dockerized mattermost instance\n\nExcept from my `docker-compose.yml`\n\n```yaml\n    cleanup:\n      image: dsander/mattermost-cleanup\n      container_name: cleanup\n      depends_on:\n        - postgres-mattermost\n      networks:\n        - mattermost\n      volumes:\n        - \"{{ appdata_path }}/mattermost/data:/mattermost/data:rw\"\n      environment:\n        POSTGRES_HOST: postgres-mattermost\n        POSTGRES_USER: mattermost\n        POSTGRES_PASSWORD: mattermost\n        POSTGRES_DB: mattermost\n```\n\nRun with\n\n```\ndocker compose run -it cleanup python3 -Bu db.py\ndocker compose run -it cleanup python3 -Bu fs.py\n```\n\n\n\n# Someone's privileged Mattermost scripts.\n+ Copyright (c) 2016-2022 by Someone \u003csomeone@somenet.org\u003e (aka. Jan Vales \u003cjan@jvales.net\u003e)\n+ published under MIT-License\n+ These scripts need DB- and Filesystem-access.\n\nBeware: 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.\n\nIt 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)\nBut eventually grew to include other scripts too.\n\nconsider running as cronjobs:\n\n    00 23 * * *   (cd /srv/mattermost/mattermost-privileged; git pull --recurse-submodules=yes; git gc) \u0026\u003e/dev/null\n    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)\n    59 11 * * MON (cd /srv/mattermost/mattermost-privileged/profile_badges; python3 -Bu main.py)\n    0 0 * * 2-7   (cd /srv/mattermost/mattermost-privileged/stats; python3 -Bu main.py)\n    0 0 * * MON   (cd /srv/mattermost/mattermost-privileged/stats; python3 -Bu main.py week)\n\n\n## maintenance\n+ permanently deletes {\"deleted\",orphaned,old,unused} MM-db data and unreferenced files.\n+ fix db-health degrading issues MM has (had?).\n+ 'delete' System-Spam messages and \"Posts marked for deletion\"\n+ enforce our system-policy (Can/must be enabled separately; Likely only makes sense for our instances)\n  + Deleting inactive Channels + Users/Guests.\n\n### **Beware: running this WILL break your instance's audit-trails. This IS intended behavior**\n\n\n## profile_badges\n+ Sets custom profile badges, needs DB access for post-count based badges.\n\n\n## stats\n+ various stats posted into channels.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsander%2Fmattermost-privileged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsander%2Fmattermost-privileged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsander%2Fmattermost-privileged/lists"}