Chaosthebot / Chaos

A social coding experiment that updates its own code democratically.
http://chaosthebot.com
MIT License
2.44k stars 210 forks source link

Encryptation DON'T WORK. TRAVIS CI ERROR #547

Open eamanu opened 7 years ago

eamanu commented 7 years ago

I have problems with permissions (I think).. whatever I give up

ERROR: cron (unittest.loader._FailedTest)

ImportError: Failed to import test module: cron Traceback (most recent call last): File "/home/travis/build/chaosbot/Chaos/encryption.py", line 8, in create_decryptor with open(private_location, "rb") as key_file: FileNotFoundError: [Errno 2] No such file or directory: '/etc/privkey' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/python/3.6.1/lib/python3.6/unittest/loader.py", line 462, in _find_test_path package = self._get_module_from_name(name) File "/opt/python/3.6.1/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name import(name) File "/home/travis/build/chaosbot/Chaos/cron/init.py", line 4, in from .poll_pull_requests import poll_pull_requests as poll_pull_requests File "/home/travis/build/chaosbot/Chaos/cron/poll_pull_requests.py", line 12, in from twitter_api import Twitter as tw File "/home/travis/build/chaosbot/Chaos/twitter_api/init.py", line 1, in from . import misc File "/home/travis/build/chaosbot/Chaos/twitter_api/misc.py", line 1, in from encryption import decrypt File "/home/travis/build/chaosbot/Chaos/encryption.py", line 48, in decrypt = create_decryptor("/etc/privkey", "server/pubkey.txt") File "/home/travis/build/chaosbot/Chaos/encryption.py", line 15, in create_decryptor with open(private_location, "wb") as key_file: PermissionError: [Errno 13] Permission denied: '/etc/privkey'

ERROR: twitter_api (unittest.loader._FailedTest)

ImportError: Failed to import test module: twitter_api Traceback (most recent call last): File "/home/travis/build/chaosbot/Chaos/encryption.py", line 8, in create_decryptor with open(private_location, "rb") as key_file: FileNotFoundError: [Errno 2] No such file or directory: '/etc/privkey' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/python/3.6.1/lib/python3.6/unittest/loader.py", line 462, in _find_test_path package = self._get_module_from_name(name) File "/opt/python/3.6.1/lib/python3.6/unittest/loader.py", line 369, in _get_module_from_name import(name) File "/home/travis/build/chaosbot/Chaos/twitter_api/init.py", line 1, in from . import misc File "/home/travis/build/chaosbot/Chaos/twitter_api/misc.py", line 1, in from encryption import decrypt File "/home/travis/build/chaosbot/Chaos/encryption.py", line 48, in decrypt = create_decryptor("/etc/privkey", "server/pubkey.txt") File "/home/travis/build/chaosbot/Chaos/encryption.py", line 15, in create_decryptor with open(private_location, "wb") as key_file: PermissionError: [Errno 13] Permission denied: '/etc/privkey'

rudehn commented 7 years ago

try sudo

PlasmaPower commented 7 years ago

@rudehn sudo is disabled by default on Travis builds. We could enable it, but that'd probably be a bad idea (longer build times).

PlasmaPower commented 7 years ago

We should probably just disable the encryption module on Travis, as the key there won't be the same anyway.

eamanu commented 7 years ago

Yeah encryptation doesn't work ... And well if we use private tokens, we have to trust in us

PlasmaPower commented 7 years ago

Encryption does work, just not on Travis. Yes, we have to place trust in the author of the PR, but we can always change the key to someone else's if something happens.

dbpokorny commented 7 years ago

@PlasmaPower huh? I thought the bot made its own private key and kept it private. Encryption works on Travis, you just have to write code that tests the process of creating a private key.

PlasmaPower commented 7 years ago

What I mean by "doesn't work" is that the private key will be different, so decryption will fail.