jsxc / xmpp-cloud-auth

:key: Authentication hub for Nextcloud+JSXC→Prosody, ejabberd, saslauthd, Postfix
https://www.jsxc.org
MIT License
60 stars 18 forks source link

install on Manjaro / Arch #71

Closed scurrvy2020 closed 5 years ago

scurrvy2020 commented 5 years ago

I'm trying to install this on Arch. I have everything setup and modified the files as needed. When I execute /opt/xmpp-cloud-auth/xcauth.py I get this output:

Traceback (most recent call last): File "./xcauth.py", line 3, in <module> from xclib.configuration import get_args File "/opt/xmpp-cloud-auth/xclib/__init__.py", line 4, in <module> from xclib.sigcloud import sigcloud File "/opt/xmpp-cloud-auth/xclib/sigcloud.py", line 1, in <module> import urllib.request, urllib.parse, urllib.error ImportError: No module named request It looks like a python problem to me (this is with python2 shebang). it looks like it isn't able to import the modules included in the package. I've tried adding to $PYTHONPATH and using sys.path, but I still get errors.

MarcelWaldvogel commented 5 years ago

The xcauth 2.x releases require Python3.

On Ubuntu 18.04, urllib is in package python3-future. You may want to check your distro or install it via pip3 (or pip, if Python3 is your default).

scurrvy2020 commented 5 years ago

Thanks for your reply. I was trying to install v1.1.0, but I had the same error with 2.0.2. I installed python-future (python3) and python2-future from the manjaro repository and changed to v2.0.2. I still get the same error. With python3 I get an additional syntax error.

`Python3:
Traceback (most recent call last):
  File "./xcauth.py", line 3, in <module>
    from xclib.configuration import get_args
  File "/opt/xmpp-cloud-auth/xclib/__init__.py", line 5, in <module>
    from xclib.sigcloud import sigcloud
  File "/opt/xmpp-cloud-auth/xclib/sigcloud.py", line 9, in <module>
    from xclib.roster import roster
  File "/opt/xmpp-cloud-auth/xclib/roster.py", line 42
    def try_roster(self, async=True):
                             ^
SyntaxError: invalid syntax

Python2: 
Traceback (most recent call last):
  File "./xcauth.py", line 3, in <module>
    from xclib.configuration import get_args
  File "/opt/xmpp-cloud-auth/xclib/__init__.py", line 5, in <module>
    from xclib.sigcloud import sigcloud
  File "/opt/xmpp-cloud-auth/xclib/sigcloud.py", line 1, in <module>
    import urllib.request, urllib.parse, urllib.error
ImportError: No module named request`
scurrvy2020 commented 5 years ago

Okay, I've figured a little bit out. It looks like in python 3.7 async is no longer valid and it needs to be changed to async_. https://github.com/pypa/pipenv/issues/956

I made those changes to a few of the files and I'm able to get it to run without errors. My service is still failing though.

scurrvy2020 commented 5 years ago

Okay, got it working! Manjaro also needs python-systemd as a dependency.

MarcelWaldvogel commented 5 years ago

Can you list your changes? (e.g., as a pull request)

scurrvy2020 commented 5 years ago

I'm still a newb at this, but I'll try to figure out how to do a pull request with the changes for you.

MarcelWaldvogel commented 5 years ago

The standard workflow (unfortunately, not as simple as I would like):

  1. Fork the repository
  2. Check out your fork
  3. (Optional:) Create a feature branch with e.g. git checkout -b python37-compatibility)
  4. Normal edit, commit, push
  5. In the web interface of your fork, the option to create a pull request will be highlighted as a yellow bar above the code

https://help.github.com/articles/creating-a-pull-request/

scurrvy2020 commented 5 years ago

I think I got it. Thanks for the bit of guidance.

MarcelWaldvogel commented 5 years ago

The change is in your repository right now. Can you also click on the Create Pull Request button below the green Clone or Download in your repository?

MarcelWaldvogel commented 5 years ago

Ah, just noticed you already did, but (accidentally, I believe) closed the pull request.