Skip to content

Instantly share code, notes, and snippets.

@qknight
Created March 8, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qknight/3191bc7f0274f5e70c32 to your computer and use it in GitHub Desktop.
Save qknight/3191bc7f0274f5e70c32 to your computer and use it in GitHub Desktop.
services.httpd = {
adminAddr = "js@lastlog.de";
enable = true;
documentRoot= "/www";
extraModules = [
#{ name = "php5"; path = "${pkgs.php}/modules/libphp5.so"; }
{ name = "deflate"; path = "${pkgs.apacheHttpd}/modules/mod_deflate.so"; }
{ name = "proxy_wstunnel"; path = "${pkgs.apacheHttpd}/modules/mod_proxy_wstunnel.so"; }
];
virtualHosts = [
{
serverAliases = ["www.example.com"];
documentRoot = "/www";
extraConfig = ''
<Directory "/www/">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# <IfModule mod_dir.c>
# DirectoryIndex index.html
# </IfModule>
'';
}
# example.com (http)
{
hostName = "example.com";
serverAliases = [ "example.com" ];
documentRoot = "/www/example.com/";
enableSSL = false;
extraConfig = ''
# prevent a forward proxy!
ProxyRequests off
RewriteEngine On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
Alias "/rt/static/" "/www/static/"
<Directory "/rt/static/">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ProxyPassMatch ^/rt/static/ !
ProxyPass "/rt/websocket" "ws://localhost:5000/websocket/" retry=0
ProxyPass "/rt" "http://127.0.0.1:8080/" retry=0
ProxyPassReverse "/rt" "http://127.0.0.1:8080/" retry=0
'';
}
{
hostName = "tour.example.com";
serverAliases = [ "tour.example.com" ];
documentRoot = "/www/tour";
enableSSL = false;
extraConfig = ''
ServerPath "/tt"
RewriteEngine On
# remove tt from URL
RewriteRule ^tt/(.*)$ $1 [QSA,L]
# rewrite 'question/23' to ?id=23
#RewriteRule /(.*)$ ?id=$1
# RewriteRule .*/(.*)$ ?id=$1
'';
}
];
};
# Any configuration directives you include here will override
# RT's default configuration file, RT_Config.pm
#
# To include a directive here, just copy the equivalent statement
# from RT_Config.pm and change the value. We've included a single
# sample value below.
#
# This file is actually a perl module, so you can include valid
# perl code, as well.
#
# The converse is also true, if this file isn't valid perl, you're
# going to run into trouble. To check your SiteConfig file, use
# this command:
#
# perl -c /path/to/your/etc/RT_SiteConfig.pm
#
# You must restart your webserver after making changes to this file.
#Set( $rtname, 'example.com');
# You must install Plugins on your own, this is only an example
# of the correct syntax to use when activating them:
# Plugin( "RT::Extension::SLA" );
# Plugin( "RT::Authen::ExternalAuth" );
#
Set(@ReferrerWhitelist, qw( example.com:80 www.example.com:443 localhost:8080 localhost:80 127.0.0.1:80 127.0.0.1:8080));
Set($LogToFile, 'debug');
Set($LogDir, "/tmp");
Set($StatementLog => "debug");
Set($LogToFileNamed , "debug.log");
Set($LogToSyslog , 'error');
Set($LogToScreen , 'error');
Set($LogToFileNamed , "rt.log"); #log to rt.log
Set( $CommentAddress, '' );
Set( $CorrespondAddress, '' );
Set( $DatabaseHost, 'localhost' );
Set( $DatabaseName, 'rt4' );
Set( $DatabasePassword, '' );
Set( $DatabasePort, '' );
Set( $DatabaseType, 'mysql' );
Set( $DatabaseUser, 'root' );
Set( $Organization, 'example.com' );
Set( $OwnerEmail, 'js@lastlog.de' );
Set( $SendmailPath, '/var/setuid-wrappers/sendmail' );
# Set( $WebDomain, 'example.com' );
Set( $WebPort, '8080' );
# Set( $rtname, 'example.com' );
Set( %KanbanConfigs, (
important => q(
{
"lanes":[
{
"Name": "New Open",
"Change": {"Status": "open"},
"Query": "(Status='open' OR Status='new') AND Priority<100"
},
{
"Name": "IMPORTANT",
"Change": {"Status": "open"},
"CallOnEnter": "{
if (ticket.Priority < 100){
ticket.Priority = 100;
}
alert('hello world');
return [];
}",
"Query": "(Status='open' OR Status='new') AND Priority >=100"
},
{
"Name": "Resolved",
"Change": {"Status": "resolved"},
"Query": "(Status='resolved') AND (Resolved > '{{=it.Date}}')",
"timeOffSet":2
}
]
}),
distributeTickets => q(
{
"lanes":[
{
"Name": "New Open",
"Change": {"Status": "open"},
"Query": "(Status='open' OR Status='new') AND (Owner = 'Nobody')"
},
{
"Name": "jj",
"Change": {"Owner": "jj"},
"Query": "(Status != 'Resolved' AND Status != 'Rejected' AND Owner = 'jj')"
},
{
"Name": "bar",
"Change": {"Owner": "bar"},
"Query": "(Status != 'Resolved' AND Status != 'Rejected' AND Owner = 'bar')"
}
]
})));
Set(@KanbanDefault, "distributeTickets");
# Set( @StaticRoots,
# {
# path => qr{^/static/},
# root => '/tmp/rt4/opt/rt4/share',
# },
# );
Plugin('RT::Extension::KANBAN');
# Set( $WebsocketPort , "5000");
Set( $WebPath, "/rt" );
# Set( $WebURL, "http://example.com:8080/");
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment