An unofficial companion tool created for use alongside PhotoPrism to enable API endpoints and automation.

Overview

PhotoPrism Helper

Build CodeQL Publish Docker image CodeFactor Known Vulnerabilities

PhotoPrism Helper is an unofficial companion tool created for use alongside PhotoPrism. This project isn't associated with the PhotoPrism project, it's just a companion tool created to extend the functionality of PhotoPrism.

Feature Overview

  • Middleware API
  • Web Interface
  • Automation of PhotoPrism features

The current main features are API endpoints for importing and indexing content, as well as setting up cron tasks to enable automated importing and indexing.

Getting Started

The application is designed to be used in a docker container or hosted on any local machine. After cloning the repository you can set up, build, and run the project by doing the following:

Start by installing all the dependencies:

npm install

Build the project:

npm run build

or

Build the docker image:

docker build -t aerilym/photoprism-helper .

Environment Variables

A list of possible environment variables is available: .env.template

Variable Default Description
PHOTOPRISM_SITE_URL http://localhost:2342/ The URL of your PhotoPrism instance.
HOSTPORT 2343 The port the helper is hosted on.
PHOTOPRISM_USERNAME admin The PhotoPrism username you want the helper to use for access.
PHOTOPRISM_PASSWORD The PhotoPrism password associated with the username.
APIKEY testkey The API key you'll use to query the helper API.
TIMEZONE Melbourne/Australia The timezone of your instance.
IMPORT_TIMEOUT 300000 The number of milliseconds the import function should wait for a success message before timing out.
MOVE_ON_IMPORT false Enable/Disable moving files on import.
AUTO_IMPORT false Enable/Disable the auto-import feature.
AUTO_IMPORT_CRON 0 0 4 * * * * The cron expression for when to run auto-import.
INDEX_AFTER_AUTO_IMPORT false Enable/Disable the index after auto-importing feature.
INDEX_TIMEOUT 300000 The number of milliseconds the index function should wait for a success message before timing out.
INDEX_RESCAN false Enable/Disable rescanining when indexing (From PhotoPrism settings).
INDEX_SKIP_ARCHIVED false Enable/Disable skipping archive (From PhotoPrism settings).
AUTO_INDEX false Enable/Disable the auto-index feature.
AUTO_INDEX_CRON 0 0 6 * * * * The cron expression for when to run auto-index.
LOGFILE_PATH logs/local.log The logging file path.
LOGLEVEL_CONSOLE info The log level to apply to the console log.
LOGLEVEL_FILE error The log level to apply to the file log.
SEND_ERRORS true Enable/Disable sending errors/exceptions to the dev.
ERROR_LOG_URL The URL to send errors to. (Don't change unless you're running your own fork of the helper)
ERROR_LOG_KEY The API key sent with error logs to the external server.
ERROR_LOG_ANONYMISE false Enable/Disable anonymising externally sent error logs.
ERROR_LOG_OPTIONS true Enable/Disable sending your configuration options with externally sent errors.
EXTERNAL_LOG false Enable/Disable sending logs to an external log server.
EXTERNAL_LOG_DEPTH info The log level to apply to the external log.
EXTERNAL_LOG_URL The URL of the external log server.
EXTERNAL_LOG_KEY The API key sent with logs sent to the external log server.
EXTERNAL_LOG_ANONYMISE false Enable/Disable anonymising externally sent logs.
EXTERNAL_LOG_OPTIONS true Enable/Disable sending your configuration options with externally sent logs.

If enabled, the configuration options sent with externally sent errors and logs are:

TBD

Building a Local Install

Create a .env file, based on the .env.template file and fill it with your options.

At a minimum, the USER AND PASS environment variables need to be set, but BASEURL will be required if your PhotoPrism instance isn't available on localhost:2342. Read more about environment variables.

Run the following command to build the application from the source files:

npm run build

This will build the application and output the files to build/

Once the application is built, run the following command to start it:

npm run start:prd

The application will now run and be available at the address and port you specified in .env

If you're familiar with Node and TypeScript feel free to isolate the build folder to minimise the installation.

Docker

The container can be created using the Dockerfile available, or by using the container available as a GitHub Package or DockerHub.

The container can be easily built from the source code by running:

npm run build:docker

API Documentation

Authentication

