summaryrefslogtreecommitdiffstats
path: root/bridge/config/config.go
diff options
context:
space:
mode:
authorRemi Reuvekamp <github@remi.im>2018-06-08 22:30:35 +0200
committerWim <wim@42.be>2018-06-08 22:30:35 +0200
commit33bd60528be4eaf28ffd1065517ea41fde9ea62b (patch)
tree057ceb94989fd5f88d0195b8bbfdc42dcf4f14f0 /bridge/config/config.go
parent7e544741117138943b51bffe4317e11d45777389 (diff)
downloadmatterbridge-msglm-33bd60528be4eaf28ffd1065517ea41fde9ea62b.tar.gz
matterbridge-msglm-33bd60528be4eaf28ffd1065517ea41fde9ea62b.tar.bz2
matterbridge-msglm-33bd60528be4eaf28ffd1065517ea41fde9ea62b.zip
Add config option MediaDownloadPath (#443)
* Add config option MediaUploadPath MediaDownloadPath can be used instead of MediaServerUpload, for when your webserver is on the same system as matterbridge and matterbridge has write access to the serve dir. * Limit length of hash in MediaServer urls to 8chars Full SHA256 is unnecessary for uniqueness. Also; if a file has the same first 8 charachters of the SHA256 hash, it's still not a problem, as long as the filename is not the same.
Diffstat (limited to 'bridge/config/config.go')
-rw-r--r--bridge/config/config.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go
index 1627adc2..351e6cad 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -2,14 +2,15 @@ package config
import (
"bytes"
- "github.com/fsnotify/fsnotify"
- log "github.com/sirupsen/logrus"
- "github.com/spf13/viper"
- prefixed "github.com/x-cray/logrus-prefixed-formatter"
"os"
"strings"
"sync"
"time"
+
+ "github.com/fsnotify/fsnotify"
+ log "github.com/sirupsen/logrus"
+ "github.com/spf13/viper"
+ prefixed "github.com/x-cray/logrus-prefixed-formatter"
)
const (
@@ -76,6 +77,7 @@ type Protocol struct {
MediaDownloadSize int // all protocols
MediaServerDownload string
MediaServerUpload string
+ MediaDownloadPath string // Basically MediaServerUpload, but instead of uploading it, just write it to a file on the same server.
MessageDelay int // IRC, time in millisecond to wait between messages
MessageFormat string // telegram
MessageLength int // IRC, max length of a message allowed