[Support] Linuxserver.io - CodiMD


Recommended Posts

I've seen the reverse proxy / SWAG and bookmarked it (for later). I am at first only gonna run the whole unraid locally only (if I can)/ in VPN with my parents network. 
There's a lot to look into when changing from Synology (my todo for now is basically enable all functionality I used on my old synology NAS XD).
I can see both points, and databases is something I need to look into anway (for work related things).

 

Does the docker layering also count if I grab the database container via the Community App ?



I've also found the Support/Readmefirst link, https://github.com/linuxserver/docker-hedgedoc#readme but I really can't see any explicit mention, that something is needed in addition, that I have to provide the database or such.
I'd understand the docker (compose) commands as alternative ways to install it (especially since those repos dont seem to be unraid specific).

I would really think it would be good to have at least some mention of additionally needed containers / resources, or maybe even a tag in the Community App directory - to make it clear.

Edited by wambo
Link to comment
59 minutes ago, JonathanM said:

For less experienced users, I recommend multiple database containers each with their own app connected. Since the docker engine shares image layers, the extra storage is extremely minimal, a few KB for the config files.

 

The advantages of being able to blow away a single database without affecting the others while not needing to know database management commands is helpful.


I'm not to much worried about the storage, more with having several database systems potentially thrash the hdd's. Might not be a big issue at the start, but it never hurt to learn and understand the systems you use and try to use them effectively. Plus, if you need to work on them, you can get at the from one point of entry.

To be fair here, I'm 100% I don't do things effectively. There's so many different components, getting it all right sucks.

Link to comment
48 minutes ago, wambo said:

Does the docker layering also count if I grab the database container via the Community App

Doesn't matter where the container comes from, the docker engine manages the layers by checksum.

 

When you get updates, watch as the different pieces get pulled, only the changed layers get updated, and if you have 2 copies of the same container with different names, updating the first instance will update all the pieces of the second, as they are the same.

Link to comment
52 minutes ago, wambo said:

Does the docker layering also count

I'm not sure what you mean by docker layering sorry. But there's no issue using the template from CA (Community Apps), it's what I started with.

 

 

53 minutes ago, wambo said:

I've also found the Support/Readmefirst link, https://github.com/linuxserver/docker-hedgedoc#readme but I really can't see any explicit mention, that something is needed in addition, that I have to provide the database or such.


Personally, I feel that's more for the people who make the application to tell you. Linux Server typically makes containers for applications that might not have one already, or to or to make a container that's better than the official one that might be provided.

Linux Server have provided a link to the application configuration details from the Application Setup section of the doc, and state afterwards that example they provide uses mysql. In HedgeDoc's configuration doc is a basics section which has a link to the different databases you can use here. One of the options is an SQLite option, which is a single file database thing.

Looking at the manual-setup here. You could drop the need for a database container by popping this into your config file for the db:

"db": {
      "dialect": "sqlite",
      "storage": "/config/db.hedgedoc.sqlite"
},

That should work for the CA Template. You can probably ignore the "DB_" sections of the template, the config using sqlite should mean it ignores those values.

Link to comment
16 minutes ago, JonathanM said:

It's highly recommended to keep docker containers and their operating appdata on SSD based pools, for many reasons, including this.


I should clarify, I am using ssd cache pools. I used hdd incorrectly in this instance. However, I'd still prefer to not have several database systems having a go at them, it feels much better having one system managing the read/writes and queuing.

Link to comment
On 12/25/2021 at 1:44 AM, Ryonez said:


Looking at the manual-setup here. You could drop the need for a database container by popping this into your config file for the db:

"db": {
      "dialect": "sqlite",
      "storage": "/config/db.hedgedoc.sqlite"
},

That should work for the CA Template. You can probably ignore the "DB_" sections of the template, the config using sqlite should mean it ignores those values.

Ahhh, you might've made me dodge the "digging into DBs" part :D

Is that method gonna be future-proof? As in, can I manage to export the sqlite file DB to a big DB as soon as I get to it (or want it for whatever reason) ?

Edit:
Had to find out its not thaaat easy.  I removed the '  //"use_env_variable": "CMD_DB_URL" ' line

{
  "db": {
        "dialect": "sqlite",
        "storage": "/config/db.hedgedoc.sqlite"
  }
}

{
  "db": {
        "dialect": "sqlite",
        "storage": "/config/db.hedgedoc.sqlite"
  }
}

Weirdly its still waiting for MySQL service before it reads the config ? (At least json mistakes were brought up only later)
 

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
Waiting for Mysql service
[...]
Waiting for Mysql service
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
/bin/sh: 1: git: not found
2021-12-25T22:41:29.480Z warn: Session secret not set. Using random generated one. Please set `sessionSecret` in your config.json file. All users will be logged out.
[...]
[services.d] starting services
[services.d] done.
/bin/sh: 1: git: not found
2021-12-25T22:41:29.480Z warn: Session secret not set. Using random generated one. Please set `sessionSecret` in your config.json file. All users will be logged out.
2021-12-25T22:41:29.952Z warn: Database cannot be reached. Try 1 of 30.
[...]
2021-12-25T22:41:58.063Z warn: Database cannot be reached. Try 29 of 30.
2021-12-25T22:41:59.065Z error: Cannot reach database! Exiting.

/bin/sh: 1: git: not found
2021-12-25T22:41:59.436Z warn: Session secret not set. Using random generated one. Please set `sessionSecret` in your config.json file. All users will be logged out.
2021-12-25T22:41:59.065Z error: Cannot reach database! Exiting.
[...]
2021-12-25T22:41:59.905Z warn: Database cannot be reached. Try 1 of 30.

 

Edited by wambo
Link to comment
7 hours ago, wambo said:

