mirror of https://github.com/statping/statping
include netgo tag during golang build process
parent
96be7f96da
commit
5d66e34e56
|
@ -1,3 +1,6 @@
|
||||||
|
# 0.90.44 (05-25-2020)
|
||||||
|
- Modified Makefile to include "netgo" tag during golang build
|
||||||
|
|
||||||
# 0.90.43 (05-21-2020)
|
# 0.90.43 (05-21-2020)
|
||||||
- Fixed service TLS checkbox form for edit and create
|
- Fixed service TLS checkbox form for edit and create
|
||||||
- Modified ICMP ping's to use system's "ping" command (doesn't need root access)
|
- Modified ICMP ping's to use system's "ping" command (doesn't need root access)
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -162,13 +162,13 @@ build-win:
|
||||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-windows-386/statping.exe ./cmd
|
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-windows-386/statping.exe ./cmd
|
||||||
|
|
||||||
build-darwin:
|
build-darwin:
|
||||||
GO111MODULE="on" GOOS=darwin GOARCH=amd64 go build -a -ldflags "-s -w -X main.VERSION=${VERSION}" -o releases/statping-darwin-amd64/statping --tags "darwin" ./cmd
|
GO111MODULE="on" GOOS=darwin GOARCH=amd64 go build -a -ldflags "-s -w -X main.VERSION=${VERSION}" -o releases/statping-darwin-amd64/statping --tags "netgo darwin" ./cmd
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
CGO_ENABLED=1 GO111MODULE="on" GOOS=linux GOARCH=amd64 \
|
CGO_ENABLED=1 GO111MODULE="on" GOOS=linux GOARCH=amd64 \
|
||||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-amd64/statping --tags "linux" ./cmd
|
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-amd64/statping --tags "netgo linux" ./cmd
|
||||||
CGO_ENABLED=1 GO111MODULE="on" GOOS=linux GOARCH=386 \
|
CGO_ENABLED=1 GO111MODULE="on" GOOS=linux GOARCH=386 \
|
||||||
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-386/statping --tags "linux" ./cmd
|
go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION}" -o releases/statping-linux-386/statping --tags "netgo linux" ./cmd
|
||||||
|
|
||||||
build-linux-arm:
|
build-linux-arm:
|
||||||
CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc-6 CXX=arm-linux-gnueabihf-g++-6 GO111MODULE="on" GOOS=linux GOARCH=arm GOARM=7 \
|
CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc-6 CXX=arm-linux-gnueabihf-g++-6 GO111MODULE="on" GOOS=linux GOARCH=arm GOARM=7 \
|
||||||
|
|
|
@ -114,8 +114,9 @@ func start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.Params.GetBool("SAMPLE_DATA") {
|
if utils.Params.GetBool("SAMPLE_DATA") {
|
||||||
|
log.Infoln("Adding Sample Data")
|
||||||
if err := configs.TriggerSamples(); err != nil {
|
if err := configs.TriggerSamples(); err != nil {
|
||||||
exit(errors.Wrap(err, "error creating database"))
|
exit(errors.Wrap(err, "error adding sample data"))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err := core.Samples(); err != nil {
|
if err := core.Samples(); err != nil {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Checkins...")
|
||||||
checkin1 := &Checkin{
|
checkin1 := &Checkin{
|
||||||
Name: "Demo Checkin 1",
|
Name: "Demo Checkin 1",
|
||||||
ServiceId: 1,
|
ServiceId: 1,
|
||||||
|
@ -31,6 +32,7 @@ func Samples() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SamplesChkHits() error {
|
func SamplesChkHits() error {
|
||||||
|
log.Infoln("Inserting Sample Checkins Hits...")
|
||||||
checkTime := utils.Now().Add(-3 * time.Minute)
|
checkTime := utils.Now().Add(-3 * time.Minute)
|
||||||
|
|
||||||
for i := int64(1); i <= 2; i++ {
|
for i := int64(1); i <= 2; i++ {
|
||||||
|
|
|
@ -28,9 +28,8 @@ type Sampler interface {
|
||||||
func TriggerSamples() error {
|
func TriggerSamples() error {
|
||||||
return createSamples(
|
return createSamples(
|
||||||
core.Samples,
|
core.Samples,
|
||||||
//users.Samples,
|
|
||||||
messages.Samples,
|
|
||||||
services.Samples,
|
services.Samples,
|
||||||
|
messages.Samples,
|
||||||
checkins.Samples,
|
checkins.Samples,
|
||||||
checkins.SamplesChkHits,
|
checkins.SamplesChkHits,
|
||||||
failures.Samples,
|
failures.Samples,
|
||||||
|
|
|
@ -9,10 +9,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
log = utils.Log
|
log = utils.Log.WithField("type", "failure")
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Service Failures...")
|
||||||
createdAt := utils.Now().Add(-3 * types.Day)
|
createdAt := utils.Now().Add(-3 * types.Day)
|
||||||
|
|
||||||
for i := int64(1); i <= 4; i++ {
|
for i := int64(1); i <= 4; i++ {
|
||||||
|
|
|
@ -3,10 +3,14 @@ package groups
|
||||||
import (
|
import (
|
||||||
"github.com/statping/statping/database"
|
"github.com/statping/statping/database"
|
||||||
"github.com/statping/statping/types/errors"
|
"github.com/statping/statping/types/errors"
|
||||||
|
"github.com/statping/statping/utils"
|
||||||
"sort"
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
var db database.Database
|
var (
|
||||||
|
db database.Database
|
||||||
|
log = utils.Log.WithField("type", "group")
|
||||||
|
)
|
||||||
|
|
||||||
func SetDB(database database.Database) {
|
func SetDB(database database.Database) {
|
||||||
db = database.Model(&Group{})
|
db = database.Model(&Group{})
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Groups...")
|
||||||
group1 := &Group{
|
group1 := &Group{
|
||||||
Name: "Main Services",
|
Name: "Main Services",
|
||||||
Public: null.NewNullBool(true),
|
Public: null.NewNullBool(true),
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
var SampleHits = 99900.
|
var SampleHits = 99900.
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Service Hits...")
|
||||||
for i := int64(1); i <= 5; i++ {
|
for i := int64(1); i <= 5; i++ {
|
||||||
records := createHitsAt(i)
|
records := createHitsAt(i)
|
||||||
if err := gormbulk.BulkInsert(db.GormDB(), records, db.ChunkSize()); err != nil {
|
if err := gormbulk.BulkInsert(db.GormDB(), records, db.ChunkSize()); err != nil {
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
package incidents
|
package incidents
|
||||||
|
|
||||||
import "github.com/statping/statping/database"
|
import (
|
||||||
|
"github.com/statping/statping/database"
|
||||||
|
"github.com/statping/statping/utils"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
db database.Database
|
db database.Database
|
||||||
dbUpdate database.Database
|
dbUpdate database.Database
|
||||||
|
log = utils.Log.WithField("type", "service")
|
||||||
)
|
)
|
||||||
|
|
||||||
func SetDB(database database.Database) {
|
func SetDB(database database.Database) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Incidents...")
|
||||||
incident1 := &Incident{
|
incident1 := &Incident{
|
||||||
Title: "Github Issues",
|
Title: "Github Issues",
|
||||||
Description: "There are new features for Statping, if you have any issues please visit the Github Repo.",
|
Description: "There are new features for Statping, if you have any issues please visit the Github Repo.",
|
||||||
|
|
|
@ -3,9 +3,13 @@ package messages
|
||||||
import (
|
import (
|
||||||
"github.com/statping/statping/database"
|
"github.com/statping/statping/database"
|
||||||
"github.com/statping/statping/types/errors"
|
"github.com/statping/statping/types/errors"
|
||||||
|
"github.com/statping/statping/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var db database.Database
|
var (
|
||||||
|
db database.Database
|
||||||
|
log = utils.Log.WithField("type", "message")
|
||||||
|
)
|
||||||
|
|
||||||
func SetDB(database database.Database) {
|
func SetDB(database database.Database) {
|
||||||
db = database.Model(&Message{})
|
db = database.Model(&Message{})
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Messages...")
|
||||||
m1 := &Message{
|
m1 := &Message{
|
||||||
Title: "Routine Downtime",
|
Title: "Routine Downtime",
|
||||||
Description: "This is an example a upcoming message for a service!",
|
Description: "This is an example a upcoming message for a service!",
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Services...")
|
||||||
createdOn := utils.Now().Add(((-24 * 30) * 3) * time.Hour)
|
createdOn := utils.Now().Add(((-24 * 30) * 3) * time.Hour)
|
||||||
s1 := &Service{
|
s1 := &Service{
|
||||||
Name: "Google",
|
Name: "Google",
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Samples() error {
|
func Samples() error {
|
||||||
|
log.Infoln("Inserting Sample Users...")
|
||||||
u2 := &User{
|
u2 := &User{
|
||||||
Username: "testadmin",
|
Username: "testadmin",
|
||||||
Password: "password123",
|
Password: "password123",
|
||||||
|
|
|
@ -7,15 +7,16 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Params *viper.Viper
|
Params *viper.Viper
|
||||||
|
configLog = Log.WithField("type", "configs")
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitCLI() {
|
func InitCLI() {
|
||||||
Params = viper.New()
|
Params = viper.New()
|
||||||
Params.AutomaticEnv()
|
Params.AutomaticEnv()
|
||||||
|
setDefaults()
|
||||||
Directory = Params.GetString("STATPING_DIR")
|
Directory = Params.GetString("STATPING_DIR")
|
||||||
//Params.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
//Params.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
||||||
setDefaults()
|
|
||||||
Params.SetConfigName("config")
|
Params.SetConfigName("config")
|
||||||
Params.SetConfigType("yml")
|
Params.SetConfigType("yml")
|
||||||
Params.AddConfigPath(Directory)
|
Params.AddConfigPath(Directory)
|
||||||
|
@ -30,16 +31,12 @@ func InitCLI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func setDefaults() {
|
func setDefaults() {
|
||||||
if Directory == "" {
|
defaultDir, err := os.Getwd()
|
||||||
defaultDir, err := os.Getwd()
|
if err != nil {
|
||||||
if err != nil {
|
configLog.Errorln(err)
|
||||||
defaultDir = "."
|
defaultDir = "."
|
||||||
}
|
|
||||||
Params.SetDefault("STATPING_DIR", defaultDir)
|
|
||||||
Directory = defaultDir
|
|
||||||
}
|
}
|
||||||
Directory = Params.GetString("STATPING_DIR")
|
Params.SetDefault("STATPING_DIR", defaultDir)
|
||||||
Params.SetDefault("STATPING_DIR", Directory)
|
|
||||||
Params.SetDefault("GO_ENV", "")
|
Params.SetDefault("GO_ENV", "")
|
||||||
Params.SetDefault("DB_CONN", "")
|
Params.SetDefault("DB_CONN", "")
|
||||||
Params.SetDefault("DISABLE_LOGS", false)
|
Params.SetDefault("DISABLE_LOGS", false)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.90.43
|
0.90.44
|
||||||
|
|
Loading…
Reference in New Issue