Standard Notes Container revisited -Blog Step 03

Currently reading
Standard Notes Container revisited -Blog Step 03

196
36
NAS
DS920+, DS918+, DS214+, DS211j
Operating system
  1. Linux
  2. Windows
Mobile operating system
  1. Android
  2. iOS
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...
 
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).
 
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?
 
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?
 
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 ;-)
 
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.
 
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?
 
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.
 
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

https://github.com/usememos/memos Don’t miss the mentioned mobile apps.
Replies
0
Views
1,363
I can’t find any option to restore just the settings. 1710356648 Phew, managed to fix it. Within the...
Replies
4
Views
389
  • Question
Open an issue on that GitHub page. The developers will be glad to assist. OP has posted two threads on...
Replies
5
Views
957
I'm happy with email notifications but in v0.3.3 of dockcheck the author added apprise notifications...
Replies
4
Views
1,040
Hi, I'll start by saying, my understanding of networking is very limited so I apologize if I'm asking an...
Replies
0
Views
688
You can run cmd.exe to get a command window from which you can execute SSH commands. However, my personal...
Replies
36
Views
2,966
I can confirm it's not in the list. All I've got are the following: Worth noting that I'm already...
Replies
4
Views
1,107

Welcome to SynoForum.com!

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

Registration is free, easy and fast!

Back
Top