[Support] FoxxMD - szurubooru


Recommended Posts

Application Name: szurubooru-api
Application Site: https://github.com/rr-/szurubooru

Docker Hub: https://hub.docker.com/r/sgsunder/szurubooru-api

Template Repo: https://github.com/FoxxMD/unraid-docker-templates
 

Application Name: szurubooru-client
Application Site: https://github.com/rr-/szurubooru

Docker Hub: https://hub.docker.com/r/sgsunder/szurubooru-client

Template Repo: https://github.com/FoxxMD/unraid-docker-templates

 

Overview

 

Szurubooru is an image board engine inspired by services such as Danbooru, Gelbooru and Moebooru dedicated for small and medium communities. It is pronounced as shoorubooru. Some features:

 

  • Post content: images (JPG, PNG, GIF, animated GIF), videos (MP4, WEBM), Flash animations
  • Ability to retrieve web video content using youtube-dl
  • Post comments
  • Post notes / annotations, including arbitrary polygons
  • Rich JSON REST API
  • Token based authentication for clients
  • Rich search and privilege system
  • Autocomplete in search and while editing tags
  • Tag categories
  • Tag suggestions
  • Tag implications (adding a tag automatically adds another)
  • Tag aliases
  • Duplicate detection
  • Post rating and favoriting; comment rating

 

3f1123d6-75ee-11e6-85dd-88a7615243a0.thumb.png.beac1f018c24df7bceb4af7931140b5d.png

 

3f1566ee-75ee-11e6-9594-e86ca7347b0f.thumb.png.3badd6b9ed1bc947cc668acf7e0077d0.png

 

Prerequisites

 

Postgres 11 is required for szurubooru to run. It is accessed through IP so any existing instances you have can be used. Otherwise check CA for "postgres" to find available options.

 

How To Use

 

Start by installing szurubooru-api. The template provides defaults for volumes and api port, you will need to:

  • Fill in the IP endpoints for Postgres as well as user/pass/db.
  • Optionally, if you have your own server config you can override the default production config by creating another Path entry and setting container dir to /opt/app/config.yaml, with the host dir pointing a valid file EX /mnt/user/appdata/szurubooru/config.yaml

 

After the api is running install szurubooru-client. The template provides defaults for everything but the api endpoint. Visit your docker page or check "show docker allocations" to find the internal IP szurubooru-api is bound to. Use that as the BACKEND_HOST value.

 

The first user created will have admin privileges.

 

NOTE: If you are upgrading from v2.2 Elasticsearch is no longer necessary. It is recommended you backup your postgres DB and data folders before upgrading. Once you have started the new (upgraded) container do not stop/update the container until post data has been rehashed -- progress can be checked by viewing the logs. After hashing is complete you can safely remove the Elasticsearch Host variable from your unraid template and restart the the container.

Edited by FoxxMD
add more description
  • Like 1
Link to comment

I got this up and running but when first installing szurubooru-api it was throwing errors about config.yaml being a directory.  I noticed in the template you had a path by default labeled as (optional) that created a config.yaml folder in the appdata/szurubooru folder.  Deleting this path from your folder allowed the api docker to start properly. 

 

Other than that everything worked exactly as you instructed.  Thanks for your work.

Link to comment

@Clay Smith thanks for checking out the container!

 

So a file in the container at /opt/app/config.yaml would override default production settings. If the path configuration contains a valid config.yaml file on the host then it isn't a problem but I forgot to test in your scenario (coming in with no config.yaml) -- and its not possible to mount at the /opt/app level because then it overwrites the main app folder, doh!

 

I have updated the template to remove the default config/volume and instead now include directions on how to add a config.yaml mapping. That should fix a clean install scenario.

 

Thanks!

Link to comment

Hello!

First of all: Thanks for this awesome Docker, was exactly what I was looking for!

I got this running with no problems and used a custom config.yaml like you described in the initial post.

What I am wondering now is if it is possible to change the favicon.png? I tried it with a volumemapping for the client >

Container Path: /opt/app/img/favicon.png to /mnt/user/Docker/appdata/szurubooru/img/favicon.png 

 

