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

APPRISE_ALLOW_SERVICES and APPRISE_DENY_SERVICES globals added #64

Merged
merged 1 commit into from
Dec 2, 2021

Conversation

caronc
Copy link
Owner

@caronc caronc commented Dec 2, 2021

Description:

Related issue (if applicable): n/a

Adds 2 new global variables that allow users to disable services they don't want people using. The filters work in 2 ways:

  1. APPRISE_ALLOW_SERVICES: A comma separated list that defines any services (by it's schema) you want to exclusively allow (denying everything else).
  2. APPRISE_DENY_SERVICES: A comma separated list that defines any services (by it's schema) deny (without touching other services). By default this is pre-configured to block local services: windows,dbus,gnome,macosx,syslog

Other things worth mentioning:

  • If both variables are defined, APPRISE_ALLOW_SERVICES will always take priority (and APPRISE_DENY_SERVICES will be ignored).
  • It's not case sensitive. So MAILTO will still match gracefully against the mailto schema.
  • Your disabling is happening at a global scale; so if you specify mailtos, you're still disabling the mailto (and vs versa); so there is no need to specify both.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • tests added

@codecov-commenter
Copy link

Codecov Report

Merging #64 (025f84b) into master (efe88a5) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #64   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          418       466   +48     
=========================================
+ Hits           418       466   +48     
Impacted Files Coverage Δ
apprise_api/api/views.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efe88a5...025f84b. Read the comment docs.

@caronc caronc merged commit 2943bce into master Dec 2, 2021
@caronc caronc deleted the exclude-include-filter branch May 15, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants