runfalk / synology-wireguard

WireGuard support for some Synology NAS drives
MIT License
919 stars 131 forks source link

DSM 7.0 Support #93

Open kobayashi90 opened 2 years ago

kobayashi90 commented 2 years ago

can someone compile a DSM 7.0 version for DS218j (armada38x), since it failed for me many times i give up and let someone else figure it out. would be awesome.

Matige commented 2 years ago

I see that @nohnaimer has released a package for armada38x: https://github.com/runfalk/synology-wireguard/pull/71#issuecomment-871556682

ben-ba commented 2 years ago

Have fun; zipped with gzip * so unzip it with gzip -d *

tested with DS1817+

sudo synopkg install WireGuard-avoton-1.0.20210606.spk Password: {"error":{"code":0},"results":[{"action":"install","beta":false,"betaIncoming":false,"error":{"code":0},"finished":true,"installReboot":false,"installing":true,"language":"enu","last_stage":"postreplace","package":"WireGuard","packageName":"WireGuard","pid":20951,"spk":"WireGuard-avoton-1.0.20210606.spk","stage":"installed_and_stopped","status":"stop","success":true,"username":""}],"success":true} user@dsm:/volume1$ sudo synopkg status WireGuard WireGuard package is stopped Status: [3] user@dsm:/volume1$ sudo /var/packages/WireGuard/scripts/start WireGuard has been successfully started user@dsm:/volume1$ sudo synopkg status WireGuard WireGuard package is started user@dsm:/volume1$

EDIT: x86 is missing, because there is no toolkit anymore WireGuard-cedarview-1.0.20210606.spk.gz WireGuard-rtd1296-1.0.20210606.spk.gz WireGuard-kvmx64-1.0.20210606.spk.gz WireGuard-monaco-1.0.20210606.spk.gz WireGuard-geminilake-1.0.20210606.spk.gz WireGuard-denverton-1.0.20210606.spk.gz WireGuard-bromolow-1.0.20210606.spk.gz WireGuard-broadwellnk-1.0.20210606.spk.gz WireGuard-avoton-1.0.20210606.spk.gz WireGuard-broadwell-1.0.20210606.spk.gz WireGuard-braswell-1.0.20210606.spk.gz WireGuard-armada38x-1.0.20210606.spk.gz WireGuard-apollolake-1.0.20210606.spk.gz

SharkyRawr commented 2 years ago

@ben-ba I tried your apollolake build on my DS918+ and the start script seems to be broken:

root@NAS:~# synopkgctl start WireGuard ======== start WireGuard ======== Failed to execute '/var/packages/WireGuard/scripts/start-stop-status start' (err=1)

root@NAS:~# /var/packages/WireGuard/scripts/start-stop-status start net.ipv4.ip_forward = 1 Loaded 7 iptables core modules Loaded 11 iptables NAT modules insmod: ERROR: could not load module /wireguard/wireguard.ko: No such file or directory

ben-ba commented 2 years ago

Looks like you missed, to run the start script first;

sudo /var/packages/WireGuard/scripts/start

mada199122 commented 2 years ago

the Broadwell package doesn't work...

photo_2021-10-03 11 22 05

SharkyRawr commented 2 years ago

@mada199122 did you extract it (gunzip)?

SharkyRawr commented 2 years ago

Looks like you missed, to run the start script first;

sudo /var/packages/WireGuard/scripts/start

To be clear, when I install the package it tries to start but fails, this is what DSM has to say: image

Clicking repair shows an unhelpful error: image

mada199122 commented 2 years ago

@SharkyRawr yes of course... I'm on DSM 7.0.1... Can be the package not compatible with that version?

SharkyRawr commented 2 years ago

@mada199122 just making sure, I kept forgetting to ungzip :) I'm still on 7.0 and it installs but doesn't run. Hmm.

mada199122 commented 2 years ago

yes I've tried three times with gzip -d using terminal, Keka and the Apple "Archive utility"...

ben-ba commented 2 years ago

Looks like you missed, to run the start script first; sudo /var/packages/WireGuard/scripts/start

To be clear, when I install the package it tries to start but fails, this is what DSM has to say:

Don't run the package after installation, mentioned in the REAMDE.md, ssh into your nas and run the script. After you run this script once, the package is able to start with gui. This limitation is a security concern from synology, because this package need root rights.

@mada199122 : upload the spk with the synology FileManager into your home folder, ssh into your nas and run; sudo synopkg install WireGuard-broadwell-1.0.20210606.spk

post the output.

SharkyRawr commented 2 years ago

@ben-ba my bad! Yes, after running the star script it's working. Thanks. :)

nohnaimer commented 2 years ago

@SharkyRawr yes of course... I'm on DSM 7.0.1... Can be the package not compatible with that version?

After update to 7.0.1 DS920+ all work fine....

