rax-maas / dreadnot

deploy without dread
Apache License 2.0
631 stars 61 forks source link

Let user specify a hook to configure webapp in the config file. #43

Closed mpasternacki closed 10 years ago

mpasternacki commented 11 years ago

This allows customization in the web panel without forking, that lets user set up e.g. alternative authentication schemes. I can e.g. configure authentication to just use SSO headers left by frontend Apache, or (sample below) hard-code username for local tests:

    configure_server: function (app) {
        app.enable('trust proxy');
        app.use( function(req, res, next) {
            req.session.authed = true;
            req.session.username = 'japhy';
            next();
        });
    },
russellhaering commented 10 years ago

Nice patch, merging. Sorry for the long wait.