-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9358be
commit 9b6b8d3
Showing
6 changed files
with
139 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Ignore everything | ||
* | ||
|
||
# Allow files and directories | ||
!/src | ||
!/daemon.php | ||
!/composer.json | ||
!/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM composer:2.7.2 AS composer | ||
|
||
COPY ./ /app | ||
WORKDIR /app | ||
|
||
# Run composer to install dependencies | ||
RUN composer install \ | ||
--optimize-autoloader \ | ||
--no-interaction \ | ||
--no-progress \ | ||
--no-dev | ||
|
||
FROM alpine:3.19.1 | ||
|
||
# Install packages | ||
RUN apk add --no-cache \ | ||
curl \ | ||
php82 \ | ||
php82-curl \ | ||
php82-ctype \ | ||
php82-mbstring \ | ||
php82-openssl \ | ||
php82-phar \ | ||
php82-xml \ | ||
php82-xmlreader | ||
|
||
# Copy app folder from composer build stage | ||
COPY --from=composer /app /app | ||
WORKDIR /app | ||
|
||
CMD [ "php", "./daemon.php" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3' | ||
services: | ||
vigilant: | ||
image: ghcr.io/verifiedjoseph/vigilant:1.2.0 | ||
environment: | ||
- VIGILANT_TIMEZONE=Europe/London | ||
- VIGILANT_NOTIFICATION_SERVICE=ntfy | ||
- VIGILANT_NOTIFICATION_NTFY_URL=https://ntfy.sh/ | ||
- VIGILANT_NOTIFICATION_NTFY_TOPIC=testingtesting | ||
volumes: | ||
- "./feeds.yaml:/app/feeds.yaml" | ||
restart: unless-stopped | ||
security_opt: | ||
- no-new-privileges:true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is for testing. For the production version see: https://github.com/VerifiedJoseph/vigilant/tree/main/docker-compose.yml | ||
version: '3' | ||
services: | ||
app: | ||
build: ../ | ||
container_name: vigilant | ||
environment: | ||
- VIGILANT_TIMEZONE=Europe/London | ||
- VIGILANT_NOTIFICATION_SERVICE=ntfy | ||
- VIGILANT_NOTIFICATION_NTFY_URL=https://ntfy.sh/ | ||
- VIGILANT_NOTIFICATION_NTFY_TOPIC=testingtesting | ||
volumes: | ||
- "../feeds.yaml:/app/feeds.yaml" | ||
security_opt: | ||
- no-new-privileges:true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
# Installation | ||
|
||
## docker-compose | ||
|
||
```yaml | ||
version: '3' | ||
services: | ||
vigilant: | ||
image: ghcr.io/verifiedjoseph/vigilant:1.2.0 | ||
environment: | ||
- VIGILANT_NOTIFICATION_SERVICE=ntfy | ||
- VIGILANT_NOTIFICATION_NTFY_URL=https://ntfy.sh/ | ||
- VIGILANT_NOTIFICATION_NTFY_TOPIC=testingtesting | ||
volumes: | ||
- "./feeds.yaml:/app/feeds.yaml" | ||
restart: unless-stopped | ||
security_opt: | ||
- no-new-privileges:true | ||
``` | ||
## Manually | ||
Clone the repository. | ||
1) Download the [latest release](https://github.com/VerifiedJoseph/vigilant/releases/latest) to your server and extract the zip archive. | ||
``` | ||
git clone https://github.com/VerifiedJoseph/vigilant.git | ||
``` | ||
2) Setup the feeds to monitor using a [feeds file](feeds.md). | ||
Install dependencies with composer. | ||
3) Set the configuration using [environment variables](configuration.md) with `config.php` copied from [`config.example.php`](../config.example.php). | ||
|
||
``` | ||
composer install --no-dev | ||
``` | ||
``` | ||
cp config.example.php config.php | ||
``` | ||
|
||
There are two scripts that can be used to run Vigilant: `vigilant.php` and `daemon.php`. | ||
4) Create a scheduled task with cron (below) or similar that runs `vigilant.php` at least every 5 minutes. | ||
|
||
`vigilant.php` is designed to be used with a task scheduler like cron, whilst `daemon.php` is designed to used as a daemon process. | ||
``` | ||
1 * * * * php path/to/vigilant/vigilant.php | ||
``` | ||
|
||
Cron example: | ||
``` | ||
5 * * * * php vigilant.php | ||
``` | ||
When Vigilant running via a task scheduler, the script should ran at a minimum of every 5 minutes. |