rustdesk / rustdesk-server

RustDesk Server Program
https://rustdesk.com/server
GNU Affero General Public License v3.0
5.96k stars 1.22k forks source link

problems with the last update V1.1.10-2 "HBBS Container" #358

Closed Joselito1980 closed 5 months ago

Joselito1980 commented 5 months ago

Describe the bug

in the latest update of today, "V.1.1.10-2". "HBBS" container does not start and the following error appears in the log

image

Describe the environment its installed in docker in a Synology DS 720+ with DSM 7.2.1-69057 Update 4.

i am using this docker compose:

version: '3.9'

services: hbbs: container_name: Rustdesk_HBBS ports:

How to Reproduce the bug when i start the proyect appears this error: image image image

thanks!!!!!!!

GarnetSunset commented 5 months ago

Agreed. New update is broken. Same issue on every version.

paspo commented 5 months ago

Today's build added a check for correct size of the secret key, which is causing the error in this case.

The secret key file should NOT have a trailing newline; if there's a newline, with previous release the key is ignored and hbbs is accepting unencrypted connections also.

Now you know that you have to remove such newline at the end of the file. (I think you can use the text editor you have in synology dsm); then restart the container.

GarnetSunset commented 5 months ago

With love, this should have been in the Changelog, if it's intended behavior!! Also shouldn't it be possible to snip the possible newline?

Joselito1980 commented 5 months ago

La compilación de hoy agregó una verificación del tamaño correcto de la clave secreta, lo que está causando el error en este caso.

El archivo de clave secreta NO debe tener una nueva línea al final; si hay una nueva línea, con la versión anterior la clave se ignora y hbbs también acepta conexiones no cifradas.

Ahora sabes que debes eliminar esa nueva línea al final del archivo. (Creo que puedes usar el editor de texto que tienes en Synology dsm); luego reinicie el contenedor.

hello!!! in this file? i'm only one line with the token id, or it's other file? image

paspo commented 5 months ago

you have to look at id_ed25519 (without .pub).

Please do it using a more advanced editor, capable of distinguish the different kind of newlines (LF or CR+LF). Something like Notepad++ in windows.

mariushosting commented 5 months ago

you have to look at id_ed25519 (without .pub).

Please do it using a more advanced editor, capable of distinguish the different kind of newlines (LF or CR+LF). Something like Notepad++ in windows.

The docker image seems to be bugged since I can replicate the issue on a fresh installation.

Joselito1980 commented 5 months ago

you have to look at id_ed25519 (without .pub).

Please do it using a more advanced editor, capable of distinguish the different kind of newlines (LF or CR+LF). Something like Notepad++ in windows.

hello, in the file i only have a 1 line with the token, any idea? image

paspo commented 5 months ago

wrong file.

id_ed25519.pub contains the PUBLIC KEY. id_ed25519 contains the SECRET KEY. You have to look at this file.

(because the public key can be derived from the secret key)

expected file size should be: 44 bytes for id_ed25519.pub 88 bytes for id_ed25519

Joselito1980 commented 5 months ago

wrong file.

id_ed25519.pub contains the PUBLIC KEY. id_ed25519 contains the SECRET KEY. You have to look at this file.

(because the public key can be derived from the secret key)

expected file size should be: 44 bytes for id_ed25519.pub 88 bytes for id_ed25519

ok thanks.. but in this file its same.. only have a 1 line... image

mariushosting commented 5 months ago

The issue is the latest Rustdesk docker image it's bugged from the beginning. No key file is saved in any folder on a fresh installation because of the malformed key error message. using version :1.1.9 will solve your issue @Joselito1980

Change:

image: rustdesk/rustdesk-server

with

image: rustdesk/rustdesk-server:1.1.9

in both images then redeploy the stack Until the dev solve the issue

Joselito1980 commented 5 months ago

The issue is the latest Rustdesk docker image it's bugged from the beginning. No key file is saved in any folder on a fresh installation because of the malformed key error message. using version :1.1.9 will solve your issue @Joselito1980

Change:

image: rustdesk/rustdesk-server

with

