开源照片管理服务LibrePhotos

news2024/9/26 5:24:15

在这里插入图片描述

本文是为了解决网友 赵云遇到的问题,顺便折腾的。虽然软件跑起来了,但是他遇到的问题,超出了老苏的认知。当然最终问题还是得到了解决,不过与 LibrePhotos 无关;

什么是 LibrePhotos ?

LibrePhotos 是一个自托管的开源照片管理和共享平台。它旨在提供一个类似于商业化照片服务的功能,但用户可以完全控制自己的数据,并在自己的服务器上存储照片。

什么是 UhuruPhotos ?

UhuruPhotos 是一款功能齐全,使用 Jetpack Compose和最新的 android 技术编写的 LibrePhotos android 客户端。它借鉴了 Google Photos 的很多想法,旨在成为功能齐全的相册替代品,包括离线支持、备份和同步等功能。

安装

在群晖上以 Docker 方式安装。

docker-compose.yml

将下面的内容保存为 docker-compose.yml 文件

源文件来自:https://github.com/LibrePhotos/librephotos-docker/blob/main/docker-compose.yml,老苏只修改了 container_name

# DO NOT EDIT
# The .env file has everything you need to edit.
# Run options:
# 1. Use prebuilt images (preferred method):
#   run cmd: docker-compose up -d
# 2. Build images on your own machine:
#   build cmd: COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose build
#   run cmd: docker-compose up -d

version: "3.8"
services:
  proxy:
    image: reallibrephotos/librephotos-proxy:${tag}
    container_name: librephotos-proxy
    restart: unless-stopped
    volumes:
      - ${scanDirectory}:/data
      - ${data}/protected_media:/protected_media
    ports:
      - ${httpPort}:80
    depends_on:
      - backend
      - frontend

  db:
    image: postgres:13
    container_name: librephotos-db
    restart: unless-stopped
    environment:
      - POSTGRES_USER=${dbUser}
      - POSTGRES_PASSWORD=${dbPass}
      - POSTGRES_DB=${dbName}
    volumes:
      - ${data}/db:/var/lib/postgresql/data
    command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0
    healthcheck:
      test: psql -U ${dbUser} -d ${dbName} -c "SELECT 1;"
      interval: 5s
      timeout: 5s
      retries: 5

  frontend:
    image: reallibrephotos/librephotos-frontend:${tag}
    container_name: librephotos-frontend
    restart: unless-stopped

  backend:
    image: reallibrephotos/librephotos:${tag}
    container_name: librephotos-backend
    restart: unless-stopped
    volumes:
      - ${scanDirectory}:/data
      - ${data}/protected_media:/protected_media
      - ${data}/logs:/logs
      - ${data}/cache:/root/.cache
    environment:
      - SECRET_KEY=${shhhhKey:-}
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=${adminEmail:-}
      - ADMIN_USERNAME=${userName:-}
      - ADMIN_PASSWORD=${userPass:-}
      - DB_BACKEND=postgresql
      - DB_NAME=${dbName}
      - DB_USER=${dbUser}
      - DB_PASS=${dbPass}
      - DB_HOST=${dbHost}
      - DB_PORT=5432
      - MAPBOX_API_KEY=${mapApiKey:-}
      - WEB_CONCURRENCY=${gunniWorkers:-1}
      - SKIP_PATTERNS=${skipPatterns:-}
      - ALLOW_UPLOAD=${allowUpload:-false}
      - CSRF_TRUSTED_ORIGINS=${csrfTrustedOrigins:-}
      - DEBUG=0
      - HEAVYWEIGHT_PROCESS=${HEAVYWEIGHT_PROCESS:-}
    depends_on:
      db:
        condition: service_healthy

一共用到了 4 个镜像,其中:

  • reallibrephotos/librephotos-proxy :反向代理服务;
  • reallibrephotos/librephotos:后端服务;
  • reallibrephotos/librephotos-frontend :前端页面;

以上 3 个镜像 latest 对应的版本均为 2023w31

  • postgres:13:数据库服务;

env.txt

将下面的内容保存为 env.txt 文件

源文件来自:https://github.com/LibrePhotos/librephotos-docker/blob/main/librephotos.env,请根据自己的环境进行修改;

# This file contains all the things you need to change to set up your Libre Photos. 
# There are a few items that must be set for it to work such as the location of your photos.
# After the mandatory entries there are some optional ones that you may set. 

