Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop external dependencies and reduce usage of root #225

Merged
merged 1 commit into from
May 1, 2019
Merged

Drop external dependencies and reduce usage of root #225

merged 1 commit into from
May 1, 2019

Conversation

ranisalt
Copy link
Contributor

@ranisalt ranisalt commented Jan 30, 2019

I have removed the need for superuser access to store logs and VPN configuration, relying on user home locations instead. That makes it only needed to use root for connection, and I think that can be avoided too, so openpyn can be installed per user.

I also removed the need for external software such as unzip and wget by replacing with Python dependencies (zipfile and requests, respectively).

Edit: I intend to remove other popen calls if possible, replacing with Python code instead.

@jotyGill
Copy link
Owner

jotyGill commented Feb 2, 2019

Thanks mate.
When i started this project, I was too noob to know which is the better approach, using external tools like 'unzip' to not. Then i just kept it that way.
@1951FDG Could you please have a look at this. If this works with your android app setup, I'll merge it (Thanks)

@1951FDG
Copy link
Contributor

1951FDG commented Feb 2, 2019

@jotyGill I'll have a look at this, this week, also to ensure it works on routerOS...

@1951FDG
Copy link
Contributor

1951FDG commented Feb 7, 2019

@jotyGill Hi,

Finally got around to reviewing and testing. The code was suddenly highly unstable, most likely due to no testing, so it's a good thing we review each other's code when we get the chance

@ranisalt Nice work, I've learned a couple of neat things from reviewing the code, just don't forget to run the code and run some tests before opening a pull request

@ranisalt I can help you with documentation on how to setup Atom for usage with Python to enable linting and other features if you're interested

Regarding changes I had to make, to make all working again :), see commit: 789717b

I've opened a pull request containing this one, #226

This also includes a bugfix, 5b10756

@ranisalt
Copy link
Contributor Author

ranisalt commented Feb 17, 2019

using external tools like 'unzip' to not

I usually avoid external tools, e.g. I only have installed unzip and wget because of this (I use gzip and curl)

I can help you with documentation on how to setup Atom for usage with Python to enable linting and other features if you're interested

I don't use Atom, but it could be useful anyway to have a style guide.

Oh, I'm thinking on creating a support library to deal with systemd, instead of calling subprocess when needed.

@ranisalt
Copy link
Contributor Author

The code was suddenly highly unstable, most likely due to no testing

I've been using this patched version for a few days now without any issues, no loss of connection, no errors, nothing out of usual, what exactly do you point as "highly unstable"?

@1951FDG
Copy link
Contributor

1951FDG commented Feb 24, 2019

@ranisalt Hi,

By "highly unstable" I meant the code would break at various points depending on the arguments passed to openpyn, but no worries it has been fixed in the new pull request...

@jotyGill jotyGill merged commit 5ee459b into jotyGill:test May 1, 2019
@ranisalt ranisalt deleted the drop-external-deps branch May 1, 2019 22:41
@arichiardi
Copy link

arichiardi commented Jul 5, 2019

I am trying this branch and while everything installs fine I then get this on connection:

2019-07-04 20:08:37 [SUCCESS] CONNECTING TO SERVER ca409 ON PORT udp
2019-07-04 20:08:37 [SUCCESS] Your OS 'linux' Does have '/sbin/resolvconf', using it to update DNS Resolver Entries
Thu Jul  4 20:08:38 2019 WARNING: Using --management on a TCP port WITHOUT passwords is STRONGLY discouraged and considered insecure
Thu Jul  4 20:08:38 2019 WARNING: cannot stat file '/home/kapitan/.local/lib/python3.7/site-packages/openpyn/credentials': No such file or directory (errno=2)
Options error: --auth-user-pass fails with '/home/kapitan/.local/lib/python3.7/site-packages/openpyn/credentials': No such file or directory (errno=2)
Options error: Please correct these errors.
Use --help for more information.

I have installed with python -m pip install --user --upgrade . and I am on Manjaro (Arch).

On openpyn --init I see:

2019-07-04 20:12:00 [INFO] Awesome, the credentials have been saved in '/home/kapitan/.local/share/openpyn/credentials'

Sorry to paste this here but I figured that @ranisalt would be interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants