This article explores how to leverage Cloudflare's services to create various free projects, including an online video collection platform, a permanent free wireless storage solution, and a subscription management system. Lin Dujie, a self-proclaimed CardFly enthusiast, guides us through these projects.
Building a Free Online Video Collection Platform (LabelTV)
Registering for a Cloudflare Account
- Navigate to the provided Cloudflare official website link (found in the video description or blog post).
- Register for a free account using a Google account, Apple account, or email address.
- Log in to your newly created Cloudflare account.
Forking the LabelTV Project on GitHub
- Fork the LabelTV open-source project to your GitHub account. This allows you to connect the project to Cloudflare.
- If you don't have a GitHub account, register for free.
- On GitHub, click the "Fork" button on the LabelTV project page.
- Keep the default project name and click "Create Fork."
Deploying LabelTV on Cloudflare Pages
- In Cloudflare, navigate to the "Workers & Pages" section (usually found under the "Compute" option).
- Click "Create Project" and select the "Pages" option.
- Choose "Connect to Git" and select your GitHub account.
- Authorize Cloudflare to access your GitHub repositories.
- Select the forked LabelTV repository from your GitHub account.
- In the "Configure build settings" section, leave the "Production branch," "Build command," and "Build output directory" fields as their default values (usually blank).
- Click "Save and Deploy." This will initiate the build and deployment process.
- Once deployed, Cloudflare will provide a unique domain name for your LabelTV site.
Accessing and Configuring LabelTV
- Access your LabelTV site using the provided Cloudflare domain name.
- If the site doesn't load, consider using a VPN or binding your own domain name (discussed later).
- Agree to the terms and conditions.
-
Setting up a password: For enhanced security, set up a password. Go to the LabelTV project settings in Cloudflare. Under "Variables and Secrets," add two new variables:
-
PASSWORD
with a value (e.g., "0"). -
ADMIN_PASSWORD
(all caps) with a value (e.g., "0"). - Redeploy the application to apply these new variables. After a successful deployment, you will be prompted for the password upon accessing the site.
-
Binding a Custom Domain Name
- In Cloudflare, navigate to your deployed LabelTV project.
- Find the "Custom domains" section and add your own domain name.
- Add the required DNS records to your domain registrar to point your domain to Cloudflare.
- Activate the domain name in Cloudflare.
Deploying a Free Wireless Storage Solution (Telegram Image Bed)
Setting up a Telegram Channel and Bot
- Download and install Telegram on your computer or mobile device.
- Create a new Telegram channel (public or private, based on your preference).
- Search for "BotFather" in Telegram and start a chat with it.
- Use the
/newbot
command to create a new Telegram bot. Provide a name and username (ending in "bot") for your bot. BotFather will provide a token. - Add the newly created bot as an administrator to your Telegram channel.
Obtaining the Chat ID
- Search for "@get_id_bot" in Telegram and start a chat.
- Forward a message from your Telegram channel to the get_id_bot.
- The bot will reply with the channel's chat ID.
Deploying the Telegram Image Bed on Cloudflare Pages
- Fork the provided Telegram Image Bed open-source project to your GitHub account.
- In Cloudflare, navigate to "Workers & Pages" and create a new project.
- Connect to your GitHub account and select the forked Telegram Image Bed repository.
- Use the default settings and click "Save and Deploy."
-
Once deployed, go to the project settings in Cloudflare. Under "Variables and Secrets," add the following variables:
-
TELEGRAM_BOT_TOKEN
with the value being the token received from BotFather. -
TELEGRAM_CHAT_ID
with the value being the chat ID obtained earlier (include the minus sign if present). - Redeploy the application.
-
Uploading Images
- Access your deployed Telegram Image Bed site.
- Upload images. These images will be uploaded to your Telegram channel.
Deploying a Subscription Management and Reminder System
Creating a Cloudflare Worker
- In Cloudflare, navigate to "Workers & Pages."
- Create a new project. This time select "Workers" and then "Create empty Project."
- Give your project a name (e.g., "Subscriptions").
Adding the Code
- Go to the provided link, copy the code.
- Go back to Cloudflare. Clear all the JavaScript code, and paste the new code.
- Deploy the Worker.
Accessing and Configuring the System
- Access the deployed Worker URL.
- The default username is "admin" and the password is "password."
- Configure notification methods. To use Telegram notifications, use the bot token and chat ID obtained in the previous project.
- Add new subscriptions, including name, type, date, and pre-announcement settings.