+# Default auth to on if they set $WebRemoteUserAuth
+$opt{auth} = '' if not exists $opt{auth} and parseconf( "WebRemoteUserAuth" );
+
+# Set an auth path if they want it but didn't pass a path
+if (defined $opt{auth} and not $opt{auth}) {
+ $opt{auth} = "$opt{root}/var/htpasswd";
+ unless (-f $opt{auth}) {
+ open(my $fh, ">", $opt{auth}) or die "Can't create default htpasswd: $!";
+ print $fh 'root:$apr1$TZA4Y0DL$DS5ZhDH8QrhB.uAtvNJmh.' . "\n";
+ close $fh or die "Can't create default htpasswd: $!";
+ }
+} elsif ($opt{auth} and not -f $opt{auth}) {
+ die "Can't read htpasswd file $opt{auth}!";
+}
+