Coder Social home page Coder Social logo

jlil / mod_cookietrack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from krux/mod_cookietrack

0.0 2.0 0.0 163 KB

A vastly improved version of mod_usertrack, supporting DNT, rolling expires, redirects and much much more.

License: MIT License

Perl 39.85% C 59.21% Shell 0.17% JavaScript 0.77%

mod_cookietrack's Introduction

mod_cookietrack

A vastly improved version of mod_usertrack, supporting DNT, rolling expires, redirects and much much more.

Building

Make sure you have apxs2 and perl installed, which on Ubuntu you can get by running:

  $ sudo apt-get install apache2-dev perl

From the checkout directory run:

  $ sudo perl build.pl --install

This will build, install & enable the module on your system

Configuration

See the file 'DOCUMENTATION' in the same directory as this README for all the extra features this module has compared to mod_usertrack, as well as documentation on the configuration directives supported.

Custom UID generation

Create a C file or library that has a 'gen_uid' function with the following prototype:

  void gen_uid( char *uid, char *timestamp, char *ip );

Where 'timestamp' is a 16 character microtime, 'ip' is the remote IP address and 'uid' is a char pointer for you to store the UID to use for this request.

And then, build the module like this (any gcc linking target is acceptable):

  $ sudo perl build.pl --inc /where/my_uid/lives --lib my_uid.c

Testing

*** Note: for this will you will need Apache, NodeJS *** and Perl installed.

First, start the backend node based server. It serves as an endpoint and shows you the received url & headers for every call:

  $ test/run_backend.sh

Next, start a custom Apache server. This will have all the modules needed and the endpoints for testing:

  $ sudo test/run_httpd.sh

Then, run the test suite:

  $ perl test/01_cookietrack.pl

Run it as follows to enable diagnostic/debug output:

  $ perl test/01_cookietrack.pl --debug

Note that if you're using a custom library for generating the UID, be sure to pass the length of the expected cookie as the second argument. So, if your library generates UIDs of 12-16 characters, use:

  $ perl test/01_cookietrack.pl --cookielength 12,16

There will be an error log available, and that will be especially useful if you built the library with --debug:

  $ tail -F test/error.log

Building your own package

Make sure you have dpkg-dev, cdbs and debhelper installed, which on Ubuntu you can get by running:

$ sudo apt-get install dpkg-dev cdbs debhelper

Then build the package by first compiling the module, then running buildpackage:

$ perl build.pl
$ dpkg-buildpackage -d -b

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.