dphoto

module
v1.6.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0

README

Licence CLI Version live version dev version

DPhoto

Backup photo to your private AWS Cloud, and share them with family and friends. Core features:

Feature Version Description
Backup medias v0.1 Backup photos and videos from USB Sticks, Flash drives, and Camera (USB) when they're plugged
Organise by album v0.1 Photos and videos are organised by album based on their creation date. Each album is a directory in S3.
Migration script v0.1 Medias already uploaded in S3 are re-ordered by albums and de-duplicated (with interactive command line interface)
Web viewer v0.5 See photos by albums, tag them, search by tag or dates
Faster UI v1.0 Pre-generate miniatures, supports browser caching (miniature + medium quality) and backend cache medium-quality images.
Album sharing v1.3 Albums can be shared to other users
Upgraded sharing - Pre-selected emails and globals views, merge owned and shared-with-me albums
Upgraded album views - Albums are listed by most recent medias, medias can be listed by dates (without being grouped by albums
Upgraded backup - Backup directly to the cloud (WebDAV), cleaning/filtering possible after backup
Photo Frame - Generate a random pick of media for a photo frame
Album contribution - Several users can contribute to the same album (families, friend group)
API Driven - Provide enhanced API to tip the business on the backend side: CLI authenticated by Google Token (vs AWS Credentials)
Android App - Minimalist app to synchronise local medias to DPhoto.
Tagging - Adding tags to medias to find them later, share them, or print them
Google Photo - Support Google Photo to push images and video, or import from Google Photo.

Getting Started

Install 'dphoto' command line interface and configure it using the following:

go install github.com/thomasduchatelle/dphoto/cmd/dphoto@latest
dphoto configure

Then use command backup to upload media in a directory, or scan to interactively organise the albums.

dphoto scan /x/y/z
dphoto backup /x/y/z

Evaluate locally

To run the command line interface locally - using localstack:

# start and configure localstack
make dcup

# move to a directory with a default confi with localstack
cd cmd/dphoto

# backup some pictures
go run . backup <a directory of photo>

# interactively add/remove albums
go run . album -i

# verify album changes has been applied
AWS_ACCESS_KEY_ID=localstack AWS_SECRET_ACCESS_KEY=localstack aws --endpoint http://localhost:4566 --region us-east-1 s3 --recursive s3://dphoto-local

Contribute

Components:

  • deployments/infra-data: terraform project to create required infrastructure on AWS for the CLI to work. Project won't be re-usable in a different context without overriding backend and some other defaults.
  • pkg: core domain model and business logic from Hexagonal Architecture. This domain is used from both CLI and app's APIs
  • DPhoto CLI: installed on the end-user computer, backup photos and videos using command line interface
  • APP: deployed on top of infra-data, contains the APP (API deployed on AWS lambdas, and WEB)

Note: the repository follow https://github.com/golang-standards/project-layout structure convention.

Install development environment

Required tools:

  • Infra:
    • terraform: brew install tfenv, Makefile
    • Serverless Framework: npm install -g serverless
    • AWS CLI: brew install awscli
  • Languages & build tools:
    • make
    • GoLang: brew install golang
    • Yarn: brew install yarn
  • Docker and Docker Compose
    • brew install docker docker-compose

Setup the environment:

make setup all

# Run tests & build (all sub-projects)
make
Commit messages & Github Actions

Commit messages are following the convention:

<domain>[/<area>] [+tags] - <message>

With:

  • domains: catalog, archive, backup
  • area: web, cli, proj, api, ...
  • supported tags are:
    • +update-snapshots: snapshots used to test visual regression will be updated
    • +patch, +minor, +major: control the version of the software
    • +pr: creates a Pull Request if the pipeline is successful
Releasing process

Bootstrap an environment with built-in command (one-of pre-requisite):

go run ./tools/infra-bootstrap -domain <domain> -email <email> -env dev -google-client-id <id>

To release a new version:

  1. Push a change on a feature branch with +pr or +next in the commit message
  2. (optional) Verify "next" is working, check the terraform plan in the PR comment
  3. Accept and merge the PR (created automatically on step 1)

Any machine should update to the latest version of the CLI:

go install github.com/thomasduchatelle/dphoto/cmd/dphoto@latest
AWS Support

DPhoto only supports AWS to be deployed as a serverless application using AWS Gateway, Lambdas, DynamoDB, and S3.

DynamoDB is a single table documented in README.md.

TODOs

TODO.md

Directories

Path Synopsis
api
lambdas Module
app
viewer_api Module
cmd
dphoto/config
Package config create AWS session and distribute it (alongside other config value) to any package interested.
Package config create AWS session and distribute it (alongside other config value) to any package interested.
delegate module
dphoto module
internal
printer
Package printer display in standard output simple info/success/error messages
Package printer display in standard output simple info/success/error messages
screen
Package screen provides building blocks to represent progress bars.
Package screen provides building blocks to represent progress bars.
pkg
acl/aclcore
Package aclcore manage what an API consumer is granted to do, and issue access tokens to represent it.
Package aclcore manage what an API consumer is granted to do, and issue access tokens to represent it.
archiveadapters/archivedynamo
Package archivedynamo extends catalogdynamo to add media locations to the main table
Package archivedynamo extends catalogdynamo to add media locations to the main table
archiveadapters/s3store
Package s3store implements archive.StoreAdapter with AWS S3 backend
Package s3store implements archive.StoreAdapter with AWS S3 backend
backup
Package backup is providing commands to inspect a file system (hard-drive, USB, Android, S3) and backup medias to a remote DPhoto storage.
Package backup is providing commands to inspect a file system (hard-drive, USB, Android, S3) and backup medias to a remote DPhoto storage.
backupadapters/analysers/exif
Package exif parse image files to extract key details.
Package exif parse image files to extract key details.
backupadapters/analysers/m2ts
Package m2ts is parsing M2TS files followings specs: https://en.wikipedia.org/wiki/MPEG_transport_stream https://en.wikipedia.org/wiki/Packetized_elementary_stream https://en.wikipedia.org/wiki/Program-specific_information
Package m2ts is parsing M2TS files followings specs: https://en.wikipedia.org/wiki/MPEG_transport_stream https://en.wikipedia.org/wiki/Packetized_elementary_stream https://en.wikipedia.org/wiki/Program-specific_information
backupadapters/analysers/mp4
Package mp4 parse a MP4 file to retrieve creation date, length, and other details found in the stream.
Package mp4 parse a MP4 file to retrieve creation date, length, and other details found in the stream.
backupadapters/filesystemvolume
Package filesystemvolume scans a local filesystem to find medias in it
Package filesystemvolume scans a local filesystem to find medias in it
catalog
Package state provides tools to maintain an index of all medias that have been backed up.
Package state provides tools to maintain an index of all medias that have been backed up.
catalogadapters/catalogarchivesync
Package catalogarchivesync is calling archive domain directly
Package catalogarchivesync is calling archive domain directly
catalogadapters/catalogdynamo
Package catalogdynamo package store all the data in a single multi-tenant table:
Package catalogdynamo package store all the data in a single multi-tenant table:
dns
Package dns expose functions to renew SSL certificates on AWS
Package dns expose functions to renew SSL certificates on AWS
meta
Package meta expose information about the application like the version.
Package meta expose information about the application like the version.
tools

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL