Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Synology NAS guide with Photoprism + MariaDB directions #177

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

miniksa
Copy link

@miniksa miniksa commented Jan 13, 2024

This guide had Photoprism + SQLite directions and the caveat that was not recommended versus using MariaDB.

So as I set this up for myself with MariaDB + phpMyAdmin + Photoprism, I took photos and updated the guide accordingly to advise future folks on how to set up the whole chain of containers to make this happen.

@CLAassistant
Copy link

CLAassistant commented Jan 13, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use MARIADB_ROOT_PASSWORD, or as its not going to be used MARIADB_RANDOM_ROOT_PASSWORD=1

Why are the other env variables there? Maybe its default from container- unused at runtime.

Why not use MARIADB_USER, MARIADB_DATABASE, MARIADB_PASSWORD to create the photoprism user with all the permissions on MARIADB_DATABASE?

Could have MARIADB_AUTO_UPGRADE=1 to handle mariadb upgrades when installed.

ref: https://mariadb.com/kb/en/mariadb-server-docker-official-image-environment-variables/
ref2: https://mariadb.com/kb/en/docker-official-image-frequently-asked-questions/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I... simply didn't realize that was an option... that is more elegant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error in filename - search.


### Prerequisites
- Docker is installed (called 'Container Manager' to Synology.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why call it 'Docker' if even Synology don't call it that? And if "installed" the prerequisite is satisfied.

- Later, if you're okay with your setup, you can link your pictures to the photos folder.

### Preparing MariaDB
- Launch `Container Manager` to access Docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe container manage isn't "Docker". So just omit "to access Docker". Still makes sense.

- Switch to the `Container` tab and click `Create`

![Container Manager's Container Tab and Create Button](./img/synology/synology-create-container.png){ class="shadow" }
- Choose the `mariadb:latest` (or whatever tag you chose as your image) then continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mariadb:lts is a worth while suggestion.

- By default, when you scroll down, this will probably be attached to the `bridge` network with an IP address range of `172.17.0.0/16` or something similar. That's OK as long as you also attach the future Photoprism container to the same one.

![Create Container Advanced Settings showing network connection to the default `bridge` network in a dropdown with subnet and gateway details beneath](./img/synology/synology-network.png){ class="shadow" }
- In the `Environment` section, click the `+ Add` button to add a new variable. Add `MYSQL_ROOT_PASSWORD` as the key and set the value to something secret. You can manipulate this later to eliminate or change this password, but you'll need it for now to get in there and make users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MARIADB_ROOT_PASSWORD. Per photo comment MARIADB_{USER,PASSWORD,DATABASE} here would eliminate the pma need.

- Download and choose the flavor. (You may also skip ahead and grab `phpmyadmin` and `photoprism` while you're here or come back later.)

![Container Manager Registry Search Results for `mariadb`](./img/synology/synology-mariadb-serach.png){ class="shadow" }
- Wait until you get the message your image is downloaded.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

png link "search.png"

- Before you go on, be sure you check the `Create database with the same name and grant all privileges.` checkbox to make your life easier. (Or you'll have to do this yourself later.)

![phpMyAdmin Add user account page with username `photoprism`, a generated password, host name as any, and the `Create database with same name and grant all privileges` box checked](./img/synology/synology-photoprism-user.png){ class="shadow" }
- I recommend you leave the `Host name` as `Any host` which is a `%`. You could technically lock this down by putting in the name or IP address of the `photoprism` container, but as you're inside a private bridge network for docker already, it's really only your other containers that are in here and `%` is probably a reasonable balance between the security you already have in the private network and the potential headache you might have if the host name or IP address changes of the other container.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"docker already" - not necessary.

"inside a private bridge network, only your other containers are there, and %.."

![New Container General Setings showing choice of `photoprism` container and named container](./img/synology/synology-photoprism-create.png){ class="shadow" }
- Under `Port Settings`, be sure you map `2342` to an external port so you can log in. You can leave the other two unmapped for now. They can be edited later if you determine you need them.
- Scroll down and under `Volume Settings`, add two or three volumes.
- Choose the `/docker/Photoprism/config` folder you made earlier (or wherever you are keeping your other Docker config files) and mount it to `/photoprism/storage` with `Read/Write` permission
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Docker" -> "container"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you see a ROOT_PASSWORD here. Acceptable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants