Commit Graph

104 Commits (c79edbfc84a06df9216e3c4a7ea0272affaa7937)
 

Author SHA1 Message Date
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
Darksider3 c1488f6164 Return True on success 5 years ago
Darksider3 cd8fe5fed0 commit on querys 5 years ago
Darksider3 0718de20fb Let SQLite check for incorrect dates on timestamp row 5 years ago
Darksider3 2202af7826 Introduce imports, which comes with a new flag(--Import)
--Import depends on --file being present pointing to a valid CSV-file
that contains unique users with id's. When a user already exists
with his id, the script will fail.
It is also Backup.py-only which is reflected in the help message
5 years ago
Darksider3 c28e616ea5 Faster rebuildung by moving system relevant stuff up 5 years ago
Darksider3 e0efeee67d Better error handling, just hang a freakin' / to ssh_dir if it got screwed up 5 years ago
Darksider3 04d95c2d08 realign layout 5 years ago
Darksider3 43c7636920 Make PEP8 finally happy 5 years ago
Darksider3 290e72f159 Add various documentation to the System class and sqlitedb-Class...
... which are all written in rst-format, which sphynx understands and has
an own formal specification in  http://docutils.sourceforge.net/rst.html
5 years ago
Darksider3 d413662b36 Adds ability to delete users in db as well as on the system + type hints..
.... in function names for further documentation.
5 years ago
Darksider3 a6d63fee42 PEP8: One Import per line... -.-
Add TODO statements and foremost return False on error. Missed that
5 years ago
Darksider3 c43cad73fa Print Error messages to stderr instead of standard-out. Makes very much sense indeed! 5 years ago
Darksider3 89faf57b58 System: Still a lot @TODO here, but add it. Should(TM) work, but didn't
test it yet and also have to do a whole lot more. e.g. write out in dry-mode
which commands are getting to run in serious-mode but build up together
correctly in the correct order
5 years ago
Darksider3 2afb4c79a2 Implements a backup to csv. Uses StringIO because it has an own writer()
method, which is pretty nice to have when csv.writer() want's that on its
passed variable.

Also respects every flag yet introduced(-c, -f, -a, -u) and reuses the code
already written in ListUsers.py. It could be very nice to bring that code
into lib/ because it is probably needed way more often
5 years ago
Darksider3 90b2ee5236 add gitignore 5 years ago
Darksider3 a984b14c37 Implement -f/--file option. Defaults to stdout 5 years ago
Darksider3 4134e3cc2e introduces -f/--file, which outputs or takes from a file(conditional to the current program) 5 years ago
Darksider3 6e86bf11bb -a Flag: default false, do action on only approved users 5 years ago
Darksider3 c40ef4d40a Max username length is 16 now 5 years ago
Darksider3 cab4cd25a2 Well, that alternative view rocks hard... 5 years ago
Darksider3 b368ea058c huh, that already looks close to good... o.o 5 years ago
Darksider3 f06d4fa945 first steps towards real listings! 5 years ago
Darksider3 3915843943 introducing the -u flag, which turns on the 'unapproved' mode.
Oh, and just testing it in ListUsers.py :)
5 years ago
Darksider3 2eeeebdacb Add sceleton for listusers.py 5 years ago
Darksider3 96837cebe3 Externalize CFG-Handling into lib/CFG.py.
Never write this code again!
5 years ago
Darksider3 8ed215e89b Create sqlite3 connector class to handle all the errors and quirks for us 5 years ago
Darksider3 c4912502d7 Now with dynamic TILDE_CONF support! 5 years ago
Darksider3 79fb448f30 pep8-changes like before mostly 5 years ago
Darksider3 4d353e6804 Some PEP8 conform changes, noteably line breaks and too long lines and indendantion 5 years ago
phre4k d79e06a70e Merge branch 'master' of dark/ssh-reg into master 5 years ago
Darksider3 a772fa9d40 Create /app/user/.ssh before trying to write to it! 5 years ago
darksider3 4079166167 Respect $TILDE_CONF ENV in container build 5 years ago
darksider3 e00e587fac Reflect changes made 5 years ago