No idea if that makes any sense at all, was just what I came up with looking at the files on Github. 

 

Link to comment

Hi @GoodOlCap, glad it worked for you!

 

The mapping you listed is for the build directory in the intermediate layer. Instead overwrite the copied favicon in the final layer like this:

 

Container Path: /var/www/img/favicon.png

Host Path: /mnt/user/Docker/appdata/szurubooru/img/favicon.png

 

You may then need to flush the favicon cache for your browser if restarting the browser doesn't work: https://www.stirtingale.com/guides/2018/01/how-to-favicon-flush

Link to comment
  • 4 weeks later...

All I get is "Could not fetch basic configuration from server".

 

I'm using non-standard ports and stuff like that, but everything is configured correctly afaik.

 

I tried defining the host by 127.0.0.1 as well as my 192.x.x.x with and without IPs in various places...

 

If I'm supposed to find some config file or do anything else, please lend me a helping hand, because I'm a super fresh unRAID _AND_ Docker newb.

 

Having the front-end and api split seems like needless potential for disruption, but I don't want to pretend to understand all of the reasons for and against. Just seems weird, also because double icons etc... but I digress.

 

Bit surprised this is the only image board docker available on community apps... Like... Am I missing something here?

 

Massive thanks for picking up the slack, I doubt I could pull off a fully manual install of other boards. If all else fails I might just run a VM with something else, but I really don't feel like having to build my bins all the time by myself... It's 2019, isn't FOSS software way past that? That's the 1990s Linux stigma we wanted to get rid of, right? Ain't nobody got time for building all their apps' updates...

 

Edit: back to default ports, no luck.

Edited by Glassed Silver
Link to comment

Personally I am considering going official Danbooru. Has a lot more functionality, only problem is I would need to figure out setup myself.

 

Ah well, boorus are godly. Tags and their consequent use make finding niche pics so easy. :) and it's great to discover new artists as well.

 

I have since asked the creator of imgbrd-grabber to look into those two boorus to update their setup guide to include them, they are going to look into it. :)

 

Edited by Glassed Silver
Link to comment

For current users: After v2.2 Elasticsearch is no longer needed. You do not have to take any action in order to upgrade but it is still recommended to backup your postgres DB and data folders beforehand.  

 

Once you have started the new (upgraded) container do not stop/update the container until post data has been rehashed -- progress can be checked by viewing the logs. After hashing is complete you can safely remove the Elasticsearch Host variable from your unraid template and restart the the container.

Edited by FoxxMD
Link to comment
  • 4 weeks later...

  Awesome docker!  This is something I never knew I needed.  I’m in the process of moving my images/ reaction gifs/ stupid classy memes /etc over to the booru.  It’s soooooo much easier to find that one image (you know the one, no not that one, wait it’s here somewhere. . . ) when you can tag things. 

 

  I have a few questions,

1.

  I can’t figure out how to change the colors of the webpage. Full disclosure, I am an old school linux hobbyist however, this week is the first time I have touched docker so i’m not really sure how it works.  Poking around in the client docker container I found the colors in a file called colors.styl in opt/app/css/ and tried overwriting it with my own version in the same way you do the config file for the server.  I also tried building it similar to the favicon using /var/www/css/colors.styl, and a bunch of other variants but I can’t get it to work.  I appreciate any help.

 

2.

  When I built the docker the szurubooru-api template said it required elasticsearch 5 so I installed that.  I didn’t see your post about it no longer being needed till after I got the booru up and running.  Is elasticsearch used during the initial build process or should I have omitted it?  Is it safe to just remove it now?

 

3.

  When I use the upload page to scrape youtube videos they are ripped in low quality and not HD.  This is behavior that youtube-dl does if ffmpeg is not installed.  I tried SSH’ing into the unraid server and diving into the szurubooru server container to install ffmpeg but, apk shows ffmpeg is installed.  Running youtube-dl from inside the container works as desired and automagicly uses ffmpeg to spit out an HD video file.  

  This may be a bug in Szurubooru but I don’t know enough about how dockers work to rule out a permissions or similar issue.  Any ideas?

 

