diff --git a/config/.env.sample b/config/.env.sample index 83f1a02..c7c1b44 100644 --- a/config/.env.sample +++ b/config/.env.sample @@ -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= \ No newline at end of file diff --git a/docs/self_hosting.md b/docs/self_hosting.md index cf83aa1..25c9c9a 100644 --- a/docs/self_hosting.md +++ b/docs/self_hosting.md @@ -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. diff --git a/scripts/http_host/http_host_lib/nginx.py b/scripts/http_host/http_host_lib/nginx.py index b72990e..ddb9c19 100644 --- a/scripts/http_host/http_host_lib/nginx.py +++ b/scripts/http_host/http_host_lib/nginx.py @@ -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(): diff --git a/scripts/http_host/http_host_lib/nginx/cf.conf b/scripts/http_host/http_host_lib/nginx/cf.bak similarity index 100% rename from scripts/http_host/http_host_lib/nginx/cf.conf rename to scripts/http_host/http_host_lib/nginx/cf.bak diff --git a/scripts/loadbalancer/loadbalancer.py b/scripts/loadbalancer/loadbalancer.py index 4292ad9..0cc2e99 100755 --- a/scripts/loadbalancer/loadbalancer.py +++ b/scripts/loadbalancer/loadbalancer.py @@ -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 diff --git a/ssh_lib/tasks.py b/ssh_lib/tasks.py index 3b8fe6c..d9e3c0d 100644 --- a/ssh_lib/tasks.py +++ b/ssh_lib/tasks.py @@ -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'),