# Start of mandatory changes. 

# Location of your photos.
scanDirectory=./librephotos/pictures

# Internal data of LibrePhotos
data=./librephotos/data

# ------------------------------------------------------------------------------------------------

# Wow, we are at the optional now. Pretty easy so far. You do not have to change any of the below.

# Set this value if you have a custom domain name. This allows uploads and django-admin access. If you do not have a custom domain name, leave this blank.
csrfTrustedOrigins=

#What port should Libre Photos be accessed at (Default 3000)
httpPort=3068

# What branch should we install the latest weekly build or the development branch (dev)
tag=latest

# Number of workers, which take care of the request to the api. This setting can dramatically affect the ram usage.
# A positive integer generally in the 2-4 x $(NUM_CORES) range.
# You’ll want to vary this a bit to find the best for your particular workload.
# Each worker needs 800MB of RAM. Change at your own will. Default is 2.
gunniWorkers=2

# You can set the database name. Did you know Libre Photos was forked from OwnPhotos?
dbName=librephotos

# Here you can change the user name for the database.
dbUser=docker

# The password used by the database.
dbPass=AaAa1234

# Default minimum rating to interpret as favorited. This default value is used when creating a new user.
# Users can change this in their settings (Dashboards > Library).
DEFAULT_FAVORITE_MIN_RATING=4

# Database host. Only change this if you want to use your own existing Postgres server. If using your own server, you can remove the 'db' container from docker-compose.yml. If you're changing the name of the DB's container name (DB_CONT_NAME further down), you need to set this variable to match that name too.
dbHost=db

# Set the names of the docker containers to your own entries. Or don't, I'm not your dad.
# Changing these will require you to `make rename` to rename the services, and start the system with your chosen `docker-compose up -d` invocation again.
# Note that changing the DB_CONT_NAME will also need you to set the `dbHost` variable to the same value.
DB_CONT_NAME=db
BACKEND_CONT_NAME=backend
FRONTEND_CONT_NAME=frontend
PROXY_CONT_NAME=proxy
PGADMIN_CONT_NAME=pgadmin
# ---------------------------------------------------------------------------------------------

# If you are not a developer ignore the following parameters: you will never need them.

# Where shall we store the backend and frontend code files.
codedir=./librephotos/code

# Location for pgAdmin
pgAdminLocation=./librephotos/pgadmin

相比源文件,老苏修改了 3

  • scanDirectory:从 ./librephotos/pictures 修改为了 ./pictures
  • data:从 ./librephotos/data 修改为了 ./data
  • httpPort:从 3000 修改为了 3068,这个只要不冲突就行;

其他参数,除了 dbPass 可以按需要修改外,其他的直接用默认值就可以,除非你清楚每个参数的用途

如果执行时遇到下面的错误,请用 UTF-8 格式保存 env.txt 文件

然后执行下面的命令

# 新建文件夹 librephotos 和 子目录
mkdir -p /volume1/docker/librephotos/{data/{cache,db,logs,protected_media},pictures}

# 进入 librephotos 目录
cd /volume1/docker/librephotos

# 将 docker-compose.yml 和 env.txt 放入当前目录

# 一键启动
docker-compose --env-file env.txt up -d

目录结构

运行

在浏览器中输入 http://群晖IP:3068 ,第一次会看到注册页面

然后需要登录

登录成功后的主界面

需要点 Edit User 按钮来设置路径,直接点击下面的 data 或者直接输入 /data,点 Save 保存即可

右下角会提示开始扫描

鼠标移到右上角的红点,可以看到照片处理进度

变成绿色时,表示已处理完成

虽然支持 AI,但期望值不要太高了

android 客户端

这是一个第三方的移动客户端,下载地址:https://github.com/savvasdalkitsis/uhuruphotos-android

选择右侧的 Manage media on mypersonal cloud

输入服务器地址、账号和密码

设置 Allow允许通知

Media without date 分类中查看

虽然还处于早期阶段,但它已经具备了很多功能,例如:与 LibrePhotos 服务器定期后台同步等

参考文档

LibrePhotos/librephotos: Self hosted alternative to Google Photos
地址:https://github.com/LibrePhotos/librephotos

LibrePhotos/librephotos-docker
地址:https://github.com/LibrePhotos/librephotos-docker

