Compare commits
6 Commits
docker-api
...
7ed847251f
Author | SHA1 | Date | |
---|---|---|---|
7ed847251f | |||
e3a4776a5d | |||
357d99cb91 | |||
908d02803f | |||
6e6bd2b143 | |||
47fbaab403 |
@ -31,7 +31,6 @@ load_dotenv(find_dotenv())
|
||||
app = Flask(__name__)
|
||||
|
||||
app.config.from_mapping(
|
||||
|
||||
BASE_URL=os.environ.get("BASE_URL", default="http://localhost:5000"),
|
||||
SECRET_KEY=os.environ.get("SECRET_KEY", default="dev"),
|
||||
HUB_MODE_ENABLED=os.environ.get("HUB_MODE_ENABLED", default="True").lower() in ['true', '1', 't', 'y', 'yes'],
|
||||
@ -219,6 +218,9 @@ def override_url_for():
|
||||
return dict(url_for=url_for_with_cache_bust)
|
||||
|
||||
|
||||
@app.context_processor
|
||||
def load_config_vars():
|
||||
return dict(config=app.config)
|
||||
|
||||
def url_for_with_cache_bust(endpoint, **values):
|
||||
"""
|
||||
@ -244,7 +246,3 @@ def url_for_with_cache_bust(endpoint, **values):
|
||||
values['q'] = current_app.config['STATIC_FILE_HASH_CACHE'][filename]
|
||||
|
||||
return url_for(endpoint, **values)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -160,7 +160,10 @@ def can_claim_create(payload, host_id) -> (str, str):
|
||||
if allocated_network_name is None or allocated_ipv4_address is None:
|
||||
return "", f"host \"{host_id}\" does not have any avaliable IP addresses on any of its networks."
|
||||
|
||||
payload["network_name"] = allocated_network_name
|
||||
# payload["network_name"] = allocated_network_name
|
||||
# hard-code the network name for now until we can fix the phantom dhcp lease issues.
|
||||
|
||||
payload["network_name"] = 'public3'
|
||||
payload["public_ipv4"] = allocated_ipv4_address
|
||||
|
||||
return payload, ""
|
||||
|
@ -48,6 +48,10 @@ def validate_dollars():
|
||||
def btcpay_payment():
|
||||
errors = list()
|
||||
|
||||
if current_app.config['BTCPAY_PRIVATE_KEY'] == "":
|
||||
flash("BTCPay is not enabled on this server")
|
||||
return redirect(url_for("console.account_balance"))
|
||||
|
||||
if request.method == "POST":
|
||||
result = validate_dollars()
|
||||
errors = result[0]
|
||||
@ -289,4 +293,4 @@ def success():
|
||||
# except stripe.error.SignatureVerificationError:
|
||||
# print("/payment/stripe/webhook returned 400: invalid signature")
|
||||
# abort(400, "invalid signature")
|
||||
|
||||
|
||||
|
@ -46,7 +46,9 @@
|
||||
<a href="/payment/stripe">Add funds with Credit/Debit (stripe)</a>
|
||||
<ul><li>notice: stripe will load nonfree javascript </li></ul>
|
||||
</li>
|
||||
{% if config['BTCPAY_PRIVATE_KEY'] != "" %}
|
||||
<li><a href="/payment/btcpay">Add funds with Bitcoin/Litecoin/Monero (btcpay)</a></li>
|
||||
{% endif %}
|
||||
|
||||
<li>Cash: email <a href="mailto:treasurer@cyberia.club">treasurer@cyberia.club</a></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user