• Skip to primary navigation
  • Skip to main content

Magda Sicknick

  • About me
  • Articles
  • Portfolio

Synology

January 18, 2019 by Leave a Comment

Synology mail() function

If you’re like me, and you have your WordPress site set up on your Synology box, the moment you forget your password to your login you’re kind of SOL.

You think you can click the Lost your password? link, enter your email, and your password reset link will be sent to you, except you get an error message:

The email could not be sent.
Possible reason: your host may have disabled the mail() function.

Now what?

Well, It is actually fairly simple to fix.

  1. Navigate to your Control panel -> Notifications -> Email
  2. Check Enable email notificaions
  3. Enter the Recipient’s email address
  4. Choose your Service provider
  5. Log in to your service provider
  6. Save your settings, and send out a test e-mail to confirm that they work

August 30, 2018 by Leave a Comment

Customizing the login page for a Synology box

This post will guide you through on how to set up a customized login screen for a Synology Disk Station beyond the settings provided in the GUI. It will require you to understand how to connect to your Disk Station using terminal (here is the latest version of PuTTY). The following scripts will allow you to manipulate the CSS and the favicon of your device’s login screen.

NOTE: Be careful when messing with the internal file system of your device!!

 

Pre-requisite: Back up everything!

Everyone makes mistakes, and it is better to be safe than sorry.

Create a shared folder

First, we will create a directory for the new and backup files within your root directory:

  1. Navigate to the Control Panel on your Synology DiskStation.
  2. Under File Sharing choose Shared Folders.
  3. Click on Create and Create again.
  4. Name the new shared folder something along the lines of _DiskStation so that it shows up at the top of your shared folders list.
  5. Check all checkboxes to hide the shared folder from My Network Places and users without permissions.
  6. You do not have to encrypt the folder or enable a quota
  7. Click Apply
  8. Edit permissions so that only your admin account has Read/Write access to the shared folder.
Back up CSS folder
  1. Create a folder called ‘backup’ in the _DiskStation directory
  2. In terminal, navigate to /usr/syno/synoman/webman/resources/
    $ cd /usr/syno/synoman/webman/resources/
  3. Run the command:
    $ sudo cp -r css /volume1/_DiskStation/backup/css_bak

    It may ask you for your administrator password again before running the command – enter it.

Back up mobile CSS files
  1. In terminal, navigate to /usr/syno/synoman/mobile/
    $ cd /usr/syno/synoman/mobile/
  2. Run the command:
    $ sudo cp -r ui /volume1/_DiskStation/backup/ui_bak

    It may ask you for your administrator password again before running the command – enter it.

Prepare your files and folder structure

Note: There is a possibility of a DSM update overwriting the style files we will be updating, so in order to prevent it, we are going to create folders under the /volume1/_DiskStation directory and copy the files from there.

Folder structure

The following will be the structure of folders we will make to store our files:

_DiskStation
   customstyle
      loginstyle.css
      mobilestyle.css
   customimage
      background.jpg
   copystyles.sh
   fixoverwrites.sh
File contents

For this part, you will have to use inspect-element to find which pieces you want to modify. Remember that the mobile stylesheet is very different from the desktop version, so use the responsive and device-specific viewports to test your mobile changes.
Any changes you make should be done directly in the _DiskStation folder you created, and later copied into the internal directory.

Bash files

To make things easier and type less, I’ve compiled all the commands needed into two files. You can simply run them with the command

$ sudo sh /volume1/_DiskStation/yourfilename.sh

The follwing should be ran only once, and after any DSM updates if the login page style gets overwritten:

echo "Removing unneccessary files..";
rm -r /usr/syno/synoman/webman/resources/css/desktop-default.css.gz
rm -r /usr/syno/synoman/webman/resources/css/desktop-business.css.gz
rm -r /usr/syno/synoman/webman/resources/css/desktop.css.gz
rm -r /usr/syno/synoman/webman/resources/css/desktop.css
rm -r /usr/syno/synoman/mobile/ui/style.css.gz

echo "Inserting import statement into stylesheets";
sed -i '1s/^/@import url("loginstyle.css");\n/' /usr/syno/synoman/webman/resources/css/desktop-default.css
sed -i '1s/^/@import url("loginstyle.css");\n/' /usr/syno/synoman/webman/resources/css/desktop-business.css
sed -i '1s/^/@import url("mobilestyle.css");\n/' /usr/syno/synoman/mobile/ui/style.css

echo "Success!";

The below should be ran whenever you make a change to the stylesheet to copy the files over.

echo "Copying stylesheets...";
cp -f /volume1/_DiskStation/customstyle/loginstyle.css /usr/syno/synoman/webman/resources/css
cp -f /volume1/_DiskStation/mobilestyle/mobilestyle.css /usr/syno/synoman/mobile/ui/

echo "Copying images...";
cp -Rf /volume1/_DiskStation/customimage /usr/syno/synoman/webman/resources/images
cp -Rf /volume1/_DiskStation/customimage /usr/syno/synoman/mobile/ui/images

echo "Updating permissions...";
find /usr/syno/synoman/webman/resources -type d -exec chmod 755 {} \;
find /usr/syno/synoman/webman/resources -type f -exec chmod 755 {} \;

find /usr/syno/synoman/mobile/ui -type d -exec chmod 755 {} \;
find /usr/syno/synoman/mobile/ui -type f -exec chmod 755 {} \;

echo "Success!";

CTRL+SHIFT+R and your changes should appear on your login screen!

Questions, comments, concerns?

May 30, 2018 by Leave a Comment

WordPress on Synology

PHP version

Most hosts use PHP 5.6, but I do suggest using 7.0

php.ini file

Change the following memory limits for optimal use with wordpress:

upload_max_filesize = 32M
post_max_size = 48M
memory_limit = 128M
max_execution_time = 600
max_input_vars = 10000
max_input_time = 400

required extensions:

  • cURL – 127 uses (requires libcurl)
    • HTTP API (class WP_Http_curl)
    • url_is_accessable_via_ssl()
    • SimplePie (overridden with class WP_SimplePie_File)
    • GoogleSpell (from TinyMCE package, is not used?)
  • Date/Time – 367 uses
  • DOM – 6 uses (requires libxml)
    • iis7_rewrite_rule_exists()
    • iis7_delete_rewrite_rule()
    • iis7_add_rewrite_rule()
    • saveDomDocument()
  • POSIX Regex – 23 uses
  • Filter – 2 uses
    • class PHPMailer->ValidateAddress() (optional)
  • FTP – 72 uses
    • class ftp_base
    • class ftp (pure and sockets versions)
    • class WP_Filesystem_FTPext
    • class WP_Filesystem_ftpsockets
  • GD – 56 uses
    • wp-admin\includes\image-edit.php
    • wp-admin\includes\image.php
    • wp-includes\media.php
  • Hash – 6 uses
    • wp-includes\pluggable.php multiple uses (optional – fallback in wp-includes\compat.php)
  • iconv – 5 uses
    • class SimplePie (optional)
    • wp_check_invalid_utf8() (optional)
    • wp-mail.php (optional)
  • JSON – 20 uses
    • optional, fallbacks in wp-includes/compat.php
  • libxml – 4 uses
    • class WP_oEmbed->_parse_xml() (optional)
    • SimplePie
  • Multibyte String – 29 uses
    • some fallback in wp-includes/compat.php
  • MySQL – 60 uses
    • class wpdb
    • class SimplePie_Cache (overridden with class WP_Feed_Cache)
  • OpenSSL – 4 uses
    • class PHPMailer
  • PCRE – 743 uses
  • SimpleXML – 1 uses
    • class WP_oEmbed (seems optional)
  • Sockets – 64 uses
    • class ftp (sockets implementation)
  • SPL – 3 uses
  • Tokenizer – 3 uses
    • wp_doc_link_parse() (optional)
  • XML Parser – 89 uses
  • XMLReader – 1 uses
    • SimplePie (seems optional)
  • Zlib – 30 uses

Let’s Talk

Looking to get your business a website or update your current online presence?

Please send me information about you project so that I can determine how to best fulfill your needs.

    Service Required *

    Copyright© 2023 · Magda Sicknick · All Rights Reserved · Powered by Wordpress and the Genesis Framework.