Giter Club home page Giter Club logo

databasecleanup's Introduction

DatabaseCleanup plugin for Mantis issue tracker
=============================================

The main usage for this plugin is to remove issues that reached a predefined
status and age.

WARNING
This plugin can purge a large number of issues, along with their comments, 
attachments, and all other related data **without any confirmation**.
Please make sure to backup your database before testing the plugin. 


Installation
------------
As with other plugins, it is enough to download or unpack the plugin in the
plugins/ directory of your existing mantis installation


Configuration
-------------
All the tunables for the plugin are accessible from the Manage Plugins page
<mantis_url>/plugin.php?page=DatabaseCleanup/config

However, it is always possible to define configuration variables in 
config_inc.php; those will named:

$g_plugin_DatabaseCleanup_<variable name>

where the actual variable names are given below


Configuration variables
-----------------------
*   default_expiration_period
    bug expiration period, valid for all projects. It is possible to use
    natural language like 'one year' or '6 months' as understood by the 
    strtotime() PHP function. A value of '0' disables the plugin.

*   reference_date
    timestamp to use as reference. Can be either the string 'date_submitted'
    or 'last_udpdated'

*   minimum_status
    only bugs above this status will be deleted

*   run_as_user
    run script as the given user wsaas logged in. Needs delete privileges 
    for all projects

*   admin_email
    if set, send a summary email to the administator with a CSV attachment
    detailing issues deleted

*   run_delay
    delay in hours between consecutive runs of the script. This is a security
    measure against DoS attacks

*   secret_key
    a shared secret string, used to authorize clients to run the cleanup


Testing cleanup
---------------
When everything is configured, it is possible to test the procedure by 
opening the page:

<mantis_url>/plugin.php?page=DatabaseCleanup/dummy_cleanup

you will be able to check if the call has all the required parameters (see 
below) and see the cleanup summary with the sample CSV that will be sent to 
the administator


Running the cleanup operation
-----------------------------
In order to trigger the cleanup operation, you need to call the URL:
<mantis_url>/plugin.php?page=DatabaseCleanup/cleanup&key=XXXXX&sig=YYYYY

where XXXXX is a random string (for security purposes, we suggest using a 
different one at each run) and sig is call signature, defined as:

md5(secret_key + key)

There is a convenient run_cleanup.sh script in the cron/ directory that can be
used to trigger periodically the cleanup script

databasecleanup's People

Contributors

giallu avatar

Watchers

James Cloos avatar  avatar

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.