From d33a4a041ab5d9e11e127d8a0e18205f97f4cabd Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 9 Jul 2019 18:20:10 +0200 Subject: [feat] allow overriding of PROVIDER_CONFIG --- branding/README.txt | 17 ++++++++++++++--- branding/scripts/vendorize.py | 6 ++++++ 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'branding') diff --git a/branding/README.txt b/branding/README.txt index 3601524..dea4d76 100644 --- a/branding/README.txt +++ b/branding/README.txt @@ -8,14 +8,25 @@ BitmaskVPN for your provider. Configure -------------------------------------------------------------------------------- -- Edit the file at 'branding/config/vendor.conf'. Add all the needed variables. -- Copy your provider CA certificate to 'branding/config/-ca.crt' +- Copy or edit the file at 'branding/config/vendor.conf'. Add all the needed variables. +- Copy your provider CA certificate to the same folder: 'branding/config/-ca.crt' - Make sure that the folder 'branding/assets/' exists. Copy there all the needed assets. Build -------------------------------------------------------------------------------- +Some of the following scripts need network access, since they will check +whether the configuration published by your provider matches what is configured +before the build. + Run: -PROVIDER=example.org make generate +PROVIDER=example.org make prepare +make build + +You can also specify a cusom config file: + +PROVIDER=example.org PROVIDER_CONFIG make prepare make build + + diff --git a/branding/scripts/vendorize.py b/branding/scripts/vendorize.py index c600967..dc19952 100755 --- a/branding/scripts/vendorize.py +++ b/branding/scripts/vendorize.py @@ -88,6 +88,12 @@ if __name__ == "__main__": except IndexError: bail() + env_provider_conf = os.environ.get('PROVIDER_CONFIG') + if env_provider_conf: + if os.path.isfile(env_provider_conf): + print("[+] Overriding provider config per PROVIDER_CONFIG variable") + configfile = env_provider_conf + if not os.path.isfile(infile): bail('[!] Cannot find template in {path}'.format( path=os.path.abspath(infile))) -- cgit v1.2.3