84 Commits (8d4d2038d3ac5305847f27a4e2348ab07b8e413b)
 

Author SHA1 Message Date
Darksider3 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!
5 years ago
Darksider3 84508820a6 ListUsers: Implement --user flag, rename --list to --list-asc 5 years ago
Darksider3 b7ffedfba2 Rename SQLitedb to SQLiteDB 5 years ago
Darksider3 fb4b577eb8 minor adjustemenets 5 years ago
Darksider3 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.
5 years ago
Darksider3 dd01acf801 editUsers: Refactor from System taken 5 years ago
Darksider3 05f27078f6 System: Refactors username given in constructor
deleted all references and added one class which accepts to set a
username
5 years ago
Darksider3 f204a74f98 Refactor some variable names 5 years ago
Darksider3 7ebabbb5f6 EditUsers: Implement --remove flag 5 years ago
Darksider3 b4d4fd9ad4 System: Improved return calls at remove_user 5 years ago
Darksider3 7d5ef3b493 Wording fix in docstring 5 years ago
Darksider3 0eeafa626e Documentation work all over the place
Renamed also some paramters
5 years ago
Darksider3 65c7bb6b3f Move argparser into mains function body 5 years ago
Darksider3 a17d0ed30f ListUsers: UAP and APP => Unapproved and Approved replaced 5 years ago
Darksider3 389b614de9 Revert "ListUsers: UAP and APP renamed, function updates /home/users.txt"
This reverts commit 84cc83db3c.
5 years ago
Darksider3 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.
5 years ago
Darksider3 452204a5e9 ListUsers: --list sorts all approved users ascending 5 years ago
Darksider3 c46adc2849 editUsers: Description, remove username change and so on 5 years ago
Darksider3 24eee6e84e Shebang/env for script execution 5 years ago
Darksider3 6ea679cb60 System: userdel returns 6 when no maildir is deleted but homedir is
So we agree on that one!
5 years ago
Darksider3 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
5 years ago
Darksider3 eb6f3da3d7 System: Account for userdel returning 6 on success...
just because it couldnt delete the users mail.
5 years ago
Darksider3 fb7544bd8c edit: Added Name, email and first steps for status changes 5 years ago
Darksider3 7091cbcbd2 Validator: checkName taken from registration form 5 years ago
Darksider3 786b652b21 update dev environment with disable possiblities 5 years ago
Darksider3 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.
5 years ago
Darksider3 7786df3761 System: Introduce function to write just write the auth file 5 years ago
Darksider3 96097e26b1 Catched that little error and killed it! 5 years ago
Darksider3 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
5 years ago
Darksider3 710ceacd7c Breaking up the code smell regarding the CFG.py!
It began smelling already but having some duplicate code across the
interfaces is still better than having all of it all over the place.

It enables to write specific flags which are nice to have. For example,
Import.py requires the --Import flag because it WANTS the user to read
the whole Help before it acts actually as an importer. When the user
supplies something they should know what's currently happening.

Also removes the hardcoded dependency on lib.CFG-Calls from most calls
which was already embarassingly present. Introduced some db and
cfg-variables which doesnt clutter anything but suck much less.

In future we provide a set of default arguments and a bare minimum -
config_ui as the bare minimum, default as the full blown storm.

This is rather big because it also patches several other smells
including a bug where a user from the db wouldnt be reported as existent
5 years ago
Darksider3 934b6bf75a Factor out 'as CFG' 5 years ago
Darksider3 670aa3d9c3 Factor out CONF_FILE 5 years ago
Darksider3 cdc72a30f4 Factor out REG_FILE 5 years ago
Darksider3 77efb4b339 delete cfgparse again and get it going as it where before 5 years ago
Darksider3 8c3ac4060f Split CFG.py to private/lib/cfgparse.py 5 years ago
Darksider3 192e70e4a2 Seperate out even more, own dir for UIs
default UI is now in private/lib/uis/default.py
5 years ago
Darksider3 5c6ecaf627 Modularize CFG.py into CWD, default_cmd and cmd ui 5 years ago
Darksider3 5a57a62780 Allow uppercase Chars afters first character in usernames 5 years ago
Darksider3 91b5e6ae7b Positional fix: OperationalError before general 5 years ago
Darksider3 77a31a44d1 Abort on errors in import file before even trying to activate
Moves every check regarding the imported file outside of import.py into
the validator. Also removes every follow-up checks regarding it out of
import.py.

Looks a whole lot cleaner now!
5 years ago
Darksider3 2ab27aa019 Validate Timestamps and don't not insert into DB when error
Validates now the timestamp in the import.py, doesn't insert users into
the sqlite-database before creating the systems account and checks now
for existence in the database too(unapproved users, who comes first,
gets his name first..)
5 years ago
Darksider3 3ae497e2eb Let the container stop gracefully with exec!
Right now the container can't stop gracefully because the sshd-server
runs on the server as PID 0. This results in the docker daemon not
killing it but waiting for it to die, which never happens, and results
in the default timeout-wait before it KILLS the process. With exec, the
sshd becomes PID 1 and can receive and process signals(probably SIGTERM
here) and handles them as well. The container stops now nearly
instantly..
5 years ago
Darksider3 b0856b558e Move import related stuff to the Import.py script.
and delete occurences in Import It is much tidier to look at and
doesn't clutter the Script. Is even a whole seperate task
so it does make no sense to call it in Backup when i think about it.
5 years ago
Darksider3 283143104d Actually we allow currently strange things, this fixes it on the usernames 5 years ago
Darksider3 d517db3b2a On Operational Exceptions we create the table and try again
this could potentially result in a endless recursion when the
table isnt writeable and a lot other funny things happen
but normally and in 99,999999999% of our cases this
is totally fine
5 years ago
Darksider3 a1563116f6 Renamed SSH-Exception 5 years ago
Darksider3 0c1f7ea252 Validate even imported files and users
Created a new file for the validation functions, should be soon(TM) used too
in the userapplication-script but dont hurry
5 years ago
Darksider3 8274cbb27e unregister() is just a different word for removing 5 years ago
Darksider3 4760e35fda it's freakin stupid to import IDs. Nothing depends on them. Ignore them. 5 years ago
Darksider3 96c403a3d9 Introducing own Exception classes to distinguish between possible System errors 5 years ago