image: rustdesk/rustdesk-server:1.1.9

in both images then redeploy the stack Until the dev solve the issue

thanks a lot!!! now it's working with the last version, i'm whait to new version! best regards!!!

mariushosting commented 5 months ago

The issue is the latest Rustdesk docker image it's bugged from the beginning. No key file is saved in any folder on a fresh installation because of the malformed key error message. using version :1.1.9 will solve your issue @Joselito1980 Change: image: rustdesk/rustdesk-server with image: rustdesk/rustdesk-server:1.1.9 in both images then redeploy the stack Until the dev solve the issue

thanks a lot!!! now it's working with the last version, i'm whait to new version! best regards!!!

with version 1.1.9 it works but not with version 1.1.10 so the latest version is the 1.1.10 version but currently bugged.

paspo commented 5 months ago

With love, this should have been in the Changelog, if it's intended behavior!!

This was meant to be a quick and dirty fix for a problem affecting a small number of users. If the key file is not correct (exactly 88 bytes), hbbs can be used without encryption. The only modification is an error indicating the incorrect key with subsequent program stop.

Also shouldn't it be possible to snip the possible newline?

This can lead to difficult debug: imagine having an extra space at the beginning of the file, the program will have to complain because of a wrong key that looks perfectly normal to anyone looking at the contents.

mariushosting commented 5 months ago

With love, this should have been in the Changelog, if it's intended behavior!!

This was meant to be a quick and dirty fix for a problem affecting a small number of users. If the key file is not correct (exactly 88 bytes), hbbs can be used without encryption. The only modification is an error indicating the incorrect key with subsequent program stop.

Also shouldn't it be possible to snip the possible newline?

This can lead to difficult debug: imagine having an extra space at the beginning of the file, the program will have to complain because of a wrong key that looks perfectly normal to anyone looking at the contents.

@paspo You can't even write to the folder from the beginning with a fresh RustDesk server installation. No issue with version 1.1.9 the issue appear almost instantly on version 1.1.10 - The affected user are both (old installation and new installation).

GarnetSunset commented 5 months ago

Agreed. The key that rustdesk generates on 1.1.10 even after you blow it away, doesnt appear to pass this check. So clearly the key generation code needs to match this check

Edit: Rolling back works, using the local windows version run locally also doesnt work on latest.

th0mcat commented 5 months ago

Can also confirm that rolling back to 1.1.9 fixes the issue.

· The latest container will not generate new Ed25519 keys when the container is restarted or recreated. · Generating new keys with 1.1.9 and then moving to latest does not fix the issue either.

kiokoman commented 5 months ago

same problem here (ubuntu server with precompiled packages .deb), I don't have any space/return on my file but the resulting size is 89B this was auto-generated by rustdesk in a previous version. the .pub is 44B

vi id_ed25519 ->

IO+n+dV2L????????????????????????????????????????????????????????????????????????KP46g== ~ ~ ~ ...... "id_ed25519" 1L, 89B

so i made a new clean installation and there is the same problem, the service hbbs does not start (EXIT / FAILED) with malformed private key but there is no key generated inside /var/lib/rustdesk-server

paspo commented 5 months ago

should be fixed by https://github.com/rustdesk/rustdesk-server/pull/361 lets just wait for @rustdesk to test it and merge if ok

ECX-mpoellinger commented 5 months ago

So even a echo -n $(tr -d "\n" < id_ed25519) > id_ed25519 and afterwards the file size is exact 88 Byte hbbs still fails with "Malformed private key" Seems the check is broken.

linuxkidd commented 5 months ago

I can confirm that the 1.1.10-3 release ( pr #361 ) fixed this issue for me.

Thanks to @paspo and the @rustdesk team for resolving this quickly! :)

Joselito1980 commented 5 months ago

it's working in the last update! thanks!!!!

ECX-mpoellinger commented 5 months ago

confirmed. Latest release is working. Thank you @paspo

nemiah commented 4 months ago

HI,

the docker images does not seem to have been updated: https://hub.docker.com/r/rustdesk/rustdesk-server/tags

Could you please push the update? @rustdesk