Synology Markdown



Synology and Docker are a great combination, so long as you have purchased the correct platform. Ensure that you're using an Intel chipset if you want take full advantage of Docker functionality.

Markdown Table of Contents. I'm using marktext for writing blogs, technical documentation, or notes. It's a great piece of software and completely free and open source but it doesn't support adding a table of contents in the document - most markdown editors don't. Synology, PHP, and the mysql Extension Written by David Schlottman on May 13th, 2018 May 13th, 2018. 3 Comments This week I installed a few new items on my Synology NAS server so that I could better familiarize myself with PHP and MySQL.

I've found productivity tools to be a rather personal thing and depends on how, where, and when you use them. If it's for work or academic use then high volume of notes is expected and so exporting is a concern, but for plodders that do low volume but over a long time then exporting by hand isn't such a chore. Come and join us at Synology Community. A place to answer all your Synology questions. Ask a question or start a discussion now.

Additionally, adding additional hardware resources (like adding memory) is a great way to maximize your Synology Docker host. To find out if your Synology Diskstation has an Intel chipset, look no further than the Synology Wiki. Below are some useful development tools that you can run with your Synology NAS.

Preparation

If you haven't already installed Docker on your DSM platform, you should do so by logging into your DSM and opening up Package Center. Once there, you can search for the Docker application and easily install it onto your system.

This script will convert notes from Synology Note Station to plain-text markdown notes. The script is written in Python and should work on any desktop platform. It's tested on Linux, Windows 7, mac OS 10.15. After conversion you will get.

The first thing you will want to consider is backend data persistence. Pretty convenient that we're running this whole Docker environment on a NAS, right? You can pick your own, or you can use my examples.

The next thing you'll want to do is enable CLI connectivity to your Diskstation (if you don't already have this enabled). My assumption is that if you're interested in Docker, you probably already have this enabled, but if not I'll provide these steps below:

Synology Markdown
  1. Go to your Synology Diskstation Control Panel and select 'Terminal and SNMP'. Once there, check 'Enable SSH Service' and I would highly suggest to pick a random port within the TCP Ephemeral Port Range.

There's no sense in documenting this process much further, but you get the idea. My main concern is that you're enabling SSH, and using a random high port. For further reading, following the instructions at Synology's wiki.

  1. Next, you'll want to create the persistent data directories for Docker to use. I am going to stick with Synology's method as close as possible. So if you haven't already run Docker, create a directory at /volume1/docker/.

Anything directly in /volume1/ should be owned by root.

  1. Now you want to create the directory for your Docker containers. I'll show you how to do that for each example.
Container Examples on Synology

Below are some examples that you can use. These are more developer-focused, but you'll get the idea.

Ghost Blog
(Not this Ghost blog)
The first example is a pretty simple one; a Ghost Blog! Ghost is what I'm using to present you with this walk-through. I like it because it's simple and attractive. It uses a Markdown language that's easy to use. This is a similar language used by GitHub/Gist, GitLab, Atlasian Stash and many tools. So if I create a blog walk-through, in most cases I can use the same code for my GitHub repositories, like I've done for my Kubelab Examples. Enough with the benefits of Ghost, let's get to the the part where we run it.

  1. Create the directory for Ghost and change permission for Docker to use it correctly.

Notice that I've created a /volume1/docker/jinkit/ directory. I recommend doing this so you have one place to store all of your custom Docker configuration data. This keeps your personalized Docker containers separate from what Synology would include, should you choose to use their default Docker applications (like Gitlab or Redmine).

I also changed the permissions to 1000:1000 which is the user Synology uses for their default Docker data folder mappings. This is something I want to look into further though, especially after reading Alexander Morozov's (LK4D4 on Github)namespace example, because I'd really like to limit running containers in privileged mode, and so should you (where possible).

  1. Next, run the container.

Markdown

So what I've done is I've told Docker to restart this container always (pretty obvious), use a tcp high port (which you will want to change yourself) and map the data folder we've created to the default Ghost configuration data folder within the container.

The really nice thing about Docker is that the mapped host directory takes priority over what exists in the container (as I experienced it). So if there is no data in /volume1/docker/jinkit/ghost, the jinkit_ghost container will create it. If there is data in that folder (like you're previous settings and Ghost Blog) than it will prioritize that over the container. This is great for destroying and re-creating the container.

  1. Lastely, to http://gitlab.domain.com:<http-port> to access jinkit_ghost.

GitLab
GitLab is an extremely powerful development tool. I'm not going to say that I like it better than GitHub, but there are some features that I really like about it. One of those features is the ability to map my GitHub repos to my GitLab repo locally, and then running Jenkin's build tests again the repo. (I keep telling myself that I'm just a network security guy, and not a developer). More on Jenkin's later, because I want to talk about bringing up GitLab first.

  1. Start off by creating a few directories and changing the file permissions for each of them to match what we used above for our Ghost blog.

GitLab Postgres Container

  1. Shinkoelectric printers driver download for windows. Next, start each of the containers starting with postgres.

Synology Markdown Editor

Make sure that's running correctly with a docker ps command at the command-line. If you don't see it, run a docker ps -a to see all of your containers (running or stopped), and run a docker logs <container-id> to read the log information for further troubleshooting.

It's very important to change the values for <db-user> and <db-pass>, and make sure they match across each of the containers that reference your jinkit_postgres container.

GitLab Redis Container

  1. Start the Redis container.

Well, that's easy enough! Now let's string it all together with the GitLab container.

GitLab GitLab Container

  1. Start the GitLab container.

Sens modems driver. Ok, first a couple of tripping points (this is really important).

  • Change <http-port> and <ssh-port> port to your own tcp high ports.
  • The <secrets-key> is a long and random alpha-numeric string that you will need to keep secure somewhere. Don't lose it! I would make it very long, and very random.
  • I have included an example for an Office 365 Email account. There are other documented examples out on the world inter-webs for you to explore, should you need something different.
    That's it! Use the same troubleshooting steps with docker ps, docker ps -a. and docker logs if you're having trouble. My original reference was the awesome Docker Registry Hub examples provided by Sameersbn. And for those who are wondering, this is the exact same repo that Synology uses for their Docker packages for GitLab and Redis!
  1. Go to http://gitlab.domain.com:<http-port> to access jinkit_gitlab.

Synology Markdown

To login, the default user/pass are:
User: root
Pass: 5iveL!fe

Jenkins
Oh Jenkins..what an awesome tool! Developers know it well, as it's similar to Travis-CI, Bamboo and others. But what makes Jenkins awesome, other than the fact that it's open source, is that it can actually be used to spin up Docker workers based on load! That's pretty powerful, and it's something we'll get to later (when I have more time).

Additionally, you can use Jenkins to take a Docker Declaration file (known as a Docker file), test-build the Docker image and report back any errors. This process [in a nutshell] is known as Continual Integration. It's pretty cool that we can do this on our own Synology Diskstation!

  1. First, let's create the directory and make sure we have the correct permissions.

  2. Next, run Jenkins.

Make sure to change the <htttp-port> and <ci-worker-port> to your own values.

  1. Next, go to http://jenkins.domain.com:<http-port> to access jinkit_jenkins.
Wrapping Up

Synology Markdown Software

Synology makes it really nice to use Docker. I have to admit that the inclusion of Docker in my Synology platform has given me a whole new sense of understanding around containers as well. If you've ever wanted to explore containers, perhaps the amazing Synology Diskstation could be your gateway drug into next generation computing. Well done Synology!

I hope that in some small way, these examples provide a little help to someone out there! After you've completed them, check out the awesome little management tool that Synology has included (making use of Docker's powerful API). Have fun with it!

When I want to change my nas,
I use Hyper backup software to backup my nas,
Copy from my nas to USB device.

But when I run the copy task,
it tells me 'Run command fail'

So I reboot the nas,
and then I see 'The storage is full, you can't login.' message.

Login with SSH,
I see the partation /dev/md0 100% used.

I cost a lot time to find the reason,
finally I figure it out.

Run df -h command you will see something like this,
the /dev/md0 is 100% used.

Synology

Now the purpose is to solve this problem.

First, You can see the /dev/md0 is mounted on /,
the root folder.

It means every folder in root may used the space,
You must find it out yourself.

In my case,
the Hyper backup software copy file into /volumeUSB1 folder,
This is the problem:
the /volumeUSB1/ folder is under the /, not USB device!
The right USB device folder is /volumeUSB1/usbshare1-2/

Synology Markdown Server

So I delete the files under /volumeUSB1/,
and reboot nas,
I can login again.

Synology Markdown Manager

1, Find where the /dev/md0 is mounted.
2, Find which folder used the space.
3, Delete the files.
4, Reboot.