diff --git a/c3l_membership/__init__.py b/c3l_membership/__init__.py --- a/c3l_membership/__init__.py +++ b/c3l_membership/__init__.py @@ -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: diff --git a/config.json b/config.json new file mode 100644 --- /dev/null +++ b/config.json @@ -0,0 +1,32 @@ +{ + "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}" + } + } +}