Weirdly its still waiting for MySQL service before it reads the config ? (At least json mistakes were brought up only later)


Right, hammered at this a little and got it kinda working.

  1. Delete the `config.json` file. It's setup incorrectly anyway (example config is here), but we'll have the container remake it.
  2. Remove `DB_HOST` from the template. This is what is triggering the search for a mysql database.
  3. Add a new variable to the template. Call it something like "DB_URL". The key: "CMD_DB_URL". The Value: "sqlite:///config/hedgedoc.sqlite". Don't include the quotes.
  4. Start the container, navigate to the exposed port. It might look kinda broken, that's because the config isn't fully setup.

Google from this point should be able to help you fill out the config as needed, like why the page looks broken. I won't be to much help here, my set-up uses a database and a domain with a reverse proxy. It's also been a while since I've done it.

Hope this helps.

Link to comment

Thanks a lot for your time! I really didnt want to make anybody spend time for this during the holidays 😕
I will look into it a bit more.

Is there some kind of documentation / guide to look into how the Unraid Templates work ? ( as in, is there a file (in the that I can comprehend from, for example that DB_HOST causes the search for a DB ?) 
Gott up my knowledge of Docker as well, I suppose. I only ever used them as "turn on and it works"  similar thing with LXC


I'd also like to repeat the wish that it would be stated / marked more clearly, if additional resources / DBs / containers have to be present for a Community App to work. (Many do state if they set upon another App already, like Unassigned Devices Plus)

 

 

Edit:
Nothing broken, looks perfectly alright. I could register a user and got my first note running :)

Edited by wambo
Link to comment
2 minutes ago, wambo said:

Is there some kind of documentation / guide to look into how the Unraid Templates work ? ( as in, is there a file (in the that I can comprehend from, for example that DB_HOST causes the search for a DB ?) 


The detection doesn't have anything to do with the template. The template is basically a form someone has stuck together, telling unRaid where to pull the container, what env vars the user is expected to provide, and some other information, like support links. I found out the `DB_HOST` was causing the issue for looking a mysql server as I looked at the files used to make the container image, finding the relevant check here.

Here is where you can find information on how templates are made and used: https://wiki.unraid.net/DockerTemplateSchema
Also, templates gotten from CA will replace removed template values. `DB_HOST` will return at some point. I have this issue with templates exposing ports that just should not be exposed and it drive me freaking crazy. This is something managed by the CA plugin.
The way to "fix" this is to remove the `TemplateURL` value from the template. You won't get updates for the template anymore, but it will stop the template from changing to what can be undesired or even unsafe values for your environment.

  1. You'll have to manually edit the template file on the usb (via the unraid console or ssh).
  2. Open the unRaid Console
  3. Navigate to `/boot/config/plugins/dockerMan/templates-user`
  4. Look for the xml file with the name matching the name of the template you're wanting to edit (This is the "Name" field at the top of the update container page for the container). `nano <name>.xml` should work. Ctrl+x and confirm save to close once the change are made.
  5. Find the template url field, it'll look like ` <TemplateURL>https://raw.githubusercontent.com/selfhosters/unRAID-CA-templates/master/templates/openldap.xml</TemplateURL>`
  6. Chance it to be just ` </TemplateURL>`
  7. Save the file.


It might help to think of the CA Templates as just shortcuts. They are great for quickly setting things up, but they are bad for forcing values you might not want around on you.

And don't worry to much about my time, I have plenty to spare >.<

Link to comment
On 12/24/2021 at 6:32 PM, wambo said:

I would really think it would be good to have at least some mention of additionally needed containers / resources, or maybe even a tag in the Community App directory - to make it clear.

There already is.  Documented here https://forums.unraid.net/topic/38619-docker-template-xml-schema/page/3/?tab=comments#comment-1015826

 

 

Support for the maintainers adding this in directly when generating the template via dockerMan will be slow until 6.10 becomes stable (the tag support has been in there for quite a while now)  For other maintainers like LinuxServer that generate the templates via a script it requires them to adjust the scripts accordingly to add the tag when appropriate.

 

Every once in a while when I've got nothing else to do I do random searches within CA and add the tag via moderation, but in the case of Hedgedoc since there's no mention of SQL within it I would not have seen it via any search.

 

Adding the tag now.  Thanks.

Link to comment
10 minutes ago, Squid said:

There already is.  Documented here https://forums.unraid.net/topic/38619-docker-template-xml-schema/page/3/?tab=comments#comment-1015826

 

 

Support for the maintainers adding this in directly when generating the template via dockerMan will be slow until 6.10 becomes stable (the tag support has been in there for quite a while now)  For other maintainers like LinuxServer that generate the templates via a script it requires them to adjust the scripts accordingly to add the tag when appropriate.

 

Every once in a while when I've got nothing else to do I do random searches within CA and add the tag via moderation, but in the case of Hedgedoc since there's no mention of SQL within it I would not have seen it via any search.

 

Adding the tag now.  Thanks.

Hey thx! I didnt mean to say there is no system, just that this template / App should add it or mention it more prominently.
But that means, if I notice something missing again I could a Community Developer to add it? :D 


Just trying to help as much as I can as a dirty leecher XD

Edited by wambo
Link to comment
5 hours ago, Squid said:

Adding the tag now.  Thanks.


To be fair, this container can run without mysql. It's just with the template enforcing yanking the `DB_HOST` field back in it'll keep breaking the container. Honestly that's something that needs to be exposed to users, a way to tell CA to not change/update the template/s.

As it stands the container is working fine with sqlite, showing mysql is not needed.

While it has been a annoying experience for the user, seeing a requirement for something that's not actually needed would likely turn them away completely. If the `requires` tag is to be used, it should be used only for things that are actually required, otherwise it losses it's purpose.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.