mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
DOMAIN_CF removed
This commit is contained in:
@@ -27,8 +27,3 @@ HTTP_HOST_LIST=
|
|||||||
TELEGRAM_TOKEN=
|
TELEGRAM_TOKEN=
|
||||||
TELEGRAM_CHAT_ID=
|
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=
|
|
||||||
@@ -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.
|
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_LE - Use this to specify a domain to be used with Let's Encrypt.
|
||||||
|
|
||||||
DOMAIN_CF - Use this if you want to use long term CloudFlare Origin certificates. You have to upload the certs into `config/certs`
|
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -17,21 +17,9 @@ from http_host_lib import (
|
|||||||
def write_nginx_config():
|
def write_nginx_config():
|
||||||
curl_text_mix = ''
|
curl_text_mix = ''
|
||||||
|
|
||||||
domain_cf = HOST_CONFIG['domain_cf']
|
|
||||||
domain_le = HOST_CONFIG['domain_le']
|
domain_le = HOST_CONFIG['domain_le']
|
||||||
domain_ledns = HOST_CONFIG['domain_ledns']
|
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
|
# processing Cloudflare config
|
||||||
if domain_ledns:
|
if domain_ledns:
|
||||||
if not (OFM_CONFIG_DIR / 'rclone.conf').is_file():
|
if not (OFM_CONFIG_DIR / 'rclone.conf').is_file():
|
||||||
|
|||||||
@@ -150,15 +150,6 @@ def update_records(c, working_hosts) -> bool:
|
|||||||
cloudflare_api_token=cloudflare_api_token,
|
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
|
return updated
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,29 +72,18 @@ def prepare_tile_gen(c):
|
|||||||
|
|
||||||
def upload_http_host_config(c):
|
def upload_http_host_config(c):
|
||||||
domain_le = dotenv_val('DOMAIN_LE').lower()
|
domain_le = dotenv_val('DOMAIN_LE').lower()
|
||||||
domain_cf = dotenv_val('DOMAIN_CF').lower()
|
|
||||||
domain_ledns = dotenv_val('DOMAIN_LEDNS').lower()
|
domain_ledns = dotenv_val('DOMAIN_LEDNS').lower()
|
||||||
skip_planet = dotenv_val('SKIP_PLANET').lower() == 'true'
|
skip_planet = dotenv_val('SKIP_PLANET').lower() == 'true'
|
||||||
le_email = dotenv_val('LE_EMAIL').lower()
|
le_email = dotenv_val('LE_EMAIL').lower()
|
||||||
|
|
||||||
if not (domain_le or domain_cf):
|
if not (domain_le or domain_ledns):
|
||||||
sys.exit('Please specify DOMAIN_LE or DOMAIN_CF in config/.env')
|
sys.exit('Please specify DOMAIN_LE or DOMAIN_LEDNS 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 domain_le and not le_email:
|
if domain_le and not le_email:
|
||||||
sys.exit('Please add your email to LE_EMAIL when using DOMAIN_LE')
|
sys.exit('Please add your email to LE_EMAIL when using DOMAIN_LE')
|
||||||
|
|
||||||
host_config = {
|
host_config = {
|
||||||
'domain_le': domain_le,
|
'domain_le': domain_le,
|
||||||
'domain_cf': domain_cf,
|
|
||||||
'domain_ledns': domain_ledns,
|
'domain_ledns': domain_ledns,
|
||||||
'skip_planet': skip_planet,
|
'skip_planet': skip_planet,
|
||||||
'le_email': le_email,
|
'le_email': le_email,
|
||||||
@@ -222,13 +211,11 @@ def setup_ledns_writer(c):
|
|||||||
|
|
||||||
|
|
||||||
def setup_loadbalancer(c):
|
def setup_loadbalancer(c):
|
||||||
domain_cf = dotenv_val('DOMAIN_CF').lower()
|
|
||||||
domain_ledns = dotenv_val('DOMAIN_LEDNS').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()]
|
http_host_list = [h.strip() for h in dotenv_val('HTTP_HOST_LIST').split(',') if h.strip()]
|
||||||
assert (CONFIG_DIR / 'cloudflare.ini').exists()
|
assert (CONFIG_DIR / 'cloudflare.ini').exists()
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'domain_cf': domain_cf,
|
|
||||||
'domain_ledns': domain_ledns,
|
'domain_ledns': domain_ledns,
|
||||||
'http_host_list': http_host_list,
|
'http_host_list': http_host_list,
|
||||||
'telegram_token': dotenv_val('TELEGRAM_TOKEN'),
|
'telegram_token': dotenv_val('TELEGRAM_TOKEN'),
|
||||||
|
|||||||
Reference in New Issue
Block a user