waschinski / photo-stream

Self-hosted, super simple photo stream
https://github.com/waschinski/photo-stream
MIT License
448 stars 68 forks source link
docker jekyll photography photos ruby static-site

Photo Stream Social Preview

Photo Stream

Photo Stream is a simpler home for your photos initially created by @maxvoltar and now maintained by @waschinski, @boerniee and friends. Easy to use, self hosted, no tracking, just photos.

Demo

There is a demo of this repository hosted on a Free Plan on Render.

Live Examples

Features

Why?

We like to take photos and share them. Problem is it's hard to really own your photos and how they're represented across social media these days, so we set out to make a place for them. You host it yourself, wherever you want (Netlify, Github Pages...), you're in control.

How to install

Previously the recommended way to install Photo Stream was to fork the repository. In my opinion this was not really optimal and being a fan of Docker I began working on optimizations to run Photo Stream in a container. That's why configuration has been moved from _config.yml to .env so when switching from the initial repo you will have to set up the .env file accordingly.

Using Docker

There is an image over at Docker Hub which you can pull using:

docker pull waschinski/photo-stream:latest

Alternatively download the docker-compose.yml file, change the configuration as needed and use the following command to get Photo Stream running:

docker-compose up -d

The photos folder can be mounted as a volume. Make sure to put your photos in a folder called original.

Using Docker on Raspberry Pi (linux/arm/v6 only):

Prerequisites : docker and docker-compose are installed on RPI

In docker-compose.yml comment image section, uncomment build section, and setup BASE_IMAGE arg to arm32v6/ruby:3.1.2-alpine3.16.

Then docker-compose build

Then docker-compose up -d

Manually

Grab the latest version from the release page and extract it.

Make sure you meet the following requirements in order to run Photo Stream:

Build tools

How to install these depends on your OS. Debian users will go with sudo apt-get install build-essential while on MacOS you should be fine with xcode-select --install.

Ruby (v3+ recommended)

Check to see if you already have Ruby installed (ruby -v). If you don't, you can follow the installation instructions provided here.

libvips

Instructions on how to install libvips can be found here.

Jekyll

Next you'll have to install Jekyll (a simple gem install bundler jekyll should suffice). Make sure you meet its requirements or install them as well before proceeding.

Once all these requirements are met you can finally install all the gems required by Photo Stream (you should be in the Photo Stream folder):

bundle install

How to deploy directly

on Render

Fork this repo and add your own photos to the photos/original folder. Log in to your Render account or create a new one. Create a new static site on the Render Dashboard. Connect your Github account and select your photo-stream repository. Select the correct branch and adjust the Build Command (bundle exec jekyll build) and Publish Directory (_site). Under Advanced you Add Secret File and create a .env file containing your adjusted environment variables. You might be able to change this file directly in your repo and skip the former step (adding a secret file) but I haven't tested this.

How to use

Put your photos (not resized) in the photos/original directory. Optionally you can give them a name, which will appear as the title of the photo page and in the RSS feed.

This command will serve the static page on your local machine. http://localhost:4000

bundle exec jekyll serve

You can also statically build your site to be uploaded to a regular webhost.

bundle exec jekyll build

Now upload the contents of the _site/ directory to your webserver.

Automating the build & upload with rsync or lftp

Just execute the script you need to run directly from the _scripts folder like that:

sh ./_script/build-n-lftp.sh

build.sh will build your site while rsync.sh and lftp.sh will sync it accordingly. build-n-rsync.sh and build-n-lftp.sh are simply doing both steps in one. Don't forget to add your sync configuration in the .env file.

Customize

Basics

First thing you want to do is edit a couple of things in /.env:

Don't include the @-part of your social handles. Links to your Github, Twitter and Instagram profiles are only shown when set.

Advanced

Before publishing your website, Jekyll will resize your photos into 3 different buckets:

Credits