mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Replace auth.txt with SQLite auth database (#7279)
* Replace auth.txt with SQLite auth database
This commit is contained in:
parent
1836882495
commit
153fb211ac
19 changed files with 1153 additions and 82 deletions
|
@ -29,6 +29,7 @@ It can be copied over from an old world to a newly created world.
|
|||
|
||||
World
|
||||
|-- auth.txt ----- Authentication data
|
||||
|-- auth.sqlite -- Authentication data (SQLite alternative)
|
||||
|-- env_meta.txt - Environment metadata
|
||||
|-- ipban.txt ---- Banned ips/users
|
||||
|-- map_meta.txt - Map metadata
|
||||
|
@ -62,6 +63,34 @@ Example lines:
|
|||
- Player "bar", no password, no privileges:
|
||||
bar::
|
||||
|
||||
auth.sqlite
|
||||
------------
|
||||
Contains authentification data as an SQLite database. This replaces auth.txt
|
||||
above when auth_backend is set to "sqlite3" in world.mt .
|
||||
|
||||
This database contains two tables "auth" and "user_privileges":
|
||||
|
||||
CREATE TABLE `auth` (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`name` VARCHAR(32) UNIQUE,
|
||||
`password` VARCHAR(512),
|
||||
`last_login` INTEGER
|
||||
);
|
||||
CREATE TABLE `user_privileges` (
|
||||
`id` INTEGER,
|
||||
`privilege` VARCHAR(32),
|
||||
PRIMARY KEY (id, privilege)
|
||||
CONSTRAINT fk_id FOREIGN KEY (id) REFERENCES auth (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
The "name" and "password" fields of the auth table are the same as the auth.txt
|
||||
fields (with modern password hash). The "last_login" field is the last login
|
||||
time as a unix time stamp.
|
||||
|
||||
The "user_privileges" table contains one entry per privilege and player.
|
||||
A player with "interact" and "shout" privileges will have two entries, one
|
||||
with privilege="interact" and the second with privilege="shout".
|
||||
|
||||
env_meta.txt
|
||||
-------------
|
||||
Simple global environment variables.
|
||||
|
@ -107,6 +136,7 @@ Example content (added indentation and - explanations):
|
|||
readonly_backend = sqlite3 - optionally readonly seed DB (DB file _must_ be located in "readonly" subfolder)
|
||||
server_announce = false - whether the server is publicly announced or not
|
||||
load_mod_<mod> = false - whether <mod> is to be loaded in this world
|
||||
auth_backend = files - which DB backend to use for authentication data
|
||||
|
||||
Player File Format
|
||||
===================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue