[Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx]

User avatar
sorcerykid
Member
Posts: 1282
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by sorcerykid » Post

Thanks for the debug output. I see what is happening now. The database is being read in binary mode, however the awk script is writing the database as a text file. Windows treats text files differently than binary files. So a quick fix is to edit the convert.awk script as follows:

Insert the following line of code immediately after BEGIN { on line 22:

Code: Select all

     ORS = "\n";
Now run the convert.awk script just as you did before, and this time the files should be correctly generated.

Sorry about the confusion. I'm not sure why I settled on binary mode in the first place :-/ I think it's a holdover from the builtin auth handler of Minetest. Since I tested the awk scripts on Linux, I admittedly didn't catch this bug.

lilo
Member
Posts: 54
Joined: Sat May 27, 2017 14:45

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by lilo » Post

Hi,

i have now an working Auth mod :) but when i use "/auth", my server will crash:

Code: Select all

2019-03-02 19:39:42: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'auth_rx' in callback on_chat_message(): ...4.17.1-win64 Servertest\bin\..\mods\auth_rx/commands.lua:734: attempt to call field 'create_form' (a nil value)
2019-03-02 19:39:42: ERROR[Main]: stack traceback:
2019-03-02 19:39:42: ERROR[Main]: 	...4.17.1-win64 Servertest\bin\..\mods\auth_rx/commands.lua:734: in function 'func'
2019-03-02 19:39:42: ERROR[Main]: 	....1-win64 Servertest\bin\..\builtin\game\chatcommands.lua:30: in function <....1-win64 Servertest\bin\..\builtin\game\chatcommands.lua:9>
2019-03-02 19:39:42: ERROR[Main]: 	...4.17.1-win64 Servertest\bin\..\builtin\game\register.lua:420: in function <...4.17.1-win64 Servertest\bin\..\builtin\game\register.lua:400>
I'm kind of out of luck with these things. :/

greets

User avatar
sorcerykid
Member
Posts: 1282
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by sorcerykid » Post

No worries. Both chat commands require the ActiveFormspecs mod, which is listed as a dependency in the first post:

https://content.minetest.net/packages/s ... formspecs/

For the next release, I'll be sure to provide the above link in the readme file so there's no confusion. I've also made note to improve exception handling, so the server doesn't crash in these situations (the /fdebug command already has a sanity check) and also to fix the conversion scripts so they are Windows compatible and easier to use :) Thanks for bringing these issues to my attention!

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by bosapara » Post

Have the same problem as lilo, but adding ORS = "\n"; to convert.awk can't help.

Any advices?

Image

User avatar
sorcerykid
Member
Posts: 1282
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by sorcerykid » Post

It appears that this is still related to the discrepancy with line-endings. I can see that the error is occurring during validation of the database header. Either that, or else the awk conversion script is not generating the correct database header. I admittedly didn't test the awk script on Windows. So it may be a simple oversight on my part.

Ultimately, I plan to switch Auth Redux to text-mode rather than binary-file handling. But in the more immediate term, I'll try to get a hot fix together for Windows users that resolves this issue once and for all. Thanks for bringing this to my attention.

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by bosapara » Post

Database header added successfuly as we can see. Added screen of line-endings bellow, maybe this is the issue.

Image

User avatar
sorcerykid
Member
Posts: 1282
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by sorcerykid » Post

If you would be so kind as to share the sequence of commands you issued from the command line as well as the debug log output, that would better help for me to diagnose the problem. If there's any sensitive information, you can feel free to PM me instead.

Many thanks!

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx

by bosapara » Post

Let it be in public, possibly will help to another players to install it.

All commands from CMD:

Code: Select all

C:\Users\pirozhok>cd Users

C:\Users\pirozhok\Users>awk -f convert.awk -v mode=install auth.txt
Installing the required journal and ruleset files...
Converting auth.txt...
Done! 142603 of 142603 total records were imported to auth.db (0 records skipped).

C:\Users\pirozhok\Users>
Info from minetest debug:

Code: Select all

2020-02-01 14:18:16: ACTION[Main]: Reading authentication data from disk...
2020-02-01 14:18:16: ERROR[Main]: Invalid header in authentication database.
2020-02-01 14:18:16: ERROR[Main]: ModError: Failed to load and run script from F:\0.4.16\main\bin\..\mods\auth_rx\init.lua:
2020-02-01 14:18:16: ERROR[Main]: F:\0.4.16\main\bin\..\mods\auth_rx/db.lua:197: Fatal exception in AuthDatabase:reload( ), aborting.
2020-02-01 14:18:16: ERROR[Main]: stack traceback:
2020-02-01 14:18:16: ERROR[Main]: 	[C]: in function 'error'
2020-02-01 14:18:16: ERROR[Main]: 	F:\0.4.16\main\bin\..\mods\auth_rx/db.lua:197: in function 'db_reload'
2020-02-01 14:18:16: ERROR[Main]: 	F:\0.4.16\main\bin\..\mods\auth_rx/db.lua:271: in function 'connect'
2020-02-01 14:18:16: ERROR[Main]: 	F:\0.4.16\main\bin\..\mods\auth_rx\init.lua:141: in main chunk
2020-02-01 14:18:16: ERROR[Main]: Check debug.txt for details.

User avatar
sorcerykid
Member
Posts: 1282
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Auth Redux v2.14 (Authentication Handler) [auth_rx]

by sorcerykid » Post

Great news! My PR #9574 was just merged this morning. That means it will be possible to accurately track successful logins in the database, rather than resorting to awkward workarounds. This will definitely help with state-based ruleset filters.

I'll try to get an update ready in the next few weeks with support for these new features!

Post Reply

Who is online

Users browsing this forum: thomz92 and 1 guest