Commit Graph

588 Commits

Author SHA1 Message Date
Iain Powrie
18ab2cd76d Drop to less permissive mask for bedrock imports
`Owner` of the file (which should be us) can r-w-e
`Group` of the file can r-w
`World` can do nothing. 

Sticky bit is still set.
2022-06-03 11:42:20 +00:00
Andrew
98b364cd3e Fix support logs validation 2022-06-02 08:57:36 -04:00
Andrew
5970895268 Fix resetting api_key 2022-06-02 08:23:28 -04:00
Andrew
fae4ff12ea Fix general user support logs 2022-06-02 08:23:18 -04:00
Andrew
50872e2bb5 Remove active tasks when server is deleted 2022-06-02 07:34:34 -04:00
Andrew
f2dec0c52b Reset secret key on fresh start when db dumped 2022-06-02 07:33:43 -04:00
Andrew
ec730a1694 Merge branch 'bug/pretzel-support-log-temp-cleanup' into 'dev'
Cleanup temp dirs on support log creation

See merge request crafty-controller/crafty-4!286
2022-06-01 22:33:52 +00:00
Andrew
ea2dd5b78f Add self to parameters for non-static function 2022-06-01 18:31:31 -04:00
Andrew
5d3badef2c Cleanup temp dirs on support log creation 2022-06-01 17:54:58 -04:00
Silversthorn
9e4c8e99b1 Merge branch 'dev' into dev-StatsDBImprovement 2022-06-01 23:52:49 +02:00
Andrew
9864cecff1 Merge branch 'experimental/lukas-codebase-improvements' into 'dev'
Lukas's codebase improvements

See merge request crafty-controller/crafty-4!277
2022-06-01 20:22:47 +00:00
luukas
89b6e239bc
Merge branch 'dev' into experimental/lukas-codebase-improvements 2022-06-01 22:35:11 +03:00
Andrew
28ffbe4627 Remove unnecessary pass 2022-06-01 15:20:16 -04:00
Andrew
3946a926bf Remove print statement 2022-06-01 15:17:13 -04:00
Andrew
fdc88451b9 Add exception for permissions in helpers check 2022-06-01 15:11:37 -04:00
Zedifus
de96844276 Remove useless return from a_backup_server
(Pylint R1711)
2022-06-01 18:34:04 +01:00
Zedifus
256c6567fd Remove temporary directory on backup completion
When running backups, the temporary directory wasn't being properly removed.
Added logic to remove the temporary directory upon backup completion,
cleaned up the try/except a bit.
2022-06-01 18:28:24 +01:00
luukas
e0b0e52bd5
Add stdin route for the API 2022-05-31 00:11:17 +03:00
Silversthorn
ec2d967419 Fixing Commands to server 2022-05-30 22:49:42 +02:00
Silversthorn
150e8e5794 Renaming Server in shared to ServerInstance 2022-05-30 22:40:34 +02:00
Silversthorn
8f5c688b72 Fixing Pylint issues 2022-05-30 19:28:39 +02:00
luukas
290c398198
Add command queue stdin commands back 2022-05-30 18:23:37 +03:00
Silversthorn
37bda32164 Fixing moved functions calls 2022-05-30 07:36:25 +02:00
luukas
7885b2c8f7
Fix null writer 2022-05-28 21:11:09 +03:00
luukas
0df5fedf2b
Add try-excepts for host stats 2022-05-28 19:32:54 +03:00
luukas
d1beb2f125
Redirect stderr to null during psutil's import.
On some systems /proc might be unavailable and psutil would freak out
printing several exceptions to stderr but strangely not raising the
exceptions for upper scope to handle
2022-05-28 19:00:25 +03:00
Silversthorn
3b4253de9b Fixing get_authorized_server 2022-05-26 23:19:59 +02:00
Silversthorn
99b28efd33 Merge branch 'dev' into dev-StatsDBImprovement 2022-05-26 15:39:52 +02:00
Silversthorn
be1930c7c7 fixing server shutdown gracefull exit 2022-05-26 15:28:54 +02:00
Silversthorn
2b484d5a07 fixing download jar 2022-05-26 15:20:21 +02:00
Silversthorn
056856cf98 Fixing Helpers issue 2022-05-26 15:02:47 +02:00
Silversthorn
8423cc24c1 I'm breaking/fixing stuff 2022-05-26 14:50:20 +02:00
Andrew
b0b9936df7 Merge branch 'bugfix/stats-db-select' into 'dev'
Get rid of the stats database proxy

See merge request crafty-controller/crafty-4!276
2022-05-25 18:29:23 +00:00
Andrew
b293164e12 Add crash detection to realtime stats 2022-05-25 14:26:13 -04:00
luukas
3956d9c699
Remove stdin sending from command_watcher
Reasons:
* It's unused in our program
* It can be a start to security vulnerabilities.
  I've seen many routes add commands to `Commands` without validation.
2022-05-25 17:44:09 +03:00
Silversthorn
5a1353373a trying something new 2022-05-25 15:54:35 +02:00
luukas
ca450f21ed
Document set_passwd and threads prompt commands
Help messages:
set_passwd: Set a user's password. Example: set_passwd admin
threads: Get all of the Python threads used by Crafty
2022-05-25 16:25:49 +03:00
luukas
8e13b4e11d
Simplify helpers setting methods 2022-05-25 16:21:34 +03:00
luukas
4e84eee5a5
Rename server stats variables to server_stats 2022-05-25 16:15:51 +03:00
luukas
83018c6860
Calculate the min stats date with timedelta
This is more correct than just using days.
I've also tested this working in a completely separate Peewee project.
2022-05-25 16:14:42 +03:00
luukas
a937a94ac8
Use a better variable name for stat disappear date
* Rename occurences of `last_week` with `minimum_to_exist`
2022-05-25 14:49:17 +03:00
luukas
0d62223982 Merge branch 'dev' into bugfix/api-v2-bugfixes 2022-05-23 20:20:49 +03:00
luukas
8f8b2aa22f
Simplify MainPrompt.emptyline. 2022-05-21 02:04:03 +03:00
luukas
b49bca3279
Use a tab character in the threads prompt command
https://i.imgur.com/jy0Rlgm.png
2022-05-21 01:57:40 +03:00
luukas
b724fc500d
Improve the startup process 2022-05-21 01:53:17 +03:00
luukas
eff7aefb6e
Use local date and time formatting for Console 2022-05-21 01:41:48 +03:00
luukas
02f5318f76
Merge branch 'dev' into merge/pretzel-lukas-cleanup-nosquash 2022-05-20 22:04:41 +03:00
luukas
dba3fafa87
Use shorthand for Controller.check_system_user
This reduced the code from 4 lines to 1 line.

The code
    if <condition>:
        return True
    else:
        return False
can be shortened to
    return <condition>