Thanks again for putting together this awesome docker.

Link to comment
3 hours ago, WNSwins said:

  [...]
3.

  When I use the upload page to scrape youtube videos they are ripped in low quality and not HD.  This is behavior that youtube-dl does if ffmpeg is not installed.  I tried SSH’ing into the unraid server and diving into the szurubooru server container to install ffmpeg but, apk shows ffmpeg is installed.  Running youtube-dl from inside the container works as desired and automagicly uses ffmpeg to spit out an HD video file.  

  This may be a bug in Szurubooru but I don’t know enough about how dockers work to rule out a permissions or similar issue.  Any ideas?

 

Thanks again for putting together this awesome docker.

This may be related:

 

https://github.com/rr-/szurubooru/pull/310

 

Alternatively it might be that this project is using a middleware to interface with youtube-dl that might be borked a little.

 

That’s the case for youtubedl-material as well and one of the reasons why I have yet to release my CA for that application.

 

Keep in mind, might be a good idea to share your experience at the official bug tracker either for assistance or to help find a bug others simply haven’t run into or noticed yet. :) 

 

As for the other two questions I think someone else will have to fill in. :) 

 

Cheers! 

Link to comment
On 6/25/2020 at 11:22 AM, Glassed Silver said:

 

 

Keep in mind, might be a good idea to share your experience at the official bug tracker either for assistance or to help find a bug others simply haven’t run into or noticed yet. :) 

 

As for the other two questions I think someone else will have to fill in. :) 

 

Cheers! 

Thanks for the suggestion!  I opened an issue over on the szurubooru gethub: https://github.com/rr-/szurubooru/issues/331
After digging through the link you gave me I think I found the issue with youtube vids.  I think it's in the Szurubooru code and not the docker.  I don't have time to try to build it for testing atm tho.

Still have not made any progress on changing the colors for the site.  

Link to comment
On 6/25/2020 at 7:39 AM, WNSwins said:

I can’t figure out how to change the colors of the webpage. 

Unfortunately I do not think there is an easy way to go about this just using docker. The Dockerfile for the client shows that the source is copied to a working directory, then built, and then copied to the www folder. There is a CLIENT_BUILD_ARGS argument for adding arguments to the end of the build command but that's a bit unwieldy. Your options boil down to:

  • Build szurubooru yourself locally, then map your built css folder to the www folder
  • Open an issue (or better yet PR) on the repo to implement some kind of user-defined intermediate step between initial code copy and building, like...
    • Specify an additional folder the Dockerfile could check for files in and copy those after the initial source copy -- that way a user could map their own source style files into that and have them overwrite files original source files before the build step
Quote

Is elasticsearch used during the initial build process or should I have omitted it?  Is it safe to just remove it now?

Yes, it is safe to remove! Thank you for catching that I had forgotten to update the template.

Link to comment
On 6/29/2020 at 12:49 PM, FoxxMD said:

Unfortunately I do not think there is an easy way to go about this just using docker. The Dockerfile for the client shows that the source is copied to a working directory, then built, and then copied to the www folder.

  I was afraid this would be the case.  Seems like a bit of a shortcoming IMHO.  Thanks for the advice.  When I have some time I will be building it to try and solve the YT bug.  At that point I'll test ways of changing the style files.

Quote

Yes, it is safe to remove! Thank you for catching that I had forgotten to update the template.

No worries.  Thanks for maintaining this docker!  It's been an awesome addition to my server.  

Link to comment
  • 4 months later...
  • 2 months later...

Hey, FoxxMD, I've got a bit of confusion. I tried to change my favicon, by adding a path as previously discussed, but I'm not sure it's functioning correctly. Instead of taking the file favicon.png at /mnt/user/appdata/szurubooru/img/favicon.png it creates a folder called "favicon.png" in img directory. I can submit a picture, if you'd like, but it's supposed to be a path type variable, right?

Link to comment

@mrguymiah the instructions I gave are still correct -- just forced a container update to make sure nothing had changed.

 

