atoponce / d-note

Self destructing encrypted notes
Other
130 stars 43 forks source link

Two installation issues #52

Open elyograg opened 6 years ago

elyograg commented 6 years ago

I ran into two problems while trying to install d-note today, and neither was straightforward to diagnose.

One problem is that only two explicitly hard-coded locations are searched for d-note.ini. The first path searched is /etc/dnote, the other is ~/.dnote ... but the instructions do not explicitly state that only these paths are supported. They do say that one of these paths is recommended ... but unless the code is modified, that should say required. I think that the current directory as well as the location of the .wsgi file should be searched, and possibly some other well-known locations in the git working directory. The generate_dnote_hashes script seems to use the same code.

The other problem is the permissions on the dconfig.py file, which may be the problem that the user who filed issue #48 was having. This problem took even longer to track down than the limited ini file locations, because I had to add debug lines to the script that would give a better stacktrace. Only after adding some lines for debugging was I able to determine that dconfig couldn't be imported, despite its location being added to sys.path.

Here's the cause of the second problem: I ran "generate_dnote_hashes" as root. The dconfig.py file was created with 440 permissions, owned by root:root. This meant that the apache user was unable to read the file, so dconfig couldn't be imported, and the traceback in the apache error log was useless except for pointing me at line 47 of note.py. The printed note about needing to run generate_dnote_hashes was NOT included in the apache error log, so I never saw that output.

For both problems, the message for the traceback must be improved so the user has some idea of what's actually gone wrong. For the second problem, the permissions on dconfig.py should be at least 444, if not 644. I can work up a patch for the traceback messages, but I haven't investigated the permission issue yet to see if it's something I know how to fix.

skiedude commented 5 years ago

This helped me out greatly, changing the perms on the dconfig.py to 444, and then changing the perms on /var/lib/dnote/data so that apache could write to it.