m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.96k stars 449 forks source link

support Chinese #252

Closed superen7527 closed 1 year ago

superen7527 commented 1 year ago

I can't input Chinese, setting Chinese has no effect.

If it is difficult to solve, I suggest pre-installing an ibus-pinyin input method, so that you can input English to select Chinese.

m1k1o commented 1 year ago

We installed chinese fonts, could you make a PR that fixes what is your issue? I have no experience with Chinese inputs.

superen7527 commented 1 year ago

Hi, glad you believe in me so much. But sorry I can't provide pr.

I'm not a developer, I don't have any development experience. I just like to find projects and build and run them on my vps. Other than that, I don't have a relatively high technology.

I provide this method only because I used to use GNOME to connect with xrdp and couldn't transmit Chinese, so I finally used the input method to solve it.

I don't know if this project also deploys the desktop and then opens the browser to pass the view. If it is I think using the input method is a relatively easy solution, because the languages ​​​​of many countries are not compatible, but they all have the same keyboard, so you can use the input method of the corresponding country to fully support it temporarily. You only need to provide the corresponding font encoding support is sufficient.

I can only provide the code when I was dealing with xrdp, he is very simple

apt-get install -y xfonts-intl-chinese xfonts-wqy fontforge ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy fonts-wqy-microhei
apt-get install -y ibus-libpinyin

Others I may not be able to help, I am not a professional. sorry.

I hope I can help you. (The full text uses Google Translate, maybe the expression is not clear, sorry)

m1k1o commented 1 year ago

When running neko, can you please do this?

docker exec neko apt-update
docker exec neko apt-get install -y xfonts-intl-chinese xfonts-wqy fontforge ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy fonts-wqy-microhei 

Where neko is name of your neko container. This should install it to your neko, and you can confirm if it works as intended.

superen7527 commented 1 year ago

He doesn't look like he's working. This actually installs Chinese fonts and Chinese input on the desktop.

Of course, maybe I'm doing something wrong. Or let it be over. My level is limited, and I am new to docker, so I can't help, and it's not good to keep sending useless information, so I won't bother you. sorry. I will not close this issue. maybe compatriots will solve it in the future, so I won't close it.

root@ubuntu:~# docker exec root_neko-rooms_1 apt-update
OCI runtime exec failed: exec failed: unable to start container process: exec: "apt-update": executable file not found in $PATH: unknown
root@ubuntu:~# docker exec root_neko-rooms_1 apt-get install -y xfonts-intl-chinese xfonts-wqy fontforge ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy fonts-wqy-microhei ibus-libpinyin
OCI runtime exec failed: exec failed: unable to start container process: exec: "apt-get": executable file not found in $PATH: unknown
root@ubuntu:~# docker exec neko-rooms-kYsVI9wE apt-update
OCI runtime exec failed: exec failed: unable to start container process: exec: "apt-update": executable file not found in $PATH: unknown
root@ubuntu:~# docker exec neko-rooms-kYsVI9wE apt-get install -y xfonts-intl-chinese xfonts-wqy fontforge ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy fonts-wqy-microhei ibus-libpinyin
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package xfonts-intl-chinese
E: Unable to locate package xfonts-wqy
E: Unable to locate package fontforge
E: Unable to locate package ttf-wqy-microhei
E: Unable to locate package xfonts-wqy
E: Unable to locate package fonts-wqy-microhei
E: Unable to locate package ibus-libpinyin
m1k1o commented 1 year ago

Sorry I made a mistake, it should be docker exec neko apt-get update.

superen7527 commented 1 year ago

First of all, I'm sorry, before replying to the issue immediately after the reset of the server, because the server installed nginx occupied 80 ports There is no way to continue to test the command you gave (because your one-click script must occupy port 80 443 to enable the https certificate. Although I once wanted to raise an issue to ask whether it can be optimized and nginx compatible, but you gave the command I have not tested, it is embarrassing to send a new issue and reply). And I do not have a computer, everything is a cell phone link ssh and operating browser, not much interface is really some low efficiency (and page translation is not good), and can not test whether it is compatible with the computer version, after all, this project is the beginning of computer access.

Recently, I temporarily went out to touch a computer, I took the opportunity to re-examine neko, only to find that rooms is another project. I had seen the one-click install command for rooms in a forum post, but the project pointed to a github link for neko. As well as the main documentation is not on github (due to network problems I can not view the documentation site), so until now I found that you can deploy neko single application alone (I always thought room is neko separated from the room isolation project, I did not think it was the other way around neko is nekoroom separated from the single browser project), so I found a port to run a little independent neko tested your command, the results are as follows.