All requests must contain an authorization header with a set API key as such:

Authorization: "Bearer <APIKEY>"

Endpoints

Import

POST /import

Index

POST /index

Stats

GET /stats

Comments
  • [HELP] - Helper Auto Index timing out

    [HELP] - Helper Auto Index timing out

    Describe the issue I've got auto index set up in docker (via Unraid). Only option I planned on using. The task is scheduled and run but I get a timeout error every time.

    [2022-12-11 17:21:20] info: Timezone set to America/New_York
    [2022-12-11 17:21:20] info: Targeting PhotoPrism instance at http://192.XXX.XX.XX:2342/
    [2022-12-11 17:21:20] info: Scheduling auto index task.
    [2022-12-11 17:21:20] info: PhotoPrism Helper API listening on port 2343
    [2022-12-12 08:00:00] info: Running auto index.
    [2022-12-12 08:00:31] error: timeout of 30000ms exceeded
    [2022-12-12 08:00:31] info: Unknown error
    

    To Reproduce Steps to reproduce the behavior:

    Not sure how to reproduce. Included docker settings below. The one thing I was unsure of on the setup is how to handle the API. I generated an API for the container, but if there is something I need to do in PhotoPrism, not sure what that is. Acknowledging my API understanding is limited.

    Expected behavior

    Run auto index every day.

    Screenshots

    image image

    Additional context None.

    help wanted 
    opened by twinkie0101 2
  • [HELP] - Auto Index not working

    [HELP] - Auto Index not working

    I think I set it correct, but the photoprism's content changed nothing. I cant't find any error info in the log.

    It's log: [2022-09-01 16:29:52] info: Timezone set to Asia/Shanqhai [2022-09-01 16:29:52] warn: Env var ISDOCKER is set to true. If the application is not running in a docker container, change this to false. [2022-09-01 16:29:52] info: Targeting PhotoPrism instance at http://10.1.1.99:2342/ [2022-09-01 16:29:52] info: PhotoPrism Helper API listening on port 2343 [2022-09-03 03:50:02] info: Timezone set to Asia/Shanqhai [2022-09-03 03:50:02] warn: Env var ISDOCKER is set to true. If the application is not running in a docker container, change this to false.

    only index true: cron: 0 0 3,12,19 * * ?

    bug help wanted 
    opened by overcast404 2
  • [Snyk] Upgrade express from 4.18.1 to 4.18.2

    [Snyk] Upgrade express from 4.18.1 to 4.18.2

    Snyk has created this PR to upgrade express from 4.18.1 to 4.18.2.

    merge advice :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 1 version ahead of your current version.
    • The recommended version was released 22 days ago, on 2022-10-08.
    Release notes
    Package name: express from express GitHub release notes
    Commit messages
    Package name: express

    Compare


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    ๐Ÿง View latest project report

    ๐Ÿ›  Adjust upgrade PR settings

    ๐Ÿ”• Ignore this dependency or unsubscribe from future upgrade PRs

    opened by snyk-bot 0
  • [Snyk] Upgrade winston-axios from 1.7.3 to 1.7.7

    [Snyk] Upgrade winston-axios from 1.7.3 to 1.7.7

    This PR was automatically created by Snyk using the credentials of a real user.


    Snyk has created this PR to upgrade winston-axios from 1.7.3 to 1.7.7.

    merge advice :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 2 versions ahead of your current version.
    • The recommended version was released 21 days ago, on 2022-09-04.
    Release notes
    Package name: winston-axios
    • 1.7.7 - 2022-09-04

      What's Changed

      • Remove deploy prd from local (#5) @ Aerilym
      • Fix publish to include build (#4) @ Aerilym
      • Add missing comments (#1) @ Aerilym
      • Fix transport creation to allow no options
      • Add CI release and publishing
    • 1.7.4 - 2022-09-04

      1.7.4

    • 1.7.3 - 2022-08-20
    from winston-axios GitHub release notes
    Commit messages
    Package name: winston-axios
    • 97a77af Merge pull request #5 from Aerilym:aerilym_remove_deploy_prd_from_local
    • 104cfca Remove deploy prd from local
    • c0a105e 1.7.7
    • 2a09c80 1.7.6
    • 4b59021 1.7.5
    • 5dc7536 Fix publish to include build
    • 1dd4860 Fix publish to include build
    • 3b3d571 Update publish action
    • f063b8f Update publish action
    • 3b15bfe Fix relase detection for npm publish
    • 224d9b5 Fix relase detection for npm publish
    • e8cc8db 1.7.4
    • 89f3bf8 Merge pull request #1 from Aerilym:aerilym_optional_args_and_comments
    • ff8c225 Add missing comments
    • b0b4d55 Add release drafter template
    • 0a5bd7e Add release drafter action
    • 7c75ad0 Create npm-publish.yml
    • 650feff Fix transport creation to allow no options

    Compare


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    ๐Ÿง View latest project report

    ๐Ÿ›  Adjust upgrade PR settings

    ๐Ÿ”• Ignore this dependency or unsubscribe from future upgrade PRs

    opened by Aerilym 0
  • [Snyk] Upgrade dotenv from 16.0.1 to 16.0.2

    [Snyk] Upgrade dotenv from 16.0.1 to 16.0.2

    This PR was automatically created by Snyk using the credentials of a real user.


    Snyk has created this PR to upgrade dotenv from 16.0.1 to 16.0.2.

    :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 1 version ahead of your current version.
    • The recommended version was released 22 days ago, on 2022-08-30.
    Release notes
    Package name: dotenv from dotenv GitHub release notes
    Commit messages
    Package name: dotenv
    • 0757a1b Version bump - patch 16.0.2
    • d8002ae Update README
    • 5691677 Update CHANGELOG
    • 03f50d5 Merge pull request #660 from lnasc256/fix/config-options
    • cf72d2b Match png to svg and compress
    • d1314a2 Add width to svg
    • 847c8ad Merge pull request #670 from LitoMore/use-svg-logo
    • 591604f Bring back PNG file and move SVG icon to root
    • 08f94ee Use SVG logo
    • 228c7b4 Update README
    • f32799c Update README
    • e085861 Update rate on openbase badge
    • e8ef07d amend to a3c1189a6087b70b0ebda925b0dcebea22cc1db2
    • a1c245e exporting env and cli options files +
    • 8b635d6 Update README with badge

    Compare


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    ๐Ÿง View latest project report

    ๐Ÿ›  Adjust upgrade PR settings

    ๐Ÿ”• Ignore this dependency or unsubscribe from future upgrade PRs

    opened by Aerilym 0
  • [Snyk] Upgrade express-rate-limit from 6.5.1 to 6.5.2

    [Snyk] Upgrade express-rate-limit from 6.5.1 to 6.5.2

    Snyk has created this PR to upgrade express-rate-limit from 6.5.1 to 6.5.2.

    merge advice :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


    • The recommended version is 1 version ahead of your current version.
    • The recommended version was released 22 days ago, on 2022-08-24.
    Release notes
    Package name: express-rate-limit
    • 6.5.2 - 2022-08-24

      Fixed

      • Fixed an issue with missing types in ESM monorepos. (#321)

      You can view the changelog here.

    • 6.5.1 - 2022-07-23

      Changed

      • The message option can now be a (sync/asynx) function that returns a value (#311)
      • Updated all dependencies
    from express-rate-limit GitHub release notes
    Commit messages
    Package name: express-rate-limit
    • c2e2082 6.5.2
    • 0d1be7d Merge pull request #321 from rafaelpimpa/patch-1
    • 550ea20 fix types missing in ESM monorepos

    Compare


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

    For more information:

    ๐Ÿง View latest project report

    ๐Ÿ›  Adjust upgrade PR settings

    ๐Ÿ”• Ignore this dependency or unsubscribe from future upgrade PRs

    opened by snyk-bot 0
Releases(v1.0.2)
  • v1.0.2(Sep 6, 2022)

  • v1.0.1(Sep 6, 2022)

    What's Changed

    • Add timezone checker (#7)
    • Aerilym_convert_web_puppet_to_api_caller (#5)
    • Aerilym_external_logger (#4)
    • Apply fixes from CodeFactor (#3)
    • Fix code scanning alert - Missing rate limiting (#2)
    Source code(tar.gz)
    Source code(zip)
Owner
Ryan Miller
I make things
Ryan Miller
Hemsida fรถr personer i Sverige som kan och vill erbjuda boende till mรคnniskor pรฅ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo fรถr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A new generation GUI automation framework for Web and Desktop Application Testing and Automation.

Clicknium-docs Clicknium is a new generation GUI automation framework for all types of applications. It provides easy and smooth developer experience

null 109 Dec 19, 2022
A Travel companion app using Google Maps API, Travel Search and Weather API

Travel Advisor Introduction An advanced Travel Companion Application using Google Maps. With Geolocation, Google Maps API, Searching for places, Fetch

Sunny Bhadani 4 Nov 11, 2022
Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services.

Tidbyt Client for Node.js Unofficial API client for the Tidbyt API. Use this client to control Tidbyt devices and integrate with other services. Insta

Nicholas Penree 19 Dec 17, 2022
Automatically generated documentation for the Valorant API endpoints the client uses internally.

Valorant API Docs To read documentation and get started, see Docs This is a project designed to automatically document Valorant endpoints based on a J

Techdoodle 223 Dec 25, 2022
API client to test endpoints over HTTP. Uses superagent under the hood

@japa/client API client to test endpoints over HTTP. Uses superagent under the hood The API client plugin of Japa makes it super simple to test your A

Japa.dev 8 Apr 13, 2022
An API library of useful mocked endpoints to help you get your designs feeling lifelike with real data.

About Welcome to Mocked-API, this is a live API that can be accessed by anyone who needs data to test out their website, app, components etc. Hacktobe

Aaron Rackley 48 Dec 29, 2022
An interceptor to validate and decode Pub/Sub push messages for endpoints

NestJS GCP Pub/Sub Interceptor Provides an Interceptor for NestJS to automagically validate and unwrap HTTP push messages from Google Cloud Platform's

Hiphops 3 Dec 15, 2022
Create Route53 HealthChecks to monitor TCP, HTTP, HTTPS endpoints, CloudWatch Alarms and other Route53 HealthChecks

AWS CDK Route53 HealthCheck Create Route53 HealthChecks to monitor TCP, HTTP, HTTPS endpoints, to monitor CloudWatch Alarms and to monitor other Route

Pepperize 7 Dec 15, 2022
This script is the defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.

The HTML5 Shiv The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 styling for Internet Explo

Alexander Farkas 9.9k Jan 2, 2023
An API ๐Ÿ“ฆ for the the unofficial MyAnimeList API jikan.moe v4

Marika A promise based API wrapper for the unofficial MyAnimeList API Installation npm i @shineiichijo/marika yarn add @shineiichijo/marika ?? Import

Lucky Yambem 21 Nov 4, 2022
Companion articles and projects for the Learning TypeScript book.

Website This website is built using Docusaurus 2, a modern static website generator. Installation $ yarn Local Development $ yarn start This command

Josh Goldberg 26 Nov 20, 2022
A Typescript companion to the book A Common-Sense Guide to Data Structures and Algorithms by Jay Wengrow

This repository aims to be a companion to the book A Common-Sense Guide to Data Structures and Algorithms by Jay Wengrow. I rewrote most of the data s

Alexandre Lim 29 Dec 3, 2022
Companion articles and projects for the Learning TypeScript book.

Website This website is built using Docusaurus 2, a modern static website generator. Installation $ yarn Local Development $ yarn start This command

null 5 May 10, 2022
Introduction to Metrics, Logs and Traces session companion code.

Introduction to Metrics, Logs and Traces in Grafana This is the companion repository to a series of presentations over the three pillars of observabil

Grafana Labs 35 Dec 24, 2022
Quo is a (free) debugging companion app to help you debug dumped variables, the dumped variables will appear in this Quo client instead of the traditional way which is often tedious.

Quo is a debugging companion to help you debug dumped variables, the dumped variables will appear in this Quo client instead of via the traditional way which is often tedious.

Protoqol 33 Dec 25, 2022
Official companion browser extensions for Kagi Search (Chrome, Firefox)

Kagi Search Extension This contains the source for the Kagi Search extension for Firefox and Chrome. Get it for your browser here: Chrome Firefox Cont

Kagi Search 18 Nov 25, 2022
A cloud based companion app to help keep you safe when you're on the go.

Safe-Travels A cloud based companion app to help keep you safe when you're on the go. Installation Frontend $ git clone https://github.com/6okuJins/Sa

Dom 3 Sep 16, 2022