Recently, when using v2rayA on my Synology NAS, I encountered an issue where incorrect time synchronization caused it to stop working properly, which in turn prevented Emby from scraping metadata. Although I don’t know the exact reason, it’s an old problem. The version was very old, and I was using a Docker image from a third-party application store; currently, Docker can’t pull images via direct connection either. Here is my experience with solving this:
- Reinstall v2rayA
- Configure the Docker version of Emby.
Reference Websites:
Linux Backup Installation Method - v2rayA
Implementing Transparent Proxy on Synology - v2rayA
sjtuross/syno-iptables: Some missing iptables modules for Synology
Setting up Proxy for Container Manager (Docker) on Synology DSM 7.2 - CSDN Blog
v2rayA
According to the official v2rayA documentation, there is no specially adapted version for Synology, so we use the generic binary file for installation. Since we cannot pull files from GitHub over a direct connection, we download it on our computer and transfer it to the NAS. In addition, the installation steps below are actually slightly different from the official documentation.
Copy v2rayA and xray
1 2 3 4cp v2raya_linux_x64 /usr/local/bin/v2raya cp xray /usr/local/bin/ chmod +x /usr/local/bin/v2raya chmod +x /usr/local/bin/xrayCopy the GFWList proxy rule files included with xray:
geoip.datandgeosite.dat1 2 3cd /usr/local/share mkdir xray cp .../g* xrayModify the
serviceconfiguration file1sudo vi /etc/systemd/system/v2raya.serviceThe content was generated by ChatGPT combined with the official documentation:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16[Unit] Description=v2rayA Service After=network.target [Service] Type=simple User=root Environment="V2RAYA_CONFIG=/usr/local/etc/v2raya" Environment="V2RAYA_LOG_FILE=/tmp/v2raya.log" Environment="XRAY_LOCATION_ASSET=/usr/local/share/xray" ExecStart=/usr/local/bin/v2raya --passcheckroot Restart=on-failure LimitNOFILE=1000000 [Install] WantedBy=multi-user.targetActivate v2rayA. According to the official documentation, run it as a service
1 2sudo systemctl start v2raya sudo systemctl status v2rayaConfigure it to start up automatically on boot. Theoretically, the configuration is complete after this step. Along the way, I also solved the issue of transparency proxy not working on Synology.
1 2sudo systemctl enable v2raya sudo systemctl is-enabled v2rayaActivate Transparent Proxy
arch kernel iptables version system model platform version apollolake 4.4.180+ v1.8.3 DS918+ 7.0.1-42218 apollolake 4.4.59+ v1.6.0 DS918+ 6.2.3-25426 broadwell 3.10.105 v1.6.0 DS3617xs 6.2.3-25426 bromolow 3.10.105 v1.6.0 DS3615xs 6.2.3-25426 geminilake 4.4.180+ v1.8.3 DS920+ 7.1-42661 geminilake 4.4.302+ v1.8.3 DS220+ 7.2-64570 Due to the characteristics of the Synology system, first determine the architecture based on your model, then select the appropriate files for your machine from the downloaded modules from the GitHub repository (for example, my DS224 is geminilake).
Upload the corresponding ko modules to
/lib/modules/, and upload the corresponding so modules to/usr/lib/iptables/, and that’s it.Run
sudo -iand then run the followinginsmodcommands to attempt loading the ko kernel modules. Because the modules depend on each other, they must be loaded in a specific order.1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21insmod /lib/modules/nfnetlink.ko insmod /lib/modules/ip_set.ko insmod /lib/modules/ip_set_hash_ip.ko insmod /lib/modules/xt_set.ko insmod /lib/modules/ip_set_hash_net.ko insmod /lib/modules/xt_mark.ko insmod /lib/modules/xt_connmark.ko insmod /lib/modules/xt_comment.ko insmod /lib/modules/xt_TPROXY.ko insmod /lib/modules/xt_socket.ko insmod /lib/modules/iptable_mangle.ko insmod /lib/modules/textsearch.ko insmod /lib/modules/ts_bm.ko insmod /lib/modules/xt_string.ko insmod /lib/modules/nf_nat_ipv6.ko insmod /lib/modules/nf_nat_masquerade_ipv6.ko insmod /lib/modules/ip6t_MASQUERADE.ko insmod /lib/modules/ip6table_nat.ko insmod /lib/modules/ip6table_raw.ko insmod /lib/modules/ip6table_mangle.koHowever, after a system reboot, the modules need to be reloaded, so generate a script with the above content at
/usr/local/bin/load_v2raya_mods.sh.Then restart the v2rayA service:
1sudo systemctl restart v2raya
Emby
After configuring v2rayA, even though I used the method of modifying the configuration file, Emby’s traffic still couldn’t successfully pass through v2rayA. After various fruitless attempts to modify the IP configuration, it naturally occurred to me that this was caused by Docker running as a host service.
After modifying the configuration on v2rayA multiple times, I finally found that enabling the transparent proxy solved the problem, and it also fixed the issue of being unable to connect to the Docker repository. But a bigger problem arose: enabling the transparent proxy caused all external network access to fail (fortunately, local network connections still worked). I think “transparent proxy” can be understood as a “global proxy”.
For the issue of setting up a proxy specifically for Docker (Container Manager), please refer to the links in the preface.
Select Emby in “Images” and run it. Add the path to the media library in “Volume Settings”, add three environment variables in “Environment”, and select
hostmode in “Network”:1 2 3HTTP_PROXY = http://127.0.0.1:20171 HTTPS_PROXY = http://127.0.0.1:20171 NO_PROXY = localhost,127.0.0.1Complete the basic setup, install the previous anime-related plugins, and the scraping was successful.