mftp
mftp copied to clipboard
CDC noticeboard at your mail inbox.
MFTP - My Freaking Training & Placements
CDC Noticeboard on Your Mail: Where Automatic Updates Turn Chaos into Pleasure!
Report Bug
·
Request Feature
Table of Contents
- About The Project
-
Using docker
- Prerequisites
- Installation
-
Usage
- As a cronjob
-
Without using docker
- Supports
- Prerequisites
- Installation
- Usage
- Maintainer(s)
- Contact
- Additional documentation
About The Project
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.
(back to top)
Using docker
To set up a local instance of the application using docker, follow the steps below.
Prerequisites
The following requirements are to be satisfied for the project to function properly:
(back to top)
Installation
- 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
(back to top)
Usage
It is mandatory to provide all of the following env variables
before the docker-compose command.
-
MFTP_CONFIG
: Absolute path tomftp_config
directory -
DOCTOR_CONFIG
: Absolute path todoctor_config
directory -
MFTP_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.
As a cronjob
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
(back to top)
Without using docker
To set up a local instance of the application without using docker, follow the steps below.
Supports:
- Shells
-
bash
-
zsh
-
- OS(s)
- any
*nix
[GNU+Linux
andUnix
]
- any
(back to top)
Prerequisites
The following requirements are to be satisfied for the project to function properly:
(back to top)
Installation
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
-
Configure the mftp service
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
(back to top)
Usage
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
(back to top)
Maintainer(s)
(back to top)
Contact
(back to top)
Additional documentation
- License
- Code of Conduct
- Security Policy
- Contribution Guidelines
(back to top)