Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f67d6f9ae | |||
| 30153f9656 | |||
| 3150201348 | |||
| bce6225e9a | |||
| 893774c557 | |||
| 145996055a | |||
| 1cae5ea864 | |||
| 0fe6e74eb4 | |||
| eb4a738746 |
@@ -3,7 +3,7 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '36 12 * * *'
|
- cron: '36 12 * * *'
|
||||||
push:
|
push:
|
||||||
branches: [ master, influxdb ]
|
branches: [ master, beta ]
|
||||||
# Publish semver tags as releases.
|
# Publish semver tags as releases.
|
||||||
tags: [ 'v*.*.*' ]
|
tags: [ 'v*.*.*' ]
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,17 @@ on:
|
|||||||
release:
|
release:
|
||||||
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
|
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
|
||||||
types: [published]
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: 'tag to build artifacts for'
|
||||||
|
required: true
|
||||||
|
default: 'v0.0.0'
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
release-freebsd:
|
release-freebsd:
|
||||||
name: Release FreeBSD
|
name: Release FreeBSD
|
||||||
runs-on: macos-latest
|
runs-on: macos-10.15
|
||||||
env:
|
env:
|
||||||
PROJECT_PATH: /go/src/github.com/analogj/scrutiny
|
PROJECT_PATH: /go/src/github.com/analogj/scrutiny
|
||||||
GOPATH: /go
|
GOPATH: /go
|
||||||
@@ -19,9 +25,9 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{github.event.release.tag_name}}
|
ref: ${{github.event.release.tag_name || github.event.inputs.tag_name }}
|
||||||
- name: Build Binaries
|
- name: Build Binaries
|
||||||
uses: vmactions/freebsd-vm@v0.1.3
|
uses: vmactions/freebsd-vm@v0.1.5
|
||||||
with:
|
with:
|
||||||
envs: 'PROJECT_PATH GOPATH GOOS GOARCH'
|
envs: 'PROJECT_PATH GOPATH GOOS GOARCH'
|
||||||
usesh: true
|
usesh: true
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ docker run --rm \
|
|||||||
--cap-add SYS_RAWIO \
|
--cap-add SYS_RAWIO \
|
||||||
--device=/dev/sda \
|
--device=/dev/sda \
|
||||||
--device=/dev/sdb \
|
--device=/dev/sdb \
|
||||||
-e SCRUTINY_API_ENDPOINT=http://SCRUTINY_WEB_IPADDRESS:8080 \
|
-e COLLECTOR_API_ENDPOINT=http://SCRUTINY_WEB_IPADDRESS:8080 \
|
||||||
--name scrutiny-collector \
|
--name scrutiny-collector \
|
||||||
ghcr.io/analogj/scrutiny:master-collector
|
ghcr.io/analogj/scrutiny:master-collector
|
||||||
```
|
```
|
||||||
@@ -225,6 +225,21 @@ Or if you're not using docker, you can pass CLI arguments to the collector durin
|
|||||||
scrutiny-collector-metrics run --debug --log-file /tmp/collector.log
|
scrutiny-collector-metrics run --debug --log-file /tmp/collector.log
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Supported Architectures
|
||||||
|
|
||||||
|
|
||||||
|
| Architecture Name | Binaries | Docker |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| amd64 | :white_check_mark: | :white_check_mark: |
|
||||||
|
| arm-5 | :white_check_mark: | |
|
||||||
|
| arm-6 | :white_check_mark: | |
|
||||||
|
| arm-7 | :white_check_mark: | |
|
||||||
|
| arm64 | :white_check_mark: | :white_check_mark: |
|
||||||
|
| macos-amd64 | | :white_check_mark: |
|
||||||
|
| macos-arm64 | | :white_check_mark: |
|
||||||
|
| windows-amd64 | :white_check_mark: | |
|
||||||
|
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for instructions for how to develop and contribute to the scrutiny codebase.
|
Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for instructions for how to develop and contribute to the scrutiny codebase.
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ OPTIONS:
|
|||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "api-endpoint",
|
Name: "api-endpoint",
|
||||||
Usage: "The api server endpoint",
|
Usage: "The api server endpoint",
|
||||||
EnvVars: []string{"SCRUTINY_API_ENDPOINT"},
|
EnvVars: []string{"COLLECTOR_API_ENDPOINT", "SCRUTINY_API_ENDPOINT"},
|
||||||
|
//SCRUTINY_API_ENDPOINT is deprecated, but kept for backwards compatibility
|
||||||
},
|
},
|
||||||
|
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ OPTIONS:
|
|||||||
Name: "api-endpoint",
|
Name: "api-endpoint",
|
||||||
Usage: "The api server endpoint",
|
Usage: "The api server endpoint",
|
||||||
Value: "http://localhost:8080",
|
Value: "http://localhost:8080",
|
||||||
EnvVars: []string{"SCRUTINY_API_ENDPOINT"},
|
EnvVars: []string{"COLLECTOR_API_ENDPOINT"},
|
||||||
},
|
},
|
||||||
|
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Reverse Proxy Support
|
||||||
|
|
||||||
|
Scrutiny is designed so that it can be used with a reverse proxy, leveraging `domain`, `port` or `path` based matching to correctly route to the Scrutiny service.
|
||||||
|
|
||||||
|
For simple `domain` and/or `port` based routing, this is easy.
|
||||||
|
|
||||||
|
If your domain:port pair is similar to `http://scrutiny.example.com` or `http://localhost:54321`, just update your reverse proxy configuration
|
||||||
|
to route traffic to the Scrutiny backend, which is listening on `0.0.0.0:8080` by default.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# default config
|
||||||
|
web:
|
||||||
|
listen:
|
||||||
|
port: 8080
|
||||||
|
host: 0.0.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
However if you're using `path` based routing to differentiate your reverse proxy protected services, things become more complicated.
|
||||||
|
|
||||||
|
If you'd like to access Scrutiny using a path like: `http://example.com/scrutiny/`, then we need a way to configure Scrutiny so that it
|
||||||
|
understands `http://example.com/scrutiny/api/health` actually means `http://localhost:8080/api/health`.
|
||||||
|
|
||||||
|
Thankfully this can be done by changing **two** settings (both are required).
|
||||||
|
|
||||||
|
1. The webserver has a `web.listen.basepath` key
|
||||||
|
2. The collectors have a `api.endpoint` key.
|
||||||
|
|
||||||
|
## Webserver Configuration
|
||||||
|
|
||||||
|
When setting the `web.listen.basepath` key in the web config file, make sure the `basepath` key is prefixed with `/`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# customized webserver config
|
||||||
|
web:
|
||||||
|
listen:
|
||||||
|
port: 8080
|
||||||
|
host: 0.0.0.0
|
||||||
|
# if you're using a reverse proxy like apache/nginx, you can override this value to serve scrutiny on a subpath.
|
||||||
|
# eg. http://example.com/custombasepath/* vs http://example.com:8080
|
||||||
|
basepath: '/custombasepath'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Collector Configuration
|
||||||
|
|
||||||
|
Here's how you can update the collector `api.endpoint` key:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# customized collector config
|
||||||
|
api:
|
||||||
|
endpoint: 'http://localhost:8080/custombasepath'
|
||||||
|
```
|
||||||
|
|
||||||
|
# Environmental Variables.
|
||||||
|
|
||||||
|
You may also configure these values using the following environmental variables (both are required).
|
||||||
|
|
||||||
|
- `COLLECTOR_API_ENDPOINT=http://localhost:8080/custombasepath`
|
||||||
|
- `SCRUTINY_WEB_LISTEN_BASEPATH=/custombasepath`
|
||||||
@@ -60,6 +60,10 @@ devices:
|
|||||||
#
|
#
|
||||||
#api:
|
#api:
|
||||||
# endpoint: 'http://localhost:8080'
|
# endpoint: 'http://localhost:8080'
|
||||||
|
# endpoint: 'http://localhost:8080/custombasepath'
|
||||||
|
# if you need to use a custom base path (for a reverse proxy), you can add a suffix to the endpoint.
|
||||||
|
# See docs/TROUBLESHOOTING_REVERSE_PROXY.md for more info,
|
||||||
|
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
# FEATURES COMING SOON
|
# FEATURES COMING SOON
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package m20220503120000
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/analogj/scrutiny/webapp/backend/pkg"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Device struct {
|
||||||
|
//GORM attributes, see: http://gorm.io/docs/conventions.html
|
||||||
|
CreatedAt time.Time
|
||||||
|
UpdatedAt time.Time
|
||||||
|
DeletedAt *time.Time
|
||||||
|
|
||||||
|
WWN string `json:"wwn" gorm:"primary_key"`
|
||||||
|
|
||||||
|
DeviceName string `json:"device_name"`
|
||||||
|
Manufacturer string `json:"manufacturer"`
|
||||||
|
ModelName string `json:"model_name"`
|
||||||
|
InterfaceType string `json:"interface_type"`
|
||||||
|
InterfaceSpeed string `json:"interface_speed"`
|
||||||
|
SerialNumber string `json:"serial_number"`
|
||||||
|
Firmware string `json:"firmware"`
|
||||||
|
RotationSpeed int `json:"rotational_speed"`
|
||||||
|
Capacity int64 `json:"capacity"`
|
||||||
|
FormFactor string `json:"form_factor"`
|
||||||
|
SmartSupport bool `json:"smart_support"`
|
||||||
|
DeviceProtocol string `json:"device_protocol"` //protocol determines which smart attribute types are available (ATA, NVMe, SCSI)
|
||||||
|
DeviceType string `json:"device_type"` //device type is used for querying with -d/t flag, should only be used by collector.
|
||||||
|
|
||||||
|
// User provided metadata
|
||||||
|
Label string `json:"label"`
|
||||||
|
HostId string `json:"host_id"`
|
||||||
|
|
||||||
|
// Data set by Scrutiny
|
||||||
|
DeviceStatus pkg.DeviceStatus `json:"device_status"`
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/analogj/scrutiny/webapp/backend/pkg/database/migrations/m20201107210306"
|
"github.com/analogj/scrutiny/webapp/backend/pkg/database/migrations/m20201107210306"
|
||||||
|
"github.com/analogj/scrutiny/webapp/backend/pkg/database/migrations/m20220503120000"
|
||||||
"github.com/analogj/scrutiny/webapp/backend/pkg/models"
|
"github.com/analogj/scrutiny/webapp/backend/pkg/models"
|
||||||
"github.com/analogj/scrutiny/webapp/backend/pkg/models/collector"
|
"github.com/analogj/scrutiny/webapp/backend/pkg/models/collector"
|
||||||
"github.com/analogj/scrutiny/webapp/backend/pkg/models/measurements"
|
"github.com/analogj/scrutiny/webapp/backend/pkg/models/measurements"
|
||||||
@@ -256,8 +257,8 @@ func (sr *scrutinyRepository) Migrate(ctx context.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
//migrate the device database to the final version
|
//migrate the device database to the current version
|
||||||
return tx.AutoMigrate(models.Device{})
|
return tx.AutoMigrate(m20220503120000.Device{})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ package version
|
|||||||
|
|
||||||
// VERSION is the app-global version string, which will be replaced with a
|
// VERSION is the app-global version string, which will be replaced with a
|
||||||
// new value during packaging
|
// new value during packaging
|
||||||
const VERSION = "0.4.1"
|
const VERSION = "0.4.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user