GithubHelp home page GithubHelp logo

ztvzbj / webkeepalive Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 49.66 MB

basic background service that periodically sends HTTP requests to infrequently visited websites to keep them active.

C# 100.00%

webkeepalive's Introduction

WEB KEEP ALIVE

A basic background service that periodically sends HTTP requests to infrequently visited websites to keep them active. The service is administered using a Desktop Application

This solution consists of two components: a Windows Service and a Desktop Application for monitoring and controlling the service. The Desktop Application provides functionality for adding and removing websites you want to keep active, and starting and stopping the Windows Service.

Features:

  • Adds unlimited number of websites to the list.
  • Sends HTTP GET requests to the websites every 30 minutes.
  • User-friendly interface for easy administration.

Notes:

  • This first release of the application has a fixed send rate of 30 minutes. While it is possible to make the send rate dynamic (i.e. allowing the user to specify the frequency of requests in minutes or seconds), this feature has not been included in this release to avoid potential misuse (e.g. as a tool for conducting a DOS attack).
  • The primary use case for this application is for keeping websites hosted on free Cloud tiers alive, such as Azure App Services. It is important to note that many free cloud services have limits on daily processing power usage, and sending a high number of requests in a short period of time may result in additional charges from the cloud provider.
  • When adding URLs to the list of websites to keep active, it is recommended to choose an endpoint that does not consume a significant amount of processing power. This helps to minimize resource usage on your server. If the website's home page is feature-rich and requires access to a database, consider adding a simpler page such as the "About" or "Privacy" page, or creating a dedicated endpoint specifically for this purpose.
  • Future releases may include the dynamic send rate feature after further study and consideration.

Installation Steps

  1. Download the latest release of the application from here. Store the folder in a safe place.
  2. Open a PowerShell with administrator privileges.
  3. Use the following command to create a Windows Service:

sc.exe Create WebKeepAliveService binPath= "path to the downloaded WebKeepAlive.Service.exe"

Example:

image

  1. Run the WebKeepAlive.UI (as admin) and you can start, stop, add and delete websites from there.

image image

To verify that the service is installed, you can check for WebKeepAliveService in the list of services in the Windows Control Panel. From there, you can also start, stop the service, and set it to start automatically on system startup.

image

Notes:

When running the service, a folder named WebKeepAlive will be created at C:/WebKeepAlive, containing an SQLite database as well as a folder for logs. If you want to monitor the progress of sending requests or any potential issues, you can review the logs within this folder.

image

Note that the published application is not self-contained, and therefore requires the .NET runtime to be installed for both the service and the user interface to function properly

Development

If you plan to run the project in Visual Studio and continue development, keep in mind the following points:

  • When starting or stopping the service, make sure to use an absolute path to the generated bin/Debug/net6.0/WebKeepAlive.Service.exe file, during the development process.

Use this:

...

var start_info = new ProcessStartInfo
{
    FileName = @" Path_to_project\WebKeepAlive.Service\bin\Debug\net6.0\WebKeepAlive.Service.exe",
    UseShellExecute = true,
    CreateNoWindow = true
};
var starting_result = Process.Start(start_info);
...

instead of this:

...
    ServiceController service = new ServiceController(AppDefaults.SERVICE_NAME);

    service.Stop();
...
        
  • If you plan to start or stop the Windows service (not just the generated executable), you will need to run Visual Studio as an administrator. Additionally, admin privileges are required for unit tests to pass.

webkeepalive's People

Contributors

ayoubdkhissi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.