2022-05-20 13:31:30 +03:00
luukas
48948423c9
Fix various things in create_api_server 2022-05-20 01:33:02 +03:00
luukas
7a7c7501e6 Use relative path for latest.log 2022-05-19 17:27:36 +03:00
luukas
87085cec3c Fix an IndexError in get_lang_page 2022-05-19 01:10:06 +03:00
Andrew
b7780682d5 Merge branch 'dev' into 'merge/api-v2'
# Conflicts:
#   app/classes/controllers/crafty_perms_controller.py
2022-05-18 21:56:39 +00:00
amcmanu3
d235d0b70b Add error for no user 2022-05-18 17:37:07 -04:00
amcmanu3
49965bf31f Add explaination to password fail. 2022-05-18 17:22:39 -04:00
luukas
559a345f25 Merge branch 'dev' into merge/api-v2 2022-05-18 01:49:19 +03:00
amcmanu3
e12814d0b0 Appease the linter 2022-05-17 16:01:37 -04:00
luukas
821ed7ef5d Make get_server_obj raise an error
Reason being: There is nothing that checks if it returns False
2022-05-17 21:43:15 +03:00
luukas
42af86b6f7 Merge branch 'dev' into experimental/lukas-cleanup 2022-05-17 21:21:47 +03:00
amcmanu3
a2b711b5ac Add password reset to Crafty Console 2022-05-16 15:39:10 -04:00
luukas
e7e337bea1 Improve the start_server function 2022-05-16 18:16:04 +03:00
Andrew
7d8515321b Revert bad changes for schedules 2022-05-15 15:59:55 -05:00
Andrew
4f6a90eb6a Remove unused import 2022-05-15 14:05:23 -05:00
Andrew
490fc86d4e Cleanup server schedule on delete 2022-05-15 14:00:24 -05:00
Andrew
e161e2cf0b Add cleanup method for server stats on delete 2022-05-15 13:28:02 -05:00
Andrew
0f19c0c787 Realtime server stats all the time 2022-05-15 13:16:28 -05:00
Andrew
984f4cc4d6 Change Files Aesthetic 2022-05-15 12:38:48 -05:00
luukas
930c6936d9 Add more advanced role APIs 2022-05-10 02:08:49 +03:00
luukas
721c9cfe12 Add the server creation endpoint 2022-05-05 14:02:23 +03:00
luukas
53459d83dc Merge branch 'feature/api-v2' into merge/api-v2 2022-05-05 03:32:09 +03:00
Silversthorn
16bbac7fd6 Moving Server Stats DB to Server Folder 2022-04-28 22:40:15 +02:00
Andrew
77bbde149a Fix fresh install side effects from DB rework 2022-04-17 13:27:00 -04:00
Andrew
fc1304d729 Fix file size bug when destination does not exist 2022-04-17 13:00:05 -04:00
Andrew
704ffc2742 Fix file unzip 2022-04-14 20:03:19 -04:00
luukas
1aa0d65cf7 Merge branch feature/external-frontend to feature/api-v2 without the frontend 2022-04-14 15:33:53 +03:00
Zedifus
92c8fc04f3 Refactor to standardize class/variable naming 2022-04-14 03:10:25 +01:00
Andrew
ed60e55ffe Add try catch around process kill 2022-04-12 21:52:53 -04:00
Andrew
64d2e5fedd Appease the linter 2022-04-12 19:54:35 -04:00
Andrew
e555274409 Add critical log message for None Backup path 2022-04-12 19:27:18 -04:00
Andrew
73b3571606 Appease the linter 2022-04-12 19:22:57 -04:00
Andrew
316d0aa17a Fix error thrown on task execution 2022-04-12 18:57:18 -04:00
Andrew
705da450e7 Fix bug where roles could not be deleted. 2022-04-12 17:58:59 -04:00
Andrew
ec6421b62c Disable Backups when no path 2022-04-12 17:37:20 -04:00
computergeek125
d417950eae fix fstrings, refactored console to static 2022-04-11 20:34:46 -05:00
Zedifus
19f2429a4c Fix formatting to comply with Black 2022-04-11 11:08:36 +01:00
computergeek125
42ca4bb973 Refactored the yes to not pass objects in import
Merge Conflicts ᴙ Us
2022-04-11 00:23:55 -05:00
computergeek125
119c34535c Removed fn, reduced queries in login flow 2022-04-10 17:46:07 -05:00
amcmanu3
711d415335 Remove queue 2022-04-10 18:04:16 -04:00
Andrew
b1ed9ba2bd Add API routes from 3.x
Enhance security for permissions on API requests
Fix bug where server permissions and crafty permissions were flipped upon making a new token
Fix bug where new secret key would be created every time Crafty was started.
Fix bug where DB locks will occur with concurrent writes to the DB.
2022-04-10 19:39:31 +00:00
Zedifus
db70f9ae20 Fix W0221 emptyline override
Package advises override, see !233 for doc reference.
2022-04-02 02:49:48 +01:00
Andrew
822a3707b2 Add sleep to realtime - Reduce CPU load. 2022-03-26 19:10:04 -04:00
Zedifus
09bba7fdb0 Further fix files to conform with Black pylintrc
Mostly just breaking up strings and comments into new lines
Some strings dont require 'f' but keeping in for readability
with the rest of the concatinated string
2022-03-23 06:16:22 +00:00
Zedifus
2a512d7273 Fix files to conform with new Black pylintrc
Mostly just breaking up strings and comments into new lines
Some strings dont require 'f' but keeping in for readability
with the rest of the concatinated string
2022-03-23 06:06:13 +00:00
Zedifus
e06fe8a52a Black codebase
Apply black formatting to codebase
2022-03-23 02:50:12 +00:00
xithical
4177ca882c Put encoding arg in its proper location for maximum linter appeasal 2022-03-20 12:19:11 -05:00
xithical
1279784cc7 Appease the linter again 2022-03-20 12:14:51 -05:00
xithical
bf6d0d0368 Appease the linter 2022-03-20 12:01:14 -05:00
xithical
cda7b59a12 Fix how memory args are passed in importing from 3 2022-03-18 23:06:04 -05:00
_iEpic
4af62cbaca Added basic Import functions 2022-03-18 23:59:10 -04:00
xithical
4c14b58a2a Add user importing from 3 - servers to be added 2022-03-18 21:55:39 -05:00
Iain Powrie
ccd0bc8e8f Merge branch 'dev-BetterCertsGeneration' into 'dev'
Adding Subject Alt Names in certificate

See merge request crafty-controller/crafty-commander!209
2022-03-16 09:49:17 +00:00