-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5b9d8d
commit 2fe44f2
Showing
2,196 changed files
with
144,357 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# PetitCrolle | ||
|
||
Tool that help conducting a forensic analysis by providing a regroupement of tools in one place | ||
|
||
<img title="MarkText logo" src="file:///home/dacru/Desktop/Git/PetitCrolle/doc/crolle.png" alt="Alt text" width="388" data-align="center"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from app import create_app, db | ||
import argparse | ||
from flask import render_template | ||
import os | ||
from app.utils.init_modules import create_modules_db | ||
|
||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-i", "--init_db", help="Initialise the db if it not exist", action="store_true") | ||
parser.add_argument("-r", "--recreate_db", help="Delete and initialise the db", action="store_true") | ||
parser.add_argument("-d", "--delete_db", help="Delete the db", action="store_true") | ||
parser.add_argument("-m", "--create_module", help="Create modules in db", action="store_true") | ||
args = parser.parse_args() | ||
|
||
os.environ.setdefault('FLASKENV', 'development') | ||
|
||
app = create_app() | ||
|
||
@app.errorhandler(404) | ||
def error_page_not_found(e): | ||
return render_template('404.html'), 404 | ||
|
||
|
||
if args.init_db: | ||
with app.app_context(): | ||
db.create_all() | ||
elif args.recreate_db: | ||
with app.app_context(): | ||
db.drop_all() | ||
db.create_all() | ||
elif args.delete_db: | ||
with app.app_context(): | ||
db.drop_all() | ||
elif args.create_module: | ||
with app.app_context(): | ||
create_modules_db() | ||
else: | ||
app.run(host=app.config.get("FLASK_URL"), port=app.config.get("FLASK_PORT")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from flask import Flask | ||
from flask_sqlalchemy import SQLAlchemy | ||
from flask_wtf import CSRFProtect | ||
from flask_migrate import Migrate | ||
|
||
from config import config as Config | ||
import os | ||
|
||
|
||
db = SQLAlchemy() | ||
csrf = CSRFProtect() | ||
migrate = Migrate() | ||
|
||
def create_app(): | ||
app = Flask(__name__) | ||
config_name = os.environ.get("FLASKENV") | ||
|
||
app.config.from_object(Config[config_name]) | ||
|
||
Config[config_name].init_app(app) | ||
|
||
db.init_app(app) | ||
csrf.init_app(app) | ||
migrate.init_app(app, db, render_as_batch=True) | ||
|
||
from .home import home_blueprint | ||
app.register_blueprint(home_blueprint, url_prefix="/") | ||
|
||
return app | ||
|
Oops, something went wrong.