foreword
Synology Nas, with its own DSM system, DiskStation Manager (DSM) is an intuitive operating system with web interface that helps users manage files, photos, music, videos and other important content stored in Synology DiskStation and RackStation. What DiskStation Manager can achieve is not only to store data, but also users can set up applications and choose the services they need to enrich their lives and improve work efficiency. I bought a DS218+ on September 20, 2019, and it has been almost three years since I used it. The platform is mainly used for file storage. Now that the public network IP has been opened with the broadband installed by Telecom, the playability is even greater. Today, I will share what I mainly do with Synology.
Equipment introduction
DS218+, 2-disk, 6GB memory, bought two 4T wolf disks, the standby power is 4.41W.
my play
remote access
Because my broadband is the broadband of telecommunications, and the public network IP is opened, I use the router of PHICOMM K3, plus the router firmware of Openwrt, through the method of router dialing + dynamic DNS + port forwarding, I can achieve external network access, so Synology, router management can be achieved remotely. Of course, if there is no public IP, you can also access the public network through some other intranet penetration tools such as frpc, zerotier, and ddnsto. Here I mainly introduce how to use Openwrt + dynamic DNS + port forwarding to achieve remote access.
- router dial
Generally, when installing broadband by default, the master will use the optical modem for dial-up Internet access, and then connect to the router for network connection through DHCP. In this case, the IP address obtained by our router is only the IP address of the intranet, usually 192.168 .xx is like this, in order to realize the remote access of the public network IP, you need to change the connection mode of the optical modem to 桥接
, dial-up on the router, the modification methods of different optical modems are basically the same, mainly you need to use the super Log in as an administrator. Here we provide you with the account and password of the super administrators of different operators. You can set up Baidu by yourself.
中国电信:
telecomadmin nE7jA%5m
中国联通:
CUAdmin CUAdmin 或 CUadmin
中国移动:
CMCCAdmin aDm8H%MdA 或 CMCCAdmin WoTf6&$7
After the light cat is changed to bridge, in the router, find the network-interface, set the wan interface,
Select PPPoE for communication protocol, PAP/CHAP username is broadband account, PAP/CHAP password is broadband password
In the advanced settings, you can set it according to the actual needs. In the physical settings, you can set it according to the actual port that your router is connected to the optical modem. Generally, the default can be used.
After the setting is completed, click Save to apply the router to dial up. After successful dialing, you can see the IPv4 address of the pppoe port on the interface of the interface, which is the public IP address.
- Set up port forwarding
Set the port that needs to be forwarded in 网络-防火墙-端口转发
, here because my Synology intranet address is 192.168.2.16, the router's intranet address is 192.168.2.1, and all the ports in Synology are forwarded here, and 9999 to the router's port
Of course, according to actual needs, not all ports need to be forwarded, you can add them as needed, for example, only forward the port of mongodb:
After the port forwarding is set here, the IP address obtained by dialing the router above, plus the port here, can already achieve remote access. For example, my public IP address is 10.23.122.11, the port forwarding mongodb is 27017, the internal corresponding address is Synology's IP192.168.2.16, the internal port is mongodb's port 27017 in Synology, and it passes through 10.23. 122.11:27017 can connect to Synology's mongodb service to achieve remote access to Synology's mongodb. Similarly, if you need mysql port 3306, you can also set it like this.
It is worth noting that the operator has not opened ports 443 and 80, so the external ports cannot be set to 443 or 80 here.
Through the above settings, you can achieve remote access to various services within Synology. It is not certain that if your router is restarted, the dial-up of pppoe will also change, because operators generally give dynamic IP segment addresses, and each restart The IP address obtained later will be different from the last time, so we need to bind the domain name through dynamic DNS to access our internal services.
- Set up dynamic DNS
The dynamic DNS of openwrt is a plug-in. Generally, the router firmware will come with it. If not, you need to install it yourself. The installation packages of different architectures can be downloaded here: https://op.supes.top/packages/ . The main function of dynamic DNS is to bind the domain name to the IP address. When the IP address changes dynamically, we can still access through the automatically bound domain name.
Find 服务-动态DNS
, I have added it here, if you need to add a new one, just add a new item below. When you need to pay attention, the process of adding a domain name needs to obtain the accessKey provided by the corresponding domain name provider. Here I use the domain name of Alibaba Cloud.
After opening, in the basic settings, set the relevant configuration
- Check Enabled
- Query host name: the domain name you want to set, for example, nas.wangbo.site
- IP address version: IPv4 address
- DDNS service provider: Because mine is Aliyun, I choose aliyun.com and set it according to my own domain name service provider
- Domain name: the same as the query host name
- Username: AccessKeyID of Alibaba Cloud
- Password: Alibaba Cloud's AccessKeySecret, see the figure below for details.
- Use Https: Check
- CA certificate path: keep it empty
After the above settings are made, Alibaba Cloud's domain name resolution system will automatically resolve and bind the domain name. You will see in the domain name console that it has added an A record, and every time the IPv4 in the router changes, within two minutes It will update automatically.
The above is the remote access method I use. Of course, if you do not have a public network IP, it will be relatively troublesome. If you use frpc, you need a server with a public network IP for forwarding. If you use zerotier, you need to connect between the router and the network. Only plug-ins can be installed on the nas. Others such as ddnsto use the domain name and port provided by them, and cannot forward services such as mysql and mongo, which is relatively inconvenient. Of course, it is not a problem if you have the ability to cash, because there are many Service providers that penetrate the intranet can help you, such as peanut shells, etc., according to your own needs.
After the remote access settings are complete, we can start tossing things on Synology.
kit
The Synology DSM system provides you with a lot of kits, which can be viewed here . At the same time, some big guys also provide some more useful kits for free, such as Yunmeng , Mine God , Lone Soul under the Skirt, etc., we Just use the kit they provide with a simple setup.
Kit Source Configuration
Open Synology's Package Center, click Settings - Package Source in the upper right corner, and configure the corresponding package source address. The above three have provided you with a wealth of kits, you can use them directly. In addition, Synology itself actually provides a lot of useful kits. The following mainly share the kits that I use every day.
Common Kits
- Alibaba Cloud Disk WebDev
Provided by Mine God, download it directly after configuring the source, and configure it according to Mine God's documentation. aria-label="Alibaba Cloud Disk WebDAV service, the main usage scenario is to cooperate with client apps that support WebDAV protocol such as Infuse, nPlayer, etc. to directly watch cloud disk video content on TV, support uploading files, but limited by WebDAV protocol. Support file transfer in seconds. Kit usage tutorial: https://imnks.com/3939.html
- Cloud Sync
Synology comes with it, and the package center can be downloaded and installed directly. It can synchronize super multi-cloud platforms and synchronize files to Nas. It is very easy to use, and the specific configuration is also very simple.
- Synology Photos
Synology comes with it, you can directly download and install it in the package center, picture management, and the APP on the mobile phone Photos Mobile
can back up mobile phone albums anytime, anywhere.
- Synology Video Station
Synology comes with it, you can directly download and install it in the package center, video player, management and APP on the mobile phone DS Video
can watch the videos stored on Synology anytime, anywhere, and the intranet experience is better. Of course, some third-party players such as emby are also good, because I don't have much demand for watching videos, so this is enough, and more people can Baidu by themselves.
- SMB
Synology comes with it. It can be turned on through 控制面板-文件服务-SMB
. After it is turned on, you can use the SMB service. I mainly use this to backup Mac. After connecting through Time Machine, I can back up my Mac irregularly in Synology.
- Synology Drive
Included with Synology and installed by default, Synology Drive Server is a comprehensive file storage, management, sharing and synchronization solution. Once installed, you can centrally manage and monitor via Synology Drive Management Console, access files via web portal via Synology Drive, and sync between Synology NAS devices via Synology Drive ShareSync.
- Synology Note Station
Comes with Synology and installed by default, Note Station allows you to fully enjoy writing, watching, editing and sharing rich notes. You can easily create content using rich text editing, media embedding, attachments, and more. Manage your notes by using tags and combining them into a notepad. When you're ready, Note Station makes it easy and quick to share content via social networking platforms. Create, share and enjoy!
- Vip video analysis
Yunmeng provides it. After configuring the source, download it directly. The function is just like the name. Enter the video address and automatically resolve it. VIP needs to pay? nonexistent! !
- More
In addition, Synology officially provides a lot of packages for downloading, and there are also many third-party sources. Because I don't need it for the time being, I won't go into details here. If you need it, you can search it yourself.
Docker
Of course, in addition to some of its own kits and kits developed by some third-party bigwigs, the most fun of Synology is Docker. After all, everyone knows that having Docker is equivalent to infinite possibilities. There are so many mirrors, just install them. Just play! The way to install Docker in Synology is also to download and install directly in the package center.
Docker basic configuration
Because of the Docerk source problem, sometimes when we download the image, the image download may fail due to irresistible network reasons, so we need to set the default Docker image source address, because my router supports science, so I don't have it here. Set up domestic mirror sources can also be downloaded.
Open the Docker suite, click on the registry, and add the corresponding Docker source in the pop-up box. What sources can be set, you can Baidu by yourself.
my docker service
I mainly installed the following Docker services.
- Portainer
The Docker Chinese panel can easily manage docker containers, which is provided by Yunmeng, and can be installed directly in the package source. It will automatically create the docker image without any extra configuration.
- Lsky figure bed
Picture bed management system, search in the registry halcyonazure/lsky-pro-docker
download. Specific configuration method: https://zhuanlan.zhihu.com/p/544546775
- Halo Blog
Halo blog management system, search in the registry Halo
download. For the specific configuration method, please refer to my blog: https://zhuanlan.zhihu.com/p/550167599
- mongo, mysql
mongodb, mysql database services, you can directly search and download in the registry. Synology itself also provides MariaDB and phpMyAdmin, but sometimes I am not satisfied, so I installed these two services myself. The specific configuration is as follows. It is worth noting that the latest version of mongodb is more troublesome to install. I installed v4. .4.9: mysql installation , mongodb installation , connection method Because I set up remote access above, I can connect directly in Webstorm
- BaiduPcs
Baidu cloud file management, unlimited download, direct search in the registry baidupcs
download, provided by oldiy. Specific configuration method: https://www.ioiox.com/archives/48.html
- qinglong
Qinglong panel, special for wool, everyone who understands it. Search directly in the registry qinglong
download. Specific configuration method: https://www.163.com/dy/article/H55ES8KB05534O7Z.html
Here are several libraries for you, involving Meituan, Jingdong, and Station B
ql repo https://github.com/gys619/Absinthe.git "jd_|jx_|jddj_|gua_|getJDCookie|wskey" "activity|backUp" "^jd[^_]|USER|utils|ZooFaker_Necklace|JDJRValidator_|sign_graphics_validate|jddj_cookie|function|ql|magic|JDJR|JD" "main"
ql repo https://github.com/KingRan/KR.git "jd_|jx_|jdCookie" "activity|backUp" "^jd[^_]|USER|utils|function|sign|sendNotify|ql|JDJR"
ql repo https://github.com/raywangqvq/bilibilitoolpro.git "bili_task_"
ql repo https://github.com/liroBoy/MT_fuli.git
- Vaultwarden
Password management, used in conjunction with Bitwarden on the browser side, is the Pro version directly after Synology docker is installed. Search directly in the registry Vaultwarden
download. Specific configuration method: https://post.smzdm.com/p/a5d0n308/
- Watchtower
Docker image version monitoring, regularly update the image version by setting a scheduled task, directly search in the registry Watchtower
download, the specific configuration method: https://post.smzdm.com/p/akx8m8oe/
- zerotier
Remote LAN access, can be used in conjunction with Openwrt, after DSM7.0 version, zerotier recommends using Docker to install, search directly in the registry zerotier-containerized
download, the specific configuration method: https://blog .csdn.net/jxluh/article/details/124269549
- More
Of course, through the Docker image, there are more fun things to install, everyone can play freely! ! !
other
- Scheduled Tasks
Here I mainly set the background image of the login interface to the background image recommended by Bing every day through the scheduled task, and save it in the nas. The specific configuration is as follows:
Create a new task in the control panel - task plan and name it arbitrarily. My name is changeWallpaper
, user account Xuan root, choose the planned time by yourself, fill in the following content in the user-defined script in the task settings, and save after adding That's it, and then it will be executed periodically.
#如需收集每日美图去掉下面注释设置保存文件夹路径
savepath="/volume1/Photo/desktopImg"
#在FileStation里面右键文件夹属性可以看到路径
pic=$(wget -t 5 --no-check-certificate -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1")
echo $pic|grep -q enddate||exit
link=$(echo https://www.bing.com$(echo $pic|sed 's/.\+"url"[:" ]\+//g'|sed 's/".\+//g'))
date=$(echo $pic|sed 's/.\+enddate[": ]\+//g'|grep -Eo 2[0-9]{7}|head -1)
tmpfile=/tmp/$date"_bing.jpg"
wget -t 5 --no-check-certificate $link -qO $tmpfile
[ -s $tmpfile ]||exit
rm -rf /usr/syno/etc/login_background*.jpg
cp -f $tmpfile /usr/syno/etc/login_background.jpg &>/dev/null
cp -f $tmpfile /usr/syno/etc/login_background_hd.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default_wallpaper/01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/1x/default_wallpaper/dsm6_01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/2x/default_wallpaper/dsm6_01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/1x/default_wallpaper/dsm6_02.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/2x/default_wallpaper/dsm6_02.jpg &>/dev/null
title=$(echo $pic|sed 's/.\+"title":"//g'|sed 's/".\+//g')
copyright=$(echo $pic|sed 's/.\+"copyright[:" ]\+//g'|sed 's/".\+//g')
word=$(echo $copyright|sed 's/(.\+//g')
if [ ! -n "$title" ];then
cninfo=$(echo $copyright|sed 's/,/"/g'|sed 's/,/"/g'|sed 's/(/"/g'|sed 's/ //g'|sed 's/\//_/g'|sed 's/)//g')
title=$(echo $cninfo|cut -d'"' -f1)
word=$(echo $cninfo|cut -d'"' -f2)
fi
sed -i s/login_background_customize=.*//g /etc/synoinfo.conf
echo "login_background_customize=\"yes\"">>/etc/synoinfo.conf
sed -i s/login_welcome_title=.*//g /etc/synoinfo.conf
echo "login_welcome_title=\"$title\"">>/etc/synoinfo.conf
sed -i s/login_welcome_msg=.*//g /etc/synoinfo.conf
echo "login_welcome_msg=\"$word\"">>/etc/synoinfo.conf
if (echo $savepath|grep -q '/') then
cp -f $tmpfile $savepath/$date@$title-$word.jpg
fi
rm -rf /tmp/*_bing.jpg
Summarize
The above are some of the things I have done with Synology at present. In fact, I have done more before, but later I found out that it is not necessary, so there is no record. If you have Synology or a friend who can install Black Synology, you can try tried!
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。