unattended installation
Hello,
where can I find the documentation about the config.auth.user.php file format ?
I need it to be able to automate the installation of PML.
Thanks!
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by potsky on Jan 02, 2016 @ 06:47 PM
Hello,
there will be an API I hope in 2016 ! But for the moment, here is the basic format of the
auth
file (all auth functions are in the classSentinel
in fileinc/Sentinel.php
:And here are the explanations :
Always copy this line as it to avoid people access directly the json file.
The
generated
key is the timestamp of the creation date of the auth file.This is a random key which will be used as salt when hashing password. If you change it when users have already been created, their password will not work anymore.
The list of logs (file ids) accessible anonymously
The list of users where keys are usernames and values are the user object.
The first user is
potsky
. The username is the key of the user object.A list of roles. Supported roles are now
user
oradmin
. No need to set an admin as a user too.The user password hash encoded with this formula :
sha1( $security . $username . $generated . $password )
This array lists all log files accessible by the user. Here is an other example with a user and not an admin :
The only supported value now is
r
forread
.The creation date timestamp.
cb
is forcreated by
. This is the username of the user who has created the current user. System isnull
. You can set all values tonull
.This is the access token
Presalt for this user, postsalt is the instance security token
Do not set this value when creating a user.
Do not set this value when creating a user.
Do not set this value when creating a user.
If you want to use PHP to create the authentication file and users, it is easier :
create
method to create the authentication filesetUser($username , $password)
method to create a usersetAdmin($username , $password)
method to create an adminFor example :
Tell me if it works !
2 Posted by Pietro on Jan 05, 2016 @ 10:45 PM
Thanks a lot for the very clear explaination.
it worked as well with some minor changes:
<?php
include 'inc/global.inc.php'; include 'inc/classes/Sentinel.php'; Sentinel::init(); Sentinel::create(); Sentinel::setAdmin('admin','pass'); Sentinel::save(); ?>
Support Staff 3 Posted by potsky on Jan 06, 2016 @ 08:13 AM
Nice!
potsky closed this discussion on Jan 06, 2016 @ 08:13 AM.
Pietro re-opened this discussion on Jan 13, 2016 @ 01:05 AM
4 Posted by Pietro on Jan 13, 2016 @ 01:05 AM
Here: https://github.com/pbertera/dockerfiles/tree/master/SyslogServer
you can find a Docker container with rsyslog and PML.
Thanks,