-
Notifications
You must be signed in to change notification settings - Fork 44
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
Showing
15 changed files
with
159 additions
and
253 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,3 @@ | ||
[submodule "stalkerware-indicators"] | ||
path = stalkerware-indicators | ||
url = [email protected]:AssoEchap/stalkerware-indicators.git |
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
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
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
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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
#!/usr/bin/env python3 | ||
import logging | ||
import logging.handlers as handlers | ||
""" | ||
The mainfile of ISDi repo. | ||
""" | ||
import webbrowser | ||
from threading import Timer | ||
|
||
import config | ||
from db import init_db | ||
from web import app, sa | ||
|
||
PORT = 6200 if not (config.TEST or config.DEBUG) else 6202 | ||
HOST = "127.0.0.1" if config.DEBUG else "0.0.0.0" | ||
|
||
def open_browser(): | ||
webbrowser.open('http://127.0.0.1:' + str(PORT), new=0, autoraise=True) | ||
"""Opens a browser to make it easy to navigate to ISDi | ||
""" | ||
if not config.TEST: | ||
webbrowser.open('http://127.0.0.1:' + str(PORT), new=0, autoraise=True) | ||
|
||
if __name__ == "__main__": | ||
import sys | ||
if 'TEST' in sys.argv[1:] or 'test' in sys.argv[1:]: | ||
print("Running in test mode.") | ||
config.set_test_mode(True) | ||
print("Checking mode = {}\nApp flags: {}\nSQL_DB: {}" | ||
.format(config.TEST, config.APP_FLAGS_FILE, | ||
config.SQL_DB_PATH)) | ||
print("TEST={}".format(config.TEST)) | ||
print(f"Checking mode = {config.TEST}\n" | ||
"App flags: {config.APP_FLAGS_FILE}\n" | ||
"SQL_DB: {config.SQL_DB_PATH}") | ||
|
||
print(f"TEST={config.TEST}") | ||
init_db(app, sa, force=config.TEST) | ||
handler = handlers.RotatingFileHandler('logs/app.log', maxBytes=100000, | ||
backupCount=30) | ||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.ERROR) | ||
logger.addHandler(handler) | ||
PORT = 6200 if not config.TEST else 6202 | ||
config.setup_logger() | ||
Timer(1, open_browser).start() | ||
app.run(host="0.0.0.0", port=PORT, debug=config.DEBUG, use_reloader= False) | ||
app.run(host=HOST, port=PORT, debug=config.DEBUG, use_reloader=config.DEBUG) |
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
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
Oops, something went wrong.