Showing posts with label synology. Show all posts
Showing posts with label synology. Show all posts

April 3, 2014

CalDAV Calendar on Synology DSM5: Remote access to Baikal with iPhone/iPad

Previously we had set up Baikal to sync locally with our CalDAV client. This is a great, convenient way to edit your calendar while using your home computer. But what if we're on the road, and need to block in an upcoming meeting?

This required some changes on our Synology NAS' part, and involved adding a DDNS host and opening some ports to the interwebs for public access.

Now we can attempt to connect using an iPhone! This might vary depending on your version of iOS, but generally it is found at Settings -> Mail, Contacts, Calendars:


Add an "Other" type account:


Add a "CalDAV Account" (and keep in mind that CardDAV might come in handy one day as well... Baikal can also handle our contacts!):


Give your server's hostname here, including the Baikal username and password for the account to be connected to:


Make sure to specify port 80, and enter the following into Account URL, substituting for your own credentials. Note that the port does not need to be specified in the URL:
http://[your-ddns-server-hostname]/baikal/cal.php/principals/[baikal-username]


If you are using a third-party DNS host, see here for configuration.

We are done, and once hitting that button on your phone, it should verify the credentials, and if successful will show some blue checkmarks next to each input box. All that remains is to open your calendar app and enjoy the fruit of your labor!

Synology DSM5.0 remote access via DDNS

There are times when it would be very convenient to have remote access to our Synology NAS for various reasons. This is easily and securely accomplished.

Start from the Control Panel -> External Access -> DDNS tab:


One of the beautiful things about Synology is all the freebies. You can register yourself a free domain name through them, or you can always use any of the other service providers in the drop-down list. I'll go for the freebie, and select Synology as the provider and hit the "Register Now" button:


Once registered, you can login and administrate at https://myds.synology.com/ in the future, but this isn't necessary at the moment. At this point, we should configure our router and add some port forwarding rules, however DSM is probably still dynamically setting its IP address. Static IP is required, so change it to "Use manual configuration" in Control Panel -> Network -> Network Interface -> Edit LAN:



Now we can go set up our router at Control Panel -> External Access -> Router Configuration. DSM will try to automatically determine your router settings, and I was lucky enough that mine was detected:


From here, click the Create button and select Built-in application to create some port forwarding rules. In a previous post we set up Baikal, a calendar package, and now want to access it remotely. According to Baikal documentation, it uses the Web Station protocols, so we should at least enable port 80. Port 443 is the secure SSL encrypted version, but for purposes of this post to just get things running, simple HTTP access is sufficient:


Click "Save" when done, and DSM will configure the router. Great! We've set up a DDNS service, and enabled port forwarding, now all that remains is to connect over the vast internet!

Edit: Another alternative is to use https://www.noip.com to host a DNS redirect. This way you can host a local IP address to a URL-accessible location. Be sure to configure a new DNS host (A), not a redirect.

April 2, 2014

CalDAV Calendar on Synology DSM5: Locally sync Baikal with Windows eM Client

In my previous post, we set up the Baikal calendar package and added some users and blank calendars. Now let's sync it with a CalDAV client over the local home network. In my case, I will be using eM Client on Windows 7.

I don't have Outlook, and am more interested in eM Client, which seems to be one of rather few alternative standalone mail/contacts/calendar clients for Windows. For purposes of simply viewing and editing a calendar, it is overkill given all of its features, but it is easy and convenient to set up and use while troubleshooting this setup. My eventual goal is to sync the calendar hosted on my Synology box with my cellphone.

Once eM Client is installed, go to Tools -> Accounts -> New Account. From here, go to the "Calendar" dropdown, and select "CalDAV":


Fill in your info as was set up during Baikal's installation. Note that the account address URL does not contain a port number, and that the user ID that should be used is not any existing DSM user, but instead a Baikal user that was set up during the package's installation:



If all went well, you should see... absolutely nothing!:



This is because we have yet to add any info to our blank calendars. I am planning to import my Google Calendar here, so let's go grab that real quick. Select from your desired Calendar, and go to its settings page:



Here export your calendar as ICAL format by conveniently clicking the green button (don't get to say that often, lol), and then right-clicking and "Save Link As..." in the pop-up:



It's probably not a bad idea to rename the default name from basic.ics to something more meaningful, especially if you have multiple calendars to export. This will help keep track when importing them via the now-connected eM Client to our NAS. Back in eM Client, go File -> Import, and select "Import events from iCalendar (.ics)":




Once the import is complete, you should now see your previously existing Google Calendar events here. Congratulations, you just severed the tie with Google, and now have a completely private calendar that you can access over your local network! In the next post, we will sync our private calendar with a mobile device, becoming fully self-reliant.

April 1, 2014

CalDAV Calendar on Synology DSM5: Installing Baikal app

I got tired of spoonfeeding Google my day-to-day routines through using their Calendar app. I'll put on my tinfoil hat here, but nobody really knows what our habits, places and events translate into for a data-mining operation, and I would rather enjoy freedom from being part of a statistic. A small step towards cutting the cord involved privatizing my personal calendar and reminders.

I had a lot of difficulty trying to get the built-in Synology CalDAV working, so instead I ended up looking at Baïkal instead. Baïkal is a third-party app that runs on Synology's DSM, and while at the time of this writing it has only been tested by the author on DSM4.3, I found it worked well for me running DSM5.0. Furthermore, it also abstracted itself from existing user accounts, which I found useful, because I likely would have made calendar-specific users anyways. Additionally, it actually uses SQLite or MySQL, which opens a whole new dimension of possibilities, including some convenient backing up methods.

First, download the Baïkal DSM installable .spk package.

Next, back in DSM, install MariaDB from the Synology Package Center if you haven't already - this will provide SQLite and MySQL support. Note that MySQL was replaced in DSM5.0 with MariaDB.

Another prerequisite is to enable Web Station on your NAS, so go to Control Panel -> Web Services and check the "Enable Web Station" checkbox.


Now we are ready to install the downloaded package manually in Package Center:


Follow the steps, and once installed, Baïkal should appear in the list of installed packages. It can now be launched from the Main Menu in the top-left of your DSM interface. You should be greeted with a page such as this below, located at the URL path of [servername]/baikal/admin/install. Note that the port is omitted. For security reasons, you have one hour to complete installation, else you must remove the Baikal package and re-install it.


I will just stick with SQLite for now, but if you want to set up MySQL, feel free to consult the online Baïkal manual. If all goes well, and the installation goes to completion, you should be welcomed with a fresh Dashboard:



 From here, you can add new users, and then calendars for those users:


In the next post we'll take a look at syncing with a CalDAV client and actually adding some stuff!

Windows/Mac/Linux filesharing from Synology NAS accounts

This is really simple to do, but ties in with setting up proper user accounts and permissions. Remember setting up user accounts and permissions? On the final application page, check what is necessary. I have a need for all these services on this particular user account:


Now we need to actually enable file sharing with our operating system. In most cases this should already be filled in, but if it is not, take a look at Control Panel -> File Services:


Since I'm using Windows, I don't presently have a need for Mac File Service, so let's disable that for now.

You should now be able to access your NAS from Windows' Network, and should see it listed as a "computer" along with all the other devices on the network.

Synology DSM Email Notification service

Access via Control Panel -> Notification -> Email tab:

Synology has taken all the guesswork out of setting up an automated Email notification system in DSM5.0. In older versions, it was slightly more of a manual process (see this older blog post by someone else for an example of DSM4's legacy set up), but now it is literally just filling in some information:


I use Gmail, and the SMTP server and port settings are conveniently pre-configured by DSM now. You can use any Gmail account from which to send your notifications. If you applied the settings as above, and then click the "Use custom email server" radio button, you can see some of the finer settings:


I chose to provide a Sender Name, just for distinction between messages from you yourself (if using your personal email like I did) versus messages from your email service. The email address will of course be the same, but the name will differ depending on the sender.

This is the end result from sending a test email:

Synology User Accounts

Let's set up some users on our Diskstation. This is important because it allows us to set some very specific access permissions - this granularity will definitely improve security. But first things first, disable that darned Guest user account:


Honestly, I can't think of any reason why this would be useful to me, and maybe I should just put on my tinfoil hat now, but I prefer setting explicit permissions. Either way, it is now out of the way, so let's get some real users going.

I like setting up users for specific purposes, so I get one in my own name, and so do other specific users. As far as automated backups go, I will also create a user for that purpose, and that purpose alone:



Email is optional, but you can send an email to the user to notify them of the new account.

You can continue and set up group permissions, specific folder permissions, quota limits, application permissions where needed. Remember, less is more - only grant what is necessary, however, for file sharing within your operating system, you will need to enable a few more things.

Synology clean URL local access

It surprises me how few people know this, but you really don't need to access your Diskstation via its IP address. Remember setting up the server name? Well, you can simply access your Diskstation with that! I called my server the "AllSpark", so in my case, the local access URL translates to:

http://allspark:5000

Be sure to substitute port 5001 for https access, or if you're declaring custom ports then use those.

Enable SSH access for Synology DSM

This assumes you already have an SSH client installed and set up.

From Control Panel -> Terminal & SNMP, select "Enable SSH service"



Next, enable "user home service" at Control Panel -> User -> Advanced tab, so that users can actually SSH login to somewhere useful:



Next, enable permissions for SSH-capable users to their "homes" folder:



You can now log in via terminal like:

ssh username@ip-address

Be sure that your user has login privileges. If they don't, SSH in as root, and set them up:


ssh root@ip-address
//...Logging on to the NAS...
sudo vi /etc/passwd

Change the end of the listed user's line from /sbin/nologin to /bin/ash to permit login.

Interesting read regarding security:
http://www.eldemonionegro.com/blog/archivos/2012/08/19/how-to-securely-activate-ssh-into-your-synology-diskstation-with-ssh-keys-and-no-root-login

Synology DSM packages and Widgets

Upon first logging into your freshly installed DSM, you are greeted with the Package Center, as well as some widgets displaying system info at the side. Another post will cover setting up some users and user groups, but let's install some useful packages.

Let's say I am interested in setting up a private Git server on my unit. Simple! Just look for the readily available Synology package under "Utilities". I chose a few official packages from the list:
  • Git Server
  • Antivirus Essential
  • MariaDB

There are a few basic packages that are available right off the bat, but what about installing something that is not listed? Use "Manual Install":


As for Widgets, I enjoy having lots of information readily available at a glance. Click the + in the top left corner, and add to your heart's content. These panes can also be shifted around to different positions.


Getting started with Synology DSM

On a fresh Synology DiskStation install, there are always a few things that I need set up ASAP. I don't often do a hard factory reset, but sometimes it is nice starting with a clean slate - at least, I experiment so much with mine that after a few months a lot of digital crap accumulates.

Synology Assistant is your gateway to get started; it is downloadable, though should also be included as a CD with your Synology NAS. Doing a "Network Search" using this tool will show a list of networked units. In my case, I only performed a reset, so some fields may already contain info versus an out-of-the-box unit:


Hit the "Connect" button, and your browser will open a page to your server in the format of http://[local ip address]:5000/web_index.html. Port 5000 is the default for accessing the DSM software.



You are greeted with the above screen, and just follow the simple instructions. You can install DSM from internet or a local file, which I opted to do. The latest DSM can be downloaded at http://www.synology.com/en-us/support/download/


I like Transformers, and all our home computers are named accordingly, so I decided to name it "AllSpark" (this becomes both the server's network name, and a clean URL with which it can be accessed). This can always be changed at Control Panel -> Network -> General tab -> Server Name field.

After some initial setup, you can log in with the admin user and password!

DSM5.0 will prompt you to set up a QuickConnect ID, which is convenient to make your NAS accessible outside your home network. You can either register for the first time, or use an already existing MyDS account (the same one used to manage https://myds.synology.com/. I already have one, so I opted to just use it again:



Congrats, you are now able to start using DSM!

A couple of good practices would include checking out how to set up proper users and permissions, but right off the bat, we can do a couple of things in Control Panel -> Security:

Set a logout timer. I lowered my auto-logout time from 15 to 5 mins:


Enable Denial-of-Service (DoS) protection (not sure why this isn't on by default):



Set auto-block options for botched login attempts; this is just another safeguard against brute-force login hacks:


These are just some quick and dirty ways to add a touch of protection to your NAS, especially if you plan on being able to access it outside your home network.

Reset a Synology server for firmware reinstall

Messed up your current config? Reset and reinstall the firmware this way:

The reset

  1. Have the Synology system in the ready state 
  2. Look at the back of the Synology System, find a small reset hole near the USB ports 
  3. Using a paper clip, gently depress and hold down the recessed button for about four seconds 
  4. The system will beep once 
Stop here to just reset the admin password and network settings.
  1. After hearing the system beep once, release the button and press it again for another four seconds 
  2. The system will beep three times and execute a reboot
  3. After rebooting, launch the Synology Assistant 
  4. Determine that the data volume will remain unaffected, and upload the system firmware. 
  5. Restore the configuration file. 

Taken from: http://forum.synology.com/wiki/index.php/How_to_Reset_the_Synology_System

Windows 7 Professional Backup to Synology NAS

Lately I've been enjoying exploring my Synology NAS. I have a DS213+ that I purchased after a recent scare in which some of my PC hard drives failed. Until then, proper backups were a distant afterthought, but data preservation has since become a neurotic pastime.

Finding the right tool to perform autonomous backups was actually harder than I thought. Synology is often touted as having fantastic software to go along with their sleek hardware, but I could not put up with using Data Replicator 3, which comes with the unit. I have somewhat over 1TB of crap (I'm a digital packrat...) that I wouldn't mind hanging on to, and absolutely need incremental backup capability. Data Replicator 3 would perform a complete data replication (ha ha) and then go and delete the older backups, depending on your settings. A single backup would take many hours of dominating network bandwidth. If there was an incremental backup option hidden somewhere, I could not find it before becoming fed up, and started looking at other options.

There are lots of supposed good (and free!) options out there, but I settled on Windows Backup. Here's my experience:

  • It is already included in Windows 7, and readily available without initial setup.
  • Any version of Windows 7 can back up to a local disk, but Windows 7 Professional can back up to a network location.
  • Can run autonomously on a schedule.
  • Folders can be "cherry-picked" as needed.

This post assumes that Synology DSM has already been set up, along with proper users/groups/folder permissions. Setting up the Windows side of the coin was easy enough. Note that since we are about to set up a way to automatically back up our stuff, we need to make sure that Windows Backup is actually running properly - check this post out if Windows Backup is behaving oddly or not starting. Otherwise, hit up the Start Menu -> Backup and Restore, then select "Set up backup" to get started.


Browse to your NAS location. Do note, that to be able to backup to a network location, you need a genuine and activated copy of Windows 7. If for some reason you haven't yet activated your copy, the setup will keep failing at this step, even if your NAS is visible on the network and has correct credentials entered.



You'll see a warning saying that other people on your network might access your backup, but that's why having good user settings and permissions on your Synology's end is a good idea. 



Once your network location is shown, hit next, wait for validation, then pick what you want to back up. I'm anal retentive, so I want to pick what gets stored:



From here, go nuts with your goods. You can even include a system image if you want some way to quickly restore your computer in case of nubbery. After that, review your settings, and you're done! All that remains is the actual backup. The first backup will take the longest, but the subsequent backups are indeed incremental, and should go much faster.

Windows backup seems to store files in a compressed state in a weird folder/zipfile hierarchy that I haven't dug into too much. It does save a tiny bit of space if that's your thing, but with a 3TB drive, it really wasn't a concern for me.



All in all, Windows backup seemed to work the most intuitively, and was seamless with my Synology unit.