-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] first path segment in URL cannot contain colon
with discord notifier
#745
Comments
After experimenting, I discovered that the following version: '3.5'
services:
scrutiny:
container_name: scrutiny
image: ghcr.io/analogj/scrutiny:master-omnibus
cap_add:
- SYS_RAWIO
ports:
- "8080:8080" # webapp
volumes:
- /run/udev:/run/udev:ro
- ./config:/opt/scrutiny/config
- ./influxdb:/opt/scrutiny/influxdb
environment:
+ - SCRUTINY_NOTIFY_URLS=discord://<token>@<webhookid>
- - SCRUTINY_NOTIFY_URLS="discord://<token>@<webhookid>"
devices:
- "/dev/sda"
- "/dev/sdb"
restart: unless-stopped The difference is only the quote around the url. I then looked at the code, and a "patch" could be easily made by adding the following line in the url = strings.Trim(url, "\"") Or to add it "earlier" in the - c.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))
+ c.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_", "\"", "")) Let me know what you think, I may make a PR ! |
Hello again, I investigated this issue more, and I have new ideas. I tracked the issue back to the notify.go file. So, turns out when using environment variable, SCRUTINY_NOTIFY_URLS=discord://token@webhookid slack://token:token@channel/ ... The documentation is not very clear, but in docs/INSTALL_HUBS_SPOKE.md, the example state that you can use array of string for SCRUTINY_NOTIFY_URLS=["discord://token@webhookid", "slack://token:token@channel/", "..."] (which does not work right now). To resolve that without changing the inner working, we could try to Please let me know your thought on this ! |
I use Gotify, I had no notification. Finally, I succed to test with :
My error was to run the test in my browser (GET) With POST, it's OK |
Describe the bug
I use
scrutiny:master-omnibus
with Docker Compose.I set the environment variable
SCRUTINY_NOTIFY_URLS
to"discord://<token>@<webhookid>"
.When I run
curl -X POST http://localhost:8080/api/health/notify
, I have the following error:Expected behavior
For scrutiny to send a test notification to Discord.
docker-compose.yml
Log Files
docker info
Client: Docker Engine - Community Version: 27.5.1 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.20.0 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.32.4 Path: /usr/libexec/docker/cli-plugins/docker-composeServer:
Containers: 22
Running: 22
Paused: 0
Stopped: 0
Images: 49
Server Version: 27.5.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc version: v1.2.4-0-g6c52b3f
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.0-30-amd64
Operating System: Debian GNU/Linux 12 (bookworm)
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 31.12GiB
Name: nas
ID: f2d7c9c9-6a5b-42a5-a420-3069aee47d76
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
The text was updated successfully, but these errors were encountered: