Skip to content

confirmedcode/Renewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Renewer Server

This is a private Node.js server that runs subscription updates once daily. It only runs updates for subscriptions whose expiration_date are a few days before and after the current date.

The expiration_date date range that Renewer checks daily are determined by the Parameter Store values in START_DAYS_AGO and END_DAYS_LATER. For example, if these values are 2 and 5 respectively, and the current date is October 8th, then all subscription rows in the database with expiration_date of October 6th to October 13th will be updated.

Subscriptions in the database need to be updated daily in order to track status changes of user subscriptions. For example, if a user renews their iOS subscription, Renewer updates the that user's subscription entry in our database so that we continue to allow the user access to the VPN service.

Renewer can also be manually triggered to update a specific set of subscriptions, described in the APIs below.

AWS Prerequisites

  • Run the Renewer CloudFormation and all its prerequisites
  • (For Manual Usage) Add your machine's IP to the Inbound rules of the Renewer instance's Security Group

Automatic Usage

Once deployed, every day at 12:50 UTC the Renewer updates all subscription rows with expiration_date between the START_DAYS_AGO and END_DAYS_LATER date range.

Reporting

Basic counts of successful and failed updates are published to CloudWatch Metrics. Detailed logs of updates are published to CloudWatch Logs.

Manual Usage

Update Subscriptions in Default Range

Updates all subscription rows with expiration_date between the START_DAYS_AGO and END_DAYS_LATER date range.

Request

GET /renew

Response

Status: 200 OK
{
	message: OK
}

Update All Subscriptions

Request

GET /renew-all

Response

Status: 200 OK
{
	message: OK
}

Update One User's Subscriptions

Request

GET /renew-user
Name Type Description
id string Required The ID of the user whose subscriptions you wish to update.

Response

Status: 200 OK
{
	message: [id] check started.
}

Update Failed Checks

Request

GET /renew-all

Response

Status: 200 OK
{
	message: Failed check started.
}

Health Check

Request

GET /health

Response

Status: 200 OK
{
	message: OK
}

Feedback

If you have any questions, concerns, or other feedback, please let us know any feedback in Github issues or by e-mail.

We also have a bug bounty program -- please email engineering@confirmedvpn.com for details.

License

This project is licensed under the GPL License - see the LICENSE.md file for details

Contact

engineering@confirmedvpn.com

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published