Support Global System (Apprise) Configuration (#875)

pull/877/head
Chris Caron 2023-05-12 22:07:55 -04:00 committed by GitHub
parent c542ab23bf
commit 1e30be32d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 7 deletions

View File

@ -221,18 +221,28 @@ No one wants to put their credentials out for everyone to see on the command lin
# ~/.apprise.yml
# ~/.config/apprise
# ~/.config/apprise.yml
# /etc/apprise
# /etc/apprise.yml
# Also a subdirectory handling allows you to leverage plugins
# ~/.apprise/apprise
# ~/.apprise/apprise.yml
# ~/.config/apprise/apprise
# ~/.config/apprise/apprise.yml
# /etc/apprise/apprise
# /etc/apprise/apprise.yml
# Windows users can store their default configuration files here:
# %APPDATA%/Apprise/apprise
# %APPDATA%/Apprise/apprise.yml
# %LOCALAPPDATA%/Apprise/apprise
# %LOCALAPPDATA%/Apprise/apprise.yml
# %ALLUSERSPROFILE%\Apprise\apprise
# %ALLUSERSPROFILE%\Apprise\apprise.yml
# %PROGRAMFILES%\Apprise\apprise
# %PROGRAMFILES%\Apprise\apprise.yml
# %COMMONPROGRAMFILES%\Apprise\apprise
# %COMMONPROGRAMFILES%\Apprise\apprise.yml
# If you loaded one of those files, your command line gets really easy:
apprise -vv -t 'my title' -b 'my notification body'
@ -293,10 +303,14 @@ Once you've defined your custom hook, you just need to tell Apprise where it is
# all plugin files (if present) from the following directory paths:
# ~/.apprise/plugins
# ~/.config/apprise/plugins
# /var/lib/apprise/plugins
# Windows users can store their default plugin files in these directories:
# %APPDATA%/Apprise/plugins
# %LOCALAPPDATA%/Apprise/plugins
# %ALLUSERSPROFILE%\Apprise\plugins
# %PROGRAMFILES%\Apprise\plugins
# %COMMONPROGRAMFILES%\Apprise\plugins
# If you placed your plugin file within one of the directories already defined
# above, then your call simply needs to look like:

View File

@ -80,28 +80,64 @@ DEFAULT_CONFIG_PATHS = (
'~/.apprise/apprise.yml',
'~/.config/apprise/apprise',
'~/.config/apprise/apprise.yml',
# Global Configuration Support
'/etc/apprise',
'/etc/apprise.yml',
'/etc/apprise/apprise',
'/etc/apprise/apprise.yml',
)
# Define our paths to search for plugins
DEFAULT_PLUGIN_PATHS = (
'~/.apprise/plugins',
'~/.config/apprise/plugins',
# Global Plugin Support
'/var/lib/apprise/plugins',
)
# Detect Windows
if platform.system() == 'Windows':
# Default Config Search Path for Windows Users
DEFAULT_CONFIG_PATHS = (
expandvars('%APPDATA%/Apprise/apprise'),
expandvars('%APPDATA%/Apprise/apprise.yml'),
expandvars('%LOCALAPPDATA%/Apprise/apprise'),
expandvars('%LOCALAPPDATA%/Apprise/apprise.yml'),
expandvars('%APPDATA%\\Apprise\\apprise'),
expandvars('%APPDATA%\\Apprise\\apprise.yml'),
expandvars('%LOCALAPPDATA%\\Apprise\\apprise'),
expandvars('%LOCALAPPDATA%\\Apprise\\apprise.yml'),
#
# Global Support
#
# C:\ProgramData\Apprise\
expandvars('%ALLUSERSPROFILE%\\Apprise\\apprise'),
expandvars('%ALLUSERSPROFILE%\\Apprise\\apprise.yml'),
# C:\Program Files\Apprise
expandvars('%PROGRAMFILES%\\Apprise\\apprise'),
expandvars('%PROGRAMFILES%\\Apprise\\apprise.yml'),
# C:\Program Files\Common Files
expandvars('%COMMONPROGRAMFILES%\\Apprise\\apprise'),
expandvars('%COMMONPROGRAMFILES%\\Apprise\\apprise.yml'),
)
# Default Plugin Search Path for Windows Users
DEFAULT_PLUGIN_PATHS = (
expandvars('%APPDATA%/Apprise/plugins'),
expandvars('%LOCALAPPDATA%/Apprise/plugins'),
expandvars('%APPDATA%\\Apprise\\plugins'),
expandvars('%LOCALAPPDATA%\\Apprise\\plugins'),
#
# Global Support
#
# C:\ProgramData\Apprise\plugins
expandvars('%ALLUSERSPROFILE%\\Apprise\\plugins'),
# C:\Program Files\Apprise\plugins
expandvars('%PROGRAMFILES%\\Apprise\\plugins'),
# C:\Program Files\Common Files
expandvars('%COMMONPROGRAMFILES%\\Apprise\\plugins'),
)

View File

@ -151,6 +151,7 @@ files and loads them:
~/.apprise/plugins
~/.config/apprise/plugins
/var/lib/apprise/plugins
Simply create your own python file with the following bare minimum content in
it:
@ -192,6 +193,11 @@ in the following local locations for configuration files and loads them:
~/.config/apprise/apprise
~/.config/apprise/apprise.yaml
/etc/apprise
/etc/apprise.yml
/etc/apprise/apprise
/etc/apprise/apprise.yml
If a default configuration file is referenced in any way by the **apprise**
tool, you no longer need to provide it a Service URL. Usage of the **apprise**
tool simplifies to:
@ -215,4 +221,4 @@ If you find any bugs, please make them known at:
## COPYRIGHT
Apprise is Copyright (C) 2021 Chris Caron <lead2gold@gmail.com>
Apprise is Copyright (C) 2023 Chris Caron <lead2gold@gmail.com>