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)
|
||||
- Fixed Delete Failures button/function
|
||||
- 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
|
||||
|
||||
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:
|
||||
docker exec -t -i statping /bin/sh
|
||||
|
|
|
@ -135,8 +135,10 @@ func main() {
|
|||
exit(errors.Wrap(err, "error creating default admin user"))
|
||||
}
|
||||
|
||||
if err := configs.TriggerSamples(); err != nil {
|
||||
exit(errors.Wrap(err, "error creating database"))
|
||||
if utils.Getenv("SAMPLE_DATA", true).(bool) {
|
||||
if err := configs.TriggerSamples(); err != nil {
|
||||
exit(errors.Wrap(err, "error creating database"))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,14 +5,12 @@ services:
|
|||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres
|
||||
volumes:
|
||||
- ../docker/databases/postgres:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_PASSWORD: password123
|
||||
POSTGRES_DB: statping
|
||||
POSTGRES_USER: root
|
||||
ports:
|
||||
- 5432:5432
|
||||
- "127.0.0.1:5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U root"]
|
||||
interval: 15s
|
||||
|
@ -22,8 +20,6 @@ services:
|
|||
mysql:
|
||||
container_name: mysql
|
||||
image: mysql:5.7
|
||||
volumes:
|
||||
- ../docker/databases/mysql:/var/lib/mysql
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: password123
|
||||
|
@ -31,7 +27,7 @@ services:
|
|||
MYSQL_USER: root
|
||||
MYSQL_PASSWORD: password123
|
||||
ports:
|
||||
- 3306:3306
|
||||
- "127.0.0.1:3306:3306"
|
||||
healthcheck:
|
||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||
timeout: 20s
|
||||
|
@ -46,7 +42,7 @@ services:
|
|||
mysql:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- 5050:80
|
||||
- "127.0.0.1:5050:80"
|
||||
links:
|
||||
- mysql:db
|
||||
environment:
|
||||
|
@ -62,7 +58,7 @@ services:
|
|||
restart: on-failure
|
||||
command: sqlite_web -H 0.0.0.0 -r -x /data/statping.db
|
||||
ports:
|
||||
- 6050:8080
|
||||
- "127.0.0.1:6050:8080"
|
||||
volumes:
|
||||
- ../docker/statping/sqlite/statping.db:/data/statping.db:ro
|
||||
environment:
|
||||
|
@ -75,11 +71,8 @@ services:
|
|||
environment:
|
||||
DEFAULT_USER: admin@admin.com
|
||||
DEFAULT_PASSWORD: admin
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- 7000:5050
|
||||
- "127.0.0.1:7000:5050"
|
||||
links:
|
||||
- postgres:postgres
|
||||
|
||||
|
@ -91,7 +84,7 @@ services:
|
|||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
- ../docker/databases/prometheus:/prometheus
|
||||
ports:
|
||||
- 7050:9090
|
||||
- "127.0.0.1:7050:9090"
|
||||
healthcheck:
|
||||
test: "/bin/wget -q -Y off http://localhost:9090/status -O /dev/null > /dev/null 2>&1"
|
||||
interval: 10s
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package configs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/statping/statping/database"
|
||||
"github.com/statping/statping/types/checkins"
|
||||
"github.com/statping/statping/types/core"
|
||||
|
@ -101,11 +103,11 @@ func (d *DbConfig) CreateDatabase() error {
|
|||
log.Infoln("Creating Database Tables...")
|
||||
for _, table := range DbModels {
|
||||
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 {
|
||||
return err.Error()
|
||||
return errors.Wrap(err.Error(), fmt.Sprintf("error creating 'core' table"))
|
||||
}
|
||||
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"`
|
||||
LoggedIn bool `gorm:"-" json:"logged_in"`
|
||||
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"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
Started time.Time `gorm:"-" json:"started_on"`
|
||||
|
@ -46,7 +46,7 @@ type Core struct {
|
|||
|
||||
type OAuth struct {
|
||||
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"`
|
||||
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"`
|
||||
|
|
|
@ -5,10 +5,6 @@ import (
|
|||
"github.com/statping/statping/types"
|
||||
"github.com/statping/statping/utils"
|
||||
"time"
|
||||
|
||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -23,7 +23,7 @@ type Notification struct {
|
|||
Var2 string `gorm:"not null;column:var2" json:"var2,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"`
|
||||
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"`
|
||||
Removable bool `gorm:"column:removable" json:"removable"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.90.26
|
||||
0.90.27
|
||||
|
|
Loading…
Reference in New Issue