Code Monkey home page Code Monkey logo

log-login's Introduction

log-login

This plugin logs login atempts to YOURLS. I wrote this to be used with fail2ban.

Configure the plugin by adding setting in your user/config.php

define( 'BARRE_LOG_LOGIN_FILENAME', '/path/to/filename.log' );

BARRE_LOG_LOGIN_FILENAME defines the path to where the the plugin should log authentication activities. Default value if not set is plugins/log-login/logins.log

define( 'BARRE_LOG_LOGIN_SUCCESS', false );

BARRE_LOG_LOGIN_SUCCESS (true or false) determins if successful logins should be logged or not. Default if not set is false

define( 'BARRE_LOG_LOGIN_FAILURE', true );

BARRE_LOG_LOGIN_FAILURE (true or false) determins if failed logins should be logged or not. Default if not set is true

define( 'BARRE_LOG_LOGIN_LOGOFF', false );

BARRE_LOG_LOGIN_FALSE (true or false) determins if logoffs should be logged or not. default if not set is false

This file needs the PHP Pear log package

pear install Log-1.12.7

fail2ban

copy the fail2ban-jail/yourls.conf to /etc/fail2ban/jail.d/ and change the logpath to match your settings

copy the fail2ban-filter/yourls.con to /etc/fail2ban/filter.d/

logrotate

copy the logrotate/yourls to /etc/logrotate-d/ and change the logpath to match your settings

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.