diff options
author | Ben Deutsch <ben@bendeutsch.de> | 2018-08-05 13:13:38 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-08-05 13:13:38 +0200 |
commit | 153fb211ac2342907eb766a79c1f41824f981ab5 (patch) | |
tree | 58a927bbf9a7d3d3811df6a703de02362b6474fb /doc | |
parent | 18368824958139f1428d534082852d778982b4c9 (diff) | |
download | minetest-153fb211ac2342907eb766a79c1f41824f981ab5.tar.gz minetest-153fb211ac2342907eb766a79c1f41824f981ab5.tar.bz2 minetest-153fb211ac2342907eb766a79c1f41824f981ab5.zip |
Replace auth.txt with SQLite auth database (#7279)
* Replace auth.txt with SQLite auth database
Diffstat (limited to 'doc')
-rw-r--r-- | doc/world_format.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/world_format.txt b/doc/world_format.txt index 9b0a1ef07..c5d1d1be1 100644 --- a/doc/world_format.txt +++ b/doc/world_format.txt @@ -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 =================== |