mada199122 commented 2 years ago

@ben-ba sorry for the delay this is the error...

sudo synopkg install WireGuard-broadwell-1.0.20210606.spk
{"error":{"code":0},"results":[{"action":"install","beta":false,"betaIncoming":false,"error":{"code":281,"description":"package does not support the current arch / model"},"installReboot":false,"installing":true,"language":"enu","last_stage":"prepare_install","package":"WireGuard","packageName":"WireGuard","spk":"WireGuard-broadwell-1.0.20210606.spk","stage":"install_failed","success":false,"username":""}],"success":false}

My Synology is DS1621xs+

ben-ba commented 2 years ago

@mada199122 : the Readme.md mentioned this link; https://kb.synology.com/en-global/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have

so you need a package for arch Broadwellnk, not Broadwell.

mada199122 commented 2 years ago

Really sorry for the delay... I can confirm that it installs correctly with the Broadwellnk!!! Thanks...

I was trying to use the Broadwell package because on intel ARK the Intel Xeon D-1527 is listed as Broadwell...

https://ark.intel.com/content/www/it/it/ark/products/91195/intel-xeon-processor-d-1527-6m-cache-2-20-ghz.html

Anyway thanks!!!!

erig303 commented 2 years ago

Looks fine for me and the connection to my DS718+ with DSM 7.0.1-42218. On my Android phone the most things work but i cant ping anything.

$ sudo synopkg install WireGuard-apollolake-1.0.20210606.spk
{"error":{"code":0},"results":[{"action":"install","beta":false,"betaIncoming":false,"error":{"code":0},"finished":true,"installReboot":false,"installing":true,"language":"enu","last_stage":"postreplace","package":"WireGuard","packageName":"WireGuard","pid":3040,"spk":"WireGuard-apollolake-1.0.20210606.spk","stage":"installed_and_stopped","status":"stop","success":true,"username":""}],"success":true}
$ sudo synopkg start Wireguard
{"action":"prepare","error":{"code":150,"description":"Failed to load package info"},"stage":"prepare","success":false}

That looks litle bit strange to me but hey it works

$ sudo /var/packages/WireGuard/scripts/start
WireGuard has been successfully started

Thanks @ben-ba for the package

ben-ba commented 2 years ago

@erig303 after you run the script with sudo /var/packages/WireGuard/scripts/start once, you can start, stop, restart the package with the gui and Systemd, so now after sudo synopkg stop Wireguard and sudo synopkg start Wireguard the result should be something else than an error.

HebeROF commented 2 years ago

@ben-ba

Thank you for all the links. I managed to install wireguard on my DS718+ using DSM 7.0

just one more question:

You packages are dated 2021/06/06. What to do, if there are updated releases like the DSM 6.2 one from 2021/12/21?

ben-ba commented 2 years ago

@HebeROF I'm not sure, but i think they should run fine for minor updates like 6.1->6.2. Otherwise or for major updates, you can build it yourself. Instructions are on the main page. (Or poke me and i can build them)

HebeROF commented 2 years ago

as I can see, the Instructions are "only" for compiling using docker.

I am running wireguard native, so I have to check how to compile for my DS718+

ben-ba commented 2 years ago

U compile it insider a container, it's like compiling on a other machine. The resulting spk is for running it native. I compile it on my MacBook with docker. The advantage of compiling it inside a docker container to have a clean build environment. Am 28.12.21, 11:11 schrieb HebeROF @.***>:

as I can see, the Instructions are "only" for compiling using docker. I am running wireguard native, so I have to check how to compile for my DS718+ —Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

HebeROF commented 2 years ago

i do my best. managed to install all stuff for Docker/Mac

when compiling, this is the output :/ do I have to disable the certificate check?

Set cache size limit to 8.0 Gbytes Statistics cleared [INFO] projectList=WireGuard [INFO] Start to build WireGuard. [SCRIPT] build script: //source/WireGuard/SynoBuildConf/build [INFO] ======= Run build script ======= rm -rf libmnl-1.0.4.tar.bz2 libmnl-1.0.4 wireguard-linux-compat-1.0.20211208.tar.xz wireguard-linux-compat-1.0.20211208 wireguard-tools-1.0.20210914.tar.xz wireguard-tools-1.0.20210914 wget https://netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2 --2021-12-28 22:24:04-- https://netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2 Resolving netfilter.org (netfilter.org)... 92.243.18.11, 2001:4b98:dc0:43:216:3eff:fe87:a456 Connecting to netfilter.org (netfilter.org)|92.243.18.11|:443... connected. ERROR: cannot verify netfilter.org's certificate, issued by 'CN=R3,O=Let\'s Encrypt,C=US': Unable to locally verify the issuer's authority. To connect to netfilter.org insecurely, use--no-check-certificate'. Makefile:26: recipe for target 'libmnl-1.0.4.tar.bz2' failed make: *** [libmnl-1.0.4.tar.bz2] Error 5 [Error] Build project fail! Time cost: 00:00:01 [Build-->WireGuard] [INFO] Build WireGuard finished!

----------------- Time cost statistics ----------------- Time cost: 00:00:01 [Build-->WireGuard]

######################################################## Error(s) occurred on project "WireGuard" ######################################################## 1 projects, 1 failed, 0 blocked.

[Error] Check [/logs/error.build] for fixing errors. Install log

cat: /build_env/ds.apollolake-7.0/logs.install: No such file or directory`

HebeROF commented 2 years ago

made it. found the other thread and added the "--no-check-certificate" to the wget parts of build.sh and makefile.

struggled again installing as the format seemed to be wrong, found another thread that wrote "uninstall the old version" and restart fireguard.

winner winner chicken dinner!

might be cool to see all the knowledge from different threads to the main page (update)

lfilho commented 2 years ago

Using DSM 7.0.1-42218 Update 3 (latest as of this writing) on a DS220+:

Linux balaio 4.4.180+ #42218 SMP Mon Oct 18 19:16:55 CST 2021 x86_64 GNU/Linux synology_geminilake_220+

Uploading the SPK via GUI gives me the same error:

image

runfalk commented 2 years ago

Did you grab one of the pre-compiled releases off the release page or did you compile it yourself? The pre-compiled ones don't support DSM 7.0 yet and if you compile yourself you need to follow the instructions in the README and manually specify the version.

lfilho commented 2 years ago

I was using the pre compiled ones. I'm confused. The readme does say DS220+ has DSM 7 compatibility. Is that not accurate?

Would you have plans to provide DSM7 compatible builds?

runfalk commented 2 years ago

I have yet to make released builds for DSM7, but the support is in the repository itself. You can follow the README instructions to build it yourself.

I haven't gotten around to making a new release because it needs some changes to work on my machine.

lfilho commented 2 years ago

Aaaah I see. The table in the readme led me to believe it was supported... I'll try compiling it then. I'll also submit a PR to make the readme a bit less ambiguos about it, if you don't mind. cheers

adamphetamine commented 2 years ago

@runfalk - just for completeness, I should note that user @ben-ba has compiled a bunch of these in THIS thread for DSM 7. So you are referring to your pre compiled .spk files on the main page, but this thread has been active because it contains pre-compiled .spk files that are compatible with DSM 7. Well, until recently- I just tried to install the 'broadwellnk' version and got 'invalid file format. contact the developer' So it does look like Synology has changed something.

Let me know if there's anything I can do to help - I do have access to a lot of Intel Synology devices, but I tried for hours to compile the .spk and failed...ended up using the ones from above

adamphetamine commented 2 years ago

odd- I have 2x DS1621XS+ with exactly the same DSM 7.0.1-42218 Update 3. 1 installed fine 1 gives the error above Will report back if I figure it out

joelstitch commented 2 years ago

Have fun; zipped with gzip * so unzip it with gzip -d *

tested with DS1817+

sudo synopkg install WireGuard-avoton-1.0.20210606.spk Password: {"error":{"code":0},"results":[{"action":"install","beta":false,"betaIncoming":false,"error":{"code":0},"finished":true,"installReboot":false,"installing":true,"language":"enu","last_stage":"postreplace","package":"WireGuard","packageName":"WireGuard","pid":20951,"spk":"WireGuard-avoton-1.0.20210606.spk","stage":"installed_and_stopped","status":"stop","success":true,"username":""}],"success":true} user@dsm:/volume1$ sudo synopkg status WireGuard WireGuard package is stopped Status: [3] user@dsm:/volume1$ sudo /var/packages/WireGuard/scripts/start WireGuard has been successfully started user@dsm:/volume1$ sudo synopkg status WireGuard WireGuard package is started user@dsm:/volume1$

EDIT: x86 is missing, because there is no toolkit anymore WireGuard-cedarview-1.0.20210606.spk.gz WireGuard-rtd1296-1.0.20210606.spk.gz WireGuard-kvmx64-1.0.20210606.spk.gz WireGuard-monaco-1.0.20210606.spk.gz WireGuard-geminilake-1.0.20210606.spk.gz WireGuard-denverton-1.0.20210606.spk.gz WireGuard-bromolow-1.0.20210606.spk.gz WireGuard-broadwellnk-1.0.20210606.spk.gz WireGuard-avoton-1.0.20210606.spk.gz WireGuard-broadwell-1.0.20210606.spk.gz WireGuard-braswell-1.0.20210606.spk.gz WireGuard-armada38x-1.0.20210606.spk.gz WireGuard-apollolake-1.0.20210606.spk.gz

You're a life saver. I've been trying to compile this for hours for my ds218+ and always failed. Finally got it installed.