Commit Graph
100 Commits
Author SHA1 Message Date
StNicolay 972c5577f4 Added validation to the database models 2023-01-10 21:00:03 +03:00
StNicolay 671286dc39 Removed backend because it wasn't used in encryption.accounts 2023-01-10 20:28:34 +03:00
StNicolay 5dbf93013a Added requesting a master password for deleting accounts, deleting all, reseting master password 2023-01-10 20:10:48 +03:00
StNicolay c051c14f1f Switched to the ChaCha20Poly1305 encryption algorithm for better security 2023-01-10 20:00:58 +03:00
StNicolay 3686195396 Added a message about exceptions for a user 2023-01-06 17:32:44 +03:00
StNicolay d79b57b1f0 Added return statement after sending a message about that there is no active message 2023-01-05 14:52:45 +03:00
StNicolay 157c2c4aa2 _import3 no longer blocks event loop during decryption
Now running encrytion of accounts in ProcessPoolExecutor
2023-01-05 14:11:29 +03:00
StNicolay f4a5f51b23 Made more verbose exception handler for the bot for easier debugging 2023-01-05 13:47:31 +03:00
StNicolay 6bc8eb1413 db.add changes
Added _add_model helper function to reduce code duplication
Added add_accounts for future use
2023-01-05 13:19:01 +03:00
StNicolay 9f64305050 Moved sorting back to the get_accounts 2023-01-05 13:03:44 +03:00
StNicolay 4954f39a91 Added indentation into exported json files 2023-01-05 13:02:50 +03:00
StNicolay 3edeb86b6c Disabled autoincrement in master_passwords table 2023-01-05 13:01:28 +03:00
StNicolay c7675c231f Fixed sending a final message in /import 2023-01-03 21:07:37 +03:00
StNicolay ae88fccf13 Updated type hint of the handler in the register_state function 2023-01-03 12:34:54 +03:00
StNicolay e29eefe40b Changes in helper_functions.delete_message
Removed checking if sleep_time is 0
Moved sleeping outside of try block
2023-01-03 12:29:08 +03:00
StNicolay fdbed91512 Now account name is copyable 2023-01-03 12:12:40 +03:00
StNicolay f9d163361a Renamed functions in db.get
get_accounts -> get_account_names
get_all_accounts -> get_accounts
2023-01-03 12:08:06 +03:00
StNicolay 9ec66a3521 Renamed src/database into src/db 2023-01-03 11:59:06 +03:00
StNicolay 70e9afe21d Small reformating in bot.message_handler 2023-01-03 11:48:25 +03:00
StNicolay 5d59adb7d2 Renamed encryption/other_accounts into encryption/accounts 2023-01-01 00:21:53 +03:00
StNicolay 281c4a262b _export2 no longer blocks event loop during decryption
Removed sorting in get_all_accounts
Removed decrypt_multiple function because it is no longer used
Now running decrytion of accounts in ProcessPoolExecutor
2023-01-01 00:18:57 +03:00
StNicolay 74844da4ae Added backslash to the forbidden chars 2022-12-30 13:54:03 +03:00
StNicolay 77be64ed4b sorted imports 2022-12-29 18:22:37 +03:00
StNicolay 5bec51beb2 Added keyboard markup to /delete_account 2022-12-29 15:42:27 +03:00
StNicolay d5d87a8f3b Quality of life changes
Changed default action of /cancel to be handled at message_handler
Added keyboard markup to get_account for easier account selection
2022-12-29 15:38:38 +03:00
StNicolay d4c50432d7 Added ability to send message, which can be deleted by pressing a button 2022-12-29 15:25:20 +03:00
StNicolay 0026e3321a Made handlers asynchrounos
Switched from TeleBot class to AsyncTeleBot
2022-12-29 13:58:53 +03:00
StNicolay 8858aa09a7 Added conformation before deleting an account. No longer raising an exception if message deletion fails 2022-12-25 21:34:09 +03:00
StNicolay e165020111 Added blank lines in encryption.other_accounts for better readability 2022-12-25 21:04:45 +03:00
StNicolay 50eb3057d5 Renamed classes.py into decrypted_accounts.py. Removed unnessesary elements from that file 2022-12-25 21:01:18 +03:00
StNicolay 3f744723a9 Major refactor of the code
A lot of function are now using classes instead of parameters or tuples
isort was added to the dev requirements
Comments were adjusted
2022-12-25 20:12:19 +03:00
StNicolay bbc9650357 Changed database.get file. Added fetchall method calls to close session sooner 2022-12-25 17:59:26 +03:00
StNicolay f299173e56 Changes to database.get_accounts
Function is only fetching account names from db and not whole accounts now
Made sorting in that function optional
2022-12-25 17:35:37 +03:00
StNicolay 5991041b35 Added timeout to the deletion of the message in _send_tmp_message 2022-12-16 06:25:00 +00:00
StNicolay c2eca49933 Switched to building an image localy instead of using one from docker hub
Added database folder
Created Dockerfile and config for mariadb image
Moved data folder tp database/data/
2022-12-15 15:13:39 +00:00
StNicolay a9417058ee Updated tables, changed primary keys
Removed id fields from tables
Set user_id to be primary key of master_passwords
Set user_id and name to be primary keys of accounts
2022-12-10 23:46:00 +03:00
StNicolay 9690db982e Added info about total amount of accounts for get_acccounts command 2022-12-06 14:28:29 +03:00
StNicolay 025ea868a6 Addedd ensure_ascii=False to exporting Accounst 2022-12-06 14:21:36 +03:00
StNicolay d82d152fef Added ordering by name for accounts 2022-12-06 14:16:03 +03:00
StNicolay b0599c1484 Added pool_recycle every hour 2022-12-05 20:10:20 +03:00
StNicolay eab94e1c01 Added flake8 config to dockerignore 2022-11-30 20:26:32 +03:00
StNicolay b42cbb57a4 Renamed cryptogra[hy folder into encryption to not overshadow cryptography module 2022-11-30 20:24:46 +03:00
StNicolay 138ec55ae5 Added flake8 to requirements-dev.txt, added flake8 config file 2022-11-30 20:06:04 +03:00
StNicolay 6cd8091fde More code cleanup with a few bug fixes 2022-11-30 19:41:57 +03:00
StNicolay 0d3965d5d2 Renamed columns in tables
MasterPass passwd -> password_hash
Account enc_pass -> enc_password
2022-11-30 17:05:04 +03:00
StNicolay 04bb306751 Added _base_handler call to the cancel function in handlers 2022-11-30 16:53:59 +03:00
StNicolay 2a5b594f3f Renamed gen_password.py into generate_password.py, fixed gen_password command 2022-11-30 16:50:42 +03:00
StNicolay 2d2ed017f1 Removed utils.py, added decrypt_multiple function in other_accounts.py 2022-11-30 16:43:02 +03:00
StNicolay e9eaa085a2 Moved utils into src directory, moved most of the functions from it into separate files 2022-11-30 16:28:37 +03:00
StNicolay 0463388829 Massive code cleanup 2022-11-30 16:05:33 +03:00
StNicolay 944f23a146 Added new lines in requirements 2022-11-26 19:45:29 +03:00
StNicolay b4c6e17ce2 Decreased size of enc_login and enc_pass to 256 bytes 2022-11-25 21:21:18 +03:00
StNicolay 2ea3096fb0 encoding and decoding result of fernet to store data better 2022-11-25 21:02:21 +03:00
StNicolay 63de9010de Switched .venv to venv in .dockerignore 2022-11-22 08:08:12 +00:00
StNicolay e49f2e00eb Made pip upgrade before copying requirements.txt in Dockerfile 2022-11-18 16:38:25 +00:00
StNicolay fd002e3718 Added command to update pip setuptools and install wheel in Dockerfile 2022-11-18 11:34:04 +00:00
StNicolay d68a7bb6e8 Moved check of generated password into separate function 2022-11-15 15:39:38 +03:00
StNicolay d5f3708c50 Refactored utils.py
Created constants FORBIDDEN_CHARS, PUNCTUATION, PASSWORD_CHARS
Removed pipe from forbidden chars
Moved Message type alias to the top of the file
Optimized _base_check and made its parameter positional only
Changed gen_password to use said constants
2022-11-15 15:17:36 +03:00
StNicolay cc13b35282 Made class Account private in utils.py 2022-11-14 16:58:34 +03:00
StNicolay 3802943225 Changed telebot.types.Message to Message in handlers for old functions 2022-11-14 16:58:34 +03:00
StNicolay 309fb2108b Removed unnessesary import from src.__init__ 2022-11-14 16:58:34 +03:00
StNicolay 9d5c52bebe optimized password generation function 2022-11-14 16:58:26 +03:00
StNicolay a61deca6fa Removed unnecessary comments and type hints in src.__init__ 2022-11-13 19:49:21 +03:00
StNicolay 18abdecb74 Increased time untill deletion for /gen_password to 15 secs 2022-11-13 18:53:11 +03:00
StNicolay 46a1fe59b2 Documented /gen_password command 2022-11-13 18:51:23 +03:00
StNicolay 9ee51dc19f Added /gen_password command 2022-11-13 18:49:57 +03:00
StNicolay 2c07b3bed2 Added function for password generation is utils.py 2022-11-13 18:49:14 +03:00
StNicolay b8113dc47b Sorted imports in utils.py 2022-11-13 18:16:03 +03:00
StNicolay 21bd01c3ed Changed and added comments in the database files 2022-11-10 18:45:10 +03:00
StNicolay c2280e8bc2 Changed functions for encryption and decryption of accounts to use str of master_pass instead of bytes 2022-11-09 19:02:58 +03:00
StNicolay f7f954ecd3 Sorted imports 2022-11-09 18:52:59 +03:00
StNicolay 559ee8f6d8 Renamed _memory_use in cryptography into MEMORY_USAGE 2022-11-07 21:02:13 +03:00
StNicolay a1bed9014d Changed the way the master password hashing works
Switched from Bcrypt to Scrypt for master password hashing
Changed models to use new sizes for hashes and salts, doubled the size of enc_login and enc_passwd for accounts
Created new function to check master password validity
Increased salt sizes for accounts and master passwords
Removed bcrypt from requirements
2022-11-07 16:30:45 +03:00
StNicolay 66ab13b45d Changed handlers.get_accounts to use a guard clause, added comment to clarify, why we are putting account in backticks 2022-11-07 16:29:37 +03:00
StNicolay da42d7ad1d Changed comments in cryptograpy.other_accounts to be more precise 2022-11-07 16:29:31 +03:00
StNicolay 570f15001e switched mariadb connector to pymysql 2022-11-04 02:17:17 +03:00
StNicolay b4bf9fbf41 Changed mariadb.Connection to Engine in __init__ of bot 2022-11-04 02:16:47 +03:00
StNicolay 042ca9312e Cleaned up code in handlers
Renamed variables in _set_master_pass2 for consistency
Added a few missing returns in guard clauses
Added file size limit for importing account to 100 MB
2022-11-04 01:20:25 +03:00
StNicolay b10b1fe2b3 changed to the newer version of mariadb 2022-11-03 16:27:52 +00:00
StNicolay 03646b6156 Added checks to /import 2022-11-03 10:49:00 +03:00
StNicolay b56ebd0b61 Added account name and account credential checking 2022-11-02 23:11:29 +03:00
StNicolay adf9865fbe Added ability to copy account name from /get_accounts
That also fixed an issue of having wrong behaviour, if using any special chars in account name
2022-11-02 23:02:20 +03:00
StNicolay 4122e15308 Added data directory to .dockerignore 2022-11-02 18:29:54 +00:00
StNicolay 37a81ed22d Changed change_master_pass to be more readable 2022-11-02 18:34:02 +03:00
StNicolay fb850e3737 Added ability to import accounts 2022-11-02 14:48:15 +03:00
StNicolay dbf27d401e Added ability to export accounts to json 2022-11-02 14:48:15 +03:00
StNicolay 373623b0b4 Removed type_ from sqlmodel.Column, because it isn't needed 2022-11-02 14:42:26 +03:00
StNicolay afc03a6c1f Removed comment which broke code, when uncommented 2022-11-02 14:42:26 +03:00
StNicolay 4ee7f0a609 Added installation of g++ to Dockerfile 2022-11-01 09:26:13 +00:00
StNicolay ae2b214904 Fixed an error of getting wrong account
I'm now quite shure how it worked before
2022-10-31 21:09:12 +03:00
StNicolay 01ab461d28 Added message of failure to add account 2022-10-31 20:40:53 +03:00
StNicolay 9c095779a5 Fixed a typo in README and changed one of the phrase to be more correct 2022-10-30 20:39:00 +00:00
StNicolay 9f1790b58d Changed message for reseting master password 2022-10-30 23:22:01 +03:00
StNicolay 3c5d309b9a Removed mension of missing conformation for deleting all 2022-10-30 23:20:38 +03:00
StNicolay 3e570dbaff Changed order of operations in the Dockerfile 2022-10-30 23:08:24 +03:00
StNicolay b7120f2627 Fixed an error of deleting all passwords, instead of 1 with command delete_account 2022-10-30 23:03:26 +03:00
StNicolay 99c24d9917 Added commit statement 2022-10-30 22:57:26 +03:00
StNicolay 2101c302db Added note about ability to copt 2022-10-30 16:53:56 +03:00
StNicolay ac9d89fb3d made login and password easily copyable 2022-10-30 16:37:24 +03:00
StNicolay f6b58df6c4 Properly documented help command 2022-10-30 16:30:00 +03:00