Documentation: English version | 中文版
announcement
Special Thanks
introduction
Effect
Prepare in advance
Configure the message delivery function (supports email delivery/Telegram Bot/Enterprise WeChat/Server Sauce/Bark and other message delivery methods)
Deploy via Docker Compose
Deploy via Docker (recommended, one of the simplest deployment methods)
Deploy via Heroku
Deploy via Railway
Deployed through Koyeb (recommended for users who do not have their own server to use this solution, one-click deployment)
Deploy via Mogenius (no longer possible)
Deployed through various cloud functions (currently each platform has turned on the charging mode and has given up support)
Directly pull source code for deployment
Donation List Donation List
Sponsor Donation
Belief
author
All contributors
TODO List
Other language implementations of this project
Acknowledgments
Open source agreement
Freenom 续期事务局
group for communication, testing, and feedback. To join, you can directly visit https://t.me/freenom_auto_renew, or scan the QR code to join:Thanks to JetBrains for providing a non-commercial open source software development license.
Thanks for non-commercial open source development authorization by JetBrains.
As we all know, Freenom is the only merchant on the planet that provides free top-level domain names, but they need to be renewed annually, with each renewal being up to one year. Since I applied for a bunch of domain names, and they were not applied for at the same time, every renewal was a hassle, so I wrote this automatic renewal script.
Regardless of the success or failure of the renewal or an error in program execution, you will receive a notification from the script. If it is a notification related to the success or failure of renewal, the notification will include the expiration days of the unrenewed domain name and other contents. Shown here is the content of the notification email.
Debian
is recommended. The PHP
version must be php7.3
or above. If you have a Docker
environment, you can ignore this restriction. If you don't have a server, you can refer to this document to deploy to various free environments.Gmail
, QQ邮箱
, 163邮箱
and Outlook邮箱
, the program will automatically determine the sending mailbox type and use the appropriate configuration. If you are using another third-party mailbox or a self-built mail service, please refer to the comments related to mail configuration in the .env.example file for configuration.送信邮箱
and收信邮箱
above are optional, because the program currently supports邮件送信
/ Telegram Bot
/企业微信
/ Server 酱
/ Bark
and other mail sending methods.送信邮箱
and收信邮箱
are only available when you use邮件送信
. It is required. For other sending methods, please refer to the configuration of sending function below. Here we will introduce the configuration method of邮件送信
/ Telegram Bot
/企业微信
/ Server 酱
/ Bark
delivery method, as well as the required information. You can choose any one of the delivery methods for configuration, and jump directly to the corresponding document to view it. Can. If you are an IOS user, it is recommended to use the Bark
sending method. Users on other platforms can choose an acceptable sending method according to their own preferences. It is not recommended to use Server 酱
to send messages. Server 酱
has a limit on the number of messages sent per day, and you need to be a member to directly see the message content. Otherwise, you need to jump to the Server 酱
website to view the content. These are all reasons why it is not recommended. The same configuration can be used directly to send letters via企业微信
. When sending letters via企业微信
, you can see the content of the letter directly on the ordinary WeChat client.
Quickly go to the specified location of the document:
Mail delivery
Telegram Bot
Enterprise WeChat
Server sauce
Bark delivery
The following introduces the settings of Gmail
, QQ邮箱
and 163邮箱
respectively. You only need to look at the parts you need. Note that both QQ邮箱
and 163邮箱
use the method of账户加授权码
to log in, and谷歌邮箱
uses the method of账户加密码
or账户加授权码
to log in, please be informed. I also want to complain that for domestic mailboxes, you have to spend 10 cents to send a text message to the mailbox provider to get the authorization code.
(Click to expand or collapse)
It is recommended to turn on the privacy mode of the browser before logging in to gmail to set up, to prevent being unable to jump to the correct setting address when you have multiple gmail accounts.
1. In设置>转发和POP/IMAP
, check
Then save the changes.
2. Turn on two-step verification
Refer to official documentation: Turn on two-step verification
3. Configure the use of application-specific password to log in to the email address
Refer to the official documentation: Log in with an application-specific password
Since Gmail no longer supports "insecure login methods", you can currently only log in using your account plus an application-specific password.
Under设置>账户>POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务
, enable POP3/SMTP服务
At this time, the cheating QQ mailbox will ask you to send a text message to Tencent using your mobile phone. After sending, click我已发送
Then you can see your email authorization code. Use your email account and authorization code to log in. Write down the authorization code.
Under设置>POP3/SMTP/IMAP
, enable POP3/SMTP服务
and IMAP/SMTP服务
and save
Now click on客户端授权密码
in the sidebar and obtain the authorization code. The screen you see may be different from mine, because I have already obtained the authorization code, so there is only a重置授权码
button. Here, you can apply for authorization according to the website prompts. Code, NetEase is as disgusting as Tencent. You need to send it a text message with your mobile phone to get the authorization code.
163 After the mailbox is sent, if the recipient does not receive it, he can look for it in the spam.
After the above action is completed, in the .env
file, set MAIL_USERNAME
and MAIL_PASSWORD
to your email and password (or token), set TO
to your receiving email, and then set the value of MAIL_ENABLE
to 1
to enable the mailbox Send message function.
The three mailbox setting methods are introduced above. If you do not want to use email delivery, change the value of MAIL_ENABLE
in the .env
file in the root directory to 0
to turn off the email push method.
The mail delivery part is finished.
For specific configuration steps of [Telegram Bot], please refer here
For the specific configuration steps of [Enterprise WeChat], please refer here
For specific configuration steps of [Server Sauce], please refer here
For the specific configuration steps of [Bark Send], please refer here
The space related to configuring the messaging function is complete. Let’s start with several ways to use this project. It is recommended to use Docker method without worrying about the environment.
Note that it is currently a beta version and only supports installation on amd64 architecture machines. Users of arm or other architectures please be patient and wait for subsequent updates. Or if you need a server, you can consider cheap VPS in the United States
Debian/Ubuntu (recommended)
apt-get update -y ;
apt-get install -y wget vim git make ;
wget -qO- get.docker.com | bash ;
systemctl start docker ;
sudo systemctl enable docker.service ;
sudo systemctl enable containerd.service ;
docker version ;
DOCKER_COMPOSE_VER=2.24.3 ;
DOCKER_CONFIG=/usr/local/lib/docker ;
mkdir -p $DOCKER_CONFIG /cli-plugins ;
curl -SL https://github.com/docker/compose/releases/download/v ${DOCKER_COMPOSE_VER} /docker-compose-linux-x86_64 -o $DOCKER_CONFIG /cli-plugins/docker-compose ;
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose ;
docker compose version ;
CentOS
yum update -y ;
yum install -y wget vim make ;
wget -qO- get.docker.com | bash ;
systemctl start docker ;
sudo systemctl enable docker.service ;
sudo systemctl enable containerd.service ;
docker version ;
DOCKER_COMPOSE_VER=2.24.3 ;
DOCKER_CONFIG=/usr/local/lib/docker ;
mkdir -p $DOCKER_CONFIG /cli-plugins ;
curl -SL https://github.com/docker/compose/releases/download/v ${DOCKER_COMPOSE_VER} /docker-compose-linux-x86_64 -o $DOCKER_CONFIG /cli-plugins/docker-compose ;
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose ;
docker compose version ;
git clone https://github.com/luolongfei/freenom.git && cd freenom
3.1.1 Visit https://wit.ai
3.1.2 Log in with a Facebook account or register an account with an email address. You only need an email address to register.
3.1.3 Go to https://wit.ai/apps screen and create a new app
3.1.4 Select English as the language, any name, select Private as the type, and create it.
3.1.5 Go to Management > Settings (https://wit.ai/apps//settings) screen
3.1.6 Copy the Client Access Token. The following needs to be written into the .env file, WIT_AI_KEY='Client Access Token you copied'
Modify the contents of the .env configuration file to your own configuration. If you are upgrading from an old version, you can also directly copy the old version of .env to the root directory of the new version of the project, and the script will automatically update it. For the configuration meaning, refer to the annotations in the .env.example file.
cp .env.example .env ;
vim .env ;
After the modification is completed, enter :wq
to save and exit.
Note: The following commands need to be executed in the directory where docker-compose.yml is located to be effective.
make up
Yes, it's that simple. Then you can execute make logs
to view the real-time logs.
Start or update to the latest version
make up
stop
make down
View real-time logs
make logs
Clean up the space occupied by containers
make clear
Restart container
make restart
The deployment via docker compose section ends.
If you have your own server, this is the most recommended deployment method.
The Docker warehouse address is: https://hub.docker.com/r/luolongfei/freenom. Stars are also welcome. The architectures supported by this image are linux/amd64
, linux/arm64
, linux/ppc64le
, linux/s390x
, linux/386
, linux/arm/v7
, linux/arm/v6
. Theoretically, it supports群晖
,威联通
, and树莓派
. And various types of VPS
.
Upgrade the source and install the software (choose one of the following two lines of commands according to your own system)
Debian/Ubuntu
apt-get update && apt-get install -y wget vim make
CentOS
yum update && yum install -y wget vim make
Execute this command to wait for Docker to be automatically installed
wget -qO- get.docker.com | bash
Note: Please use a VPS with KVM architecture. VPS with OpenVZ architecture does not support the installation of Docker. In addition, CentOS 8 does not support using this script to install Docker. For more information about Docker installation, please refer to the Docker official installation guide.
Start the Docker service
systemctl start docker
Check Docker running status
systemctl status docker
Add the Docker service to start automatically at boot
systemctl enable docker
The command is as follows
docker run -d --name freenom --restart always -v $( pwd ) :/conf -v $( pwd ) /logs:/app/logs luolongfei/freenom
Or, if you want to customize the script execution time, the command is as follows
docker run -d --name freenom --restart always -v $( pwd ) :/conf -v $( pwd ) /logs:/app/logs -e RUN_AT= " 11:24 " luolongfei/freenom
The above command only has one more -e RUN_AT="11:24"
than the previous one, where 11:24
means that the renewal task will be executed at 11:24 every day, Beijing time. You can customize this time. The RUN_AT
parameter here also supports the time format in the CRON command. For example, -e RUN_AT="9 11 * * *"
means that the renewal task will be executed at 11:09 Beijing time every day. If you do not want to execute the task every day, you only want to execute it every other day. It takes a few days to execute, just modify the value of RUN_AT
.
Note: Customizing script execution time is not recommended. Because you may define the same time point as many people, this may cause everyone to initiate requests to Freenom's server at the same time, making Freenom unable to provide stable services. If you do not customize the time, the program will automatically specify a random time point from 06 to 23 o'clock Beijing time as the execution time, and it will be automatically re-specified every time the container is restarted.
Order | meaning |
---|---|
docker run | Start running a container |
-d parameter | The container runs in the background and outputs the container ID |
--name parameter | Assign an identifier to the container to facilitate future operations such as starting, stopping, deleting, etc. |
--restart parameter | Configure the container startup type, always means to automatically start the container when the docker service restarts |
-v parameter | Mount the volume (volume). After the colon is the path of the container. Before the colon is the path of the host (only absolute paths are supported). $(pwd) represents the current directory. If it is a Windows system, you can replace it ${PWD} $(pwd) |
-e parameter | Specify environment variables in the container |
luolongfei/freenom | This is the full path name of the image downloaded from docker hub |
At this point, your automatic renewal container is running. After executing ls -a
, you can see that there is an .env
file and a logs
directory in your current directory. The logs
directory stores program logs, and .env
is the configuration file. Now directly execute vim .env
to change all the configuration items in the .env
file to your own and save it. Then restart the container. If the configuration is correct, you will receive the relevant email soon.
variable name | meaning | default value | Is it necessary | Remark |
---|---|---|---|---|
FREENOM_USERNAME | Freenom account | - | yes | Only email accounts are supported. If you are a user who logs in using a third-party social account, please bind your email on the Freenom management page. After binding, you can use your email account to log in. |
FREENOM_PASSWORD | Freenom password | - | yes | Some special characters may need to be escaped. For details, see the comments in the .env file. |
MULTIPLE_ACCOUNTS | Multiple account support | - | no | The format of multiple accounts and passwords must be " <账户1>@<密码1>|<账户2>@<密码2>|<账户3>@<密码3> ", be careful not to omit the "<>" symbol. Otherwise, it cannot be matched correctly. If multiple accounts are set up, the above FREENOM_USERNAME and FREENOM_PASSWORD do not need to be set. |
MAIL_USERNAME | Robot email account | - | no | Support Gmail , QQ邮箱 , 163邮箱 and Outlook邮箱 |
MAIL_PASSWORD | Robot email password | - | no | Fill in the application-specific password Gmail , and fill in the authorization code for QQ邮箱 or 163邮箱 |
TO | Email to receive notifications | - | no | Your most commonly used email address, used to receive domain name-related emails sent by robot email addresses |
MAIL_ENABLE | Whether to enable email push function | 0 | no | 1 : enable0 : Not enabled by default. If set to 1 , the mail push function is enabled, and the above MAIL_USERNAME , MAIL_PASSWORD , and TO variables become required. |
TELEGRAM_CHAT_ID | your chat_id | - | no | You can get your own id by sending /start to @userinfobot |
TELEGRAM_BOT_TOKEN | Your Telegram bot ’s token | - | no | |
TELEGRAM_BOT_ENABLE | Whether to enable Telegram Bot push function | 0 | no | 1 : enable0 : Not enabled by default. If set to 1 , the above TELEGRAM_CHAT_ID and TELEGRAM_BOT_TOKEN variables must be set. |
NOTICE_FREQ | Notification frequency | 1 | no | 0 : Only when there is a renewal operation1 : Executed every time |
NEZHA_SERVER | The IP or domain name of the Nezha probe server | - | no | |
NEZHA_PORT | Nezha probe server port | - | no | |
NEZHA_KEY | Nezha Probe Client Special Key | - | no | |
NEZHA_TLS | Nezha customer SSL/TLS encryption | - | no | 1 : enable0 : Not enabled |
For more configuration item meanings, please refer to the comments in the .env.example file.
How to verify that your configuration is correct?
After modifying and saving the .env
file, execute docker restart freenom
to restart the container, wait for about 5 seconds, and then execute docker logs freenom
to view the output content. If there is a word执行成功
in the output content, it means the configuration is correct. If you haven't had time to configure the delivery email address and other content, you can disable the email function first.
How to upgrade to the latest version or redeploy?
In the directory where .env
is located, execute docker rm -f freenom
to delete the existing container, then execute docker rmi -f luolongfei/freenom
to delete the old image, and then execute the above docker run -d --name freenom --restart always -v $(pwd):/conf -v $(pwd)/logs:/app/logs luolongfei/freenom
can be redeployed, so that it will be the latest code after deployment. Of course, the .env
file corresponding to the new version may have changes. Don’t worry, the program will automatically update the contents of the .env
file and migrate the existing configuration.
In one sentence, execute the following command in the directory where the .env
file is located to complete the update and upgrade:
docker rm -f freenom && docker rmi -f luolongfei/freenom && docker run -d --name freenom --restart always -v $( pwd ) :/conf -v $( pwd ) /logs:/app/logs luolongfei/freenom
Check the online status and size of the container
docker ps -as
View the container’s running output log
docker logs freenom
Restart container
docker restart freenom
Stop the container from running
docker stop freenom
Remove container
docker rm -f freenom
Check the CPU, memory and other information occupied by the docker container
docker stats --no-stream
View Docker installation version and other information
docker version
Restart Docker (non-container)
systemctl restart docker
End of content on container deployment.
Heroku has stopped providing free services on 2022-11-28, so forget this article. Official announcement: https://blog.heroku.com/next-chapter
For specific steps on [Deploying via Heroku], please refer here
Railway has updated its terms of service and added a monthly usage limit. The new terms of service result in a maximum of about 21 days per month. Unless you verify your credit card, there is no such limit . Detailed terms and conditions can be found here.
For specific steps on [Deployment via Railway], please refer here
It is recommended that users who do not have their own servers use this deployment plan. This plan is completely free.
For specific steps on [Deployment via Koyeb], please refer here
After reading the specific content of the upstream document and confirming that you can do it , you can click the button below to try one-click deployment:
The free package has been offline and is no longer available. #208
All cloud functions use the same compressed package and have been processed for compatibility. The download address is: https://github.com/luolongfei/freenom/releases/download/v0.5.1/freenom_scf.zip. This document will update the compressed package download address here when a new version is released, so don’t worry, the package pointed to by the download address you see must be the latest version.
After downloading, you will get a zip file. Place the zip file in any directory you can find. Later we will upload it to various cloud functions in the form of zip files.
For specific steps on [Deploying via Tencent Cloud Function], please refer here
For specific steps on [deployment through Alibaba Cloud functions], please refer here
For the specific steps of [deployment through Huawei Cloud Function], please refer here
For the specific steps of [directly pulling source code for deployment], please refer here
If you encounter any problems or bugs, you are welcome to submit an issue (please submit issue
according to the template format so that I can quickly reproduce your problem, otherwise the problem will be ignored). If Freenom
changes the algorithm and causes this project to become invalid, please submit an issue and let me know in time. Repair, long-term maintenance of this project. Welcome star
~
Many thanks to "these users" for sponsoring and supporting this project!
If you feel this project is helpful to you, please consider sponsoring this project to encourage me to invest more time in maintenance and development. If you find this project helpful, please consider supporting the project going forward. Your support is greatly appreciated.
PayPal: https://www.paypal.me/mybsdc
Every time you spend money, you're casting a vote for the kind of world you want. -- Anna Lappe
Off topic: You can leave a message when sponsoring, and the message content will be displayed on the sponsorship list screen. If the sponsored image is not displaying properly, please visit: https://images.llfapp.com/pay.png
Your star
or赞助
is my motivation for long-term maintenance of this project. I sincerely thank every supporter. "Every time you spend money, you are voting for the world you want." In addition, recommending this project to more people is also a way of support. The more people who use it, the more motivation to update it.
Believe in the future and stay "sane".
Seriousness is how we participate in this society, and seriousness is how we change this society. ——Li Zhi
@anjumrafidofficial
(For more other languages, welcome to submit PR to update this list)
MIT