🐋 Docker | LibrePhotos
地址:https://docs.librephotos.com/docs/installation/standard-install/

UhuruPhotos. A LibrePhotos android client : selfhosted
地址:https://www.reddit.com/r/selfhosted/comments/ui5xwi/uhuruphotos_a_librephotos_android_client/

savvasdalkitsis/uhuruphotos-android: A LibrePhotos android client written using Jetpack Compose and all the latest Android technologies
地址:https://github.com/savvasdalkitsis/uhuruphotos-android

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/957681.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

uniapp微信小程序用户隐私保护

使用wx.requirePrivacyAuthorize实现微信小程序用户隐私保护。 一、前言 微信小程序官方出了一个公告《关于小程序隐私保护指引设置的公告》。不整的话,后果很多授权无法使用,详见《小程序用户隐私保护指引内容介绍》 。 二、隐私相关设置 1、在 微信…

基于Laravel通用型内容建站企业官网系统源码 可免费商用

是一个基于 Laravel 企业内容建站系统。模块市场拥有丰富的功能应用,支持后台一键快速安装,让开发者能快的实现业务功能开发。 系统完全开源,免费且不限制商业使用 2023年08月23日增加了以下12个特性: [新功能] 手机端Banner支持…

视频监控人员行为识别算法

视频监控人员行为识别算法通过opencvpython网络模型框架算法,视频监控人员行为识别算法可以识别和判断员工的行为是否符合规范要求,一旦发现不符合规定的行为,视频监控人员行为识别算法将自动发送告警信息。OpenCV的全称是Open Source Comput…

Java8实战-总结18

Java8实战-总结18 使用流筛选和切片用谓词筛选筛选各异的元素截短流跳过元素 使用流 流让你从外部迭代转向内部迭代。这样&#xff0c;就用不着写下面这样的代码来显式地管理数据集合的迭代(外部迭代)了&#xff1a; List<Dish> vegetarianDishes new ArrayList<>…

​​​​​​​嵌入式学习笔记(8)ARM汇编伪指令

伪指令的意义 伪指令不是指令&#xff0c;伪指令和指令的根本区别是经过汇编后不会生成机器码。 伪指令的意义在于指导汇编过程。 伪指令是和具体的汇编器有关的&#xff0c;我们使用gnu工具链&#xff0c;因此学习gnu下的汇编伪指令 gnu汇编中的一些符号 用来做注释。 : …

react利用wangEditor写评论和@功能

