George S. Baugh 5 жил өмнө
parent
commit
e85cd3f92b

+ 4 - 0
.gitignore

@@ -10,3 +10,7 @@ pod2htmd.tmp
 fgEmojiPicker.js
 fgEmojiPicker.js
 full-emoji-list.json
 full-emoji-list.json
 www/.well_known
 www/.well_known
+config/auth.db
+config/has_users
+config/main.cfg
+config/setup

+ 1 - 1
lib/Trog/Auth.pm

@@ -111,7 +111,7 @@ sub useradd ($user, $pass, $acls) {
 # Ensure the db schema is OK, and give us a handle
 # Ensure the db schema is OK, and give us a handle
 sub _dbh {
 sub _dbh {
     my $file   = 'schema/auth.schema';
     my $file   = 'schema/auth.schema';
-    my $dbname = "$ENV{HOME}/.tcms/auth.db";
+    my $dbname = "config/auth.db";
     return Trog::SQLite::dbh($file,$dbname);
     return Trog::SQLite::dbh($file,$dbname);
 }
 }
 
 

+ 1 - 1
lib/Trog/Config.pm

@@ -15,7 +15,7 @@ Returns a configuration object that will be used by server.psgi, the data model
 
 
 =cut
 =cut
 
 
-our $home_cfg = "$ENV{HOME}/.tcms/main.cfg";
+our $home_cfg = "config/main.cfg";
 
 
 sub get {
 sub get {
     my $cf;
     my $cf;

+ 3 - 3
lib/Trog/Routes/HTML.pm

@@ -334,7 +334,7 @@ One time setup page; should only display to the first user to visit the site whi
 =cut
 =cut
 
 
 sub setup ($query, $render_cb) {
 sub setup ($query, $render_cb) {
-    File::Touch::touch("$ENV{HOME}/.tcms/setup");
+    File::Touch::touch("config/setup");
     return $render_cb->('notconfigured.tx', {
     return $render_cb->('notconfigured.tx', {
         title => 'tCMS Requires Setup to Continue...',
         title => 'tCMS Requires Setup to Continue...',
         stylesheets => _build_themed_styles('notconfigured.css'),
         stylesheets => _build_themed_styles('notconfigured.css'),
@@ -359,7 +359,7 @@ sub login ($query, $render_cb) {
     }
     }
 
 
     #Check and see if we have no users.  If so we will just accept whatever creds are passed.
     #Check and see if we have no users.  If so we will just accept whatever creds are passed.
-    my $hasusers = -f "$ENV{HOME}/.tcms/has_users";
+    my $hasusers = -f "config/has_users";
     my $btnmsg = $hasusers ? "Log In" : "Register";
     my $btnmsg = $hasusers ? "Log In" : "Register";
 
 
     my @headers;
     my @headers;
@@ -367,7 +367,7 @@ sub login ($query, $render_cb) {
         if (!$hasusers) {
         if (!$hasusers) {
             # Make the first user
             # Make the first user
             Trog::Auth::useradd($query->{username}, $query->{password}, ['admin'] );
             Trog::Auth::useradd($query->{username}, $query->{password}, ['admin'] );
-            File::Touch::touch("$ENV{HOME}/.tcms/has_users");
+            File::Touch::touch("config/has_users");
         }
         }
 
 
         $query->{failed} = 1;
         $query->{failed} = 1;

+ 1 - 1
lib/tCMS/Manual.pod

@@ -51,7 +51,7 @@ The Data model modules are all subclasses of L<Trog::Data>.
 We include a bogus data model for testing called 'DUMMY' which should not be used for production purposes.
 We include a bogus data model for testing called 'DUMMY' which should not be used for production purposes.
 It is useful as an example for developers: L<Trog::Data::DUMMY>
 It is useful as an example for developers: L<Trog::Data::DUMMY>
 
 
-Authentication is accomplished via a cookie (tcmslogin) which we check against an sqlite database, ~/.tcms/auth.db
+Authentication is accomplished via a cookie (tcmslogin) which we check against an sqlite database, config/auth.db
 Passwords are hashed and salted, and the only other thing stored there is what ACLs users have.
 Passwords are hashed and salted, and the only other thing stored there is what ACLs users have.
 The module controlling this is L<Trog::Auth>.
 The module controlling this is L<Trog::Auth>.
 
 

+ 1 - 1
www/server.psgi

@@ -75,7 +75,7 @@ my $app = sub {
     my $path = $env->{PATH_INFO};
     my $path = $env->{PATH_INFO};
 
 
     # Let's open up our default route before we bother to see if users even exist
     # Let's open up our default route before we bother to see if users even exist
-    return $routes{default}{callback}->($query,\&_render) unless -f "$ENV{HOME}/.tcms/setup";
+    return $routes{default}{callback}->($query,\&_render) unless -f "config/setup";
 
 
     my $cookies = {};
     my $cookies = {};
     if ($env->{HTTP_COOKIE}) {
     if ($env->{HTTP_COOKIE}) {