Code Monkey home page Code Monkey logo

prosody_housekeeping's Introduction

Codacy Badge

Prosody housekeeping

This script is designed to fight of unnecessary database space and junk.

Needed

  • Prosody Server
  • Prosody Community Modules listed in the main config file or in the path
  • shell access

How to install

Edit the script to fit your timeframes and paths. Add the cerdentials of your prosodys database users to the file and enable mod_mam clearing. Start daily with cron or place script as .sh file in the "cron.daily" anacron directory.

Work Flow

  • Filter registered but never logged in accounts
  • Filter formerly used but now unused accounts
  • if enabled delete expired mod_mam entries
  • delete all filtered users

Ignore List

Feature to ignore defined user accounts by placing the full JID in the ignore file one per line. There is no need to take care of whitespaces or emtpy lines. The Skript will automatically prepare the list and remove excess whitespaces/empty lines. It is possible to ignore both unused registered accounts and old accounts. It is not possible to specify an ignore list for each filter. There is only a generel ignore file.

prosody_housekeeping's People

Contributors

mightybroccoli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yut304

prosody_housekeeping's Issues

mam result only shown when enabled

  • [] detect if prosodydb variables are set and display result even when disabled

if [ "$1" = "--test" ]; then
# this is currently a workaround caused by the extrem slowness of prosodys own clearing mechanism
# filter all expired mod_mam messages from archive
echo "SELECT * FROM prosody.prosodyarchive WHERE \`when\` < UNIX_TIMESTAMP(DATE_SUB(curdate(),INTERVAL $mam_message_live));" | mysql -u "$prosody_db_user" -p"$prosody_db_password" &>> "$dbjunk_to_delete"
return 1

[bug] prepared list not always present

cleancomp calls prepared_list on every run. When there arent any commands to run an error will be printing that the prepared_list.txt is not present.

remove deleted accounts from spectrum2 db

potential privacy issue

  1. inaktive User aus Prosody gleichzeitig aus allen Spectrum Instanzen raus ( hier kann dann ggf bei Spectrum auf ne Datenbankabfrage verzichtet werden )
  2. Spectrum Datenbanken inaktive externe User ( Datenbankabfrage je Instanz )

log to file

  • add logging function general enough to fit all filters
  • rewrite filter to fit the logging start

Read mysql credentials from prosody.cfg.lua

Read the mysql credentials from prosody.cfg.lua. The benefit will be:

  • credentials are not located in another plain text file
  • avoiding that admins are writing their mysql root credentials into the config, out of laziness ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.