doomedraven / Tools

Combination of different utilities, have fun!
MIT License
202 stars 96 forks source link

cape2.sh - error running cape-web after install #38

Closed zoomequipd closed 4 years ago

zoomequipd commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

After install cape-web.service should start without errors

Current Behavior

errors when attempting to manually start the webui and when attempted to start the cape-web.service via systemd

Failure Information (for bugs)

The inclusion of passlib in line 587 causes the invocation of line 58 within CapeV2, which inturn tries to read the file configured in the config.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. install via ./cape2.sh all <user>
  2. start rooter
  3. attempt to start webui

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Question Answer
OS version Ubuntu 20.04

Failure Logs

[...snip...]
  File "/opt/CAPEv2/web/api/urls.py", line 7, in <module>
    from api import views
  File "/opt/CAPEv2/web/api/views.py", line 58, in <module>
    ht = HtpasswdFile(apiconf.api.get("users_db"))
  File "/usr/local/lib/python3.8/dist-packages/passlib/apache.py", line 730, in __init__
    super(HtpasswdFile, self).__init__(path, **kwds)
  File "/usr/local/lib/python3.8/dist-packages/passlib/apache.py", line 140, in __init__
    self.load()
  File "/usr/local/lib/python3.8/dist-packages/passlib/apache.py", line 212, in load
    with open(self._path, "rb") as fh:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/nginx/.htpasswd'

full error

doomedraven commented 4 years ago

hello, thank you, but that should be reported to cape repo ;) anyway fixed that in cape

zoomequipd commented 4 years ago

Ahh, I was thinking that perhaps the install of passlib should be moved to the install_nginx function. This allows the attempt to import of passlib by Capev2 to fail and continue without error.

However, if this approach is not desired, I will certainly open a ticket over there.

doomedraven commented 4 years ago

that doesn't nothing to see with nginx at all, that is the ability to use /api/ without limit if you have creds

zoomequipd commented 4 years ago

Ahhh, ok, I understand now. Thanks for fixing it within Cape!

doomedraven commented 4 years ago

thanks for reporting it :)