1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Merge branch 'master' of https://github.com/bpatrik/pigallery2 into develop

This commit is contained in:
Patrik J. Braun 2019-01-17 19:54:45 +01:00
commit 06c6ae3dfb
7 changed files with 1949 additions and 13 deletions

4
.gitignore vendored
View File

@ -23,3 +23,7 @@ sqlite.db
dist/ dist/
release/ release/
out-tsc/ out-tsc/
ffmpeg/
locale.source.xlf
package-lock.json
test.*

View File

@ -70,11 +70,14 @@ docker run \
-p 80:80 \ -p 80:80 \
-e NODE_ENV=production \ -e NODE_ENV=production \
-v <path to your config file folder>/config.json:/pigallery2-release/config.json \ -v <path to your config file folder>/config.json:/pigallery2-release/config.json \
-v <path to your db file folder>/sqlite.db:/pigallery2-release/sqlite.db \
-v <path to your images folder>:/pigallery2-release/demo/images \ -v <path to your images folder>:/pigallery2-release/demo/images \
-v <path to your temp folder>:/pigallery2-release/demo/TEMP \ -v <path to your temp folder>:/pigallery2-release/demo/TEMP \
bpatrik/pigallery2:1.5.5-stretch bpatrik/pigallery2:1.5.5-stretch
``` ```
Make sure that a file at `<path to your config file folder>/config.json` exists before running it. Make sure that a file at `<path to your config file folder>/config.json` and `sqlite.db` files exists before running it.
You do not need the `<path to your db file folder>/sqlite.db` line if you don't use the sqlite database.
After the container is up and running, you go to `http://localhost` and log in with user: `admin` pass: `admin` and set up the page in the settings. After the container is up and running, you go to `http://localhost` and log in with user: `admin` pass: `admin` and set up the page in the settings.
@ -133,6 +136,9 @@ apt-get install build-essential libkrb5-dev gcc g++
## 3. Feature list ## 3. Feature list
* supported formats:
* images: **jpg, jpeg, jpe, webp, png, gif, svg**
* videos: **mp4, ogg, ogv, webm**
* **Rendering directories as it is** * **Rendering directories as it is**
* Listing subdirectories recursively * Listing subdirectories recursively
* Listing photos in a nice grid layout * Listing photos in a nice grid layout

View File

@ -15,14 +15,11 @@ export class DiskMangerWorker {
private static readonly SupportedEXT = { private static readonly SupportedEXT = {
photo: [ photo: [
'.bmp',
'.gif', '.gif',
'.jpeg', '.jpg', '.jpe', '.jpeg', '.jpg', '.jpe',
'.png', '.png',
'.tiff', '.tif',
'.webp', '.webp',
'.ico', '.svg'
'.tga'
], ],
video: [ video: [
'.mp4', '.mp4',

View File

@ -36,7 +36,7 @@ export class GalleryRouter {
private static addGetImage(app: Express) { private static addGetImage(app: Express) {
app.get(['/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))'], app.get(['/api/gallery/content/:mediaPath(*\.(jpg|jpeg|jpe|webp|png|gif|svg))'],
AuthenticationMWs.authenticate, AuthenticationMWs.authenticate,
// TODO: authorize path // TODO: authorize path
GalleryMWs.loadFile, GalleryMWs.loadFile,
@ -73,7 +73,7 @@ export class GalleryRouter {
} }
private static addGetImageThumbnail(app: Express) { private static addGetImageThumbnail(app: Express) {
app.get('/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))/thumbnail/:size?', app.get('/api/gallery/content/:mediaPath(*\.(jpg|jpeg|jpe|webp|png|gif|svg))/thumbnail/:size?',
AuthenticationMWs.authenticate, AuthenticationMWs.authenticate,
// TODO: authorize path // TODO: authorize path
GalleryMWs.loadFile, GalleryMWs.loadFile,
@ -93,7 +93,7 @@ export class GalleryRouter {
} }
private static addGetImageIcon(app: Express) { private static addGetImageIcon(app: Express) {
app.get('/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))/icon', app.get('/api/gallery/content/:mediaPath(*\.(jpg|jpeg|jpe|webp|png|gif|svg))/icon',
AuthenticationMWs.authenticate, AuthenticationMWs.authenticate,
// TODO: authorize path // TODO: authorize path
GalleryMWs.loadFile, GalleryMWs.loadFile,

View File

@ -16,11 +16,17 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131201011-1"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-131201011-1"></script>
<script> <script>
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date()); gtag('js', new Date());
gtag('config', 'UA-131201011-1'); gtag('config', 'UA-131201011-1');
</script> </script>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head> </head>
<body class="text-center"> <body class="text-center">
@ -30,8 +36,10 @@
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column "> <div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column ">
<header class="masthead"> <header class="masthead">
<div class="inner"> <div class="inner">
<h3 class="masthead-brand"><img src="assets/icon_inv.png" width="30" height="30" class="d-inline-block align-top" <h3 class="masthead-brand">
alt=""> PiGallery 2</h3> <img src="assets/icon_inv.png" width="30" height="30" class="d-inline-block align-top"
alt=""> PiGallery 2
</h3>
<nav class="nav nav-masthead justify-content-center"> <nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.html">Features</a> <a class="nav-link active" href="index.html">Features</a>
<a class="nav-link" href="https://github.com/bpatrik/pigallery2">Install</a> <a class="nav-link" href="https://github.com/bpatrik/pigallery2">Install</a>
@ -46,7 +54,17 @@
PiGallery 2 is a self-hosted directory-first photo gallery website. PiGallery 2 is a self-hosted directory-first photo gallery website.
</h3> </h3>
<a href="https://pigallery2.herokuapp.com/">Try our live demo! <span class="small">(First load may take up 30s, while the server boots up)</span></a> <a href="https://pigallery2.herokuapp.com/">Try our live demo! <span class="small">(First load may take up 30s, while the server boots up)</span></a>
</div> </div>
</div>
<div class="github-button-wrapper">
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/bpatrik/pigallery2" data-size="large" data-icon="octicon-star"
data-show-count="true" aria-label="Star bpatrik/pigallery2 on GitHub">Star</a>
<!-- Place this tag where you want the button to render. -->
<a class="github-button" href="https://github.com/bpatrik/pigallery2/fork" data-size="large" data-icon="octicon-repo-forked"
data-show-count="true" aria-label="Fork bpatrik/pigallery2 on GitHub">Fork</a>
</div> </div>
<img class="banner-photo" src="assets/main_page.jpg" style="width: 100%"> <img class="banner-photo" src="assets/main_page.jpg" style="width: 100%">
<div class="row"> <div class="row">
@ -142,6 +160,12 @@
<h3 class="section-header">All features:</h3> <h3 class="section-header">All features:</h3>
<hr/> <hr/>
<ul class="text-left"> <ul class="text-left">
<li>supported formats:
<ul>
<li>images: <strong>jpg, jpeg, jpe, webp, png, gif, svg</strong></li>
<li>videos: <strong>mp4, ogg, ogv, webm</strong></li>
</ul>
</li>
<li><strong>Rendering directories as it is</strong> <li><strong>Rendering directories as it is</strong>
<ul> <ul>
<li>Listing subdirectories recursively</li> <li>Listing subdirectories recursively</li>

View File

@ -129,8 +129,10 @@ hr{
background: white; background: white;
margin-top: 0; margin-top: 0;
} }
.github-button-wrapper{
margin-top: 10px;
float: right;
}
.banner-photo{ .banner-photo{
margin-top: 30px;
margin-bottom: 30px; margin-bottom: 30px;
} }

File diff suppressed because it is too large Load Diff