Skip to content

Commit 0dd19de

Browse files
committed
Initial commit
0 parents  commit 0dd19de

10 files changed

+414
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# v1.0.0
2+
3+
## 05/22/2022
4+
5+
1. [](#new)
6+
- ChangeLog started...

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2022 Himmlisch Web
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Whistleblower Plugin
2+
3+
The **Whistleblower** Plugin is an extension for [Grav CMS](https://github.com/getgrav/grav).
4+
5+
**Whistleblower** helps you to know what happens on your site everytime by notifying you directly to your phone.
6+
7+
## Installation
8+
9+
Installing the Whistleblower plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command, the manual method lets you do so via a zip file, and the admin method lets you do so via the Admin Plugin.
10+
11+
### GPM Installation (Preferred)
12+
13+
To install the plugin via the [GPM](https://learn.getgrav.org/cli-console/grav-cli-gpm), through your system's terminal (also called the command line), navigate to the root of your Grav-installation, and enter:
14+
15+
bin/gpm install whistleblower
16+
17+
This will install the Whistleblower plugin into your `/user/plugins`-directory within Grav. Its files can be found under `/your/site/grav/user/plugins/whistleblower`.
18+
19+
### Manual Installation
20+
21+
To install the plugin manually, download the zip-version of this repository and unzip it under `/your/site/grav/user/plugins`. Then rename the folder to `whistleblower`. You can find these files on [GitHub](https://github.com/himmlisch-studios/grav-plugin-whistleblower) or via [GetGrav.org](https://getgrav.org/downloads/plugins).
22+
23+
You should now have all the plugin files under
24+
25+
/your/site/grav/user/plugins/whistleblower
26+
27+
### Admin Plugin
28+
29+
If you use the Admin Plugin, you can install the plugin directly by browsing the `Plugins`-menu and clicking on the `Add` button.
30+
31+
## Configuration
32+
33+
Before configuring this plugin, you should copy the `user/plugins/whistleblower/whistleblower.yaml` to `user/config/plugins/whistleblower.yaml` and only edit that copy.
34+
35+
Here is the default configuration and an explanation of available options:
36+
37+
```yaml
38+
enabled: true
39+
admin_mode: true
40+
endpoint: ""
41+
events:
42+
onUserLogin: "User '{username}' has logged on {domain}!"
43+
onUserLoginFailure: "Someone tried to log on {domain}!"
44+
```
45+
46+
Note that if you use the Admin Plugin, a file with your configuration named whistleblower.yaml will be saved in the `user/config/plugins/`-folder once the configuration is saved in the Admin.
47+
48+
## Usage
49+
50+
To start using the plugin you need to setup a ntfy endpoint. **Make sure this is unique**, since anyone could guess your endpoint and listen for all notifications.
51+
52+
Once setup, you can start adding any event hooks from Grav or Grav plugins and pairing them with a message you want to receive.
53+
54+
You can use a variety of variables to customize your messages. Such as `{username}` to receive the user who executed the event.
55+
56+
To start listening to the notifications you can either install the NTFY app available at the [F-Droid Store](https://f-droid.org/en/packages/io.heckel.ntfy/) or the [Google Play Store](https://play.google.com/store/apps/details?id=io.heckel.ntfy).
57+
58+
Or you can choose to use the [Web App](https://ntfy.sh/app).
59+
60+
To finish, just add the exact endpoint/topic you setup on the plugin configuration.
61+
62+
## Credits
63+
64+
Thanks to [Philip C. Heckel](https://heckel.io/) and the contributors of [NTFY](https://github.com/binwiederhier/ntfy) for making this service publicly available and free.
65+
66+
## Need a website?
67+
68+
At [Himmlisch Web](https://web.himmlisch.com.mx) we help you to develop the site of your dreams, with the exact functionality and look as you want. [Contact us!](https://himmlisch.com.mx/contact)

Diff for: blueprints.yaml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Whistleblower
2+
slug: whistleblower
3+
type: plugin
4+
version: 1.0.0
5+
description: Get notifications everytime someone tries to login using [ntfy.sh](https://ntfy.sh/)
6+
icon: assistive-listening-systems
7+
author:
8+
name: Himmlisch Web
9+
email: web@himmlisch.com.mx
10+
homepage: https://github.com/Himmlisch-Studios/grav-plugin-whistleblower
11+
demo: https://himmlisch.com.mx
12+
keywords: grav, plugin, etc
13+
bugs: https://github.com/Himmlisch-Studios/grav-plugin-whistleblower/issues
14+
docs: https://github.com/Himmlisch-Studios/grav-plugin-whistleblower/blob/master/README.md
15+
license: MIT
16+
17+
dependencies:
18+
- { name: grav, version: ">=1.7.0" }
19+
20+
form:
21+
validation: loose
22+
fields:
23+
enabled:
24+
type: toggle
25+
label: PLUGIN_ADMIN.PLUGIN_STATUS
26+
highlight: 1
27+
default: 0
28+
options:
29+
1: PLUGIN_ADMIN.ENABLED
30+
0: PLUGIN_ADMIN.DISABLED
31+
validate:
32+
type: bool
33+
admin_mode:
34+
type: toggle
35+
label: PLUGIN_WHISTLEBLOWER.ADMIN_MODE
36+
highlight: 1
37+
default: 1
38+
help: PLUGIN_WHISTLEBLOWER.ADMIN_MODE_HELP
39+
options:
40+
1: PLUGIN_ADMIN.ENABLED
41+
0: PLUGIN_ADMIN.DISABLED
42+
validate:
43+
type: bool
44+
custom_server:
45+
type: url
46+
label: PLUGIN_WHISTLEBLOWER.CUSTOM_SERVER
47+
help: PLUGIN_WHISTLEBLOWER.CUSTOM_SERVER_HELP
48+
placeholder: PLUGIN_WHISTLEBLOWER.CUSTOM_SERVER_PLACEHOLDER
49+
custom_password:
50+
type: password
51+
label: PLUGIN_ADMIN.PASSWORD
52+
help: PLUGIN_WHISTLEBLOWER.PASSWORD_HELP
53+
placeholder: PLUGIN_WHISTLEBLOWER.PASSWORD_PLACEHOLDER
54+
endpoint:
55+
type: text
56+
label: PLUGIN_WHISTLEBLOWER.ENDPOINT
57+
help: PLUGIN_WHISTLEBLOWER.ENDPOINT_HELP
58+
placeholder: PLUGIN_WHISTLEBLOWER.ENDPOINT_PLACEHOLDER
59+
validate:
60+
required: true
61+
events:
62+
type: array
63+
placeholder_key: PLUGIN_WHISTLEBLOWER.EVENTS_KEY
64+
placeholder_value: PLUGIN_WHISTLEBLOWER.EVENTS_VALUE
65+
label: PLUGIN_WHISTLEBLOWER.EVENTS
66+
_instructions:
67+
type: display
68+
markdown: true
69+
content: PLUGIN_WHISTLEBLOWER.INSTRUCTIONS

Diff for: composer.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "himmlisch-studios/whistleblower",
3+
"type": "grav-plugin",
4+
"description": "Get notifications everytime someone tries to login using ntfy.sh",
5+
"keywords": [
6+
"plugin"
7+
],
8+
"homepage": "https://github.com/Himmlisch-Studios/grav-plugin-whistleblower",
9+
"license": "MIT",
10+
"authors": [
11+
{
12+
"name": "Himmlisch Web",
13+
"email": "web@himmlisch.com.mx",
14+
"role": "Developer"
15+
}
16+
],
17+
"require": {
18+
"php": ">=7.1.3"
19+
},
20+
"autoload": {
21+
"psr-4": {
22+
"Grav\\Plugin\\Whistleblower\\": "classes/"
23+
},
24+
"classmap": [
25+
"whistleblower.php"
26+
]
27+
},
28+
"config": {
29+
"platform": {
30+
"php": "7.1.3"
31+
}
32+
}
33+
}

Diff for: composer.lock

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: languages.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
en:
2+
PLUGIN_WHISTLEBLOWER:
3+
ADMIN_MODE: Admin Mode
4+
ADMIN_MODE_HELP: Only executes events from the admin side
5+
ENDPOINT: NTFY Endpoint
6+
ENDPOINT_HELP: The ntfy endpoint to send the messages. Please be sure to use a unique endpoint.
7+
ENDPOINT_PLACEHOLDER: my-grav-site-aRTinoWLifY
8+
EVENTS: Event Hooks
9+
EVENTS_KEY: onUserLogin
10+
EVENTS_VALUE: Someone has logged on {domain}!
11+
CUSTOM_SERVER: Custom server
12+
CUSTOM_SERVER_HELP: NOT REQUIRED. Only use if you have your own server
13+
CUSTOM_SERVER_PLACEHOLDER: https://ntfy.mycustomserver.com
14+
PASSWORD_HELP: Auth password to custom server
15+
PASSWORD_PLACEHOLDER: Authentication to custom server
16+
INSTRUCTIONS:
17+
"You can use the following variables inside your messages in most events:
18+
19+
- **{site}**
20+
21+
- **{domain}**
22+
23+
- **{username}**
24+
25+
- **{date}**
26+
27+
- **{hour}**
28+
29+
30+
Check [Grav Docs](https://learn.getgrav.org/17/plugins/event-hooks) to learn about events."
31+
es:
32+
PLUGIN_WHISTLEBLOWER:
33+
ADMIN_MODE: Modo administrador
34+
ADMIN_MODE_HELP: Solo ejecuta eventos del lado de administración
35+
ENDPOINT: Ruta de NTFY
36+
ENDPOINT_HELP: La ruta de nfty a la cual mandar mensajes. Asegúrate de usar una ruta única.
37+
ENDPOINT_PLACEHOLDER: mi-sitio-grav-aRTinoWLifY
38+
EVENTS: Hooks de eventos
39+
EVENTS_KEY: onUserLogin
40+
EVENTS_VALUE: ¡Alguien a entrado a {domain}!
41+
CUSTOM_SERVER: Servidor propio
42+
CUSTOM_SERVER_HELP: NO NECESARIO. Solo usar si tienes tu propio servidor.
43+
CUSTOM_SERVER_PLACEHOLDER: https://ntfy.miservidor.com
44+
PASSWORD_HELP: Contraseña de autenticación para servidor propio
45+
PASSWORD_PLACEHOLDER: Authentication to custom server
46+
INSTRUCTIONS:
47+
"Puedes usar las siguientes variables dentro de tus mensajes en la mayoria de eventos:
48+
49+
- **{site}**
50+
51+
- **{domain}**
52+
53+
- **{username}**
54+
55+
- **{date}**
56+
57+
- **{hour}**
58+
59+
60+
Checa la [documentación de Grav](https://learn.getgrav.org/17/plugins/event-hooks) para aprender más sobre eventos."

0 commit comments

Comments
 (0)