mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 19:04:02 +03:00
Add secure mode
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
@@ -90,6 +91,9 @@ func NewConfig(debug, verbose bool, // nolint: gocyclo
|
||||
publicIPv6 net.IP, publicIPv6Port uint16,
|
||||
statsIP net.IP, statsPort uint16,
|
||||
secret, adtag string) (*Config, error) {
|
||||
if strings.HasPrefix(secret, "dd") {
|
||||
secret = secret[2:]
|
||||
}
|
||||
if len(secret) != 32 {
|
||||
return nil, errors.New("Telegram demands secret of length 32")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user