aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2014-05-05 14:36:43 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2014-05-13 21:07:24 +0200
commit0db96cce9f83f09b07a46f31f9930e5b7cc19f6f (patch)
tree577ed4c85e1346193b5fe5e4e6fef0a4abb77d87 /lib
parentd8907f11f5c255727b8a814746a0114e5c62e30a (diff)
Fix bugs introduced by the previous patch.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Net/MulkyID/Setup.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/Net/MulkyID/Setup.pm b/lib/Net/MulkyID/Setup.pm
index acfe018..2393023 100755
--- a/lib/Net/MulkyID/Setup.pm
+++ b/lib/Net/MulkyID/Setup.pm
@@ -51,22 +51,31 @@ sub setup() {
my $configpath = $::MULKONF->{configpath} // "/etc/mulkyid";
my $pemfile = $::MULKONF->{pemfile} // "$configpath/rsa2048.pem";
- my $auth_type = $::MULKONF->{auth_type} // "imap";
+ my $auth_type = $::MULKONF->{auth_type} // "imap";
my $aliases_file = $::MULKONF->{aliases_file} // "/etc/aliases";
my $imap_server = $::MULKONF->{imap_server} // "localhost";
my $imap_port = $::MULKONF->{imap_port} // 143;
my $basepath = $::MULKONF->{basepath} // "/browserid";
+ my $fake_domain = $::MULKONF->{fake_domain} // "";
+ my $real_domain = $::MULKONF->{real_domain} // "";
$configpath = prompt("Where shall I put configuration files?", $configpath);
$pemfile = prompt("Where shall I put the private key?", $pemfile);
$auth_type = prompt("How will users authenticate? (imap, google)", $auth_type);
- $basepath = int(prompt("What will be the web-facing base path for IdP files and scripts?", $basepath));
- for ($auth_type) {
+ $basepath = prompt("What will be the web-facing base path for IdP files and scripts?", $basepath);
+ given (my $_ = $auth_type) {
when ("imap") {
$aliases_file = prompt("Where is the aliases file? Type a single dot for none.", $aliases_file);
$imap_server = prompt("What is the IMAP server's address?", $imap_server);
$imap_port = int(prompt("What is the IMAP server's port?", $imap_port));
}
when ("google") {
+ $fake_domain = prompt("Fake domain name for email addresses? Type a single dot for none. (FOR DEVELOPMENT)", $fake_domain);
+ if ($fake_domain eq '.' or $fake_domain eq '') {
+ $fake_domain = '';
+ } else {
+ $real_domain = prompt("Real domain name?", $real_domain);
+ $real_domain = '' if ($real_domain eq '.');
+ }
}
default {
die "Invalid authentication type";
@@ -114,6 +123,9 @@ sub setup() {
imap_server => $imap_server,
imap_port => $imap_port,
basepath => $basepath,
+ auth_type => $auth_type,
+ fake_domain => $fake_domain,
+ real_domain => $real_domain,
};
write_file($conffile, <<EOF
#! /usr/bin/env perl