Page 2 of 3

Re: How to start a server with authentication?

Posted: Sun Jun 02, 2019 9:20 pm
by Corbeau
cazfi wrote:
Corbeau wrote:File: GT0_auth.conf (755) in the same directory. Content:

Code: Select all

[fcdb]
backend="sqlite"
database="$HOME/games/GT0/game.sqlite"
It's not a shell script! Freeciv does not know that by "$HOME" you mean value of the environment variable HOME.
I had all the same problems when it was "~". <--- this is supposed to be "tilde", it seems the forum doesn't show it properly

Anyway, problem(s) solved by other means. Madmax utilised the LT scripts so now everything is working.

But now I have another qiestion. Is it possible to reset a player's password? For example, when the game starts, it could happen that someone else, and not the pre-signed-up player, joins first and takes over someone else's nickname. What can be done in such cases?

Re: How to start a server with authentication?

Posted: Sun Jun 02, 2019 9:30 pm
by cazfi
Corbeau wrote:
cazfi wrote:
Corbeau wrote:File: GT0_auth.conf (755) in the same directory. Content:

Code: Select all

[fcdb]
backend="sqlite"
database="$HOME/games/GT0/game.sqlite"
It's not a shell script! Freeciv does not know that by "$HOME" you mean value of the environment variable HOME.
I had all the same problems when it was "~".
It doesn't parse that either. It would be looking for directory literally named "$HOME" or "~"

Re: How to start a server with authentication?

Posted: Sun Jun 02, 2019 9:35 pm
by cazfi
Corbeau wrote:But now I have another qiestion. Is it possible to reset a player's password? For example, when the game starts, it could happen that someone else, and not the pre-signed-up player, joins first and takes over someone else's nickname. What can be done in such cases?
You need to modify the database by sqlite3 -command. Requires some knowledge of SQL. I can try to write more detailed instructions in a couple of days.

Re: How to start a server with authentication?

Posted: Sun Jun 02, 2019 9:50 pm
by Corbeau
Actually, I had a look and there seem to be some GUI tool for managing SQLs. Being a complete amateur, I will make a wild guess that doing very simple tasks would be very simple. For example, "resetting a password" would simple mean deleting the password entry in the database? Am I being too simple?

Re: How to start a server with authentication?

Posted: Mon Jun 03, 2019 5:31 pm
by cazfi
Corbeau wrote:For example, "resetting a password" would simple mean deleting the password entry in the database? Am I being too simple?
Freeciv adds password only in user creation, so you can't clear password entirely from an existing user hoping for user to be able to enter a new one, but you can change the password. Or rather its md5 hash that is what is stored in the database instead of an cleartext password.

Code: Select all

> echo -n "MyNewPassword" | md5sum

Re: How to start a server with authentication?

Posted: Mon Jun 03, 2019 7:06 pm
by Corbeau
Let's put it this way.

When a game is created, there is a database where usernames and passwords are stored. So, what is the state of the database after the game is created and before the user logs in for the first time to create his password?

Re: How to start a server with authentication?

Posted: Mon Jun 03, 2019 7:44 pm
by cazfi
Corbeau wrote:So, what is the state of the database after the game is created and before the user logs in for the first time to create his password?
I don't know about longturn.net implementation (where users exist prior to server start), but in standard freeciv entire user entry (both username and password) get created when user logs in for the first time for a server that is started with -Newusers commandline parameter.

Re: How to start a server with authentication?

Posted: Mon Jun 03, 2019 8:20 pm
by Corbeau
What happens if there is no -Newusers parameter?

Re: How to start a server with authentication?

Posted: Mon Jun 03, 2019 8:26 pm
by cazfi
Corbeau wrote:What happens if there is no -Newusers parameter?
Only those users that already exist (from earlier freeciv server run with -Newusers) can log in.

Re: How to start a server with authentication?

Posted: Mon Jun 03, 2019 8:59 pm
by Corbeau
What does "from earlier freeciv server" mean? Where is the information stored between servers?