Skip to content

Moves log file configuration to config.py#128

Merged
mprahl merged 2 commits intomasterfrom
ft-change_log_config-107
Jul 5, 2016
Merged

Moves log file configuration to config.py#128
mprahl merged 2 commits intomasterfrom
ft-change_log_config-107

Conversation

@thatarchguy
Copy link
Member

Moving the log file configuration to the config.py is a safer choice than allowing it to be configured in the web interface and api.

In order to change the log file location:

  • python manage.py setlogfile <path> or edit config.py
  • Restart the application (service apache2 restart)

I dislike importing app to get the config value in the utils files. I was using current_app, but this broke the tests because it was working out of the context of the application.

Fixes #107

@mprahl mprahl force-pushed the ft-change_log_config-107 branch 2 times, most recently from a7306c8 to 1ce6753 Compare June 30, 2016 02:31
@mprahl
Copy link
Member

mprahl commented Jun 30, 2016

@thatarchguy, I added some code to verify that the log file is set and writable prior to allowing you to enable auditing. If you're good with the change. Let's squash the commits.

@mprahl
Copy link
Member

mprahl commented Jun 30, 2016

Actually, we should probably add unit tests so that we know that if the log file is not writable,and the user tries to turn on logging, that the new code raises an exception.

@mprahl
Copy link
Member

mprahl commented Jul 2, 2016

@thatarchguy, can you check my last commit? If you're good with it, I'll squash your commits and merge it.

@mprahl mprahl added this to the v1.0.1 milestone Jul 2, 2016
@mprahl mprahl assigned thatarchguy and unassigned mprahl Jul 2, 2016
@thatarchguy
Copy link
Member Author

No need to squash commits

LGTM

👍

thatarchguy and others added 2 commits July 5, 2016 09:38
Changed to not use current_app to get config.py value
Updated docs and tests

Signed-off-by: Kevin <kevin@stealsyour.pw>
Verifies that the log file is writable before allowing logging to be turned on
Improved Unit Tests
Database is recreated before every test for consistency
Logging is turned off by default during tests
Tests that test the functionality of logging or reading the log file now have a file created in the temporary directory handled by py.test.
Tests were added to test turn on updating login auditing and turn on maildb auditing
@mprahl mprahl force-pushed the ft-change_log_config-107 branch from c18c60e to 455a6e3 Compare July 5, 2016 13:41
@mprahl mprahl merged commit ac05a8c into master Jul 5, 2016
@mprahl mprahl deleted the ft-change_log_config-107 branch July 5, 2016 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants