GithubHelp home page GithubHelp logo

synology-tk's Introduction

synology-tk

Various scripts used to manage my synology

install_letsencrypt_cert.sh

All credits go to https://github.com/thiagocrepaldi/homelab-utility-belt

This modified version installs Let's Encrypt certificates managed/renewed by a SWAG docker.

Generate RSA private key

The SWAG docker generates under /volume1/docker/swag/etc/letsencrypt/live/my.domain.org/

  • A certificate with the certification chain embedded: priv-fullchain-bundle.pem
  • A private key: privkey.pem

DSM wants the private key in RSA format so let's transform it and store it in the same folder.

cd /volume1/docker/swag/etc/letsencrypt/live/my.domain.org/
openssl rsa -in privkey.pem -out privRSAKey.key

Download the priv-fullchain-bundle.pem and privRSAKey.key to your computer.

Initial Let's Encrypt certificate installation

First install the Let's Encrypt certificates manually on the Synology: In DSM

  1. Control Panel >> Security >> Certificates and click on Add
  2. Add a new certificate and click on Next.
  3. Choose on Import a certificate and check Set as default certificate to replace the existing self-signed certificate and go to the Next step.
  4. On the Private key field, click on Browse and select the generated privRSAKey.key.
  5. For the Certificate field, click on Browse and select your priv-fullchain-bundle.pem file.
  6. Leave Intermediate certificate blank as it is embedded into the priv-fullchain-bundle.pem and click on OK to finish.
  7. Click on Configure, make sure your new certificate is selected for all Services and click on Ok button to save.

Install the install_letsencrypt_cert.sh script onto the synology

mkdir -p ~/src/github/hilsonp/synology-tk
git clone https://github.com/hilsonp/synology-tk.git

Create a scheduled job that will install the certificates when renewed

  1. Services >> Task Scheduler >> Create >> Scheduled task >> User-defined script
  2. General.Task: Copy LetsEncrypt Certficate from SWAG
  3. General.User: root
  4. Schedule: Daily at 04:15
  5. Run Command: bash /volume1/homes/pierre/src/phi/github/hilsonp/synology-tk/install_letsencrypt_cert.sh -f /volume1/docker/swag/etc/letsencrypt/live/pierre.hilson.be/priv-fullchain-bundle.pem 2>&1
  6. Setup logs/mail to your liking

synology-tk's People

Contributors

hilsonp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.