Standard Notes Container revisited -Blog Step 03

Currently reading
Standard Notes Container revisited -Blog Step 03

121
20
NAS
DS918+, DS916+, DS214+, DS211j
Last edited:
Hi Rusty!

I just returned to your blog Standard Notes - Docker self-hosted alternative for all your note needs and tried to update the standardnotes sync server starting at step 03.

I just followed all additional lines and removed all occurrences from the yml file that points to db. After firing the command "docker-compose -p "standardnotes" up -d" I got this error: "ERROR: Service 'syncing-server-js' depends on service 'db' which is undefined."

Guess something is still inside the yml file that should be removed or adopted, right? Maybe all those lines with "depends_on: -db"?
Additional information: just removed all of those lines, yes, I was brave enough ;.) and the error above disappeared. However I got a new one: ERROR: Couldn't find env file: /volume1/docker/standardnotes2/docker/api-gateway.env
The file is there but located in /volume1/docker/standardnotes2 - noticed the missing docker subfolder? I fired the command docker-compose -p "standardnotes" up -d" from inside the correct folder, nevertheless the command added an additional folder name!
Ok, the above is fixed, the yml file contained paths to the subfolder docker/.env and more. Just changed the file and no more errors popped up. Rusty, perhaps you should mention this in your blog?

Btw, is it required step to adopt those lines "./wait-for.sh", "db", "3306" as well?
E.g. replace "db" with the IP-addresse of the hose and "3306" with the exposed port of the MySQL container port?

Some more questions:
  1. In file auth.env, there is an URL pointing to SYNCING_SERVER_URL=http://syncing-server-js:3000. Ist it a must have to change that to my external URL addressing the sync server?
  2. In file .env there is an additional URL AUTH_SERVER_URL=http://auth:3000. Is it required to set up an reverse proxy and/or adopts this URL somehow?
  3. Next, file api-gateway.env. Any requirements to change those URLs, too? SYNCING_SERVER_JS_URL="http://syncing-server-js:3000"and AUTH_SERVER_URL="http://auth:3000"
Thanks,
Michael

-- post merged: --

Started a new thread:

I got a new error ERROR: for cache Cannot start service cache: Bind mount failed: '/volume1/docker/standardnotes2/data/redis' does not exists :mad:
Fixed that by creating some more subfolders under ./standardnotes2/data/redis. Again the yml file required that.

Command docker-compose finished successfully now!

Wow, impressed! I now see about six(!) new containers running!

Unfortunately the standardnotes auth container is throwing some errors which my be related to my questions above:
1627844495581.png

I changed all of those entries and replaced "db" with the IP-address of the MySQL container. This fixed it!

BUT after restarting the composer, the protocols are throwing further exceptions, complaining about "cache:6379" not reachable same as syncing-server-js:3000. I cannot specify any IP-address for them since docker added a new network with their own IP-addresses.

Okay, it's too late now for further investigations on how to get rid of those errors...
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Hi Rusty!

I just returned to your blog Standard Notes - Docker self-hosted alternative for all your note needs and tried to update the standardnotes sync server starting at step 03.

I just followed all additional lines and removed all occurrences from the yml file that points to db. After firing the command "docker-compose -p "standardnotes" up -d" I got this error: "ERROR: Service 'syncing-server-js' depends on service 'db' which is undefined."

Guess something is still inside the yml file that should be removed or adopted, right? Maybe all those lines with "depends_on: -db"?
Additional information: just removed all of those lines, yes, I was brave enough ;.) and the error above disappeared. However I got a new one: ERROR: Couldn't find env file: /volume1/docker/standardnotes2/docker/api-gateway.env
The file is there but located in /volume1/docker/standardnotes2 - noticed the missing docker subfolder? I fired the command docker-compose -p "standardnotes" up -d" from inside the correct folder, nevertheless the command added an additional folder name!
Ok, the above is fixed, the yml file contained paths to the subfolder docker/.env and more. Just changed the file and no more errors popped up. Rusty, perhaps you should mention this in your blog?

Btw, is it required step to adopt those lines "./wait-for.sh", "db", "3306" as well?
E.g. replace "db" with the IP-addresse of the hose and "3306" with the exposed port of the MySQL container port?

Some more questions:
  1. In file auth.env, there is an URL pointing to SYNCING_SERVER_URL=http://syncing-server-js:3000. Ist it a must have to change that to my external URL addressing the sync server?
  2. In file .env there is an additional URL AUTH_SERVER_URL=http://auth:3000. Is it required to set up an reverse proxy and/or adopts this URL somehow?
  3. Next, file api-gateway.env. Any requirements to change those URLs, too? SYNCING_SERVER_JS_URL="http://syncing-server-js:3000"and AUTH_SERVER_URL="http://auth:3000"
Thanks,
Michael

-- post merged: --

Started a new thread:

I got a new error ERROR: for cache Cannot start service cache: Bind mount failed: '/volume1/docker/standardnotes2/data/redis' does not exists :mad:
Fixed that by creating some more subfolders under ./standardnotes2/data/redis. Again the yml file required that.

Command docker-compose finished successfully now!

Wow, impressed! I now see about six(!) new containers running!

Unfortunately the standardnotes auth container is throwing some errors which my be related to my questions above:
View attachment 4133

I changed all of those entries and replaced "db" with the IP-address of the MySQL container. This fixed it!

BUT after restarting the composer, the protocols are throwing further exceptions, complaining about "cache:6379" not reachable same as syncing-server-js:3000. I cannot specify any IP-address for them since docker added a new network with their own IP-addresses.

Okay, it's too late now for further investigations on how to get rid of those errors...
Welcome to SN nightmare.

As you can see this solution has become very complex to run and maintain not to mention unstable when it comes accessing it with all the possible clients.

Aggressive change in some of the 3 major images, requires constant update of the stack in order to be compliant. Also, you might end up in a bit of a problem if for example you are not on the latest version of stack but pulled the latest mobile version. It can/will break access.

This was the last straw for me.

Regarding your questions I guess you are aware that the setup needs a complete new stack, with redis as well, and that the env files that you will use need to be tweaked.

When it comes to URLs just keep them as they are in the specific env files, and only modify the values in the main compose config file to get the ball rolling.

Always export and backup the db before each update of the stack as you never know what breaking changes there might be (release notes do not explain it well).
 
121
20
NAS
DS918+, DS916+, DS214+, DS211j
Regarding your questions I guess you are aware that the setup needs a complete new stack, with redis as well, and that the env files that you will use need to be tweaked.

When it comes to URLs just keep them as they are in the specific env files, and only modify the values in the main compose config file to get the ball rolling.

Always export and backup the db before each update of the stack as you never know what breaking changes there might be (release notes do not explain it well).
Hi Rusty! Yes, I'm aware that I have to change those .env files, I already did that steps.

Regarding the backup: I'm using a MySQL docker container as well and as the page Migrating tells, I should use the following command to export the database.
$ docker exec your_db_container_id sh -c 'exec mysqldump your_database_name -uroot -p "your_password"' > ./dbdump.sql

However this does not work as expected. I have the correct docker id as well as the root password and the databasename of course. I fired this command in a shell of the appropriate NAS and all I get back is $ash command not found
I do have a backup of the docker folder where the mySQL database is stored, but I would rather dump the current SN database as suggested.

Do you have any clue why this command might fail?
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Hi Rusty! Yes, I'm aware that I have to change those .env files, I already did that steps.

Regarding the backup: I'm using a MySQL docker container as well and as the page Migrating tells, I should use the following command to export the database.
$ docker exec your_db_container_id sh -c 'exec mysqldump your_database_name -uroot -p "your_password"' > ./dbdump.sql

However this does not work as expected. I have the correct docker id as well as the root password and the databasename of course. I fired this command in a shell of the appropriate NAS and all I get back is $ash command not found
I do have a backup of the docker folder where the mySQL database is stored, but I would rather dump the current SN database as suggested.

Do you have any clue why this command might fail?
Have you tried to execute this command inside the container and not on your host level?
 
121
20
NAS
DS918+, DS916+, DS214+, DS211j
I tried it on the host, not inside the container because the example suggests to use the docker command for executing. I will give it a try inside the container... I'm pretty sure this will work ;-)
 
121
20
NAS
DS918+, DS916+, DS214+, DS211j
Solved: I started over with a fresh installation, after I managed to export all of my notes, using the desktop app (old version, which was still capable of accessing the old database).

Which steps did I take?
I've set up docker-compose.yml to not use latest container images but those that were suggested on Github's original yaml file.

I then created a new database (inside my MySQL container) and gave the database user all privileges on that new database. Afterwards I started docker-compose with command docker-compose -p "standardnotes2" up -d from within the folder where all .env and the yml file are stored.

After a while I could register a new account and re-imported all previously exported (and encrypted) notes.

As far as I can see, the extensions still work like before (at least did not set up a new container) but the web app was updated to the latest version available.

Both, the desktop app as well as the web app work as expected so far.
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
That’s exactly what I did twice. Glad you got it going. 🤘
 
121
20
NAS
DS918+, DS916+, DS214+, DS211j
Yeah! So after the basic setup is done, I wonder how to get the extensions running from any Github repository instead of compiling my own image. To be honest I forgot how I did it before using VSCode ;)

Source code is still available, but I will have to rethink and start over. In you blog, you mentioned the extension mtoohey/standardnotes-extensions. Is this a reliable container? Do you have any experiences with that?
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
Is this a reliable container?
In the end I was using that one for the extensions. Never a problem with that one, but then again, extensions are just added in that container and rebuild as needed.
 
121
20
NAS
DS918+, DS916+, DS214+, DS211j
OK, so does this mean, every time I restart the container, the extensions are rebuild upon their latest source code - did not have a deeper look into the yaml nor into the source at all, sorry.
 

Rusty

Moderator
NAS Support
4,378
1,269
www.blackvoid.club
NAS
DS718+, DS918+, 2x RS3614RPxs+
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
OK, so does this mean, every time I restart the container, the extensions are rebuild upon their latest source code - did not have a deeper look into the yaml nor into the source at all, sorry.
Correct. As soon as you put in the extensions, reruning the container it will build the extensions based on the list of extensions that the image can see/use.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

DSM 7 - and tht's what I'm trying to figure out how to do - can't see any option to run it as root...
Replies
3
Views
368
One note to the approach: copying the files from inside the container might cause inconsitent copies if...
Replies
20
Views
761
good question /marked! I have been long seeking for setting up a e.g. CUPS printer server, e.g .AirPrint...
Replies
3
Views
1,024
Hoping someone can help me out. I have a few docker containers running. All are accessible with the...
Replies
0
Views
339
late follow-up on this, here is the tutorial I followed for setup and the upgrade process that is supposed...
Replies
5
Views
855

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Top