wechaty / matrix-appservice

Wechaty [Matrix] Application Services Bridge
https://matrix.org/docs/projects/bridge/matrix-appservice-wechaty
Apache License 2.0
131 stars 16 forks source link

A full instructions for starting from scratch. #89

Open lprintf opened 3 years ago

lprintf commented 3 years ago

easy-matrix-wechaty is a simple and fast temporary deployment solution that provides a way to experience the main functions of matrix-appservice-wechaty. After some simple steps you can deploy a synapse server and a matrix-appservice-wechaty server. At present, in order to have a better experience, we need a domain name and a computer with a public IP address. Fortunately, we are designing a full-featured deployment plan for unpublic IP and domain names, and it is expected to be released this year(If it's necessary. ^_^).

I test it with a wechaty account name "疯帽子"(mad hatter, id: little-printf). After a period of testing, I will try to merge into this project (if appropriate). Welcome anyone to point out the shortcomings of it.

lprintf commented 3 years ago

@zrn-fight How is the progress of the project deployment this week?

zrn-fight commented 3 years ago

@545641826 I have deployed the matrix project according to your deployment method. I changed the domain name in export host = localhost to my own domain name fontweb.asia, but after I entered fontweb.asia: 8008 in the address bar of the browser, the server that cannot connect to fontweb.asia is displayed. It's the first time I've heard of docker. Will it be often used in later projects? If it is often used, I need to learn it.

lprintf commented 3 years ago

Oh, you have misunderstood the purpose of the project.There is no domain name and registered server are required. You can run it without any modify.

zrn-fight commented 3 years ago

I deployed it on Tencent ECs. Do you mean that I only need to deploy it on my own computer? OK, I'll deploy locally. Thank you

lprintf commented 3 years ago

And, did the original deployment plan encounter any problems? We can discuss any problems you encounter during the deployment process here. (Sometimes you need to explain your problems in other new issues。)

lprintf commented 3 years ago

@zrn-fight Please speak freely here. I hope you can evaluate these deployment scripts from the perspective of a new user as a reference for my next modification. If you encounter any trouble, you can give feedback here, and we can analyze the reasons together. This will be much faster.

zrn-fight commented 3 years ago

OK.After I typed docker-compose run --rm -e SYNAPSE_SERVER_NAME=$HOST -e SYNAPSE_REPORT_STATS=yes synapse generate on the virtual machine,there was an error that I haven't solved.Errors are reported as follows: 【ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.】 I restart docker and add the current user to the docker group, but still report an error.

zrn-fight commented 3 years ago

N@1UDS(L17Y L8JP 9I}N

lprintf commented 3 years ago

https://techoverflow.net/2019/03/16/how-to-fix-error-couldnt-connect-to-docker-daemon-at-httpdocker-localhost-is-it-running/#:~:text=ERROR%3A%20Couldn%27t%20connect%20to%20Docker%20daemon%20at%20http%2Bdocker%3A%2F%2Flocalhost,does%20not%20have%20the%20permissions%20to%20access%20docker.

lprintf commented 3 years ago

OK.After I typed docker-compose run --rm -e SYNAPSE_SERVER_NAME=$HOST -e SYNAPSE_REPORT_STATS=yes synapse generate on the virtual machine,there was an error that I haven't solved.Errors are reported as follows: 【ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.】 I restart docker and add the current user to the docker group, but still report an error.

Yes, this seems to be a problem that docker beginners are prone to encounter. Your question can help others to solve the problem quickly. see: solution

zrn-fight commented 3 years ago

767N``Z7`9${T8RG)FFLFH After I typed sudo sed -e 's/#app_service_config_files/app_service_config_files/' -e '/app_service_config_files/a\ - \/data\/wechaty-registration.yaml' -i files/homeserver.yaml,an error appears as shown in the picture.【sed: unable to read files / homeserver.yaml: there is no file or directory】

lprintf commented 3 years ago

Would you please run ls or tree -L 3 command on your work directory to provide more information?

lprintf commented 3 years ago

767N``Z7`9${T8RG)FFLFH After I typed sudo sed -e 's/#app_service_config_files/app_service_config_files/' -e '/app_service_config_files/a\ - /data/wechaty-registration.yaml' -i files/homeserver.yaml,an error appears as shown in the picture.【sed: unable to read files / homeserver.yaml: there is no file or directory】

The files/homeserver.yaml is the output of the command docker-compose run --rm -e SYNAPSE_SERVER_NAME=$HOST -e SYNAPSE_REPORT_STATS=yes synapse generate. Have you run the command successfully?

lprintf commented 3 years ago

I guess the admin user is not allowed to execute docker commands by default, like the root in centos. In this script, all commands that do not start with sudo should be executed by ordinary docker group users.

lprintf commented 3 years ago

@zrn-fight OK, I have writen a new version for you, please try it as soon as possible and give me a reply. see: easy-matrix-wechaty

zrn-fight commented 3 years ago

I tried to use the new version you wrote, but an error was reported after entering Chmod + X. / run.sh. I tried the first version of easy matrix wechaty again, and it ran successfully.

lprintf commented 3 years ago

I tried to use the new version you wrote, but an error was reported after entering Chmod + X. / run.sh. I tried the first version of easy matrix wechaty again, and it ran successfully.

What's wrong with it?And why the first version can run now?

zrn-fight commented 3 years ago

【chmod: : unable to read files / homeserver.yaml: there is no file or directory】 I'm also curious why the first version can run. I just reentered the command in the first version after the new version was wrong, and then it worked well. after I entered curl http://localhost:8008/_matrix/static/ on the terminal,an HTML file is returned.I'm now looking at how to install a browser on a virtual machine.

lprintf commented 3 years ago

【chmod: : unable to read files / homeserver.yaml: there is no file or directory】 I'm also curious why the first version can run. I just reentered the command in the first version after the new version was wrong, and then it worked well. after I entered curl http://localhost:8008/_matrix/static/ on the terminal,an HTML file is returned.I'm now looking at how to install a browser on a virtual machine.

You do not need to install a browser. Just install the client according to the readme file.

lprintf commented 3 years ago

Your machine is too weird. Why run chmod +x ./run.sh will throw such error about homeserver.yaml? And this command is not necessary if you can run the ./run.sh directly.

zrn-fight commented 3 years ago

ok,I will try to install a client.

lprintf commented 3 years ago

OK, There is two versions for you: v0.1 and v0.2.

lprintf commented 3 years ago

@yswtrue Are you interesting to be next user of easy-matrix-wechaty. It's easy for you. Your evaluation will be a valuable reference for further development.

zrn-fight commented 3 years ago

Is the service started by running this command [docker-compose -f "docker-compose.yml" up -d]? The service cannot start after I run it

lprintf commented 3 years ago

Is the service started by running this command [docker-compose -f "docker-compose.yml" up -d]? The service cannot start after I run it

please attach the log, let me see see.

zrn-fight commented 3 years ago

【docker-compose -f "docker-compose.yml" up -d】 easymatrixwechaty_matrix-appservice-wechaty_1 is up-to-date Starting easymatrixwechaty_synapse_1 【docker-compose exec synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -u $SYNAPSE_USER_NAME -p $SYNAPSE_USER_PASSWD --no-admin】 ERROR: No container found for synapse_1

lprintf commented 3 years ago

【docker-compose -f "docker-compose.yml" up -d】 easymatrixwechaty_matrix-appservice-wechaty_1 is up-to-date Starting easymatrixwechaty_synapse_1

Which mean that you have started the synapse successfully.

【docker-compose exec synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -u $SYNAPSE_USER_NAME -p $SYNAPSE_USER_PASSWD --no-admin】 ERROR: No container found for synapse_1

Registering users are only the installation process, not the startup process.

And in the new version of easy-matrix-wechaty, a script to run the server has been added.