diff --git a/.cirrus.yml b/.cirrus.yml index 0578f0b..bbe00e4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -7,8 +7,8 @@ lint_task: - pip install codespell script: - flake8 --version - - PYTHONWARNINGS="ignore" flake8 --ignore=E501,F841,W503 --exclude=basicswap/contrib,messages_pb2.py,.eggs,.tox - - codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=tests/lint/spelling.ignore-words.txt -S .git,.eggs,.tox,pgp,*.pyc,*basicswap/contrib,*mnemonics.py + - PYTHONWARNINGS="ignore" flake8 --ignore=E501,F841,W503 --exclude=basicswap/contrib,messages_pb2.py,.eggs,.tox,bin/install_certifi.py + - codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=tests/lint/spelling.ignore-words.txt -S .git,.eggs,.tox,pgp,*.pyc,*basicswap/contrib,*mnemonics.py,bin/install_certifi.py test_task: environment: diff --git a/.travis.yml b/.travis.yml index d09a2f6..7b6bf9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,8 +51,8 @@ jobs: - travis_retry pip install codespell==1.15.0 before_script: script: - - PYTHONWARNINGS="ignore" flake8 --ignore=E501,F841,W503 --exclude=basicswap/contrib,messages_pb2.py,.eggs,.tox - - codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=tests/lint/spelling.ignore-words.txt -S .git,.eggs,.tox,pgp,*.pyc,*basicswap/contrib,*mnemonics.py + - PYTHONWARNINGS="ignore" flake8 --ignore=E501,F841,W503 --exclude=basicswap/contrib,messages_pb2.py,.eggs,.tox,bin/install_certifi.py + - codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=tests/lint/spelling.ignore-words.txt -S .git,.eggs,.tox,pgp,*.pyc,*basicswap/contrib,*mnemonics.py,bin/install_certifi.py after_success: - echo "End lint" - stage: test diff --git a/bin/install_certifi.py b/bin/install_certifi.py new file mode 100755 index 0000000..1a970f2 --- /dev/null +++ b/bin/install_certifi.py @@ -0,0 +1,43 @@ +# install_certifi.py +# +# sample script to install or update a set of default Root Certificates +# for the ssl module. Uses the certificates provided by the certifi package: +# https://pypi.org/project/certifi/ + +import os +import os.path +import ssl +import stat +import subprocess +import sys + +STAT_0o775 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR + | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP + | stat.S_IROTH | stat.S_IXOTH ) + +def main(): + openssl_dir, openssl_cafile = os.path.split( + ssl.get_default_verify_paths().openssl_cafile) + + print(" -- pip install --upgrade certifi") + subprocess.check_call([sys.executable, + "-E", "-s", "-m", "pip", "install", "--upgrade", "certifi"]) + + import certifi + + # change working directory to the default SSL directory + os.chdir(openssl_dir) + relpath_to_certifi_cafile = os.path.relpath(certifi.where()) + print(" -- removing any existing file or link") + try: + os.remove(openssl_cafile) + except FileNotFoundError: + pass + print(" -- creating symlink to certifi certificate bundle") + os.symlink(relpath_to_certifi_cafile, openssl_cafile) + print(" -- setting permissions") + os.chmod(openssl_cafile, STAT_0o775) + print(" -- update complete") + +if __name__ == '__main__': + main() diff --git a/doc/install.md b/doc/install.md index 97b6df5..9c38e84 100644 --- a/doc/install.md +++ b/doc/install.md @@ -114,17 +114,11 @@ Install Homebrew (See https://brew.sh/): /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -Command Line Tools: - - xcode-select --install - Dependencies: - brew install wget unzip python3 git protobuf gnupg automake libtool pkg-config curl jq + brew install wget unzip python git protobuf gnupg automake libtool pkg-config curl jq -Install python SSL Certificates: - - sudo "/Applications/Python 3.9/Install Certificates.command" +Close the terminal and open a new one to update the python symlinks. ### Basicswap: @@ -143,9 +137,19 @@ Install python SSL Certificates: cd $SWAP_DATADIR git clone https://github.com/tecnovert/basicswap.git cd $SWAP_DATADIR/basicswap + +If installed on OSX, you may need to install additional root ssl certificates for the ssl module. +From https://pypi.org/project/certifi/ + + sudo python3 bin/install_certifi.py + + +Continue installing Basicswap + protoc -I=basicswap --python_out=basicswap basicswap/messages.proto pip3 install . + Prepare the datadir: CURRENT_XMR_HEIGHT=$(curl https://localmonero.co/blocks/api/get_stats | jq .height)