Changeset - 7f4b23cdb141
[Not reviewed]
default
0 1 1
Dennis Fink - 3 years ago 2022-01-19 18:27:51
dennis.fink@c3l.lu
Load config.json in current folder if we are in debug mode
2 files changed with 37 insertions and 2 deletions:
0 comments (0 inline, 0 general)
c3l_membership/__init__.py
Show inline comments
 
@@ -9,8 +9,6 @@ from flask.cli import AppGroup
 
from flask_babel import Babel
 
from flask_qrcode import QRcode
 

	
 
config_file = os.path.abspath("/etc/membership.json")
 

	
 
qrcode = QRcode()
 
babel = Babel()
 
babel_cli = AppGroup("babel")
 
@@ -20,6 +18,11 @@ def create_app():
 

	
 
    app = Flask(__name__)
 

	
 
    if app.debug:
 
        config_file = os.path.abspath("config.json")
 
    else:
 
        config_file = os.path.abspath("/etc/membership.json")
 

	
 
    try:
 
        app.config.from_file(config_file, load=json.load)
 
    except FileNotFoundError:
config.json
Show inline comments
 
new file 100644
 
{
 
  "SUPPORTING_FEE": 40,
 
  "REGULAR_FEE": 120,
 
  "DIGICASH_ENABLED": false,
 
  "CONVERSION_URL": "https://coins.c3l.lu/json",
 
  "CRYPTOCURRENCIES": {
 
    "BITCOIN": {
 
      "ENABLED": true,
 
      "ADDRESS": "bc1qfg5ytmxpmsx5tfsfkz30mw4tjj4hw295dydakk",
 
      "COMMODITY": "BTC",
 
      "URL": "bitcoin:{address}?amount={amount}&label=Membership Fee {year} {username}&message=Membership Fee {year} {username}"
 
    },
 
    "ETHEREUM": {
 
      "ENABLED": true,
 
      "ADDRESS": "0xa3c704a1810A0914D0B3392c9490f47B415b92A6",
 
      "COMMODITY": "ETH",
 
      "URL": "{address}"
 
    },
 
    "MONERO": {
 
      "ENABLED": true,
 
      "ADDRESS": "89rNUZ3KeMQFcunnG4zUo6QzrPzvvrz1NNhJwMuagKZyQjLUwb5y5oWbzJY5STy5phewEnFLuzgZvayJmU4zeWctLQZV1gG",
 
      "COMMODITY": "XMR",
 
      "URL": "{address}"
 
    },
 
    "ZCASH": {
 
      "ENABLED": true,
 
      "ADDRESS": "t1URHaR4oYFyp7XFGJ5M28XxHc5Dnm6HzsZ",
 
      "COMMODITY": "ZEC",
 
      "URL": "{address}"
 
    }
 
  }
 
}
0 comments (0 inline, 0 general)