How to start a server with authentication?

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
User avatar
Corbeau
Elite
Posts: 1292
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to start a server with authentication?

Post 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?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to start a server with authentication?

Post 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 "~"
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to start a server with authentication?

Post 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.
User avatar
Corbeau
Elite
Posts: 1292
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to start a server with authentication?

Post 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?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to start a server with authentication?

Post 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
User avatar
Corbeau
Elite
Posts: 1292
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to start a server with authentication?

Post 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?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to start a server with authentication?

Post 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.
User avatar
Corbeau
Elite
Posts: 1292
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to start a server with authentication?

Post by Corbeau »

What happens if there is no -Newusers parameter?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to start a server with authentication?

Post 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.
User avatar
Corbeau
Elite
Posts: 1292
Joined: Mon Jan 13, 2014 11:13 pm

Re: How to start a server with authentication?

Post by Corbeau »

What does "from earlier freeciv server" mean? Where is the information stored between servers?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
Post Reply