Yes it is a path config type. Make sure 1) the file exists at the location you are specifying 2) you aren't adding extra slashes or anything to the path values. Here is what mine looks like

image.thumb.png.0a5eadaf87c4710a308e2032918bfd34.png

Link to comment
1 hour ago, FoxxMD said:

@mrguymiah the instructions I gave are still correct -- just forced a container update to make sure nothing had changed.

 

Yes it is a path config type. Make sure 1) the file exists at the location you are specifying 2) you aren't adding extra slashes or anything to the path values. Here is what mine looks like

image.thumb.png.0a5eadaf87c4710a308e2032918bfd34.png

 

@FoxxMD I see the mistake. I missed in the original post by GoodOlCap. "I tried it with a volumemapping for the client >". I was initially trying in the API. Thank you for the image, though. Upon confirming that my configuration was 100% right, I went back and reviewed her post to see where I'd gone wrong. Thanks again!

  • Like 1
Link to comment
  • 1 month later...

Thanks for this.

Is there any list of options for the config.yaml file? Or a default config with all the settings available?

I tried creating a blank config but it wouldn't start.

I don't see anything about configuration options on szurubooru github, but maybe I just don't know where to look.

Link to comment

@404fox There is a default config file included in the server code (link here).

 

You can override settings from this config by providing your own with a path variable in the szurubooru-api container like this in unraid

image.thumb.png.d26e69aa0869bd01a72c75fbf5fb3121.png

 

However this is optional. You do not need a user-defined config for Szurubooru to run.

 

Double check these:

  • Ensure you are using both szurubooru-api and szurubooru-client. You need both in order to run this
  • Verify the Postgres variables in the szurubooru-api container (Host, User, Password)
  • Verify your Postgres server is reachable
  • Verify you have correct Backend Host in szurubooru-client (should be the same IP as your unraid host)
  • Verify szurubooru-api can successfully map the Api Port to 6666 (the default) as this is what szurubooru-client will try to access
Link to comment
  • 3 months later...
Posted (edited)

Hello, trying to get imgbrd-grabber by Bionus to work with the dockers, having some issue with setting it up. What would be the settings I want to input in the application so I can use my PC to have it add pictures on the Unraid server's szurubooru? The documentation is a bit bellow what it needs to be for my level so just want to remove possibility. The logs from Grabber seems to indicate I'm sending the proper node request but the logs from the dockers (Postgres/szurubooru-api and client) don't seem to indicated they have received anything.

 

Currently the settings in tools>options>commands>database are as follow
-Driver: QSLITE
-Host: unraid's IP, no port
-User: username of the szurubooru admin account
-Password: password of the szurubooru admin account
-Database: prosgres
-Image: node szurubooru.js "YOUR_USERNAME" "YOUR_TOKEN" "%all:includenamespace,unsafe%" "%rating%" "%source:unsafe%" "%path%"

 

Thanks for the help and the dockers, let me know if you need anymore detail.

------------------------------------------------------------------------------------------------------------------------------------------------------

Edit: will leave here so it might help others, you want to follow https://bionus.github.io/imgbrd-grabber/docs/commands/szurubooru.html , not touch the Database tab however modify the szurubooru.js with axios.defaults.baseURL = "http://[SERVER_IP]:6666"
Also make sure that spaces are replaced by underscore in options>save>filename
Grabber is still failing for me but at least what it's trying to do is working with CMD so issue is due to me/my setup at this point, will edit again if I figure it out

Edit2: fixed now, issue was due to where the script file was copied I think but not sure, having the .js in two spot is what fixed it but that's a bit weird as a result but oh well, hopefully this helps someone else in the future.

Edited by Eddyall
  • Like 1
Link to comment

Hello again, trying to get 2 instances of the dockers running at the same time. In short the goal is to have both sets of data separated, one for images the other videos, and while I could use Jellyfin for the second I'd rather be able to use tags for searching the content. Setting up the second API and the database is strait forward but since the API port to be used in the client isn't one of the default 6666 I'm not sure how to go about changing it in the best way?

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.