Nyr / openvpn-install

OpenVPN road warrior installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora
MIT License
19.09k stars 4.9k forks source link

Patch to support Slackware Linux #1074

Closed JWSmythe closed 11 months ago

JWSmythe commented 11 months ago

To start, I'm not experienced with using Github to do these change requests. Apologies if I'm doing this totally wrong.

I am now using this on a couple of my Slackware machines. I appreciate the work you put into it, and I like how easy it is to manage users with it. It isn't working in a commercial environment, it's just for me to get into a couple networks that I run.

Disregard the changes I made to Readme.md , they were just to show why this fork exists.

openvpn-install.sh is the file that has been patched.

openvpn-install.sh.orig can be disregarded. It is your original file. I put it here for the diff.

openvpn-install.sh.diff is the diff file, that may be easier for you to skim through.

I tried to match your style as best as I could, for example, blending Slackware into the OS checking.

Most of the changes are obvious and self explanatory. I'll point out a few changes that you may want to look closely at. I'm referencing the line numbers in the diff file, rather than trying to point out both locations in the openvpn-install.sh file.

Line 102-121 and 129-130. The Slackware /etc/rc.d/rc.openvpn allows for a specific conf to be called. By default it wants all the conf files in /etc/openvpn/ . If the user/admin starts it from anywhere but /etc/openvpn/server, it will fail. I changed the paths of the files in your server.conf to have full paths to the important files. This should work perfectly on all platforms, and should be preferred over relative paths.

Lines 164 to 240 are the new /etc/rc.d/rc.ovpn_routing, so the custom iptables lines will work. I used your lines, I just rearranged them in the Slackware section, to make it rc.d friendly.

Lines 85-86, 89-90, 319-320 correct a bash-ism. Most languages use = as an assignment operator, and == as a comparison. You used both in various places. So I fixed those to the preferred == style.

The comment on line 151 was because I was being lazy, and didn't break it up any more than necessary. The Slackware admins can just ignore the errors. If you want me to, I can make that cleaner. I just didn't want to put the effort in, if you didn't want to include it in your version.

Lines 32-33, Slackware 14 is really old now, released in 2012. No one should be using it, or anything older. It actually would work fine with any older version that supports iptables. Slackware 8.0 (2001) optionally supported iptables. Slackware 8.1 (2002) included iptables with the base install.

You can most likely add more OSs to the list, under the Slackware supported changes. Anything that uses rc files instead of systemd, and supports iptables.

If you have any questions or comments, feel free to contact me about it.

Nyr commented 11 months ago

While I appreciate the effort you have put into this and I congratulate you on your fist pull request, I am not merging this.

It is a long standing police of mine not to add "support" for distros which I can not support. Every distro update, every script update, I test almost everything in all supported distros where it can be relevant. While I understand that your current pull request can work with the current Slackware release, I do not have the time/resources to commit support for new distros other than what is currently supported, specially if their server market share is almost negligible compared to the big ones. And I also do not expect you to be here for the next decade to take care of it.