New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker infrastructure #104
base: main
Are you sure you want to change the base?
Conversation
hashview/__init__.py
Outdated
try: | ||
logger.info('Upgrading Database if needed Progressing.') | ||
import alembic.command | ||
migrate_ext = config = current_app.extensions['migrate'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to remove this double-assignment.
hashview/__init__.py
Outdated
from hashview.setup import admin_pass_needs_changed | ||
from hashview.users.routes import bcrypt | ||
if not admin_pass_needs_changed(db, bcrypt): | ||
logger.info('Admin password needs changed.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to fix this log message (it should convey the inverse).
I need to add a section the the README. Specifically it should call out that this first pass of docker is intended to be a platform to build future production deployment of hashview via docker, but for now it is in more of a "developer ready" state. Also, it should point out that a |
I need to fit the typo in my latest commit (ducker => docker). |
Any updates on this @Yoshi325 ? |
This is the next update to go in. We wanted to land v0.8.1 first. |
Rebased and updated on top of the latest. |
except: | ||
logger.exception('Adding Admin User failed.') | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should swap the order in which the default wordlists are added. Starting with the dynamic wordlist followed by the static wordlist.
This way, the dynamic wordlist, in the db ends up with id=1.
hashview/setup/__init__.py
Outdated
task = Tasks( | ||
name = 'Rockyou Wordlist', | ||
owner_id = '1', | ||
wl_id = '1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct for now, in so much as the wl_id=1 is rock you, but if we swap it so that the dynamic wordlist is loaded first, then these should be updated wl_id=2
hashview/setup/__init__.py
Outdated
task = Tasks( | ||
name = 'Rockyou Wordlist + Best64 Rules', | ||
owner_id = '1', | ||
wl_id = '1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. update to wl_id=2 if we make dynamic wordlist wl_id=1
Also required creating a web ui interface to force the admin password and settings to be set. Also unified logging to a single format.
This is a pretty heavy one. Had to shift a bunch around to make it work. Specifically the command line setup needed to be split to support a web ui setup if user input is required. And the other half of it needed automatically (but idempotently) run before first request.
With a proper
hashview/config.conf
:docker compose up
will bring up a container for mysql, as well as one for the application. Abefore_first_request
hook sets up most of the default items. And abefore_request
hook handles changing the Admin user that is created by default, and populating the Settings in the database.While working, I also addressed two comparisons with 0 that Flask was flagging. And unified logging a bit so that a common formatting is used, as well as fixing a bug where the flask migrate upgrade was squelching further log messages.