Index: trunk/lib/BookmarksApp.pm
===================================================================
--- trunk/lib/BookmarksApp.pm	(revision 114)
+++ trunk/lib/BookmarksApp.pm	(revision 118)
@@ -122,4 +122,13 @@
         $config->{realm} ||= 'Bookmarks';
         $config->{htdigest} or die "No htdigest configured for authentication\n";
+
+        # if authentication is enabled and no digest_key is provided, generate one
+        # don't do this if it isn't needed, since this is sometimes not a fast operation
+        if (!$config->{digest_key}) {
+            warn "Generating digest authentication secret...\n";
+            require Bytes::Random::Secure;
+            $config->{digest_key} = Bytes::Random::Secure::random_bytes_base64(16, '');
+        }
+
         open my $htdigest, '<', $config->{htdigest} or die "Can't open $$config{htdigest}\n";
         while (my $credentials = <$htdigest>) {
