Category: Software Development

GitLab on Synology: set ‘external_url’

There are two (or even more) solutions to install GitLab on a Synology:

  • Using Docker and the container gitlab/gitlab-ce
  • Using the DSM package manager

Depending on the type of installation, different settings are required to update the external url.

Using Docker container

The external url of GitLab can e defined in /etc/gitlab/gitlab.rb. The parameter takes an url and can also handle a port:

external_url ''

Important: when a port is specified in external_url, this will override the https/https port where nginx is listening. To use a different port for nginx, this requires an additional setting:

nginx['listen_port'] = 80

After changing this setting, it’s necessary to run:

gitlab-ctl reconfigure

The settings above are necessary, if port routing is set like the following:

Using DSM package manager installation

This installation of GitLab on Synology uses localhost as a default value for external url. This may lead to some problems when accessing GitLab over another IP or host name. In my case, this lead to missing icons and a non functional WebIDE. An inspection of the html page shows, that some resources are requested over http://localhost/... which leads to 404 errors for those resources.

Since the GitLab container on Synology is not based on the omnibus package, you can not use directly external_url in /etc/gitlab/gitlab.rb. If you want to change the url you can do it by changing the docker environment parameter GITLAB_HOST.

GitLab on Synology: Environment settings

Setup GitLab Runner for Docker containers on Synology NAS

The setup described in this post has been tested on the following system:

  • DS216+II with 8GB RAM
  • DSM 6.2.3-25426 Update 2

In addition, the following software packages have already been installed on the system using the Synology package manager:

  • Docker 18.09.0-0513

GitLab is installed via the Docker Registry:

  • gitlab/gitlab-ce:latest (in my case GitLab 13.5.1-ce.0)

Install GitLab

You can skip this part, if GitLab is already running on your Synology and continue with the step Install GitLab Runner.

To install GitLab, open the Docker Registry and search for “gitlab”. Double click the entry gitlab/gitlab-ce:latest and select the latest version:

After the image is loaded, it will be listed under image. Launch this image and set the folders to be mounted as shown in the following image. This will simplify the access to the docker files within your Synology.

Mounted folder / volumes
Port settings

The port settings depend on your system. Normally, HTTP is accessible at port 80 or HTTPS on port 443. If your system already uses other apps that are running on those port, you can adjust them in Port Settings.

After completing the setup, it might take some time until the GitLab web surface is available. When accessing GitLab for the first time, you can specify a password for the root environment. The default username for the admin area is root. Now you can create user accounts, projects and perform any adjustments that fit your needs.

Install GitLab Runner

As the Synology DSM uses Docker to run GitLab, we can use Docker as well to install GitLab Runner. For this, connect to the Synology using SSH:

ssh <admin-user>@<synology> -p <port>

Now we can install the Gitlab Runner Docker container that can run other Docker containers to perform the runner tasks:

docker run -d \
--name gitlab_runner_docker \
--restart always \<br>--network host \
-v /run/docker.sock:/var/run/docker.sock \

This will install a Docker container with the name gitlab_runner_docker which uses the same network as Docker (‘–network host‘).

As this container is the basis for our Docker-in-Docker setup, we connect the Docker socket of our main container to the new one by using -v /run/docker.sock:/var/run/docker.sock.

You might also use the Docker GUI of DSM to create the container. But the step above can only be done with the help of the console command!

To test the container, you can use the following command to connect to the console:

docker exec -it gitlab_runner_docker /bin/bash

Register the runner

Now it’s time to register the runner:

docker exec -it gitlab_runner_docker gitlab-runner register

This will ask for some input:

Runtime platform                                    arch=amd64 os=linux pid=16 revision=e95f89a0 version=13.4.1
Running in system-mode.                            
Please enter the gitlab-ci coordinator URL (e.g.
Please enter the gitlab-ci token for this runner:
Please enter the gitlab-ci description for this runner:
[synology]: docker_alpine
Please enter the gitlab-ci tags for this runner (comma separated):

Registering runner... succeeded                     runner=sA4DKorC
Please enter the executor: docker-ssh, parallels, docker+machine, kubernetes, docker, shell, ssh, virtualbox, docker-ssh+machine, custom:
Please enter the default Docker image (e.g. ruby:2.6):
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

In this case, the executor docker and the base image alpine:latest is used for this container.

Setup Docker-in-Docker

Let’s connect to the bash terminal of this container to change some settings:

docker exec -it gitlab_runner_docker /bin/bash

The created Docker container is an alpine base system without any packages installed. To perform the changes, we need a simple terminal text editor like nano or vim. The following commands will install nano for this task:

apt-get update
apt-get install nano

Now you can use nano to edit the GitLab Runner config file:

nano /etc/gitlab-runner/config.toml

And add the following lines as highlighted in the config file below:

clone_url = ""
privileged = true
pull_policy = "if-not-present"
concurrent = 1
check_interval = 0

  session_timeout = 1800

  name = "GitLab Runner Docker"
  url = ""
  clone_url = ""
  token = "Examp1eT0ken"
  executor = "docker"
    tls_verify = false
    image = "node:latest"
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
    privileged = true
    pull_policy = "if-not-present"

That’s it. Now you can use this GitLab Runner for your repositories and run jobs by using other Docker containers.

Example usage in .gitlab-ci.yml

The following example uses a php container to run tests for a simple PHP application and deploy the code to a server. Some of the settings depend on the setup of your PHP application, so the example will not work out of the box. But it can give you a good idea of what is possible.

image: php:7.4-fpm

  - mysql:5.7

  # Configure mysql environment variables (

  # Initialize database, etc

  - test
  - deploy

  stage: test
    - composer install
    - composer phpunit

  stage: deploy
    name: production
    # run on server 'git checkout master && git pull origin master && exit'
    - master

Photo by sergio souza on Unsplash

Flutter: generating *.g.dart files for json serialization

The full documentation for this is available on

When creating json_serializable classes the first time, you’ll get errors similar to what is shown in the image below.

IDE warning when the generated code for a model class does not exist yet.

These errors are entirely normal and are simply because the generated code for the model class does not exist yet. To resolve this, run the code generator that generates the serialization boilerplate.

There are two ways of running the code generator.

One-time code generation

By running 

flutter pub run build_runner build

in the project root, you generate JSON serialization code for your models whenever they are needed. This triggers a one-time build that goes through the source files, picks the relevant ones, and generates the necessary serialization code for them.

While this is convenient, it would be nice if you did not have to run the build manually every time you make changes in your model classes.

Generating code continuously

watcher makes our source code generation process more convenient. It watches changes in our project files and automatically builds the necessary files when needed. Start the watcher by running

flutter pub run build_runner watch

in the project root.

It is safe to start the watcher once and leave it running in the background.


Sourcetree keeps asking for password

When Sourcetree keeps asking for password when committing or pushing data to a server, the following solution worked for me:

Go to terminal in your project folder and enter:

git config credential.helper store
git pull

Input your username and password and press enter. That’s it.

Source (somewhere in between the lines):

Die interessantesten Podcasts: SEO, Content Marketing, Social Media, Startups

The Sience of Social Media

The Science of Social Media is a podcast for marketers and brands interested in learning about new and exciting ways to implement social media marketing across a variety of platforms and industries. Join Buffer hosts Hailley, Brian, and Kevan each week as they interview some of the best marketers from brands and businesses that are leading the way in social media innovation and experimentation around the world. We promise to keep it fun, insightful, interesting, and most of all, actionable. The Science of Social Media is a podcast presented by the social media publishing and analytics tool, Buffer.

Detailed Content Marketing

The aim of our podcast is simple: We want to bring you the best content marketing success stories the web has to offer, that you can actually use for marketing your own projects.
Each day at 7am New York Time (UTC-4) we’ll go live with a new episode so you can start your day with inspiration on what project to tackle next.

Baremetrics: Founder’s Journey and Startup-Tips

Read about (and listen to) true experiences, challenges, and what the road to success really looks like straight from the team behind Baremetrics.

Photo by Michael Mroczek on Unsplash

Unarten im Netz – oder: wie werde ich meine Besucher los

Wer kennt sie noch, die guten alten Popups: kleine Browserfenster, die sich über den Browser gelegt haben. Und das meist, um Werbung anzuzeigen. Diese Zeiten sind zum Glück vorbei, da aktuelle Browser diese von Haus aus unterdrücken.

Doch es gibt eine neue Methode, um Benutzer auf einer Webseite abzuschrecken und zu verjagen: Inline-Overlays (also kleine “Popups” innerhalb der Webseite oder auch Modals genannt). Mit diesen wird der Nutzer meist nach der Emailadresse gefragt, um einen Newsletter zu abonnieren. Ok, ist nicht ganz so nervig wie ein blinkendes Werbe-Popup, aber dennoch unterbricht es den Lesefluss. Und dies meist dann, wenn man sich gerade am Anfang eines Artikels befindet, aus versehen den Mauszeiger aus dem Browserfenster bewegt oder etwas zurück scrollt, um Inhalte erneut zu lesen. Also bei Aktivitäten, die vermuten lassen, dass man das Fenster schließen möchte.

Aber warum? Eine Einschätzung zur Nutzerfreundlichkeit: 0 von 10. Der Nutzer bekommt teilweise nicht einmal die Möglichkeit, den Inhalt zu lesen und soll sich davor schon entscheiden einen Newsletter zu abonnieren. Meines Erachtens mehr abschreckend als nützlich. Denn in den heutigen Zeiten, in denen man immer noch sehr viel Spam im Postfach findet, wird es immer schwerer an Email-Adressen zu kommen.

Aber auch hier hilft Qualität statt Quantität: es wäre sinnvoller sich auf guten Inhalt zu konzentrieren, als zwanghaft zu versuchen, die Leute zu einem Newsletter zu überreden. Also liebe Webmaster: bitte lasst es!

13 wichtige Dinge, die Deine nächste mobile App enthalten sollte

Es gibt viele Dinge, die eine gute App ausmachen. Hier ein paar Gedankenstützen, die bei der Umsetzung einer App helfen können:

  1. Feedback System (E-Mail oder Feedback-Formular)
  2. Fokussiere auf Benutzerfreundlichkeit
  3. Personalisierung (Einstellungen für Datenschutz, Schriftarten/Farben/Größen)
  4. Halte die App einfach und implementiere nur die Basisfunktionen
  5. Denke daran: es ist nur ein Telefon
  6. Wenn Anmeldung, dann auch über Social Media?
  7. Vermeide eine Art “Webbrowser” mit den gleichen Funktionen einer mobilen Webseite
  8. Weniger ist manchmal mehr – frage nicht nach zu vielen Informationen
  9. Ändere nichts (beim Umwandeln in eine mobile App, sollte sichergestellt sein, dass keine Features ausgelassen werden oder schwer auffindbar sind)
  10. Analysen einbinden
  11. Möglichkeiten zu Offline-Nutzung
  12. Gamification (Gamification ermöglicht es dem Nutzer, interaktiv zu sein und Spaß beim Verwenden der App zu haben)
  13. Fokussiere auf Geschwindigkeit (langsame Apps machen keinen Spaß)


Buttons in Dialogen: Ok und Abbrechen – rechts oder links?

Die Anordnung von Buttons ist meist abhängig vom Betriebssystem, diese Information sollte daher aus den entsprechenden User Interface Guidelines entnommen werden. Hier eine kurze Zusammenfassung:


Buttons sollten nach ihrer Aktion in folgender Reihenfolge (von links nach rechts) platziert werden:

OK/[Do it]/Ja
[Don’t do it]/Nein
Annehmen (wenn vorhanden)
Hilfe (wenn vorhanden)

Abbrechen ist immer rechts vom Ok-Button.


Ein Button der eine Aktion ausführt sollte am weitesten rechts platziert werden. Der Abbrechen-Button wird links daneben angeordnet. Bei MacOS ist Abbrechen also links von Ok.


Die ablehnendste Aktion eines Dialogs ist immer auf der linken Seite. Ablehnende Aktionen bringen den Nutzer zurück zur letzten Ansicht.

Bestätigende Aktionen sind rechts. Diese Aktionen The affirmative actions are on the right. Bestätigende Aktionen führen den Prozess fort, welcher den Dialog aufgerufen hat. Bei Android ist Abbrechen also links von Ok.