先引入wangeditor写评论功能 import React, { useEffect, useState, useRef, forwardRef, useImperativeHandle } from react; import wangeditor/editor/dist/css/style.css; import { Editor, Toolbar } from wangeditor/editor-for-react; import { Button, Card, Col, For…

IPv6网络实验:地址自动生成与全球单播通信探索

文章目录 一、实验背景与目的二、实验拓扑三、实验需求四、实验解法1. 在R1和PC3上开启IPv6链路本地地址自动生成&#xff0c;测试是否能够使用链路本地地址互通2. 为R1配置全球单播地址2001::1/64&#xff0c;使PC3能够自动生成与R1同一网段的IPv6地址3. 测试R1和PC3是否能够使…

动力学约束下的运动规划算法——Hybrid A*算法(附程序实现及详细解释)

前言&#xff08;推荐读一下&#xff09; 本文主要介绍动力学约束下的运动规划算法中非常经典的Hybrid A*算法&#xff0c;大致分为三部分&#xff0c;第一部分是在传统A * 算法的基础上&#xff0c;对Hybrid A * 算法的原理、流程进行理论介绍。第二部分是详细分析 MotionPl…

[C++]vector使用和模拟实现

&#x1f941;作者&#xff1a; 华丞臧 &#x1f4d5;​​​​专栏&#xff1a;【C】 各位读者老爷如果觉得博主写的不错&#xff0c;请诸位多多支持(点赞收藏关注)。如果有错误的地方&#xff0c;欢迎在评论区指出。 推荐一款刷题网站 &#x1f449;LeetCode 文章目录 一、vec…

什么是Flex容器和Flex项目(Flex Container and Flex Item)?它们之间有什么关系?

聚沙成塔每天进步一点点 ⭐ 专栏简介⭐ Flex容器和Flex项目⭐ Flex容器⭐ Flex项目⭐ 关系⭐ 写在最后 ⭐ 专栏简介 前端入门之旅&#xff1a;探索Web开发的奇妙世界 记得点击上方或者右侧链接订阅本专栏哦 几何带你启航前端之旅 欢迎来到前端入门之旅&#xff01;这个专栏是为…

OpenCV: cv2.findContours - ValueError: too many values to unpack

OpenCV找轮廓findContours报错 ValueError: not enough values to unpack (expected 3,got 2) 问题指向这行代码&#x1f447; binary, cnts, hierarchy cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE ) 报错的意思是需要3个返回值但只给了两…

【C++】快速排序的学习和介绍

前言 本篇文章我们先会学习快速排序这个算法&#xff0c;之后我们会学习sort这个函数 分治算法 在学习快速排序之前&#xff0c;我们先来学习一下分治算法&#xff0c;快速排序就是分治算法的一种&#xff0c;下面是分治算法的介绍&#xff0c; 分治算法&#xff0c;就是”…

设计模式-迭代器

文章目录 1. 引言1.1 概述1.2 设计模式1.3 迭代器模式的应用场景1.4 迭代器模式的作用 2. 基本概念2.1 迭代器 Iterator2.2 聚合 Aggregate2.3 具体聚合 ConcreteAggregate 3. Java 实现迭代器模式3.1 Java 集合框架3.2 Java 迭代器接口3.3 Java 迭代器模式实现示例 4. 迭代器模…

ESP32系列ESP32-D0WD双模BLE4.2+2.4G WIFI SoC芯片

目录 ESP32系列简介ESP32系列SoC功能框图ESP32-D0WD-V3芯片特性 ESP32系列SoC对比 ESP32系列简介 ESP32-DU1906和ESP32-DU1906-U两款AI模组&#xff0c;是基于ESP32-D0WD-V3芯片和语音芯片DU1906设计&#xff0c;集Wi-Fi、 传统蓝牙、低功耗蓝牙性能&#xff0c;以及音频语音处…

11.添加侧边栏,并导入数据

修改CommonAside的代码&#xff1a; <template><div><el-menu default-active"1-4-1" class"el-menu-vertical-demo" open"handleOpen" close"handleClose":collapse"isCollapse"><!--<el-menu-it…

管理类联考——逻辑——形式逻辑——汇总篇——知识点突破——假言——各种假言

角度 多重假言 &#xff08;1&#xff09;如果A&#xff0c;那么B&#xff0c;除非C。 符号化为&#xff1a;┐C→ (A→B)。 等价于&#xff1a;┐C→ (┐A∨B)。 等价于&#xff1a;C∨(┐A∨B)。 等价于&#xff1a;C∨┐A∨B。 等价于&#xff1a;┐(C∨┐A&#xff09;→…

K8S自动化运维容器化(Docker)集群程序

K8S自动化运维容器化集群程序 一、K8S概述1.什么是K8S2.为什么要用K8S3.作用及功能 二、K8S的特性1.弹性伸缩2.自我修复3.服务发现和复制均衡4.自动发布和回滚5.集中化配置管理和秘钥管理6.存储编排7.任务批量处理运行 三、K8S的集群架构1.架构2.模式3.工作4.流程图 四、K8S的核…

电子电路原理题目整理(2)

半导体是一种既不是导体也不是绝缘体的材料&#xff0c;其中包含自由电子和空穴&#xff0c;空穴的存在使半导体具有特殊的性质。 1.为什么铜是电的良导体&#xff1f; 从原子结构来看&#xff0c;铜原子的价带轨道上有一个价电子&#xff0c;由于核心和价电子之间的吸引力很弱…

【zookeeper】zookeeper的shell操作

Zookeeper的shell操作 本章节将分享一些zookeeper客服端的一些命令&#xff0c;实验操作有助于理解zookeeper的数据结构。 Zookeeper命令工具 在前一章的基础上&#xff0c;在启动Zookeeper服务之后&#xff0c;输入以下命令&#xff0c;连接到Zookeeper服务。连接成功之后&…

Shell - 根据进程名过滤进程信息

文章目录 #/bin/bash #Function: 根据输入的程序的名字过滤出所对应的PID&#xff0c;并显示出详细信息&#xff0c;如果有几个PID&#xff0c;则全部显示 read -p "请输入要查询的进程名&#xff1a;" NAME Nps -aux | grep $NAME | grep -v grep | wc -l ##统计进程…