Make a release :)

This commit is contained in:
Aaron Fischer 2017-05-12 22:37:22 +02:00
parent b5cbd71b68
commit 948be6a10b
6 changed files with 108 additions and 8 deletions

View file

@ -1,8 +1,9 @@
FROM java:8-alpine
FROM openjdk:8
MAINTAINER Aaron Fischer <mail@aaron-fischer.net>
ADD target/uberjar/yenu.jar /yenu/app.jar
ADD yenu.jar /yenu/app.jar
EXPOSE 3000
CMD ["java", "-jar", "/yenu/app.jar"]
WORKDIR "/yenu"
CMD ["java", "-jar", "app.jar"]

71
README Normal file
View file

@ -0,0 +1,71 @@
oooo ooo .ooooo. ooo. .oo. oooo oooo
`88. .8' d88' `88b `888P"Y88b `888 `888
`88..8' 888ooo888 888 888 888 888
`888' 888 .o 888 888 888 888
.8' `Y8bod8P' o888o o888o `V88V"V8P'
.o..P'
`Y8P' the image sharing tool for friends.
yenu is a simple tool to share images among a trusted group of people. No
complicated setup, no fancy features nobody really uses, no role management,
no cloud, no bullshit. Just sharing images to people you like and store
your data where you want it to be.
--{ INSTALL }------------------------------------------------------------------
Create the database schema and all needed folders. You need to execute
this only once for initial setup. IF you upgrade the yenu version (replace
the yenu.jar file), it is sometimes needed to run the migrate step again.
$ java -jar yenu.jar migrate
Start the application with the following command in a screen session or
write a systemd init file for that.
$ java -jar yenu.jar
If you like docker, you can use docker-compose to boot up the application
and send it to the background.
$ docker-compose up -d
--{ CONFIGURATION }------------------------------------------------------------
The application is configured with the yenu.properties file. Open the file
in your preferred editor and change the variables as you like. You can change
the basepath, port and other stuff like the user password and the creator
password.
--{ WHERE IS MY DATA? }--------------------------------------------------------
All your images are placed in the data/gallery/ directory, next to the
yenu.jar. When uploading a image, the raw file is placed into the raw/ folder,
if you need the original later (pull out some metadata like GPS coordinates,
scale it into other formats, print it etc.) In the normal/ folder there are
the scaled down images for the details page. The thumbnails/ folder contains
the quare images for the thumbnail preview.
The database used is a SQLite3 database, stored in the yenu.db file. You
can open the database at any time with your favourite sqlite3 client.
$ sqlite3 yenu.db
> .tables
> SELECT * FROM images;
> ...
--{ WHERE CAN IS RUN THIS THING? }---------------------------------------------
Quick answer: Wherever you want. You can boot up a Amazon S3 node and deploy
it there or you put it on your RaspberryPi and host it yourself from your
own internet connection from home (preferred way!). You can also rent a
vServer and deploy it there. All you need is a Java RE and a internet
connection.
--{ LICENSE, RIGHTS AND AUTHOR }-----------------------------------------------
This tool is written by Aaron Fischer (aaron-fischer.net). It is free to use
and is placed under the GPL v.3. The images, comments and other metadata
belongs to you. Make sure, you store the data on a place you trust and make
backups.

17
deploy.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Compile
lein uberjar
# Clean
rm -rf dist
# Package
mkdir dist
cp target/uberjar/yenu.jar dist/
cp yenu.properties dist/
cp Dockerfile dist/
cp docker-compose.yml dist/
cp README dist/
tar czf yenu-release.tar.gz dist/*

9
docker-compose.yml Normal file
View file

@ -0,0 +1,9 @@
app:
build: .
command: java -jar /yenu/app.jar
ports:
- "127.0.0.1:80:3000"
volumes:
- ./data:/yenu/data
- ./yenu.properties:/yenu/yenu.properties
- ./yenu.db:/yenu/yenu.db

View file

@ -22,10 +22,12 @@
(filter/add-filter! :parse-date #(time/to-time-zone (time-format/parse %) (time/default-time-zone)))
(defn footer []
(if (= (:count (db/get-image-count) 0))
(clojure.string/join ", " (:authors env))
(let [first-year (subs (:created_at (db/get-first-year)) 0 4)
recent-year (subs (:created_at (db/get-recent-year)) 0 4)
copy (if (= first-year recent-year) first-year (str first-year " - " recent-year))]
(str "© " copy " " (clojure.string/join ", " (:authors env)))))
(str "© " copy " " (clojure.string/join ", " (:authors env))))))
(defn render-file [template & [params]]
(content-type

View file

@ -54,7 +54,7 @@
(page (inc current) (= current num) "disabled" (h/html "Weiter " [:span.fa.fa-arrow-right]))])))
(defn index-page [current request]
(let [image-count 25
(let [image-count (:images_per_page env)
offset (* (dec current) image-count)
pages (number-of-pages image-count)
images (db/get-all-images {:offset offset :count image-count})]