ankicommunity / anki-sync-server-rs

A personal custom Anki sync server,aim to provide an easier way for deployment
GNU Affero General Public License v3.0
180 stars 27 forks source link

Bug: Can't load Settings.toml in another directory. #34

Closed JACK-THINK closed 2 years ago

JACK-THINK commented 2 years ago

BUG Report:

Version: ankisyncd-0.1.3-arm.tar.gz

image

dobefore commented 2 years ago

Hi,@JACK-THINK ,Thanks for the report.You are right.

Hello,@redmie ,I can not think up a better way to fix this and what I only do is use hard-code dir ,Do you have some ideas?

redmie commented 2 years ago

Just checked out the code @dobefore, configuration file is not loaded ever. So no need to hard code paths, that's not the problem. I'm really not happy with the way the configuration system works right now and want to fix it. Please assign this issue to me I will rework this part before next Friday.

I *will change configuration file format to fix typos in configuration and allow its serialization and de-serialization. I want to change the name of the config file to something that will allow one to find the software it is related to. In the installation guide here you can see that I named it ankisyncd.toml.

As you can see @JACK-THINK it still alpha quality (and i'm still not running it at home (else I would have caught it sooner), I'm waiting for the internal logic and bugs to be ironed out first).

dobefore commented 2 years ago

@redmie ,THanks for the reply!looking forward to your contribution!

Acatually the application reads root folder(default to the same dir as the executable) from configure file.

Will it possible that the default configure file path is set to the same path as the executable? I just wondering this can be convienient for users who use it on windows

redmie commented 2 years ago

This hopefully will be solved by #35.

Note that the configuration file will change (but you can see the defaults by calling the server with --defaults) and be incompatible with the current one.

dobefore commented 2 years ago

Hi, @JACK-THINK. Due to @redmie 's wonderful efforts,bug apears to be fixed!releases 0.1.8 is available !

After that,creating user from config file is currently impossible,which maybe return back.

So you can use command user more see README.If you would like to load configuration not from the same path as ankisyncd ,you may need to move auth.db to that path.

feel free to reopen.

redmie commented 2 years ago

I think making user/password available in config file is bad design security wise. Even in terms of usability what happens if you change the username in the config file? what if you change the password? There is so many strange corner cases possible that we should avoid that altogether.

One can simply add user to database using command and script it if automation is required.

dobefore commented 2 years ago

Sound reasonable! sorry for my less of consideration.So we will no longer make user/password available in config file