Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Matrix Chat as Service With Element WebUI #4444

Open
wants to merge 12 commits into
base: next
Choose a base branch
from

Conversation

elmatadoor
Copy link

@elmatadoor elmatadoor commented Nov 30, 2024

Changes

Add Matrix Chat as Service With Element WebUI
The matrix.org server is working, but the homeserver needs proper setup in the homeserver.yaml file.
Here is The Install Docs [Install_With_Docker_Compose]

@peaklabs-dev peaklabs-dev added the ⚙️ Service Issues requesting or PRs adding/fixing service templates. label Nov 30, 2024
@peaklabs-dev
Copy link
Member

This template is not yet completed I think because there is no port and no way to access the service over a domain is this intended? Please use the Coolify Magic to make this work: https://coolify.io/docs/knowledge-base/docker/compose#coolifys-magic-environment-variables

@peaklabs-dev peaklabs-dev added the 💤 Waiting for changes PRs awaiting changes from the author. label Dec 2, 2024
@elmatadoor
Copy link
Author

elmatadoor commented Dec 2, 2024

This template is not yet completed I think because there is no port and no way to access the service over a domain is this intended? Please use the Coolify Magic to make this work: https://coolify.io/docs/knowledge-base/docker/compose#coolifys-magic-environment-variables

it is working on my side ; the code part respensible to generate a domain is :

element:
- SERVICE_FQDN_ELEMENT <====

i dont know if i miss somme thing but for sur the PR need Manual Check and Fix ; it require to add Health check and fix the homeserver.yaml to be able to run our own homeserver here is the log :

config file '/data/homeserver.yaml' does not exist. You should either create a new config file by running with the generate argument ....................

this cane be genberated with this command :

docker run --rm -e SYNAPSE_SERVER_NAME=element-pww48cockwcwwg4k4sw08w4c.yourdomain -e SYNAPSE_REPORT_STATS=no -v /var/lib/docker/volumes/pww48cockwcwwg4k4sw08w4c_synapse-data/_data:/data matrixdotorg/synapse:v1.84.1 generate

and it can be edited using :

nano /var/lib/docker/volumes/pww48cockwcwwg4k4sw08w4c_synapse-data/_data/homeserver.yaml

if any one can test and help me with this fix
HERE is The Install Guide That Work with docker-compose that i have edit and delete traefik and nginx and add somme magic constants to be compatible with coolify

@peaklabs-dev
Copy link
Member

Thanks it looks better now as you said the healthchecks are missing and not sure what you mean by homeserver.yaml but these steps should be automated if possible inside the compose file or if not possible via docs.

@elmatadoor
Copy link
Author

Thanks it looks better now as you said the healthchecks are missing and not sure what you mean by homeserver.yaml but these steps should be automated if possible inside the compose file or if not possible via docs.

matrix.org is a decentralised communication platforme ; you can create an account on the main network called [matrix.org] or you can be the owner of the data by editing the homeserver.yaml to save all app data in your local server
take a look here
https://prnt.sc/vK-rEHf6ko3M
https://prnt.sc/Vqt-PULMTH9B

Copy link
Member

@peaklabs-dev peaklabs-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the changes in my comments and also add healthchecks to each container.

services:
synapse:
image: "docker.io/matrixdotorg/synapse:v1.84.1"
restart: unless-stopped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed coolify adds this by default.

templates/compose/matrix-element.yml Outdated Show resolved Hide resolved
volumes:
- synapse_data:/data
depends_on:
- synapse_db
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the health checks check for condition healthy of the resource.

templates/compose/matrix-element.yml Outdated Show resolved Hide resolved
@peaklabs-dev peaklabs-dev self-assigned this Dec 3, 2024
@elmatadoor
Copy link
Author

elmatadoor commented Dec 3, 2024

@peaklabs-dev , i have make somme changes , not sure if they follow the coolify standard , please take a look and let me know if any thing to fix ,
you can test the template it is working but need a mechanisme to run this command to be able to use the home server else you can just create acount on the [matrix.org] network and the container is unhealthy but the webUI is working :
[docker run --rm -e SYNAPSE_SERVER_NAME=element-xxx.yourdomain -e SYNAPSE_REPORT_STATS=no -v /var/lib/docker/volumes/xxx_synapse-data/_data:/data matrixdotorg/synapse:v1.84.1 generate]

@peaklabs-dev
Copy link
Member

You can take a look at this example https://github.com/coollabsio/coolify/blob/main/templates/compose/nextcloud-with-postgres.yaml where you can see healthchecks and so on, also you should use an entrypoint script or command to execute the command so it is automated as much as possible.

@luckydonald
Copy link
Contributor

How would one supply a entrypoint script?
Entry in volumes: with content set to something?

@elmatadoor
Copy link
Author

How would one supply a entrypoint script? Entry in volumes: with content set to something?

what do ypu mean bro ?

@luckydonald
Copy link
Contributor

@librelol
Copy link
Contributor

librelol commented Dec 9, 2024

Would be lovely to see this in production. I've taken a crack at it but haven't seen anything production worthy.

@elmatadoor
Copy link
Author

elmatadoor commented Dec 10, 2024

we have add somme editing and the entrypoint as well to generate the config file ; the service in general is working on coolify but for somme reason generating config file for the homeserver.yaml on the fly is not working ; i generate it manualy by running the command i just montion in top comment here is the oficiel docker image with guides : DOCKER HUB

@elmatadoor
Copy link
Author

elmatadoor commented Dec 21, 2024

Step 1: Generate the homeserver.yaml file

Run the following command to generate the homeserver.yaml file in your Docker container's data directory:

docker run --rm -e SYNAPSE_SERVER_NAME=matrix-b48owg0cwsg0cssoksosw88c.yourdomain \
  -e SYNAPSE_REPORT_STATS=no \
  -v /var/lib/docker/volumes/b48owg0cwsg0cssoksosw88c_synapse-data/_data:/data \
  matrixdotorg/synapse:v1.84.1 generate

This command will create the necessary configuration file for your Synapse server.


Step 2: Edit the homeserver.yaml file to enable registration

After generating the homeserver.yaml file, you need to enable registration on your server. To do this:

  1. Open the homeserver.yaml file using a text editor:
nano /var/lib/docker/volumes/b48owg0cwsg0cssoksosw88c_synapse-data/_data/homeserver.yaml
  1. Scroll to the bottom of the file and add the following two lines:
enable_registration: true
enable_registration_without_verification: true

Then Navigate To [https://element-b48owg0cwsg0cssoksosw88c.yourdomain] Click On Create account Then Click Edit To Change The Server From [Matrix.Org] To [https://matrix-b48owg0cwsg0cssoksosw88c.yourdomain]


Important Update
Manual Generation of homeserver.yaml
Please note : Generating the homeserver.yaml file automatically through the Docker Compose file is no longer supported. Instead, you will need to manually generate the configuration file.
How to Manually Generate homeserver.yaml
To generate the homeserver.yaml file for your Synapse server, follow these steps:

  1. Run the following command to manually generate the configuration file:
docker run --rm -e SYNAPSE_SERVER_NAME=matrix-b48owg0cwsg0cssoksosw88c.yourdomain \
  -e SYNAPSE_REPORT_STATS=no \
  -v /var/lib/docker/volumes/b48owg0cwsg0cssoksosw88c_synapse-data/_data:/data \
  matrixdotorg/synapse:v1.84.1 generate

This will generate the homeserver.yaml file in your Docker container's data directory.

  1. After generation , you can proceed with configuring your server manually, including enabling registration.

Alternative Option: Use the Matrix.org Server

If you don’t wish to manually generate the homeserver.yaml file, you can still use the Matrix.org public server for your communications, as it provides ready-to-use configuration without the need for local setup.


@peaklabs-dev peaklabs-dev removed the 💤 Waiting for changes PRs awaiting changes from the author. label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Service Issues requesting or PRs adding/fixing service templates.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants