A docker container containing thumbsup, but with an Express API to allow you to record (and change) your favourite images through the ThumbsUp website that is generated.
- A machine capable of running Docker (e.g. your computer, a Synology NAS, etc)
- This docker image:
ghcr.io/uglow/thumbsup-fav-server:latest
(which is build using this repo).
Fav-server is a simple NodeJS Express application that does one-thing: it creates/updates picasa.ini
files
with the favourite-state of images that you toggle the favourite-state for (via theme-cards-fav
).
When the picasa.ini
files change, the server initiates a rebuild of your site to persist the favourite-state, after a short delay.
PM2 is used to keep the server alive forever, even when there are crashes (which shouldn't happen). Note that "alive forever" means "as long as the Docker container is running" when run inside of a Docker container.
The following additional arguments can be passed on the command line:
rebuildDelay
(optional, default = 3sec): Number of seconds to wait before rebuilding the site. Balance between usability (seeing the site update) and performance.
These parameters are passed to the NodeJS server for processing.
- Edit
./run-remote.sh
and change theinput
andoutput
volumes. By default, these volumes point to<repo>/example/...
. - Run
./run-remote.sh
to start the server in Docker. - Create a web-server to serve the
output
directory. E.g.cd <outputDir> && python -m SimpleHTTPServer 8000
- Open a browser to
http://localhost:8000/
(or whatever port you have setup in the above step).
The main steps are:
- Install image onto Synology.
- Setup config
- Setup Synology Web Station
- Configure & Run
Synology's Docker support for non-DockerHub registries and images is not great. Normally you would
use the Synology > Docker app to add a new Docker image. However, at the time of writing, Synology
cannot read this image: ghcr.io/uglow/thumbsup-fav-server:latest
.
So here's how to get ghcr.io/uglow/thumbsup-fav-server:latest
onto the Synology box.
- Synology: Control Panel -> Terminal & SNMP -> Enable SSH
- From your computer, in a new terminal window:
ssh <user>@<ip.address.for.synology-device>
- Once logged in,
sudo -i
(To be able to use docker on cli. Note: use the same password as your user.) docker pull ghcr.io/uglow/thumbsup-fav-server:latest
- Synology: Control Panel -> Terminal & SNMP -> Disable SSH
After download completes, the image appears in the Synology Docker.
In this step we will provide the Thumbsup theme and config required by the Docker image.
When Docker is installed on Synology, a /docker
share folder is created. We need to create a sub-folder for the
thumbsup-fav-server config, and copy the theme-cards-fav
files here.
- Open a new terminal window.
git clone https://github.com/uglow/thumbsup-fav-server.git
to copy the source code, which includes example config.- Copy the files from
<gitRepo>/example/config
to Synology/docker/fav-server/config
. - Copy the files from
<gitRepo>/theme-cards-fav
to Synology/docker/fav-server/config/theme-cards-fav
. This updates the templates used to generate the web pages. - Edit
config.json
to supply the Thumbsup config.- Do not change the following properties:
theme-path
,theme-style
,albums-from
- Do not change the following properties:
There are lots of ways to run a website (including using a Docker image). But on a Synology NAS, the easiest way is to use Synology Web Station.
- Synology > Package Center > Search "Web Station"
- Install the "Web Station" package. Once this is installed you will see a new share-folder
called
/web
. This will be where the Thumbsup-generated website will be published to.
- Synology: Docker > Container > Select
uglow/thumbsup-fav-server_x_y_z
> Stop Running
-
Synology: Docker > Image > Select
uglow/thumbsup-fav-server
> Launch: -
Enter the container name as
thumbsup-fav-server_x_y_z
, then press "Advanced Settings" -
Advanced Settings > Enable auto-restart. Optionally create a shortcut on the desktop.
-
Volume Tab, press Add Folder for each folder below:
-
(optional) Environment Tab, set the Command to
rebuild\=5
to rebuild the website after waiting for 5 seconds. Note: As per this article, the=
characters have to be escaped with\
. E.g.inputDir\=...
-
On the Network tab, set the host port and container port to 8080. If you get a warning about the port being used, edit the configuration of the container that is using the port and assign it a different local port
-
Press Apply.
-
Review the changes, then press Done.
Open the website. Click the ⭐️ icon for images/photos that you like these selections will be persisted once the site rebuilds.
See DEVELOPERS.md.
When installing a new Docker image, repeat steps 1,2 and 4 in "Installation - Synology".
The first time you run this container, it will take a long time before the website is generated. You may even find that the container hangs. Don't worry! Just restart the Docker container, and Thumbsup will resume where it left off.
In terms of time, it took over 8 hours to finish building the website for 182 GB of images and videos, including hang-time.
The build is finished once the /web
folder on Synology contains a bunch of *.html
files, representing
the different albums. Increasing available RAM improves performance.
Thumbsup has a --concurrency
option. In order to keep your device responsive, it is best
not to use all the CPU cores on your device for rebuilding the site.