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

Photoprism #543

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Contributing to Ansible-NAS is easy! Add your functionality, then raise a pull r

* Restrict pull requests to one piece of functionality or bugfix at a time.
* Test your new functionality or bugfix using the included `tests/test-vagrant.sh` script to spin up a test VM.
1. Install Vagrant [here](https://www.vagrantup.com/downloads) (package managers usually have out-of-date versions)
2. Install a virtual machine runner like [VirtualBox](https://www.virtualbox.org/) (installation via package manager is fine)
3. Create `./tests/test.yml` with your desired ansible variables from `group_vars/all.yml` set (See [configuration](./docs/installation.md).
4. From the repo base directory run `./test/test-vagrant.sh` to start Vagrant, then `./test/test-vagrant.sh -p` to provision it.
5. Run it twice to ensure idempotence
* Run `ansible-lint` against the playbook before committing. (There is a VSCode task set up to run the right command for you)
* Ensure that your PR only changes files required for your functionality or bugfix.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ If you have a spare domain name you can configure applications to be accessible
* [openHAB](https://www.openhab.org/) - A vendor and technology agnostic open source automation software for your home
* [overseerr](https://docs.overseerr.dev) - open source software application for managing requests for your media library
* [Paperless_ng](https://github.com/jonaswinkler/paperless-ng) - Scan, index and archive all your physical documents
* [PhotoPrism](https://photoprism.app/) - AI-powered app for browsing, organizing & sharing your photo collection
* [Piwigo](https://piwigo.org/) - Photo Gallery Software
* [Plex](https://www.plex.tv/) - Plex Media Server
* [Portainer](https://portainer.io/) - for managing Docker and running custom images
Expand Down
17 changes: 17 additions & 0 deletions docs/applications/photoprism.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PhotoPrism

Homepage: [https://photoprism.app/](https://photoprism.app/)

## Usage

Set `photoprism_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.

The default user is `admin` and its password is `insecure`. To set the admin password run the following command:

```
docker exec -ti photoprism photoprism passwd
```

More commands can be found [here](https://docs.photoprism.app/getting-started/docker/#examples)
PhotoPrism creates a database in `photoprism_config_directory`.

1 change: 1 addition & 0 deletions docs/configuration/application_ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ By default, applications can be found on the ports listed below.
| Organizr | 10444 | Bridge | HTTPS |
| Overseerr | 5055 | Bridge | HTTP |
| Paperless_ng | 16922 | Bridge | HTTP |
| PhotoPrism | 2342 | Bridge | HTTP |
| Piwigo | 16923 | Bridge | HTTP |
| Plex | 32400 | Bridge | HTTP |
| Portainer | 9000 | Bridge | HTTP |
Expand Down
8 changes: 8 additions & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ joomla_available_externally: "false"
joomla_database_password: top_secret
joomla_port: "8181"

###
### PhotoPrism
###
photoprism_config_directory: "{{ docker_home }}/photoprism"
photoprism_photos_directory: "{{ photos_root }}"
photoprism_port: "2342"
photoprism_available_externally: false

###
### OpenVPN
###
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,7 @@
- import_tasks: tasks/virtual_desktop.yml
when: (virtual_desktop_enabled | default(False))
tags: virtual_desktop

- import_tasks: tasks/photoprism.yml
when: (photoprism_enabled | default(False))
tags: photoprism
33 changes: 33 additions & 0 deletions tasks/photoprism.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: PhotoPrism - create config directory
tsjordan-eng marked this conversation as resolved.
Show resolved Hide resolved
file:
path: "{{ item }}"
state: directory
mode: 0777
with_items:
- "{{ photoprism_config_directory }}/storage"

- name: PhotoPrism - install Docker container
tsjordan-eng marked this conversation as resolved.
Show resolved Hide resolved
docker_container:
name: photoprism
image: photoprism/photoprism
pull: true
ports:
- "{{ photoprism_port }}:2342"
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ photoprism_config_directory }}/storage:/photoprism/storage:rw"
tsjordan-eng marked this conversation as resolved.
Show resolved Hide resolved
- "{{ photoprism_photos_directory }}:/photoprism/originals:rw"
network_mode: "bridge"
tsjordan-eng marked this conversation as resolved.
Show resolved Hide resolved
env:
PHOTOPRISM_SITE_URL: "https://photoprism.{{ ansible_nas_domain }}"
PHOTOPRISM_ADMIN_PASSWORD: "insecure" # docker exec -ti photoprism photoprism passwd
tsjordan-eng marked this conversation as resolved.
Show resolved Hide resolved
restart_policy: unless-stopped
memory: 4g
labels:
traefik.enable: "{{ photoprism_available_externally }}"
traefik.http.routers.gitlab.rule: "Host(`photoprism.{{ ansible_nas_domain }}`)"
traefik.http.routers.gitlab.tls.certresolver: "letsencrypt"
traefik.http.routers.gitlab.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.gitlab.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.gitlab.loadbalancer.server.port: "2342"