mirror of https://github.com/statping/statping
parent
5743dd926c
commit
428a840c3d
|
@ -1,3 +1,8 @@
|
||||||
|
# 0.90.27 (04-15-2020)
|
||||||
|
- Fixed postgres database table creation process
|
||||||
|
- Modified go build process, additional ARCHs
|
||||||
|
- Added 'SAMPLE_DATA' environment variable to disable example data on startup. (default: true)
|
||||||
|
|
||||||
# 0.90.26 (04-13-2020)
|
# 0.90.26 (04-13-2020)
|
||||||
- Fixed Delete Failures button/function
|
- Fixed Delete Failures button/function
|
||||||
- Removed timezone field from Settings (core)
|
- Removed timezone field from Settings (core)
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -85,7 +85,7 @@ db-up:
|
||||||
docker-compose -f dev/docker-compose.db.yml up -d --remove-orphans
|
docker-compose -f dev/docker-compose.db.yml up -d --remove-orphans
|
||||||
|
|
||||||
db-down:
|
db-down:
|
||||||
docker-compose -f dev/docker-compose.full.yml down --remove-orphans
|
docker-compose -f dev/docker-compose.db.yml down --volumes --remove-orphans
|
||||||
|
|
||||||
console:
|
console:
|
||||||
docker exec -t -i statping /bin/sh
|
docker exec -t -i statping /bin/sh
|
||||||
|
|
|
@ -135,8 +135,10 @@ func main() {
|
||||||
exit(errors.Wrap(err, "error creating default admin user"))
|
exit(errors.Wrap(err, "error creating default admin user"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := configs.TriggerSamples(); err != nil {
|
if utils.Getenv("SAMPLE_DATA", true).(bool) {
|
||||||
exit(errors.Wrap(err, "error creating database"))
|
if err := configs.TriggerSamples(); err != nil {
|
||||||
|
exit(errors.Wrap(err, "error creating database"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,12 @@ services:
|
||||||
postgres:
|
postgres:
|
||||||
container_name: postgres
|
container_name: postgres
|
||||||
image: postgres
|
image: postgres
|
||||||
volumes:
|
|
||||||
- ../docker/databases/postgres:/var/lib/postgresql/data
|
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_PASSWORD: password123
|
POSTGRES_PASSWORD: password123
|
||||||
POSTGRES_DB: statping
|
POSTGRES_DB: statping
|
||||||
POSTGRES_USER: root
|
POSTGRES_USER: root
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- "127.0.0.1:5432:5432"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U root"]
|
test: ["CMD-SHELL", "pg_isready -U root"]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
|
@ -22,8 +20,6 @@ services:
|
||||||
mysql:
|
mysql:
|
||||||
container_name: mysql
|
container_name: mysql
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
volumes:
|
|
||||||
- ../docker/databases/mysql:/var/lib/mysql
|
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: password123
|
MYSQL_ROOT_PASSWORD: password123
|
||||||
|
@ -31,7 +27,7 @@ services:
|
||||||
MYSQL_USER: root
|
MYSQL_USER: root
|
||||||
MYSQL_PASSWORD: password123
|
MYSQL_PASSWORD: password123
|
||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- "127.0.0.1:3306:3306"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||||
timeout: 20s
|
timeout: 20s
|
||||||
|
@ -46,7 +42,7 @@ services:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- 5050:80
|
- "127.0.0.1:5050:80"
|
||||||
links:
|
links:
|
||||||
- mysql:db
|
- mysql:db
|
||||||
environment:
|
environment:
|
||||||
|
@ -62,7 +58,7 @@ services:
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
command: sqlite_web -H 0.0.0.0 -r -x /data/statping.db
|
command: sqlite_web -H 0.0.0.0 -r -x /data/statping.db
|
||||||
ports:
|
ports:
|
||||||
- 6050:8080
|
- "127.0.0.1:6050:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- ../docker/statping/sqlite/statping.db:/data/statping.db:ro
|
- ../docker/statping/sqlite/statping.db:/data/statping.db:ro
|
||||||
environment:
|
environment:
|
||||||
|
@ -75,11 +71,8 @@ services:
|
||||||
environment:
|
environment:
|
||||||
DEFAULT_USER: admin@admin.com
|
DEFAULT_USER: admin@admin.com
|
||||||
DEFAULT_PASSWORD: admin
|
DEFAULT_PASSWORD: admin
|
||||||
depends_on:
|
|
||||||
postgres:
|
|
||||||
condition: service_healthy
|
|
||||||
ports:
|
ports:
|
||||||
- 7000:5050
|
- "127.0.0.1:7000:5050"
|
||||||
links:
|
links:
|
||||||
- postgres:postgres
|
- postgres:postgres
|
||||||
|
|
||||||
|
@ -91,7 +84,7 @@ services:
|
||||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
- ../docker/databases/prometheus:/prometheus
|
- ../docker/databases/prometheus:/prometheus
|
||||||
ports:
|
ports:
|
||||||
- 7050:9090
|
- "127.0.0.1:7050:9090"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: "/bin/wget -q -Y off http://localhost:9090/status -O /dev/null > /dev/null 2>&1"
|
test: "/bin/wget -q -Y off http://localhost:9090/status -O /dev/null > /dev/null 2>&1"
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package configs
|
package configs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/statping/statping/database"
|
"github.com/statping/statping/database"
|
||||||
"github.com/statping/statping/types/checkins"
|
"github.com/statping/statping/types/checkins"
|
||||||
"github.com/statping/statping/types/core"
|
"github.com/statping/statping/types/core"
|
||||||
|
@ -101,11 +103,11 @@ func (d *DbConfig) CreateDatabase() error {
|
||||||
log.Infoln("Creating Database Tables...")
|
log.Infoln("Creating Database Tables...")
|
||||||
for _, table := range DbModels {
|
for _, table := range DbModels {
|
||||||
if err := d.Db.CreateTable(table); err.Error() != nil {
|
if err := d.Db.CreateTable(table); err.Error() != nil {
|
||||||
return err.Error()
|
return errors.Wrap(err.Error(), fmt.Sprintf("error creating '%T' table", table))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := d.Db.Table("core").CreateTable(&core.Core{}); err.Error() != nil {
|
if err := d.Db.Table("core").CreateTable(&core.Core{}); err.Error() != nil {
|
||||||
return err.Error()
|
return errors.Wrap(err.Error(), fmt.Sprintf("error creating 'core' table"))
|
||||||
}
|
}
|
||||||
log.Infoln("Statping Database Created")
|
log.Infoln("Statping Database Created")
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ type Core struct {
|
||||||
UseCdn null.NullBool `gorm:"column:use_cdn;default:false" json:"using_cdn,omitempty"`
|
UseCdn null.NullBool `gorm:"column:use_cdn;default:false" json:"using_cdn,omitempty"`
|
||||||
LoggedIn bool `gorm:"-" json:"logged_in"`
|
LoggedIn bool `gorm:"-" json:"logged_in"`
|
||||||
IsAdmin bool `gorm:"-" json:"admin"`
|
IsAdmin bool `gorm:"-" json:"admin"`
|
||||||
AllowReports null.NullBool `gorm:"column:allow_reports;default:false" json:"allow_reports"`
|
AllowReports null.NullBool `gorm:"column:allow_reports;default:false" json:"allow_reports,omitempty"`
|
||||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||||
Started time.Time `gorm:"-" json:"started_on"`
|
Started time.Time `gorm:"-" json:"started_on"`
|
||||||
|
@ -46,7 +46,7 @@ type Core struct {
|
||||||
|
|
||||||
type OAuth struct {
|
type OAuth struct {
|
||||||
Domains string `gorm:"column:oauth_domains" json:"oauth_domains,omitempty" scope:"admin"`
|
Domains string `gorm:"column:oauth_domains" json:"oauth_domains,omitempty" scope:"admin"`
|
||||||
Providers string `gorm:"column:oauth_providers;default:local" json:"oauth_providers,omitempty"`
|
Providers string `gorm:"column:oauth_providers;" json:"oauth_providers,omitempty"`
|
||||||
GithubClientID string `gorm:"column:gh_client_id" json:"gh_client_id,omitempty" scope:"admin"`
|
GithubClientID string `gorm:"column:gh_client_id" json:"gh_client_id,omitempty" scope:"admin"`
|
||||||
GithubClientSecret string `gorm:"column:gh_client_secret" json:"gh_client_secret,omitempty" scope:"admin"`
|
GithubClientSecret string `gorm:"column:gh_client_secret" json:"gh_client_secret,omitempty" scope:"admin"`
|
||||||
GoogleClientID string `gorm:"column:google_client_id" json:"google_client_id,omitempty" scope:"admin"`
|
GoogleClientID string `gorm:"column:google_client_id" json:"google_client_id,omitempty" scope:"admin"`
|
||||||
|
|
|
@ -5,10 +5,6 @@ import (
|
||||||
"github.com/statping/statping/types"
|
"github.com/statping/statping/types"
|
||||||
"github.com/statping/statping/utils"
|
"github.com/statping/statping/utils"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
|
||||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
|
||||||
_ "github.com/mattn/go-sqlite3"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Notification struct {
|
||||||
Var2 string `gorm:"not null;column:var2" json:"var2,omitempty"`
|
Var2 string `gorm:"not null;column:var2" json:"var2,omitempty"`
|
||||||
ApiKey string `gorm:"not null;column:api_key" json:"api_key,omitempty"`
|
ApiKey string `gorm:"not null;column:api_key" json:"api_key,omitempty"`
|
||||||
ApiSecret string `gorm:"not null;column:api_secret" json:"api_secret,omitempty"`
|
ApiSecret string `gorm:"not null;column:api_secret" json:"api_secret,omitempty"`
|
||||||
Enabled null.NullBool `gorm:"column:enabled;type:boolean;default:false" json:"enabled"`
|
Enabled null.NullBool `gorm:"column:enabled;type:boolean;default:false" json:"enabled,omitempty"`
|
||||||
Limits int `gorm:"not null;column:limits" json:"limits"`
|
Limits int `gorm:"not null;column:limits" json:"limits"`
|
||||||
Removable bool `gorm:"column:removable" json:"removable"`
|
Removable bool `gorm:"column:removable" json:"removable"`
|
||||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.90.26
|
0.90.27
|
||||||
|
|
Loading…
Reference in New Issue