George S. Baugh 5 年之前
父節點
當前提交
e85cd3f92b
共有 6 個文件被更改,包括 11 次插入7 次删除
  1. 4 0
      .gitignore
  2. 1 1
      lib/Trog/Auth.pm
  3. 1 1
      lib/Trog/Config.pm
  4. 3 3
      lib/Trog/Routes/HTML.pm
  5. 1 1
      lib/tCMS/Manual.pod
  6. 1 1
      www/server.psgi

+ 4 - 0
.gitignore

@@ -10,3 +10,7 @@ pod2htmd.tmp
 fgEmojiPicker.js
 full-emoji-list.json
 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
 sub _dbh {
     my $file   = 'schema/auth.schema';
-    my $dbname = "$ENV{HOME}/.tcms/auth.db";
+    my $dbname = "config/auth.db";
     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
 
-our $home_cfg = "$ENV{HOME}/.tcms/main.cfg";
+our $home_cfg = "config/main.cfg";
 
 sub get {
     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
 
 sub setup ($query, $render_cb) {
-    File::Touch::touch("$ENV{HOME}/.tcms/setup");
+    File::Touch::touch("config/setup");
     return $render_cb->('notconfigured.tx', {
         title => 'tCMS Requires Setup to Continue...',
         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.
-    my $hasusers = -f "$ENV{HOME}/.tcms/has_users";
+    my $hasusers = -f "config/has_users";
     my $btnmsg = $hasusers ? "Log In" : "Register";
 
     my @headers;
@@ -367,7 +367,7 @@ sub login ($query, $render_cb) {
         if (!$hasusers) {
             # Make the first user
             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;

+ 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.
 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.
 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};
 
     # 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 = {};
     if ($env->{HTTP_COOKIE}) {