'Client Setup' section in 'sync server' doc needs to be clarified

I am very confused by this section: sync-server.html#client-setup (this forum does not allow me to upload a post containing links pointing to anki’s own website)

I do find the ‘self-hosted sync server’ in the setting:

However, this section of doc does not mention about how to set the user name and password, which are set according to sync-server.html#installingrunning

I have set up my server successfully and got stuck in the step of syncing my data to the server.

It seems you’ve missed a step. :slight_smile:

The SYNC_USER1=user:pass part of the Installing/Running section examples is a variable where you have to substitute the values. The username in this example case would be user and the password pass.

If instead you wished to set your username as AnkiUser and your password to AnkiPass, the variable in your startup command would need to be set like so: SYNC_USER1=AnkiUser:AnkiPass

(In case I missunderstood your issue completely, my bad. Not 100% sure if the issue stems from setting the password or entering it into the client, which I would assume is just a prompt after restart. Not sure on that tho.)

Hi,

Thanks a lot for your reply.
I know how to set the user name and password in the server side as you have pointed out. My issue is entering them into the anki client (anki for macos). I restarted anki after entering the url pointing to my server but anki does not prompt me to enter the user name and password. Also, I did not find any connection to my server by looking at nginx access log and the standard output of the anki server. (I am sure that the server was set up properly because when I enter the url in the web browser I can see the connection in these two logs. And of course this test connection would fail since it does not follow the protocol. It’s only for connection testing.)

Here is some additional info about my environment:

I use GNU screen to start the anki server and detached it using ctrl +a +d.

SYNC_USER1=test:123456abc SYNC_HOST=‘127.0.0.1’ SYNC_PORT=6666 ~/syncserver/bin/python -m anki.syncserver

I also using nginx reverse proxy, here is my config:
location /uuid {
proxy_pass h t t p ://127.0.0.1:6666;
}

This is the url I entered into the anki client settings (anki for macos):
h t t p s://the-domain-of-my-server/uuid

(ssl of nginx was set up properly, I host my own website on my server)

As shown in the syncing intro video, you need to click on “Sync”.

Hi,

thanks for your reply. But when I click ‘Sync’ Anki would ask me for ‘AnkiWeb ID’ and its password. Do you mean if ‘self-hosted sync server’ is set in settings, ‘AnkiWeb ID’ would be equivalent to the username? (SYNC_USER1=user:pass)
image

My transparent proxy (proxifier) shows that even though I have set ‘self-hosted sync server’, Anki would still try to establish a connection to AnkiWeb, rather than my own server.

Also, if I entered my own username name and password anki would give me an error:
image

The problem is solved now, it’s the fault of nginx setting, hope the following note can help those with similar problems:

my nginx setting:

   location /your-path/ {
       proxy_pass h ttp://127.0.0.1:6666/;
       client_max_body_size 0;
   }

the two trailing ‘/’ are very important.

And in Anki, use the following url in settings:
h t t p s://the-domain-of-my-server/your-path/
note this trailing ‘/’

And click ‘Sync’ button. The user name is just the one you set in

SYNC_USER1=test:123456abc SYNC_HOST=‘127.0.0.1’ SYNC_PORT=6666 ~/syncserver/bin/python -m anki.syncserver

though it is called ‘AnkiWeb ID’

Here is the source code that could explain this behavior:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.