FreeBSD Certbot: AttributeError: ‘Meta’ object has no attribute ‘profiles’

The problem Requesting a certificate for example.com An unexpected error occurred: AttributeError: ‘Meta’ object has no attribute ‘profiles’ The solution Upgrade or reinstall py311-acme Debugging Check /var/log/letsencrypt/letsencrypt.log for JSON dump of the Directory object: DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directory. DEBUG:acme.client:Received response: { "keyChange": "https://acme-v02.api.letsencrypt.org/acme/key-change", "meta": { "caaIdentities": [ "letsencrypt.org" ], "profiles": { "classic": "https://letsencrypt.org/docs/profiles#classic", "shortlived":… Continue reading FreeBSD Certbot: AttributeError: ‘Meta’ object has no attribute ‘profiles’

Using peewee with mysql-connector-python

The problem You already import mysql.connector in your project and you want to use peewee, only problem is: peewee.ImproperlyConfigured: MySQL driver not installed! It’s a known issue since 2018: Why does not peewee support mysql-connector-python? · Issue #1501 · coleifer/peewee. The advice is to: either install pymysql or implement a proxy driver for the mysql.connector… Continue reading Using peewee with mysql-connector-python

Python script for certbot –manual-auth-hook and –manual-cleanup-hook for DNS-01 challenge

You can use a custom Python script as a hook for manual DNS-01 challenge. Example: certbot certonly –non-interactive –agree-tos \ –email webmaster@example.com \ –manual –preferred-challenges dns \ –manual-auth-hook /path/to/certbot-hook.py auth \ –manual-cleanup-hook /path/to/certbot-hook.py cleanup \ -d example.com -d *.example.com You can use the same script for both auth and clean up – pass auth or… Continue reading Python script for certbot –manual-auth-hook and –manual-cleanup-hook for DNS-01 challenge

Debugging cron environment on Azure Web App Service

I wrote a service script in Python and I wanted it to run daily on Azure Web App Service. The catch? Same script will run differently when launched manually via SSH and when triggered with cron. Most notably, it will be missing all your environment variables. So how do you know what actually is in… Continue reading Debugging cron environment on Azure Web App Service

Deploying a Python bot to Azure Web App Service (Free Tier)

Run a Python bot for free on Azure Web App Service Pre-requisite: have a bot. You can use mehov/bot-clock as an example. It works with Telegram, so you will need TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID – see the bot’s readme for more info. Create a new Web App Go to Azure Portal → App Services and create… Continue reading Deploying a Python bot to Azure Web App Service (Free Tier)