luolongfei/freenom

By luolongfei

Updated over 2 years ago

Freenom 域名自动续期(Docker 版本)。Automatically renew your freenom domain.

Image
135

500K+

luolongfei/freenom repository overview

freenom logo

Freenom 域名自动续期 Freenom domain name auto-renewal

stars pulls

中文文档请参考 这里

This program is used to automatically renew your freenom domain name. As you know, freenom is the only merchant in the world that offers free top-level domains, but it needs to be renewed every year, which is a hassle, and this tedious task should be left to the program. You just need to do a little simple configuration to get the program running.

Note that you need to prepare a Docker environment first, see Docker Official Installation Guide for details on how to install Docker on various Linux distributions.

Github repository:

https://github.com/luolongfei/freenom

  • latest ( Dockerfile )
  • 0.6.1 0.6.2
  • 0.5 0.5.1 0.5.3 0.5.4
  • 0.4.3 0.4.4 0.4.5
  • 0.3
  • koyeb

Supported architectures

linux/amd64linux/arm64linux/ppc64lelinux/s390xlinux/386linux/arm/v7linux/arm/v6

(Theoretically supports Synology, QNAP, Raspberry Pi and various types of VPS)

Demo

Example of notification email

How to use

The commands are 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 only difference between the two commands here is that the following command has more -e RUN_AT="11:24" parameters than the above command, where 11:24 means that the task is executed at 11:24 every day, and you can customize this time. The RUN_AT parameter here also supports the time form in the CRON command, for example, -e RUN_AT="9 11 * * *", which means that the renewal task is executed at 11:09 every day. It is worth noting that all the times mentioned here refer to Beijing time (UTC+8)

Note: Customizing the script execution time is not recommended. Because you may define the same time point with many people, which may lead to a group of people launching requests to Freenom's server at the same time, making Freenom unable to provide services stably. If you do not customize the time, the program will automatically specify a random time as the execution time. It will be reassigned every time the container is restarted.

[ Click me for the explanation of Docker command parameters above ]
CommandMeaning
docker runStart running a container
-dThe container runs in the background and outputs the container ID
--nameAssign an identifier to the container to facilitate future operations such as start, stop, delete, etc.
--restartConfigure the container startup type, always means restart the container automatically
-vMounted volume (volume), the path of the container after the colon, the path of the host before the colon (only absolute paths are supported), $(pwd) indicates the current directory, if it is a Windows system, you can replace $(pwd) with ${PWD}
-eSpecify the environment variables in the container
luolongfei/freenomThis is the full pathname of the image downloaded from docker hub

At this point, your auto-renewal container is up and running, after executing ls -a you can see that in your current directory, there is a .env file and a logs directory, the logs directory is used to store the program logs, .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 execute docker restart freenom to restart the container, and if the configuration is correct, you will soon receive notifications from the program.

[ Click me to see the meaning of some configuration items in the .env file ]
Variable NameMeaningDefault ValueMustRemarks
FREENOM_USERNAMEFreenom Account-yesIf you are using a third-party social account, please bind your email address on the Freenom admin page, and then you can use your email account to log in.
FREENOM_PASSWORDFreenom Password-yesSome special characters may need to be escaped, see the comments in the .env file for details
MULTIPLE_ACCOUNTSConfigure multiple accounts-noThe format of multiple accounts and passwords must be "<account1>@<password1>|<account2>@<password2>|<account3>@<password3>", if multiple accounts are set here, the above FREENOM_USERNAME and FREENOM_PASSWORD can be configured without
MAIL_USERNAMERobot email account-noSupport Gmail, QQ mailbox, 163 mailbox and Outlook mailbox. For details, please refer to Configuring the mail delivery function
MAIL_PASSWORDRobot's email password-noRecommend filling in the application-specific password for gmail: https://support.google.com/mail/answer/185833
TOMailbox for receiving notifications-noYour own most commonly used email address for receiving domain-related emails from the bot
MAIL_ENABLEWhether to enable the email push function0no1: enabled
0: not enabled
Not enabled by default, if set to 1 to enable the email push function, the MAIL_USERNAME, MAIL_PASSWORD, TO variables above will become required fields
TELEGRAM_CHAT_IDYour chat_id-noYou can get your own id by sending /start to @userinfobot
TELEGRAM_BOT_TOKENThe token for your Telegram bot-no
TELEGRAM_BOT_ENABLEWhether to enable Telegram Bot push function0no1: enabled
0: not enabled
Not enabled by default, if set to 1, the TELEGRAM_CHAT_ID and TELEGRAM_BOT_TOKEN variables above must be set
NOTICE_FREQNotification frequency1no0: only when there is a renewal operation
1: executed every time
CUSTOM_LANGUAGEApplication language configurationzhyeszh: zh means Chinese
en: en means English

For the meaning of the various configuration items in the .env file, please refer to the .env.example file.

FAQ

How can you 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, then execute docker logs freenom to check the output, and observe the word executed successfully in the output. then the configuration is correct.

How do I 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, then execute the above docker run -d --name freenom --restart always -v $(pwd):/conf -v $(pwd)/logs:/app/logs luolongfei/freenom to redeploy it, so that it is the latest code after deployment. Of course, there may be changes in the .env file corresponding to the new version, don't worry, the program will automatically update the .env file content and migrate the existing configuration over.

A one-sentence operation, i.e. execute the following command in the directory where the .env file is located, will 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
How do I switch the language of the program to English?

You just need to set the value of CUSTOM_LANGUAGE in the .env file to en to switch the program to English.

Docker Common Commands

View container online status and size

$ docker ps -as

View the log of the container output

$ docker logs freenom

Restart container

$ docker restart freenom

Stop container

$ docker stop freenom

Remove container

$ docker rm -f freenom

View docker container resource usage information (CPU, memory, etc.)

$ docker stats --no-stream

Restart Docker (not container)

$ systemctl restart docker

Show logs

$ docker logs -tf --tail 10 freenom

Donation

If you find this project helpful, please consider supporting the project going forward. Your support is greatly appreciated.

ko-fi

PayPal: https://www.paypal.me/mybsdc

Tag summary

Content type

Image

Digest

sha256:10237c853

Size

36.9 MB

Last updated

over 2 years ago

docker pull luolongfei/freenom