How to access your Synology NAS services over public Web

To access the Syonology NAS ports outside of your local network, you need to set up DDNS, a wildcard certificate, and a reverse proxy to support HTTPS access. DDNS Go to Control Panel / External Access / DDNS. Click Add. Make the following selections: Service Provider: Synology Hostname: yourname.synology.me Username/Email: <your email> Password: <make it up> Exteral address: no need to change Wildcard certificate Go to Control Panel / Security / Certificate. Click Add. ...

How to find out your UID and GID on Synology NAS

The UID and GID values for default user on Synlogy NAS are usually 1026 and 100. There is a very simple way to check the values as follows: Create a new Scheduled task asn User-defined script Name the script whatever you see fit Set it to be not repeating Set it to send run details to your email Write the script: id Not too complex, huh? Run it and soon enough, you will receive the email containing the UID and GID values. These values will be needed to install some Docker containers, for instance the Codeserver. ...

How to Set Up a Codeserver on Synology NAS

Have you ever missed the VSCode on your tablet? Now there is a solution: run the VSCode on your NAS at home and access it with a browser. That will be possible when you run the Codeserver Docker container on your NAS. Before you do this, you probably want to set up a wildcard certificate and a proxy server on your NAS. That will enable you to access the NAS outside your local network using HTTPS. How to do it, check this: How to Set Up Wildcard Certificate and Reverse Proxy on Synology NAS ...

How to use ConfigService in NestJS in application bootstrap

You might want to access the configuration, for example to set the microservice configuration based on the values from the configuration service. One way to do this is to create an application context from the AppModule. const appContext = await NestFactory.createApplicationContext(BootstrapConfigModule) const configService = appContext.get(ConfigService) const SERVICE_PORT = configService.get('SERVICE_PORT') appContext.close() But a better idea is to use a “temporary” module to avoid double instantiation of the whole app. See a full example below. import { Module } from '@nestjs/common' import { ConfigService } from '@nestjs/config' import { NestFactory } from '@nestjs/core' import { MicroserviceOptions, Transport } from '@nestjs/microservices' import { AppModule } from './app.module' // Bootstrap configuration module is needed to avoid // doing the DI resolution twice @Module({ providers: [ConfigService], exports: [ConfigService], }) class BootstrapConfigModule {} async function bootstrap() { const appContext = await NestFactory.createApplicationContext(BootstrapConfigModule) const configService = appContext.get(ConfigService) const SERVICE_PORT = configService.get('SERVICE_PORT') appContext.close() const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, { transport: Transport.TCP, options: { port: SERVICE_PORT, }, }) await app.listen() } bootstrap() Why would you need to use the configuration service instead of process.env you might ask. Well, while that may work, it doesn’t offer any type safety or support for fallbacks. ...

How to merge a nested list in Mongo document with another found in adjacent collection

Let’s consider a situation where you have two collections, houses and people. Each house has a collection of key holders, which link to the persons collection with their IDs. Key holders list also holds information when the key was given for the identified person. In bson, the situation in the database looks like this: { "houses": [ { "_id": ObjectId("5fba17c1c4566e57fafdcd7e"), "address": "Main street 1", "keyHolders": [ { "keyDelivered": "2022-02-02T02:02:02", "personId": "5fbb5ab778045a985690b5fc" }, { "keyDelivered": "2021-01-01T01:01:01", "personId": "5fbb5ab778045a985690b5fd" } ] }, { "_id": ObjectId("5fba17c1c4566e57fafdcd7f"), "address": "Broadway 3", "keyHolders": [ { "keyDelivered": "1993-03-03T03:03:03", "personId": "5fbb5ab778045a985690b5fc" } ] } ], "persons": [ { "_id": ObjectId("5fbb5ab778045a985690b5fc"), "name": "Jack Bauer", }, { "_id": ObjectId("5fbb5ab778045a985690b5fd"), "name": "James Bond", } ] } You can also do some mapping for the source list, for instance convert foreign keys from strings to ObjectIds. ...