docker exec superen_neko_1 apt-get update
docker exec superen_neko_1 apt-get install -y xfonts-intl-chinese xfonts-wqy fontforge ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy fonts-wqy- microhei ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-pinyin ibus-libpinyin

It didn't work, then I docker exec -it bash and went inside the container to execute commands, testing for more than 2 hours: about language settings, command settings, graphics settings, etc. I tested everything I could think of. Finally, I kept the valid commands as follows

im-config -s ibus

ibus-setup

The container can't reboot and still can't use the input method after rebooting via docker. I can even bring up the input method icon. But still can only input English In fact, ssh also gives an error (below). I have tested it many times, but it doesn't work. After setup, the input method toolbar disappears, and even if daemon stays on, I can't use the input method. I checked im-config and found that the system is always defaulted to not enabling input methods. Maybe it's the streamlined desktop and the way you keep the browser from being closed? I don't really understand. But the normal im-config and ibus-setup commands can be seen in the neko settings screen.

root@d131212ee9fd:/# im-switch
bash: im-switch: command not found
root@d131212ee9fd:/# im-config

(zenity:716): dbind-WARNING **: 12:53:31.088: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown. The name org.a11y.Bus was not provided by any .service files

(zenity:740): dbind-WARNING **: 12:53:37.747: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown. The name org.a11y.Bus was not provided by any .service files

(zenity:949): dbind-WARNING **: 12:53:45.566: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown. The name org.a11y.Bus was not provided by any .service files
root@d131212ee9fd:/# im-config -s ibus
Input Method Configuration (im-config, ver. 0.46-1+deb11u1)
(c) Osamu Aoki <osamu@debian.org>, GPL-2+
See im-config(8), /usr/share/doc/im-config/README.Debian.gz.

In fact, the optimal solution is to pass Chinese characters, but guacamole also did not do, rdp seems to be difficult to pass? So we have to settle for the second best choice of Chinese input method. But it seems that the input method also can not be used, I also have no good way. I have seen another project is through a web input box, but he is not through what the protocol delivery, but the simulation of input. Or another way you can use the clipboard api, the external input text set to the internal system clipboard, the internal system can also listen to the clipboard to set the value of the new input box? Not directly pass the clipboard because the phone is not good for direct paste, or the need for an input box.

Some humble opinions, perhaps not very efficient. Perhaps about support for passing Chinese can continue to open the issue so that the back of the ability to try to see if pr? (If you do not feel appropriate you can close again I will not open the issue again)


Also, I still prefer to be able to control multiple rooms with rooms, so I'd like to continue using neko-rooms after testing the command line.

In order to be compatible with nginx, I did not use the zero-based command.

First, I used the docker-compose file on the home page alone, and then proxied the port through nginx.

Then I checked the history of nginx and port 80 issues, as well as the project inside the two files on nginx configuration and the home page description, only to know that Traefik is required, I thought it was for one-click installation instead of nginx and automatic application of certificates. Then I used your zero-based command to generate the dcompose.yml file and removed the mapping of 80 443. Then, based on the nginx example in the project, I modified it to only map the port 80 of the proxy traefik and run docker-compose up -d with nginx applying its own certificate, but the website with https certificate will be redirected infinitely... I have modified the test several times without success.

Finally, after a day of back and forth testing, the result was that the Chinese input method was invalid and the nginx-compatible rooms did not work. I feel that nothing is done, there is some confusion, I wonder if you can point out? I'm really sorry.

m1k1o commented 1 year ago

but guacamole also did not do, rdp seems to be difficult to pass

We currently use guacamoles keyboard. So when they manage to do it, we can use it here.

im-config -s ibus

I am very sorry, but I have absolutely no idea how that works, since I only use english inputs. From documentation, it looks like -s performs No action so maybe therefore its noz actually changing something.


Yes, neko-rooms is just orchestrating neko, it was created after neko project.

only to know that Traefik is required

Traefik is not required anymore, here is example file that shows deployment without traefik. It should be just enough to replace 127.0.0.1 with your IP/domain and then run docker-compose up -d to get it running.

Yes, zero install script currently does not support installing without traefik.

tanglu1323123 commented 7 months ago

We installed chinese fonts, could you make a PR that fixes what is your issue? I have no experience with Chinese inputs.

Hi, I have set the keyboards layout to Chinese ,but it don't work ,the words can't be input. Do you know how to solve it?

If you don't have Chinese language computer, I can provide :)

ZhouGithubb commented 3 months ago

I realized Chinese input through this extension tool. https://www.google.com/inputtools/chrome/