kingmo888 / rustdesk-api-server

基于Django的RustDesk Api&Web Server,除了支持api所有功能,还支持web注册、管理、展示等。已支持到最新1.3.1版本。
979 stars 220 forks source link

can't login on desktop client #132

Closed Snuupy closed 2 months ago

Snuupy commented 2 months ago

Hi, I was able to get rustdesk-api-server web UI working with the reverse proxy, but I am not able to login with the rustdesk desktop client and I can't figure out why.

https://rustdesk.domain.tld in the browser loads and I am able to login and use the web UI to click around. On the desktop client, I have tried https://rustdesk.domain.tld and https://rustdesk.domain.tld:443, but neither work. I keep getting error when I try to log in: image

Unknown Error: FormatException: Unexpected character (at line 2, character 1))
<!doctype html>
^

Here is my nginx config:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name rustdesk.domain.tld;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://rustdesk-api-server:21114;
    }
}

Can someone help me figure out why I am unable to log in to the (seemingly) working server? Even in the web portal for the machine it says "Status: Online" but I still can't log in (and the username/password combination is correct)

Snuupy commented 2 months ago

above is scam link please do not click and report user ^

Snuupy commented 2 months ago

I looked at the docker compose logs, and I found:

rustdesk-api-server    | settings:UserProfile matching query does not exist.
rustdesk-api-server    | [03/Sep/2024 09:28:20] "POST /api/login HTTP/1.1" 500 145
rustdesk-api-server    | [03/Sep/2024 09:30:34] "POST /api/login HTTP/1.1" 500 145

What is going on here?

kingmo888 commented 2 months ago

Please change debug to True and check what the logs are for

Snuupy commented 2 months ago
rustdesk-api-server    | Internal Server Error: /api/login
rustdesk-api-server    | Traceback (most recent call last):
rustdesk-api-server    |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
rustdesk-api-server    |     response = get_response(request)
rustdesk-api-server    |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
rustdesk-api-server    |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
rustdesk-api-server    |   File "/rustdesk-api-server/api/views_api.py", line 50, in login
rustdesk-api-server    |     peer.abid = ab.guid
rustdesk-api-server    | AttributeError: 'function' object has no attribute 'guid'
rustdesk-api-server    | [03/Sep/2024 09:38:24] "POST /api/login HTTP/1.1" 500 54671
rustdesk-api-server    | [03/Sep/2024 09:38:26] "POST /api/heartbeat HTTP/1.1" 200 24
rustdesk-api-server    | Internal Server Error: /api/heartbeat
rustdesk-api-server    | Traceback (most recent call last):
rustdesk-api-server    |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
rustdesk-api-server    |     response = get_response(request)
rustdesk-api-server    |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
rustdesk-api-server    |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
rustdesk-api-server    |   File "/rustdesk-api-server/api/views_api.py", line 255, in heartbeat
rustdesk-api-server    |     device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).first()
rustdesk-api-server    | KeyError: 'uuid'

rustdesk-api-server    | Internal Server Error: /api/heartbeat
rustdesk-api-server    | Traceback (most recent call last):
rustdesk-api-server    |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
rustdesk-api-server    |     response = get_response(request)
rustdesk-api-server    |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
rustdesk-api-server    |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
rustdesk-api-server    |   File "/rustdesk-api-server/api/views_api.py", line 255, in heartbeat
rustdesk-api-server    |     device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).first()
rustdesk-api-server    | KeyError: 'uuid'
kingmo888 commented 2 months ago

有了一个错误的行,他是在v2版本中的。我提交前已经注释掉了,但好像失败了。 稍后更新一下。

peer.abid = ab.guid, error

kingmo888 commented 2 months ago

update。

Snuupy commented 2 months ago

I downgraded to v1.5.0.2 and I was able to login, but device does not show on user page. Will try latest again now

maybe was just because I had to wait. Will try again and report bugs if I find any more. Thank you! ❤️

Edit: Oh I see. You have to add to your address book for the device to show up under your user on the web UI.