Skip to content
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

self hosted docker example with --cache-file option => "flag provided but not defined: -cache-file" #320

Closed
milksteakjellybeans opened this issue Jun 11, 2022 · 2 comments
Labels
🪲 bug Something isn't working docs Improvements or additions to documentation

Comments

@milksteakjellybeans
Copy link

milksteakjellybeans commented Jun 11, 2022

Apologies if this is user error, I'm tuning a self hosted server and trying to enable the file based caching.

I'm using a modified version of the example that include the "--cache-file" option, as documented
https://ntfy.sh/docs/install/#docker
and
https://hub.docker.com/r/binwiederhier/ntfy/

When running the example (with some path modifications, and the most recent release), I get the following out put:
"Incorrect Usage. flag provided but not defined: -cache-file"

I reviewed the docs on configuring message cache on disk and I'm not seeing what I'm missing.
(https://ntfy.sh/docs/config/#message-cache)

(I might guess that it's choking on the cache file not yet existing, but if that's the case, I'm not sure how to boot strap the feature to write an initial cache file. touch cache.db?)

Here's the command I ran (modified from example):

# cat run_ntfy_ex1.sh 
docker run \
  -v /home/dude/ntfy/ex/var/cache/ntfy:/var/cache/ntfy \
  -p 80:80 \
  -it \
  binwiederhier/ntfy:v1.25.2 \
    --cache-file /var/cache/ntfy/cache.db \
    serve

And here's the output:

# sh run_ntfy_ex1.sh 
Incorrect Usage. flag provided but not defined: -cache-file

NAME:
   ntfy - Simple pub-sub notification service

USAGE:
   ntfy [OPTION..]

COMMANDS:
   help, h  Shows a list of commands or help for one command
   Client commands:
     publish, pub, send, trigger  Send message via a ntfy server
     subscribe, sub               Subscribe to one or more topics on a ntfy server
   Server commands:
     access  Grant/revoke access to a topic, or show access
     serve   Run the ntfy server
     user    Manage/show users

GLOBAL OPTIONS:
   --debug, -d                           enable debug logging (default: false) [$NTFY_DEBUG]
   --help, -h                            show help (default: false)
   --log-level value, --log_level value  set log level (default: "INFO") [$NTFY_LOG_LEVEL]
   --no-log-dates, --no_log_dates        disable the date/time prefix (default: false) [$NTFY_NO_LOG_DATES]
   --trace                               enable tracing (very verbose, be careful) (default: false) [$NTFY_TRACE]
   

Try 'ntfy COMMAND --help' or https://ntfy.sh/docs/ for more information.

To report a bug, open an issue on GitHub: https://github.com/binwiederhier/ntfy/issues.
If you want to chat, simply join the Discord server (https://discord.gg/cT7ECsZj9w), or
the Matrix room (https://matrix.to/#/#ntfy:matrix.org).

ntfy 1.25.2 (86c132f), runtime go1.18.2, built at 2022-06-03T01:45:19Z
Copyright (C) 2022 Philipp C. Heckel, licensed under Apache License 2.0 & GPLv2
flag provided but not defined: -cache-file

Thanks for reviewing

@binwiederhier
Copy link
Owner

Thanks for reporting. The serve command is the one with the flag. It should be

docker run \
  -v /var/cache/ntfy:/var/cache/ntfy \
  -p 80:80 \
  -it \
  binwiederhier/ntfy \
    serve \
    --cache-file /var/cache/ntfy/cache.db

I'll fix the docs when I get to it.

@binwiederhier binwiederhier added 🪲 bug Something isn't working docs Improvements or additions to documentation labels Jun 11, 2022
@binwiederhier
Copy link
Owner

Fixed in 3c47797

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants