-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d13b6f
commit 4c8cea2
Showing
8 changed files
with
609 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Matrix Client | ||
MATRIX_HOST=http://localhost:8008 | ||
MATRIX_ADMIN_TOKEN=secret | ||
|
||
# PostgreSQL | ||
POSTGRES_USER=synapse_user | ||
POSTGRES_PASSWORD=secretpassword | ||
POSTGRES_DB=synapse | ||
# https://www.postgresql.org/docs/current/app-initdb.html | ||
POSTGRES_INITDB_ARGS='--no-locale --encoding=UTF8' | ||
|
||
# Synapse | ||
SYNAPSE_SERVER_NAME=matrix.localhost | ||
SYNAPSE_REPORT_STATS=yes | ||
SYNAPSE_ENABLE_REGISTRATION=yes | ||
SYNAPSE_NO_TLS=true | ||
SYNAPSE_USER_DIR_SEARCH_ALL_USERS=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set positional-arguments | ||
|
||
# Lists all available commands | ||
default: | ||
just --list | ||
|
||
# Creates the `.env` file if it doesn't exist | ||
dotenv: | ||
cp -n .env.example .env || true | ||
|
||
# Generates the synapse configuration file and saves it | ||
gen_synapse_conf: dotenv | ||
docker run -it --rm \ | ||
-v ./docker/synapse:/data \ | ||
--env-file .env \ | ||
matrixdotorg/synapse:v1.96.1 generate | ||
|
||
# Runs backend dependency services | ||
backend: dotenv | ||
docker compose up --build | ||
|
||
# Stops backend dependency services | ||
stop: | ||
docker compose down | ||
|
||
# Removes oll Docker related config, volumes and containers for this project | ||
clear: stop | ||
docker compose rm --all --force --volumes --stop | ||
docker volume rm commune_synapse_database || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,51 @@ | ||
# commune | ||
Commune Server | ||
<div align="center"> | ||
<h1 align="center">commune</h1> | ||
<p align="center"> | ||
Commune Server | ||
</p> | ||
</div> | ||
|
||
## Development | ||
|
||
### Requirements | ||
|
||
- [Docker](https://www.docker.com/get-started/) | ||
- [Justfile](https://github.com/casey/just) | ||
- [Rust](https://rustup.rs) | ||
|
||
### Getting Started | ||
|
||
1. Generate `Synapse` server configuration | ||
|
||
```bash | ||
just gen_synapse_conf | ||
``` | ||
|
||
2. Run Synapse Server (and other containerized services) using Docker Compose | ||
via: | ||
|
||
```bash | ||
just backend | ||
``` | ||
|
||
**When you are ready** | ||
|
||
Teardown services using `just stop`. If you want to perform a complete cleanup | ||
use `just clear`. | ||
|
||
> **Warning** `just clear` will remove all containers and images. | ||
### Application Layout | ||
|
||
<div align="center"> | ||
<img src="./docs/diagrams/diagram.png" /> | ||
<small>Application Layout Overview</small> | ||
</div> | ||
|
||
The client, any HTTP Client, comunicates with the Commune Server which may or | ||
may not communicate with Matrix's server _Synapse_ which runs along with its | ||
database in a Docker container. | ||
|
||
## License | ||
|
||
This project is licensed under the Apache License Version 2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '3' | ||
|
||
services: | ||
synapse_database: | ||
image: 'postgres:16' | ||
ports: | ||
- '5432:5432' | ||
volumes: | ||
- synapse_database:/var/lib/postgresql/data | ||
env_file: | ||
- .env | ||
restart: always | ||
|
||
synapse: | ||
image: 'matrixdotorg/synapse:v1.96.1' | ||
ports: | ||
- '8008:8008' | ||
- '8448:8448' | ||
volumes: | ||
- ./docker/synapse:/data | ||
env_file: | ||
- .env | ||
restart: always | ||
depends_on: | ||
- synapse_database | ||
|
||
volumes: | ||
synapse_database: |
Empty file.
Oops, something went wrong.