-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
NordVPN improvements | Change up and down script and add item to DietPi-Banner #3084
Conversation
Pull latest changes into fork
Changed up to route-up and down to route-pre-down. This will ensure that the scripts will only run after the VPN succesfully connected.
First commit. Add DietPi-NordVPN status to banner.
@MichaIng I noticed that the order of the banner items is tied to the array number. How do we handle an item that is added in the middle of array? I thought the NordVPN item should live at index 7. But I guess this messes up the settings file once we push the upgraded DietPi-Banner no? |
Placeholder added in DietPi-Banner for NordVPN
Started work on a function in DietPi-NordVPN to get status from commandline. The retun now includes: [ OK ] DietPi-NordVPN | Root access verified. [ OK ] DietPi-NordVPN | RootFS R/W access verified. Need advise to solve this. Also set NORDVPN_SERVICE=1 manually because it does not sets the global var from the Init('status') function properly. Banner item NordVPN calls DietPi-NordVPN to get status.
@svh1985 Btw the order of the banner entries does not depend on the banner index, but just on the oder on the code. So no need to change existing indices :). |
Ok good to know, I’ll then have to correct the indexes. |
Get latest code
Update to maintain compatibility.
@MichaIng do you know the best way I can suppress the: |
Added service usage info that gets returned when wrong command has been passed as input.
Typo in usage info
@svh1985 Okay lets do it like this:
I was also thinking about how to avoid doubled code (optional for now):
I will remove the positive root user + r/w access prints now. |
Pull latest changes
Changed some status text and added colors to the status.
@MichaIng thanks, it works like a charm. I also added colors to the status, what do you think? |
@svh1985 |
@MichaIng Do you want to merge or shall we implement your suggestions first? When do you want to release v6.26? Kill switch would be nice! The Down script with dietpi-service stop qbittorrent is not very stable. I get multiple dietpi-service instance errors, not sure what goes wrong there. qbittorrent takes a long time to quite when having an active transfer maybe a openvpn down script timeout kills the dietpi-service script. |
I will have a look later, probably do some fine tuning and then merge.
Use Just to verify:
|
I think that the OpenVPN down command does not want to wait for 1m30s and just kills the wait leaving dietpi-services in "not finished" state. The commands you wanted me to run (directly from prompt):
Second:
|
@svh1985 |
@MichaIng Just one transfer. Ill check the log later and report it back once im home. |
+ DietPi-NordVPN | Do root user and rootfs R/W check only when menu is to be loaded, otherwise printing status would prompt error messages even that both is not required. This allows to load DietPi-Globals as well just for menu, which speeds up status print. + DietPi-NordVPN | Force non-interactive mode on status print, to skip any whiptail prompt + DietPi-NordVPN | Update WAN IP only on before first menu load, on connect, disconnect and refresh, to speed up all other navigation steps, which do not affect the connection state. This is due the WAN IP check can take up to two seconds, which adds a significant delay. + DietPi-NordVPN | Move RX/TX obtaining into an own function and remove DietPi-Globals dependency from it. This allows to share very most code between menu mode and status print. + DietPi-NordVPN | Further coding and wording enhancements
@svh1985 Then I could not hold myself to redo the NordVPN install, configuration and network state/info, so that most code is now shared between status print and menu mode. And did some other coding enhancements, that are not related to your PR. Perfectionist here 😅. I hope you are okay with that and I did not destroy anything. Will run tests now to see if banner print works as before my changes (where it worked like a charm already, as root user), then from my side it is ready to merge. Is there anything you still want to do about it (cause status was still WIP)? Two little fixes added, now testing passed from my side 👍. |
Pull latest changes
@MichaIng nice improvements! Everything worked during my testing. I'll just push one fix for a small menu alignment issue. I have to admit I now miss the connection state "Connected" in the dietpi-nordvpn menu. Do you mind if we put it back? I can push it along with the menu fix. Then I think the PR is ready to be merged 🎉 |
Misallignment in menu, changed usage to traffic and added the connected state again.
Accidental commit before filling its comment:
|
Changelog entry: 5d0f793 |
Status: Ready
Fixes: #3079
Commit list/description: