CDC Noticeboard on Your Mail: Where Automatic Updates Turn Chaos into Pleasure!
Report Bug
·
Request Feature
Table of Contents
MFTP continuously monitors the CDC Noticeboard and forwards incoming notices to the configured email address, whether it's an individual account or a Google Group. It is also available as a service and as a cronjob on linux systems along with a heath checkup utility to monitor and notify for any errors.
Warning
This tool is completely legal, but the way you use it can get you into legal trouble. Some things you cannot do are:
- Use this tool to send CDC notifications to any non-KGPian.
- Use this tool on a wide scale or publicise its running instance without consent from the Placement Committee.
Please use this tool responsibly and within ethical and legal bounds. We do not promote violating company policies or laws. The extent of the punishment may very from disciplinary action by the institute to blacklisting from CDC process.
To set up a local instance of the application using docker, follow the steps below.
The following requirements are to be satisfied for the project to function properly:
- Clone the repository and cd into it
git clone https://github.com/metakgp/mftp cd mftp
- Follow the installation steps for mftp with docker
- Follow the installation steps for mftp doctor with docker
It is mandatory to provide all of the following env variables
before the docker-compose command.
MFTP_CONFIG
: Absolute path tomftp_config
directoryDOCTOR_CONFIG
: Absolute path todoctor_config
directoryMFTP_MODE
: Mode of sending mail - --smtp, --gmail-api or --ntfy
sudo MFTP_CONFIG=/path/to/mftp_config DOCTOR_CONFIG=/path/to/doctor_config MFTP_MODE="--smtp" docker-compose up -d # Using SMTP for sending mails
sudo MFTP_CONFIG=/path/to/mftp_config DOCTOR_CONFIG=/path/to/doctor_config MFTP_MODE="--gmail-api" docker-compose up -d # Using Gmail API for sending mails
sudo MFTP_CONFIG=/path/to/mftp_config DOCTOR_CONFIG=/path/to/doctor_config MFTP_MODE="--ntfy" docker-compose up -d # Using NTFY for serving notifications
Note
There also is DOCTOR_MODE
as one of the environment variables, which is optional and considers one value only --cron
. We will use it in the sub-section just next.
It is also possible to run these docker containers as a cronjob:
- Comment out the line
restart: unless-stopped
in docker-compose.yml - Append
--cron
into theMFTP_MODE
env variable and setDOCTOR_MODE
to--cron
as well. As follows:- Using Cronjob to run containers and SMTP to send mails
sudo MFTP_CONFIG=/path/to/mftp_config DOCTOR_CONFIG=/path/to/doctor_config MFTP_MODE="--smtp --cron" DOCTOR_MODE="--cron" docker-compose up -d
- Using Cronjob to run containers and Gmail API to send mails
sudo MFTP_CONFIG=/path/to/mftp_config DOCTOR_CONFIG=/path/to/doctor_config MFTP_MODE="--gmail-api --cron" DOCTOR_MODE="--cron" docker-compose up -d
- Using Cronjob to run containers and NTFY to serve notifications
sudo MFTP_CONFIG=/path/to/mftp_config DOCTOR_CONFIG=/path/to/doctor_config MFTP_MODE="--ntfy --cron" DOCTOR_MODE="--cron" docker-compose up -d
- Using Cronjob to run containers and SMTP to send mails
- Add the updated command with desired cron expression into your cronjob using crontab -e
To set up a local instance of the application without using docker, follow the steps below.
- Shells
bash
zsh
- OS(s)
- any
*nix
[GNU+Linux
andUnix
]
- any
The following requirements are to be satisfied for the project to function properly:
Now that the environment has been set up and configured to properly compile and run the project, the next step is to download and configure the project locally on your system.
- Clone the repository
git clone https://github.com/metakgp/mftp cd mftp
- Install required dependencies
pip3 install -r requirements.txt
- Follow the installation steps for mftp
- Follow the installation steps for mftp doctor
-
For linux systems, MFTP & MFTP Doctor are available as a service and as cronjob. To configure them, execute the following commands after navigating into the root directory of the project (inside the mftp folder).
cd service/ ./configure-service.sh
After configuring MFTP as a service, you can use the mftp
command with several options to interact with the tool as a service.
Following is the help menu for the service.
Usage: mftp [COMMAND] [OPTIONS]
Command:
-h, --help Display this help and exit
logs [OPTIONS] Display last 25 lines of mftp log file
Options:
clear Clear the mftp log file
NUM Display last NUM lines of mftp log file
disable Disable mftp service
enable Enable mftp service
status Check status of mftp service
restart Restart mftp service
stop Stop mftp service
start Start mftp service
cronjob [OPTIONS] Use mftp as a cronjob
Options:
enable [NUM] Enable mftp cronjob after every NUM minutes (default is 2 minutes)
disable Disable mftp cronjob
status Check status of mftp cronjob
doctor [OPTIONS] Use mftp doctor as a cronjob
Options:
enable [NUM] Enable doctor cronjob after every NUM minutes (default is 2 minutes)
disable Disable doctor cronjob
status Check status of doctor cronjob
logs [OPTIONS] Display last 25 lines of doctor log file
Options:
clear Clear the doctor log file
NUM Display last NUM lines of doctor log file