Commit graph

108 commits

Author SHA1 Message Date
f803b1acb4 testcfg: Add genRandomString, which automates away a few cases
... of actual value testing which i won't write manually then! :)

Also implements them on ListUsers
2020-06-15 11:10:37 +02:00
cabe14d41d tests-ListUsers: Remove useless printing to dev/null
Which again allows me to actually debug with print statements.
Dont know which dragon ride gave me the desillusional idea to actually
do it that way
2020-06-15 10:45:08 +02:00
c954940bec tests: Adds verificator-tests & lib: __init__ file
Also more strings to operate on for the tests, obviously.
2020-06-12 13:44:53 +02:00
b4d52b5376 tests: lib.ListUsers tests done
Even more coverage is on it's way. Have still to figure out in which
manner i'm going to test the things i want to.
It's actually not as easy as i expected...
2020-06-09 11:58:39 +02:00
c79edbfc84 tests: backup: Even more! Now with deletion of tested tmp!
Now we also test for everything in backup.py! EVERYTHING!
We even delete the old file that we ourselfs created to test the
export/backup function.
2020-06-09 11:58:15 +02:00
3a6a92267b tests: sample csv files for tests
Enables faster integration of tests.
2020-06-09 10:41:11 +02:00
f201ab603d tests: Add initial infrastructure!
Tests now can be done with `python -m test.test_backup --verbose`!
Im going to add more tests as coverage as soon as i've got time! :)
2020-06-08 15:23:38 +02:00
b8d4dac5da Allow test directories in gitignore 2020-06-08 14:34:40 +02:00
e2c2bcb0c2 import.py: Dont check for users existence while just sanitizing.
This ends the context of commit b4bb45ef85
and 108492db3f with an awesome little
detail, which provides SO MUCH value.
2020-05-30 16:50:49 +02:00
108492db3f private/lib/Validator.py: Further code quality enhancements
Namely:
* f => file_handle
* errstr => err_str
* intendantion adjustements.
* factor out uneccessary if-return-else-return-clause.

Also a new functionality to NOT check for users existence but everything
else. Needed to sanitize in case it's a backup of the current running
instance already. This further adds to commit
b4bb45ef85.
2020-05-30 16:46:30 +02:00
d2f99d95d0 sqlitedb.py: Refactor naming
safequery->safe_query, more snake_case all over the place enforced.
2020-05-30 13:54:03 +02:00
fb620447c7 config_ui: Always point out that the script can operate on the ENV 2020-05-30 12:23:23 +02:00
b4bb45ef85 Import.py: Sanitize given csv in case --Import isnt given and...
... fixup some variable names, also a `pass` that i forget to delete
beforehand.

Also, as you can see in the title, i added the ability to sanitize a
given csv file in case the user didnt supply the --Import flag. Thus, it
isnt required anymore.
2020-05-30 12:17:28 +02:00
aae7504e13 ListUsers.py: Externalize class & rename some variables
This actually makes the whole file easier to read and maintain. I've
still to refactor the output to something.
2020-05-30 09:51:25 +02:00
b5c11455d0 Backup.py -> backup.py, also some PEP conformity-changes
Which also includes two TODO-Tasks.
We had not proven ourselfs worthy of the holy-PEP-construct yet, so we
have to rename the whole file to backu.py, which follows snake_case, and
it's classes members.
They now embrace it as they should've done in the first place!

The dragon which we just encountered isnt as big as we thought and we
can still fight it with our as-easy-as-it-gets task to just snip out the
class and give it it's own residence under lib/backup.py-File!
2020-05-29 12:15:49 +02:00
n1trux
633bfbe5c5 fix that fucking Dockerfile for good, thanks @dark 2020-02-22 14:30:42 +01:00
n1trux
dd5b4043be Merge remote-tracking branch 'origin/pr/4' 2020-02-16 19:40:23 +01:00
n1trux
43a3dd81ac Merge remote-tracking branch 'origin/pr/3' 2020-02-16 18:14:52 +01:00
df1d09a155 Forgot that message. x_X 2019-10-25 10:19:54 +02:00
8008fa36b9 General overhaul, better messages, ordered imports etc 2019-10-25 10:17:39 +02:00
32c6ea7e07 System: Rename aio_register to aio_approve. 2019-10-25 06:49:43 +02:00
8d4d2038d3 Typing support and sqlite3.Row!
Typing will be handy in further development, as well will i settle down
to sqlite3.Row. Fetchall() returns now a list(grr) with
dict-imitating/sumating objects, which you can call keys() on and will
return them, what we now already use for Backups, which comes handy.

Also Typing gives the ability to let the code even more documentate
itself. It's planned to use all over the place but i've to read myself
into it yet more to get started on that one.
It's a step in the right direction!
2019-10-25 03:03:47 +02:00
84508820a6 ListUsers: Implement --user flag, rename --list to --list-asc 2019-10-25 01:57:29 +02:00
b7ffedfba2 Rename SQLitedb to SQLiteDB 2019-10-23 18:13:42 +02:00
fb4b577eb8 minor adjustemenets 2019-10-23 18:12:58 +02:00
f31117e940 System: aio_register, performs all neccessary steps to create user...
BUT will NOT catch ANY exceptions. Therefore the caller script itself is
REQUIRED to catch.
2019-10-23 17:50:13 +02:00
dd01acf801 editUsers: Refactor from System taken 2019-10-23 17:38:43 +02:00
05f27078f6 System: Refactors username given in constructor
deleted all references and added one class which accepts to set a
username
2019-10-23 17:37:59 +02:00
f204a74f98 Refactor some variable names 2019-10-23 17:37:45 +02:00
7ebabbb5f6 EditUsers: Implement --remove flag 2019-10-23 15:02:48 +02:00
b4d4fd9ad4 System: Improved return calls at remove_user 2019-10-23 15:02:21 +02:00
7d5ef3b493 Wording fix in docstring 2019-10-23 15:01:44 +02:00
0eeafa626e Documentation work all over the place
Renamed also some paramters
2019-10-23 14:27:48 +02:00
65c7bb6b3f Move argparser into mains function body 2019-10-22 16:13:57 +02:00
a17d0ed30f ListUsers: UAP and APP => Unapproved and Approved replaced 2019-10-22 15:56:05 +02:00
389b614de9 Revert "ListUsers: UAP and APP renamed, function updates /home/users.txt"
This reverts commit 84cc83db3c.
2019-10-22 15:52:00 +02:00
84cc83db3c ListUsers: UAP and APP renamed, function updates /home/users.txt
On every register() call the System rewrites the /home/users.txt to
reflect currently active users. Will fall apart when something
unexpected happened, but that's @helix responsibility.
2019-10-22 15:47:17 +02:00
452204a5e9 ListUsers: --list sorts all approved users ascending 2019-10-22 15:26:52 +02:00
c46adc2849 editUsers: Description, remove username change and so on 2019-10-22 13:52:41 +02:00
24eee6e84e Shebang/env for script execution 2019-10-22 13:51:01 +02:00
6ea679cb60 System: userdel returns 6 when no maildir is deleted but homedir is
So we agree on that one!
2019-10-22 13:50:14 +02:00
fb9a98fb81 Edit: Did delete, but here it is back!
It can now create users on disk, delete from disk(by changing the
status), change everything that really matters, except the username yet
2019-10-21 18:34:41 +02:00
eb6f3da3d7 System: Account for userdel returning 6 on success...
just because it couldnt delete the users mail.
2019-10-21 18:33:14 +02:00
fb7544bd8c edit: Added Name, email and first steps for status changes 2019-10-21 13:08:00 +02:00
7091cbcbd2 Validator: checkName taken from registration form 2019-10-21 13:07:30 +02:00
786b652b21 update dev environment with disable possiblities 2019-10-20 15:39:55 +02:00
84431bda1d Edit: Sceleton, Interface and first argument
The sceleton for the interface and it's first possible argument are
finished, so a users pbukey can be changed now without touching the DB
itself directly.

Checking for users existence and the presence of options/arguments is
done beforehand and will throw out when nothing useful got delivered to
the script.
2019-10-20 15:25:14 +02:00
7786df3761 System: Introduce function to write just write the auth file 2019-10-20 15:24:11 +02:00
96097e26b1 Catched that little error and killed it! 2019-10-20 15:23:46 +02:00
27e5f0445a Shortcuts to source when working on ssh-reg
Just source the file and you get the aliases for dev_run,
dev_stop(affects containers) and dev_build which rebuilds the ssh-reg
image
2019-10-19 23:04:14 +02:00