aboutsummaryrefslogtreecommitdiff
path: root/telegabber.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegabber.go')
-rw-r--r--telegabber.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/telegabber.go b/telegabber.go
index 89b9e4c..13d2341 100644
--- a/telegabber.go
+++ b/telegabber.go
@@ -15,7 +15,8 @@ import (
goxmpp "gosrc.io/xmpp"
)
-const version string = "1.2.1"
+var version string = "2.0.0-dev"
+var commit string
var sm *goxmpp.StreamManager
var component *goxmpp.Component
@@ -25,11 +26,17 @@ var cleanupDone chan struct{}
var sigintChannel chan os.Signal
func main() {
+ if commit != "" {
+ version = fmt.Sprintf("%v-%v", version, commit)
+ }
+
var profilingPort = flag.Int("profiling-port", 0, "The port for pprof server")
// YAML config, compatible with the format of Zhabogram 2.0.0
var configPath = flag.String("config", "config.yml", "Config file path")
// JSON schema (not for editing by a user)
var schemaPath = flag.String("schema", "./config_schema.json", "Schema file path")
+ // Folder for Badger DB of message ids
+ var idsPath = flag.String("ids", "ids", "Ids folder path")
var versionFlag = flag.Bool("version", false, "Print the version and exit")
flag.Parse()
@@ -55,7 +62,9 @@ func main() {
SetLogrusLevel(config.XMPP.Loglevel)
- sm, component, err = xmpp.NewComponent(config.XMPP, config.Telegram)
+ log.Infof("Starting telegabber version %v", version)
+
+ sm, component, err = xmpp.NewComponent(config.XMPP, config.Telegram, *idsPath)
if err != nil {
log.Fatal(err)
}