aboutsummaryrefslogtreecommitdiffstats
path: root/cgi-bin
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-23 20:43:08 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-09-23 20:43:08 +0200
commit0a4b5d24845fb86bade3ab3c38a6202862d6caad (patch)
tree5bba357bda9c8cda0c3671d387967de4a4374650 /cgi-bin
parent858333c888ce15b16147e11d30ee1ae5403f7d5d (diff)
List creation via a Postfix local alias.
Diffstat (limited to 'cgi-bin')
-rwxr-xr-xcgi-bin/index.cgi48
-rwxr-xr-xcgi-bin/index.fcgi47
2 files changed, 47 insertions, 48 deletions
diff --git a/cgi-bin/index.cgi b/cgi-bin/index.cgi
deleted file mode 100755
index 5efa469..0000000
--- a/cgi-bin/index.cgi
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/perl
-
-use 5.010_000;
-use strict;
-use warnings;
-use utf8;
-
-=head1 NAME
-
-index.cgi -
-
-=cut
-
-use lib 'lib';
-use Fripost::Panel::Interface;
-
-# TODO: Try out Fast CGI
-#use CGI::Fast();
-#
-#while (my $q = new CGI::Fast){
-# my $app = new WebApp(QUERY => $q);
-# $app->run();
-#}
-
-my @config = 'default.in';
-push @config, 'config.in' if -f 'config.in';
-
-my $cgi = Fripost::Panel::Interface->new(
- PARAMS => { cfg_file => [ @config ], format => 'equal' }
-);
-$cgi->run();
-
-=head1 AUTHOR
-
-Guilhem Moulin C<< <guilhem at fripost.org> >>
-
-=head1 COPYRIGHT
-
-Copyright 2012 Guilhem Moulin.
-
-=head1 LICENSE
-
-This program is free software; you can redistribute it and/or modify it
-under the same terms as perl itself.
-
-=cut
-
-__END__
diff --git a/cgi-bin/index.fcgi b/cgi-bin/index.fcgi
new file mode 100755
index 0000000..8e551d8
--- /dev/null
+++ b/cgi-bin/index.fcgi
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use 5.010_000;
+use strict;
+use warnings;
+use utf8;
+
+=head1 NAME
+
+index.fcgi -
+
+=cut
+
+use CGI::Fast ();
+use File::Spec::Functions 'catfile';
+use lib 'lib';
+use Fripost::Panel::Interface;
+
+
+my $config_dir = '/etc/fripost-panel';
+my @config = catfile ('./', 'default.in');
+push @config, catfile ($config_dir, 'config.in') if -f catfile ($config_dir, 'config.in');
+
+while (my $q = CGI::Fast::->new){
+ my $cgi = Fripost::Panel::Interface::->new(
+ QUERY => $q,
+ PARAMS => { cfg_file => [ @config ], format => 'equal' }
+ );
+ $cgi->run();
+}
+
+=head1 AUTHOR
+
+Guilhem Moulin C<< <guilhem at fripost.org> >>
+
+=head1 COPYRIGHT
+
+Copyright 2012 Guilhem Moulin.
+
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as perl itself.
+
+=cut
+
+__END__