DOMAIN_CF removed

This commit is contained in:
Zsolt Ero
2024-06-24 16:48:13 +02:00
parent 5f27cade7a
commit dd7965726a
6 changed files with 3 additions and 44 deletions

View File

@@ -27,8 +27,3 @@ HTTP_HOST_LIST=
TELEGRAM_TOKEN=
TELEGRAM_CHAT_ID=
# --- Cloudflare proxied endpoint
# CloudFlare subdomain, using origin certificates
# Please put ofm_cf.key and ofm_cf.cert files in config/certs
DOMAIN_CF=

View File

@@ -46,9 +46,7 @@ It's recommended to use [direnv](https://direnv.net/), to have automatic venv ac
1. Copy `.env.sample` to `.env` and set the values.
DOMAIN_LE - Use this to specify a domain to be used with Let's Encrypt. Recommended.
DOMAIN_CF - Use this if you want to use long term CloudFlare Origin certificates. You have to upload the certs into `config/certs`
DOMAIN_LE - Use this to specify a domain to be used with Let's Encrypt.
1. If you want to run tile generation and upload via rclone, you can copy the `rclone.conf.sample` file as well. For simple self-hosting there is no need for this.

View File

@@ -17,21 +17,9 @@ from http_host_lib import (
def write_nginx_config():
curl_text_mix = ''
domain_cf = HOST_CONFIG['domain_cf']
domain_le = HOST_CONFIG['domain_le']
domain_ledns = HOST_CONFIG['domain_ledns']
# processing Cloudflare config
if domain_cf:
if not (CERTS_DIR / 'ofm_cf.cert').is_file() or not (CERTS_DIR / 'ofm_cf.key').is_file():
sys.exit('ofm_cf.cert or ofm_cf.key missing')
curl_text_mix += create_nginx_conf(
template_path=NGINX_DIR / 'cf.conf',
local='ofm_cf',
domain=domain_cf,
)
# processing Cloudflare config
if domain_ledns:
if not (OFM_CONFIG_DIR / 'rclone.conf').is_file():

View File

@@ -150,15 +150,6 @@ def update_records(c, working_hosts) -> bool:
cloudflare_api_token=cloudflare_api_token,
)
updated |= set_records_round_robin(
zone_id=zone_id,
name=c['domain_cf'],
host_ip_set=working_hosts,
proxied=True,
comment='domain_cf',
cloudflare_api_token=cloudflare_api_token,
)
return updated

View File

@@ -72,29 +72,18 @@ def prepare_tile_gen(c):
def upload_http_host_config(c):
domain_le = dotenv_val('DOMAIN_LE').lower()
domain_cf = dotenv_val('DOMAIN_CF').lower()
domain_ledns = dotenv_val('DOMAIN_LEDNS').lower()
skip_planet = dotenv_val('SKIP_PLANET').lower() == 'true'
le_email = dotenv_val('LE_EMAIL').lower()
if not (domain_le or domain_cf):
sys.exit('Please specify DOMAIN_LE or DOMAIN_CF in config/.env')
if domain_cf:
if (
not (CONFIG_DIR / 'certs' / 'ofm_cf.key').exists()
or not (CONFIG_DIR / 'certs' / 'ofm_cf.cert').exists()
):
sys.exit(
'When using DOMAIN_CF, please put ofm_cf.key and ofm_cf.cert files in config/certs'
)
if not (domain_le or domain_ledns):
sys.exit('Please specify DOMAIN_LE or DOMAIN_LEDNS in config/.env')
if domain_le and not le_email:
sys.exit('Please add your email to LE_EMAIL when using DOMAIN_LE')
host_config = {
'domain_le': domain_le,
'domain_cf': domain_cf,
'domain_ledns': domain_ledns,
'skip_planet': skip_planet,
'le_email': le_email,
@@ -222,13 +211,11 @@ def setup_ledns_writer(c):
def setup_loadbalancer(c):
domain_cf = dotenv_val('DOMAIN_CF').lower()
domain_ledns = dotenv_val('DOMAIN_LEDNS').lower()
http_host_list = [h.strip() for h in dotenv_val('HTTP_HOST_LIST').split(',') if h.strip()]
assert (CONFIG_DIR / 'cloudflare.ini').exists()
config = {
'domain_cf': domain_cf,
'domain_ledns': domain_ledns,
'http_host_list': http_host_list,
'telegram_token': dotenv_val('TELEGRAM_TOKEN'),