-
Notifications
You must be signed in to change notification settings - Fork 2
Default Database
mauricelambert edited this page Feb 16, 2023
·
9 revisions
-
data/users.csv
: Users database for authentication -
data/groups.csv
: Groups database for permissions and access -
data/passwords.csv
: temp passswords share -
data/id
: the last ID for temp passwords share -
data/uploads.csv
: versions and actions of uploaded files -
data/requests.csv
: user requests or reports -
data/rss.csv
: rss feed data
Delimiter is ,
and quote is "
.
The users database columns:
- ID: the unique ID of the user
- name: the unique name of the user
- password: base64 password hash (SHA512 using
hashlib.pbkdf2_hmac
) - salt: Salt for password hash. Generation of 32 random bytes using
secrets.token_bytes(32)
. - enumerations: Enumerations for password hash. Generation of number between: 90000 and 110000 using
90000 + secrets.randbelow(20000)
. - IPs: List of authorized IPs using glob syntax.
- groups: List of group IDs for user permissions and access.
- apikey: The API key for authenticating users using a API client. It is the base64 of 125 random bytes (
base64.b64encode(secrets.token_bytes(125))
).
The groups database columns:
- ID: the unique ID of the group and the permission level
- name: the unique name of the group
The passwords database columns:
- timestamp: The timestamp (a float) of the max time to view the password.
- password: Encrypted password (using XOR, the key and the salt is 60 random bytes using
secrets.token_bytes(60)
) - views: The number of views remaining
- hash: Hexadecimal of the password hash (SHA512 using
hashlib.pbkdf2_hmac
) - iteration: Random integer between 9999 and 15000 using
9999 + secrets.randbelow(5001)
- ID: The unique ID of the password
Passwords are automatically deleted when they expire.
The uploads database columns:
- ID: the action ID (an auto-incremented integer)
- name: the name of the file
- read_permission: permission required to read this file
- write_permission: permission required to write this file
- delete_permission: permission required to delete this file
- hidden: hide file (only admin can see the file), you can read, write and delete the file if you know the name
- is_deleted: status ("deleted" or "exist") (administrators can see deleted files)
- is_binary: state ("binary" or "text")
- timestamp: time of this action (a float)
- user: the "owner" of the file (the user of this action)
- version: the version of the file
The requests database columns:
- ID: the request ID (an auto-incremented integer)
- Time: timestamp of request creation
- UserName: user name used to create the request
- ErrorCode: the HTTP error code page used to create the request
- Page: URL used to create the request
- UserAgent: the UserAgent used to create the request
- Subject: subject of the request
- Reason: reason of the request
- Name: the name of the person creating the request
The RSS database columns:
- guid: Article's ID
- author: Person who have written this article
- title: Article's title
- description: Article's description
- link: Link to read the full article
- categories: Categories for this article
- pubDate: Publication date
- comments: Comments for this article
users.csv
ID,name,password,salt,enumerations,IPs,groups,apikey
0,Not Authenticated,,,,*,0,
1,Unknow,,,,*,"0,1",
2,Admin,pZo8c8+cKLTHFaUBxGwcYaFDgNRw9HHph4brixOo6OMusFKbfkBEObZiNwda/f9W3+IpiMY8kqiFmQcbkUCbGw==,c2FsdA==,1000,"192.168.*,172.16.*,10.*,127.0.*","50,1000",AdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdminAdmin
groups.csv
ID,name
0,Not Authenticated
1,Unknow
50,User
500,Developers
750,Maintainers
1000,Administrators
To reset it:
python3 scripts/account/modules/manage_defaults_databases.py