Commit Graph

77 Commits

Author SHA1 Message Date
mcarbonne bdbe13e320 Add option to discard SCT Data Table Temperature History (#557)
Fixes #494
2026-02-05 20:59:24 -08:00
Sam 600cd153e0 491 [FEAT] Allow disks to be hidden/archived
- Add archived to device type & db
- Add archive/unarchive handlers to webapp backend
- Add archive toggle & styling to webapp frontend
2025-02-21 09:25:27 +01:00
Aram Akhavan 09f4b34bf0 fix server test 2024-02-04 11:52:30 -08:00
Aram Akhavan 01c5a7fdfe Address review comments 2024-02-04 11:38:51 -08:00
Aram Akhavan 98d958888c refactor common code 2024-02-04 11:38:51 -08:00
Aram Akhavan 4e5c76b259 Add support for disabling repeat notifications
* Add a new database function for getting the tail

* Update ShouldNotify() to handle ignoring repeat notifications if set
2024-02-04 11:38:51 -08:00
Saswat Padhi cb5226f6e4 Update backend tests failing on insecure_skip_verify 2023-02-07 08:24:39 +00:00
Jason Kulatunga f2856e0f26 adding a healthcheck endpoint that confirms communication with influxdb and sqlite.
ref: #381
2022-11-30 08:25:27 -08:00
Jason Kulatunga 26b221532e fix tests. 2022-08-04 07:56:43 -07:00
Jason Kulatunga f823127825 simplify logger creation (move logic into a function in main packages)
Ensure logger creation is consistent between Web and Collector
Create logger in main, pass down to downstream functions (like gin)
In debug mode, print a copy of AppConfig
Better debugging for logger.
2022-08-03 22:51:44 -07:00
Jason Kulatunga 94594db20a on settings save, return the new settings.
update the frontend to persist settings to the database.
Using ScrutinyConfigService instead of TreoConfigService.
Using snake case settings in frontend.
Make sure we're using AppConfig type where possible.
2022-07-23 14:36:32 -07:00
Jason Kulatunga 7e672e8b8e adding tests for config.MergeConfigMap functionality. (Set vs SetDefault).
Converted all settings keys to snakecase.
2022-07-23 10:19:15 -07:00
Jason Kulatunga 54e2cacb00 move frontend settings into the DB (for consistent settings handling).
Flattened settings object.
2022-07-23 09:32:56 -07:00
Jason Kulatunga c0f1dfdb0b fixing config mock. 2022-07-20 22:38:30 -07:00
Jason Kulatunga 29bc79996b working settings update.
Settings are loaded from the DB and added to the AppConfig during startup.
When updating settings, they are stored in AppConfig, and written do  the database.
2022-07-19 23:12:23 -07:00
Jason Kulatunga 99af2b8b16 WIP settings system.
- updated dbdiagrams schema
- [BREAKING] force failure if `notify.filter_attributes` or `notify.level` is set
- added Settings table (and default values during migration)
- Added Save Settings and Get Settings functions.
- Added web API endpoints for getting and saving settings.
- Deprecated old Notify* constants. Created new MetricsStatus* and MetricsNotifyLevel constants.
2022-07-17 10:32:28 -07:00
Jason Kulatunga 5ea149d878 upgrading to go 1.18 for generics (and lodash-like library).
devices with an empty wwn should be filtered out (not uploaded during device registration, skipped when attempting to upload metrics).
added a migration to delete existing device entries with an empty `wwn`

fixes #314
2022-07-09 18:28:49 -07:00
Jason Kulatunga b71d6660a6 adding typescript interfaces for type hinting and testing
some code reformatting
adding tests for services and components.
cleanup of unused dependencies in components.
refactor dashboard service so that wrapper is removed before data is passed to component. (no more this.data.data...).
refactored components so that variable names are consistent (dashboardService vs smartService).
ensure argument and return types are specified everywhere.
adding tests for pipes.

adding ng test to ci steps.

change dir before running npm install.

trying to install nodejs in continer.

test frontend separately.

upload coverage for frontend and backend.

upload coverage for frontend and backend.

testing coverage file locations.

retry file upload.
2022-07-08 22:21:06 -07:00
Jason Kulatunga fbe7d63a24 trying to fix tests. 2022-06-20 18:01:43 -07:00
Jason Kulatunga d718b0898b trying to fix tests. 2022-06-20 17:21:27 -07:00
Jason Kulatunga 7babc280a0 ensure that users can filter their notifications by:
- failing attribute type (Critical vs All)
 - failure reason (Smart, Scrutiny, Both)

 fixes #300
2022-06-20 08:15:06 -07:00
Jason Kulatunga 2533d8d34f using Constants for git release/debug modes. 2022-05-28 09:53:45 -07:00
Jason Kulatunga af2523cfee setting GinMode to release by default. Users get confused otherwise. 2022-05-28 09:50:06 -07:00
Jason Kulatunga 1bd86f5abd [WIP] Delete button for devices. 2022-05-25 14:59:55 -07:00
Jason Kulatunga f844a435fd fix error message. 2022-05-25 07:55:15 -07:00
Jason Kulatunga 168ca802d1 add support for specifying scheme for influxdb endpoint url (http vs https).
fixes #258
2022-05-23 09:34:16 -07:00
Jason Kulatunga 381a6799cc updates for v0.4.0 release. Slight refactor/organization. 2022-05-09 14:50:35 -07:00
Jason Kulatunga 54178eaaf0 Merge branch 'master' into BASEPATH 2022-05-09 14:29:48 -07:00
Jason Kulatunga fabc629e40 handle case where WWN not detected for a device (print error messages, but skip device collection & uploading). 2022-05-05 23:03:06 -07:00
Jason Kulatunga 702c7cdf7a if running test iin github actions, use influxdb service for testing. 2022-04-29 16:39:14 -07:00
Jason Kulatunga 0a9d364aea adding duration key to smart attributes api endpoint 2022-04-29 15:26:15 -07:00
Jason Kulatunga 0872da57d7 fixes for tests. 2021-11-17 21:08:56 -08:00
Jason Kulatunga 03bfdd3890 changing the duration dropdown for temp history data. adding an /api/summary/temp endpoint 2021-11-16 20:39:09 -08:00
Jason Kulatunga ce032c5609 fixes for Scrutiny end-to-end testing. 2021-10-28 07:35:25 -07:00
Jason Kulatunga 7b7b4fe4e3 fixing test. 2021-10-24 19:30:29 -07:00
Jason Kulatunga 80f4660130 validate thresholds whenever SMART data is recieved. 2021-07-25 22:11:07 -07:00
Jason Kulatunga 8a46931399 !!!!WIP!!!!
adding InfluxDB

- influxdb added to dockerfile
- influxdb s6 service
- influxdb config
- adding defaults to config
- creating a DeviceRepo interface (multiple db backends)
- implemented DeviceRepo interface as ScruitnyRepository
2021-06-27 10:55:18 -07:00
Andrea Spacca a7c8c75a49 fix new test 2021-05-30 10:17:09 +02:00
Andrea Spacca 48bc7cedf4 test cases 2021-05-30 10:14:48 +02:00
Andrea Spacca 9fc11b7140 BASEPATH 2021-05-30 10:14:48 +02:00
Andrea Spacca ea3fbc09f1 BASEPATH 2021-05-30 10:14:48 +02:00
Andrea Spacca 86145be2b1 BASEPATH 2021-05-30 10:14:48 +02:00
Jason Kulatunga 93cf676818 added a "Success" test for script notifications.
bumping the version in version file? not sure why it wasnt correctly bumped already.
2020-11-03 08:20:02 -08:00
Jason Kulatunga bf07077154 fail if the parent directory for database does not exist. 2020-10-08 20:00:03 -06:00
Jason Kulatunga f27883ea4c remove requestcatcher live test. 2020-10-08 17:48:44 -06:00
Jason Kulatunga 9fac3c6308 fix gorm dependency. 2020-10-07 22:07:51 -06:00
Jason Kulatunga 1cd5ebaa43 missing device type update. 2020-10-07 21:59:48 -06:00
Jason Kulatunga b44ef5cb9c adding support for a collecto config file.
/scrutiny/config/collector.yaml

Adding ability to specify host identifier (label), that is updated on every collector run.
Can be specified by `host-id` CLI or `COLLECTOR_HOST_ID` env var.

Created a config class, interface and associated tests.

Created a "TransformDetectedDrives" function, that will allow users to insert drives not detected by Smarctl --scan, ignore drives that they dont want, and override smartctl device type.

Added Upsert functionality when registering devices.

Replaced "github.com/jinzhu/gorm" with "gorm.io/gorm" (ORM location moved, was using incorrect lib url)
Removed machineid library.
2020-10-07 21:54:29 -06:00
Jason Kulatunga a3438297e6 removeedd waitgroup, using sync/errgroup instead (to pass error messages back). returning errors in test notifications endpoint payload. Adding failure tests for webhooks, scripts & shoutrr. 2020-10-03 10:40:27 -06:00
Jason Kulatunga d339e967a6 fixing notifications. 2020-10-02 21:05:04 -06:00