This is a simple application that monitors both SSL Cert and SSL key directories for new files. When new file(s) is detected, the application will copy the new file(s) to a destination directory, rename them to the appropriate name(s), and overwrite the existing ones for the BWC Discord Bots and Applications.
- Node.js (https://nodejs.org/en/download/) (v16.9.0 or higher)
- NPM (https://www.npmjs.com/get-npm) (should be installed with Node.js)
- PM2 (https://pm2.keymetrics.io/docs/usage/quick-start/) (Optional) - Used to run the application as a service.
- Download the latest release from the releases page.
- Extract the zip file to a directory of your choice.
- Open a terminal window and navigate to the directory where you extracted the zip file.
- Run
npm install
to install the required dependencies. - Run
npm run start
to start the application. - The application will now be running in the terminal window. You can close the terminal window if you wish.
- If you wish to run the application as a service, you can use PM2 to do so. Run
pm2 start ecosystem.config.json
to start the application as a service. You can then usepm2 stop <name>/<id>
to stop the application, andpm2 restart name>/<id>
to restart the application. - If you wish to run the application as a service on startup, you can use PM2 to do so. Run
pm2 startup
to generate the startup command for your system. Then run the command that was generated to enable PM2 to run on startup. Then runpm2 save
to save the current PM2 configuration. You can then usepm2 stop name>/<id>
to stop the application, andpm2 restart name>/<id>
to restart the application.
The application can be configured by editing the ecosystem.config.json
file. The following options are available:
name
- The name of the application. This is used by PM2 to identify the application.script
- The path to the application's main file. This should not be changed.NODE_ENV
- The environment that the application is running in. This can be set todevelopment
orproduction
. This is used to change the logging output between file (production) and console (development). The default value isproduction
. This should not be changed unless you are developing the application.CERT_FOLDER
- The path to the directory where the SSL Cert files are located. Provide the full path to your SSL Cert directory.KEY_FOLDER
- The path to the directory where the SSL Key files are located. Provide the full path to your SSL Key directory.DESTINATION_FOLDER
- The path to the directory where the SSL Cert and SSL Key files will be copied to. Provide the full path to your destination directory.
The application uses the winston
logger to log messages to the console and to a log file. The log file is named CertManager.log
.
- Fork the repository.
- Create a new branch for your changes.
- Make your changes.
- Create a pull request.
- Enjoy!
If you have any questions, feel free to contact me on:
- BWC Discord
[BWC] Patrick
- BWC Forums
Patrick
.