doc: moved docker instructions to main README

This commit is contained in:
2022-04-17 15:47:13 +02:00
parent 11122d350e
commit 6650603814
5 changed files with 22 additions and 19 deletions

View File

@@ -2,9 +2,28 @@
Matrix Application Service for Okupa mi coche
## Setup
1. Install Docker in local machine
2. Add following line to /etc/hosts
```
127.0.0.1 okupamicoche-synapse
```
3. Go to `docker/synapse` and run `docker-compose up`
## Run
1. Start synapse: `docker restart okupamicoche-synapse`
2. Run app service: `./gradlew run`
## Launch Element with dev profile
1. Copy `docker/element/config.json` to `~/.config/Element-omc-dev/config.json`.
2. Launch new Element instance with `element-desktop --profile omc-dev`.
3. Send `/devtools` to any Element room. Enable `Developer mode` and `Show hidden events in timeline`.
Step 1 and 3 are only required in first run.
- Homeserver: `http://okupamicoche-synapse:8008`

View File

@@ -1,16 +0,0 @@
# Okupa mi coche - Docker containers for the backend
Guide for setting up a local development environment for the backend.
## Setup
1. Install Docker in local machine
2. Add following line to /etc/hosts
```
127.0.0.1 okupamicoche-synapse
```
3. First run: `docker-compose up`
## Run
`docker start okupamicoche-synapse`
## Inspect container
`docker exec -t -i okupamicoche-synapse /bin/bash`

View File

@@ -24,7 +24,7 @@ suspend fun main() {
matrixApplicationServiceApiServer(
hsToken = config.tokens.homeserver,
applicationServiceApiServerHandler = createAppService(matrixApiClient),
customMappings = TravelEventContentSerializerMappings()
customMappings = TravelEventContentSerializerMappings
)
}.start(wait = true)

View File

@@ -5,7 +5,7 @@ import net.folivo.trixnity.core.model.events.StateEventContent
import net.folivo.trixnity.core.serialization.events.BaseEventContentSerializerMappings
import net.folivo.trixnity.core.serialization.events.EventContentSerializerMapping
class TravelEventContentSerializerMappings : BaseEventContentSerializerMappings() {
object TravelEventContentSerializerMappings : BaseEventContentSerializerMappings() {
override val message: Set<EventContentSerializerMapping<out MessageEventContent>> = setOf(
EventContentSerializerMapping.of<TravelCreatedMessageEventContent>(TRAVEL_CREATED_MESSAGE_EVENT_TYPE)
)

View File

@@ -19,7 +19,7 @@ val matrixApiClient = if (config == null) null else MatrixClientServerApiClient(
(if (config.homeserver.secure) "https" else "http") +
"://${config.homeserver.host}:${config.homeserver.port}"
),
eventContentSerializerMappings = createEventContentSerializerMappings(TravelEventContentSerializerMappings())
eventContentSerializerMappings = createEventContentSerializerMappings(TravelEventContentSerializerMappings)
).apply { accessToken.value = config.tokens.appService }
object MatrixApiClient {