Ortograph! Renamed annoucement to announcement
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
*Lightweight swiss-knife-like VPN client to tunnel to Private Internet Access or Mullvad VPN servers, using Go, OpenVPN, iptables, DNS over TLS, ShadowSocks and Tinyproxy*
|
*Lightweight swiss-knife-like VPN client to tunnel to Private Internet Access or Mullvad VPN servers, using Go, OpenVPN, iptables, DNS over TLS, ShadowSocks and Tinyproxy*
|
||||||
|
|
||||||
**ANNOUCEMENT**: *Support for [Mullvad](http://mullvad.net)*
|
**ANNOUNCEMENT**: *Support for [Mullvad](http://mullvad.net)*
|
||||||
|
|
||||||
<a href="https://hub.docker.com/r/qmcgaw/private-internet-access">
|
<a href="https://hub.docker.com/r/qmcgaw/private-internet-access">
|
||||||
<img width="100%" height="320" src="https://raw.githubusercontent.com/qdm12/private-internet-access-docker/master/title.svg?sanitize=true">
|
<img width="100%" height="320" src="https://raw.githubusercontent.com/qdm12/private-internet-access-docker/master/title.svg?sanitize=true">
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package constants
|
package constants
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Annoucement is a message annoucement
|
// Announcement is a message announcement
|
||||||
Annoucement = "Support for Mullvad"
|
Announcement = "Support for Mullvad (a bit unstable)"
|
||||||
// AnnoucementExpiration is the expiration date of the annoucement in format yyyy-mm-dd
|
// AnnouncementExpiration is the expiration date of the announcement in format yyyy-mm-dd
|
||||||
AnnoucementExpiration = "2020-03-15"
|
AnnouncementExpiration = "2020-03-15"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_AnnoucementExpiration(t *testing.T) {
|
func Test_AnnouncementExpiration(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
if len(AnnoucementExpiration) == 0 {
|
if len(AnnouncementExpiration) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err := time.Parse("2006-01-02", AnnoucementExpiration)
|
_, err := time.Parse("2006-01-02", AnnouncementExpiration)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ func (c *configurator) BuildConf(connections []models.OpenVPNConnection, verbosi
|
|||||||
// "rcvbuf 524288"
|
// "rcvbuf 524288"
|
||||||
"cipher AES-256-CBC",
|
"cipher AES-256-CBC",
|
||||||
"tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA",
|
"tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA",
|
||||||
"tun-ipv6",
|
|
||||||
|
|
||||||
// Added constant values
|
// Added constant values
|
||||||
"mute-replay-warnings",
|
"mute-replay-warnings",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func Splash(paramsReader params.ParamsReader) string {
|
|||||||
lines = append(lines, "")
|
lines = append(lines, "")
|
||||||
lines = append(lines, fmt.Sprintf("Running version %s built on %s (commit %s)", version, buildDate, vcsRef))
|
lines = append(lines, fmt.Sprintf("Running version %s built on %s (commit %s)", version, buildDate, vcsRef))
|
||||||
lines = append(lines, "")
|
lines = append(lines, "")
|
||||||
lines = append(lines, annoucement()...)
|
lines = append(lines, announcement()...)
|
||||||
lines = append(lines, "")
|
lines = append(lines, "")
|
||||||
lines = append(lines, links()...)
|
lines = append(lines, links()...)
|
||||||
return strings.Join(lines, "\n")
|
return strings.Join(lines, "\n")
|
||||||
@@ -38,15 +38,15 @@ func title() []string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func annoucement() []string {
|
func announcement() []string {
|
||||||
if len(constants.Annoucement) == 0 {
|
if len(constants.Announcement) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
expirationDate, _ := time.Parse("2006-01-02", constants.AnnoucementExpiration) // error covered by a unit test
|
expirationDate, _ := time.Parse("2006-01-02", constants.AnnouncementExpiration) // error covered by a unit test
|
||||||
if time.Now().After(expirationDate) {
|
if time.Now().After(expirationDate) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return []string{emoji.Sprint(":mega: ") + constants.Annoucement}
|
return []string{emoji.Sprint(":mega: ") + constants.Announcement}
|
||||||
}
|
}
|
||||||
|
|
||||||
func links() []string {
|
func links() []string {
|
||||||
|
|||||||
Reference in New Issue
Block a user