Giter Site home page Giter Site logo

cloudflare-workers-e5renew's Introduction

Cloudflare-Workers-E5Renew

Deploy

中文文档

Description

Use Cloudflare Workers to renew your E5 subscription by calling the Microsoft Graph API randomly. Not guaranteed the renewal will be successful.

Deploying

Deploy to Cloudflare Workers (Not sure if this button works.)

Cloudflare Workers

  1. Create a new Workers KV namespace.
  2. Create a new Cloudflare Workers service and click on the "Quick edit" button.
  3. Copy the contents of the index.js file into the code field and click "Save and Deploy".
  4. Back to workers page and go to the "Settings" tab. In the "Environment Variables" section, add the following environment variables:
    • CRON_PATH: The path to trigger the cron job manually. For example: /cron. Leave it blank if you don't want to trigger the cron job manually.
    • TGBOT_TOKEN: The token of the Telegram bot for sending notifications. Get it from the BotFather. Or leave it blank if you don't want to be notified.
    • TGBOT_CHAT_ID: The user ID that the notifications will be sent to. Get it from the userinfobot bot. Or leave it blank if you don't want to be notified.
    • MS_CLIENT_ID: The client id of the Microsoft application. Get it in the step below.
    • MS_CLIENT_SECRET: The client secret of the Microsoft application. Get it in the step below.
    • MS_REDIRECT_URI: The redirect uri of the Microsoft application. It should be in the format of https://welcome.developers.workers.dev/callback, where welcome is the name of worker service and developers is the name your subdomain.
  5. In the "KV Namespace Bindings" section, add the following bindings:
    • Variable name: Token
    • KV Namespace: The KV namespace created in step 1.
  6. Go to "Triggers" tab and click on the "Add Cron Trigger" button in the "Cron Triggers" section. Choose whatever frequency you want and click "Add Trigger".

Microsoft Azure AD

  1. Go to the Azure portal and select "Azure Active Directory" from the menu.
  2. Select "App registrations" and click the "New registration" button from the top menu.
  3. Enter the name whatever you want for your app. For the type of supported account types, select Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).
  4. For the "Redirect URI" field, select Web, and in the "URL" field, enter the following URL: https://welcome.developers.workers.dev/callback where welcome is the name of worker service and developers is the name your subdomain.
  5. Click the "Register" button.
  6. From the "Certificates and secrets" menu, click "Client secret" tab and click the "New client secret" button. Enter the description and select the expiration time. Click the "Add" button. The client secret will be shown in the "Value" field. Copy the client secret and paste it into the MS_CLIENT_SECRET environment variable of the workers service.
  7. From the "Overview" tab, copy the "Application (client) ID" field and paste it into the MS_CLIENT_ID environment variable of the workers service.

Authorize

Access the Cloudflare Workers via the default route like https://welcome.developers.workers.dev/. Click the "Authorize" button and you will be redirected to the Microsoft login page. Just click the "Accept" button and you will be redirected back to the Cloudflare Workers page. If everything is OK, "Successfully logged in" will be shown. Enjoy!

cloudflare-workers-e5renew's People

Contributors

m3chd09 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.