parent
9b4a09677a
commit
72c9dac62c
@ -1,2 +1,7 @@
|
|||||||
|
.PHONY: all test
|
||||||
|
|
||||||
all:
|
all:
|
||||||
go build -o telegabber
|
go build -o telegabber
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test -v ./config
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestNoConfig(t *testing.T) {
|
||||||
|
_, err := ReadConfig("../test/sfklase.yml")
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("Non-existent config was successfully read")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGoodConfig(t *testing.T) {
|
||||||
|
_, err := ReadConfig("../test/good_config.yml")
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Good config is not accepted: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestBadConfig(t *testing.T) {
|
||||||
|
_, err := ReadConfig("../test/bad_config.yml")
|
||||||
|
if err == nil {
|
||||||
|
t.Errorf("Bad config is accepted but it shoudn't!")
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
:telegram:
|
||||||
|
:loglevel: :warn
|
||||||
|
:content:
|
||||||
|
:path: '/var/www/telegabber/content' # webserver workdir
|
||||||
|
:link: 'http://tlgrm.localhost/content' # webserver public address
|
||||||
|
:upload: 'https:///xmppfiles.localhost' # xmpp http upload address
|
||||||
|
:tdlib_verbosity: 1
|
||||||
|
:tdlib:
|
||||||
|
:lib_path: 'lib/'
|
||||||
|
:client:
|
||||||
|
:api_id: '17349'
|
||||||
|
:api_hash: '344583e45741c457fe1862106095a5eb'
|
||||||
|
:device_model: 'telegabber'
|
||||||
|
:application_version: '2.0'
|
||||||
|
:use_cat_info_database: false
|
||||||
|
|
||||||
|
:xmpp:
|
||||||
|
:loglevel: :warn
|
||||||
|
:host: '127.0.0.1'
|
||||||
|
:port: 8899
|
||||||
|
:password: 'password'
|
||||||
|
:db: 'sessions.dat'
|
@ -0,0 +1,23 @@
|
|||||||
|
:telegram:
|
||||||
|
:loglevel: :warn
|
||||||
|
:content:
|
||||||
|
:path: '' # webserver workdir
|
||||||
|
:link: '' # webserver public address
|
||||||
|
:upload: '' # xmpp http upload address
|
||||||
|
:tdlib_verbosity: 1
|
||||||
|
:tdlib:
|
||||||
|
:lib_path: 'lib/'
|
||||||
|
:client:
|
||||||
|
:api_id: '17349'
|
||||||
|
:api_hash: '344583e45741c457fe1862106095a5eb'
|
||||||
|
:device_model: 'telegabber'
|
||||||
|
:application_version: '2.0'
|
||||||
|
:use_chat_info_database: false
|
||||||
|
|
||||||
|
:xmpp:
|
||||||
|
:loglevel: :warn
|
||||||
|
:jid: 'tlgrm.localhost'
|
||||||
|
:host: '127.0.0.1'
|
||||||
|
:port: 8899
|
||||||
|
:password: 'password'
|
||||||
|
:db: 'sessions.dat'
|
Loading…
Reference in new issue