From f6c7a2fe24a1f42489f065a68585fa5600bf8a61 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Thu, 8 Aug 2019 15:42:56 +0100 Subject: [PATCH] Configurable bridge store --- config.sample.yml | 1 + src/Config.ts | 1 + src/GithubBridge.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.sample.yml b/config.sample.yml index 9c7af496..ef4fea73 100644 --- a/config.sample.yml +++ b/config.sample.yml @@ -23,6 +23,7 @@ bridge: mediaUrl: http://example.com/ port: 9993 # Port the appservice is binding to bindAddress: 127.0.0.1 # Address to bind to + store: "bridgestore.json" queue: monolithic: true # If this is false, use a Redis server as a queue. port: 6379 # Port for the redis server, omit for 6379 diff --git a/src/Config.ts b/src/Config.ts index 3a7a2c8c..cf0af383 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -26,6 +26,7 @@ export interface BridgeConfig { mediaUrl: string; port: number; bindAddress: string; + store: string; }; queue: { monolithic: boolean; diff --git a/src/GithubBridge.ts b/src/GithubBridge.ts index 7ab54696..e55fec35 100644 --- a/src/GithubBridge.ts +++ b/src/GithubBridge.ts @@ -46,7 +46,7 @@ export class GithubBridge { userAgent: "matrix-github v0.0.1", }); - const storage = new SimpleFsStorageProvider("bridgestore.js"); + const storage = new SimpleFsStorageProvider(this.config.bridge.store || "bridgestore.json"); this.as = new Appservice({ homeserverName: this.config.bridge.domain,