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

Feature/laravel package #1

Merged
merged 6 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

44 changes: 0 additions & 44 deletions .env.example

This file was deleted.

5 changes: 0 additions & 5 deletions .gitattributes

This file was deleted.

14 changes: 2 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
storage/photos
composer.lock
/build
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
todo.txt
credentials.json
token.json
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Google Photos Indexer

A Laravel package providing console commands to maintain a local copy of a Google Photos account.
Also has endpoints for setting up OAuth access via a couple of localhost routes.

This can serve as both a backup and, by using the [Slideshow](https://github.com/dmlogic/photo-slideshow) tool, a rolling randomised display on your TV or photo frame.

The indexer is only interested in photos you have placed in an album. The intention is that you have to denote the image as "special" enough to copy down. That way random phone shots that get sync'd don't make the cut.

## Installation

As a package, this requires a host Laravel app. I _really_ hate dealing with [laravel/laravel](https://github.com/laravel/laravel) as a container for my code, so there is a build script to quickly consume this package from a functioning App based on the latest available Laravel skeleton. This keeps the codebase clean and makes life massively easier at upgrade time.

1. Create suitable host hardware and OS. A Raspberry PI with a large storage card is perfect
2. Clone this repo
3. Copy .env.template to .env and adjust as required - particularly the full path to photo storage (which should really be totally separate from this code)
4. Setup OAuth access to your App and download credentials to `credentials.json` in this folder
5. Run `./build.sh`
6. `cd` into `build` and run `php artisan serve`
7. In your browser visit `http://127.0.0.1/oauth/start` and complete the oauth process
8. Setup a CRON command to index daily. e.g. `0 1 * * * cd /full/path/to/project/build && php artisan photos:index`

## Upgrade and maintenance

You can pretty much follow the above providing you don't trash your data. Recommended process:

* Copy `database/database.sqlite` somewhere safe
* If your photo storage is not outside of the built app, copy it somewhere safe
* Delete the built app
* Complete the installation steps
* Copy back `database/database.sqlite` and your photos if necessary
171 changes: 0 additions & 171 deletions app/Console/Commands/IndexPhotos.php

This file was deleted.

57 changes: 0 additions & 57 deletions app/Console/Commands/ReIndexAlbum.php

This file was deleted.

42 changes: 0 additions & 42 deletions app/Console/Kernel.php

This file was deleted.

Loading