kingmo888 / rustdesk-api-server

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

登入後無法連線 #138

Closed flier268 closed 2 months ago

flier268 commented 2 months ago

架設在Docker有什麼特別需要注意的嗎? 我可以在Rustdesk登入,但是登入後,原本可以連線的反而不能連線了 貼了一段看起來最可疑的錯誤訊息,但不知道這是不是這裡錯誤導致的

networks:
  rustdesk-net:
    external: false
  nginx_network:
    external: true

services:
  rustdesk-server:
    container_name: rustdesk-server
    ports:
      - 21115:21115
      - 21116:21116
      - 21116:21116/udp
      - 21117:21117
      # - 21118:21118
      # - 21119:21119
    image: rustdesk/rustdesk-server-s6:latest-amd64
    environment:
      - "RELAY=www.googlee.com:21117"
      - "ENCRYPTED_ONLY=1"
      - "DB_URL=/db/db_v2.sqlite3"
      - "KEY_PRIV=123456"
      - "KEY_PUB=789123456"
    volumes:
      - ./db:/db
    restart: unless-stopped
  rustdesk-api-server:
    container_name: rustdesk-api-server
    image: ghcr.io/kingmo888/rustdesk-api-server:latest
    environment:
      - CSRF_TRUSTED_ORIGINS=https://www.googlee.com #防跨域信任来源,可选
      - ID_SERVER=www.googlee.com #Web控制端使用的ID服务器
      # - SECRET_KEY=
      - TZ=Asia/Taipei
      - LANGUAGE_CODE=en
      - DEBUG=True
    volumes:
      - ./rustdesk-api-server/db:/rustdesk-api-server/db #修改/yourpath/db为你宿主机数据库挂载目录
      - ./rustdesk-api-server/etc/timezone:/etc/timezone:ro
      - ./rustdesk-api-server/etc/localtime:/etc/localtime:ro    
    networks:
      - nginx_network
      # - rustdesk-net
    ports:
      - "21114:21114"
    restart: unless-stopped
2024-09-10 17:04:13 rustdesk-api-server  | [10/Sep/2024 17:04:13] "POST /api/heartbeat HTTP/1.1" 200 18
2024-09-10 17:04:14 rustdesk-api-server  | Internal Server Error: /api/heartbeat
2024-09-10 17:04:14 rustdesk-api-server  | Traceback (most recent call last):
2024-09-10 17:04:14 rustdesk-api-server  |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
2024-09-10 17:04:14 rustdesk-api-server  |     response = get_response(request)
2024-09-10 17:04:14 rustdesk-api-server  |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
2024-09-10 17:04:14 rustdesk-api-server  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2024-09-10 17:04:14 rustdesk-api-server  |   File "/rustdesk-api-server/api/views_api.py", line 265, in heartbeat
2024-09-10 17:04:14 rustdesk-api-server  |     device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).first()
2024-09-10 17:04:14 rustdesk-api-server  | KeyError: 'uuid'
2024-09-10 17:04:14 rustdesk-api-server  | [10/Sep/2024 17:04:14] "POST /api/heartbeat HTTP/1.1" 500 53595
2024-09-10 17:04:15 rustdesk-api-server  | [10/Sep/2024 17:04:15] "POST /api/heartbeat HTTP/1.1" 200 18
kingmo888 commented 2 months ago

你发现了一个小bug,不会有什么大的影响。它是一个客户端定时推送心跳的处理事件。

登入后无法远程链接的话,请参考readme第一段。

flier268 commented 2 months ago

本來客戶端就要設置key才能使用id伺服器,所以這個我一直都是有設的,差別就在登入後不行連接

kingmo888 commented 2 months ago

请仔细阅读readme第一段。你一直有设置,那大概率一直设置的生成的key而不是自定义的key吧。

flier268 commented 1 month ago

圖片 圖片

Key是有設的

flier268 commented 1 month ago

不能把自動生成的key作為自訂的key嗎

kingmo888 commented 1 month ago

不能。readme第一段说的很明确。你可以设定复杂的自定义key,就是不能用自动生成的。

flier268 commented 1 month ago

弄好了 答案是rustdesk server不能用s6版本的,只能用傳統hbbr+hbbs,因為s6的啟動腳本沒有寫好,加上那個設為1開啟加密的key,會填上-k _,而不是環境變數的key