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

Dev/test ci #1

Open
wants to merge 77 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e15da6d
recitale: move log-level optional parameter as argument of subcommands
QSchulz Dec 18, 2021
1db92ac
recitale: video: fix BaseVideo.ratio crashing by casting str to int
QSchulz Dec 23, 2021
8398e3f
recitale: video: fix call of ratio for BaseVideo
QSchulz Dec 23, 2021
38cb01f
recitale: video: factor out ffprobe execution and parsing
QSchulz Dec 23, 2021
aade25e
recitale: video: switch ffprobe parsing from csv to json
QSchulz Dec 23, 2021
0bc7c26
recitale: video: get and expose duration of video
QSchulz Dec 23, 2021
115d31b
recitale: display progress bar when reencoding video
QSchulz Dec 23, 2021
0f1a949
recitale: audio: get and expose duration for audio
QSchulz Dec 23, 2021
4f1c784
recitale: audio: display progressbar when reencoding audio
QSchulz Dec 23, 2021
cf0805c
.coveragerc: display untested lines
QSchulz Dec 31, 2021
c50a6b7
test: make "same" checks for factories check for same object
QSchulz Jan 1, 2022
3c3bef2
test: cover 100% of recitale/audio.py
QSchulz Jan 1, 2022
94d64c8
test: image: improve code coverage by testing BaseImage
QSchulz Jan 1, 2022
c864e40
test: video: improve code coverage by testing BaseVideo
QSchulz Jan 1, 2022
b3b2bed
recitale: utils: migrate from subprocess'ed openssl encryption to pyc…
QSchulz Jan 4, 2022
b731e9f
docs: configuration: explicit that only the HTML is encrypted not media
QSchulz Jan 4, 2022
3bb0f1c
.github: workflows: release: use github.ref_name to get the branch/ta…
QSchulz Jan 6, 2022
0e71ec3
add Dockerfile
QSchulz Jan 6, 2022
e278efe
.github: workflows: release: build, test and push container image to …
QSchulz Jan 6, 2022
357c292
recitale: migrate from path.py to pathlib
QSchulz Dec 18, 2021
a0e694a
v2.0.0a2 release
QSchulz Jan 15, 2022
460ed48
fix URL for github container image
QSchulz Jan 15, 2022
ebcfa00
recitale: cast dpi to make it serializable
QSchulz Feb 6, 2022
b846930
v2.0.0a3 release
QSchulz Feb 19, 2022
3123448
set minimum version of Jinja2
QSchulz May 7, 2022
5f7fb06
recitale: remove with_ Jinja2 extension
QSchulz May 7, 2022
341f972
v2.0.0a4 release
QSchulz May 7, 2022
af61dac
tox.ini: fix flake configuration error
QSchulz Feb 6, 2023
dd3c16a
recitale: exposure: fix video not aligned on thumbnail
QSchulz Feb 2, 2023
d71e41c
recitale: exposure: fix video format in bordered-pictures section
QSchulz Feb 2, 2023
8c26d3f
recitale: exposure: adapt vertical video in pictures-group section
QSchulz Feb 2, 2023
79e7bda
move thumbnail/reencode addition in own function
QSchulz Feb 6, 2023
fa2b41f
handle filenames with spaces
QSchulz Feb 6, 2023
4784083
v2.0.0a5 release
QSchulz Feb 10, 2023
d57e313
fix shlex.quote call on a PosixPath object
fr33tux May 6, 2023
6a0e78c
recitale: autogen: pass a string to glob.glob
QSchulz Mar 2, 2023
acebd7d
recitale: autogen: replace glob.glob by pathlib.Path.glob
QSchulz Mar 2, 2023
7159393
recitale: autogen: close fd after writing
QSchulz Mar 2, 2023
38dc92e
test: add tests for autogen
QSchulz Jul 9, 2023
b98fd29
recitale: share variable with Pool funcs via dict
QSchulz Aug 29, 2023
10b55dc
cache: remove reference to json module
QSchulz Aug 29, 2023
348ab08
recitale: move local function to module namespace
QSchulz Aug 29, 2023
65201a8
use local variable for global cache
QSchulz Aug 29, 2023
bf71f70
recitale: remove unnecessary "test" in DEFAULTS
QSchulz Aug 29, 2023
4c9c6ac
recitale: limit scope of DEFAULTS variable
QSchulz Aug 29, 2023
b7ea1fd
recitale: move parser out of module namespace
QSchulz Aug 29, 2023
0cb4366
autogen: autofill cover gallery setting if missing
QSchulz Aug 26, 2023
5e525a5
autogen: autofill date gallery setting if missing
QSchulz Aug 26, 2023
30960e9
docs: configuration: add doc for show_date root setting
QSchulz Feb 13, 2023
e9b5b25
docs: configuration: document ffmpeg_audio settings
QSchulz Feb 13, 2023
b8da70e
docs: configuration: fix ffmpeg typo
QSchulz Feb 13, 2023
5c4f595
recitale: fix locale date filter when locale unset
QSchulz Aug 31, 2023
7dd93a4
add .vscode to gitignore
sebsto Sep 5, 2023
173b85e
missing closing curly bracket in recitale/themes/light/templates/inde…
sebsto Sep 5, 2023
97ab940
themes: fix author page website link
QSchulz Sep 5, 2023
08797a4
update HTTP links to HTTPS
QSchulz Sep 5, 2023
12a1a79
docs: index: remove such.life
QSchulz Sep 5, 2023
ff54b38
themes: share: remove Google+ links
QSchulz Sep 5, 2023
2fcb6c8
themes: material: index: fix incorrect background URL
QSchulz Sep 5, 2023
0bb497e
dependencies: force ruamel.yaml older than 0.18.0
QSchulz Dec 30, 2023
23d2d39
themes: material: style-page.css: make caption 100% of bordered-picture
QSchulz Dec 30, 2023
d21ecd9
tox: avoid bringing in pre-release versions
QSchulz Dec 30, 2023
3e965fa
tests: image: fix incorrect assertion test
QSchulz Dec 30, 2023
5101fcb
v2.0.0a6 release
QSchulz Dec 30, 2023
ca136fc
themes: exposure: style-page.css: make caption 100% of bordered-picture
QSchulz Dec 30, 2023
7a1e1bc
themes: exposure: fix video URL covers for subgalleries
QSchulz Dec 30, 2023
5c27c48
autogen: include seconds in date format
QSchulz Dec 31, 2023
3429d71
test: autogen: use non-zero number for seconds in exif field
QSchulz Jan 2, 2024
1a5b830
DO NOT MERGE: only to check CI still works without changes
QSchulz Nov 19, 2024
8a641e8
DO NOT MERGE: try with newer actions?
QSchulz Nov 19, 2024
f78eaa3
DO NOT MERGE: try python 3.13?
QSchulz Nov 19, 2024
8d5dcdb
DO NOT MERGE: maybe ubuntu's the culprit??
QSchulz Nov 19, 2024
251c38e
DO NOT MERGE: add debugging
QSchulz Nov 19, 2024
76c82e8
DO NOT MERGE: log array
QSchulz Nov 19, 2024
3020ed0
DO NOT MERGE: print get_exif
QSchulz Nov 19, 2024
9072109
fixup! DO NOT MERGE: print get_exif
QSchulz Nov 19, 2024
3874f65
DO NOT MERGE: increase log level of pyest
QSchulz Nov 19, 2024
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
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ exclude_lines =
raise NotImplementedError
if __name__ == .__main__.:
ignore_errors = True
show_missing = True
16 changes: 8 additions & 8 deletions .github/workflows/devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ on: [push, pull_request]

jobs:
tox:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
set -xe
Expand All @@ -23,12 +23,12 @@ jobs:
verbose: true

build-example:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.13'
- name: Install dependencies
run: |
set -xe
Expand Down
45 changes: 41 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,55 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

notification:
container:
if: ${{ github.repository == 'recitale/recitale' }}
needs: pypi-package
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v2
with:
build-args: VERSION=${{ github.ref_name }}
context: containers
load: true
pull: true
tags: ${{ github.repository }}:test
- name: Minimal test
run: |
docker run --rm -v $PWD/example:/var/www ${{ github.repository }}:test build
- name: Build and push
uses: docker/build-push-action@v2
with:
build-args: VERSION=${{ github.ref_name }}
context: containers
pull: true
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.ref_name }}

notification:
if: ${{ github.repository == 'recitale/recitale' }}
needs: [pypi-package, container]
runs-on: ubuntu-latest
name: Notifications
steps:
- name: Put release tag into env
run: echo "VERSION_TAG=$( echo $GITHUB_REF | grep --only-matching '[^/]*$' )" >> $GITHUB_ENV
- name: IRC notification
uses: Gottox/irc-message-action@v2
with:
channel: '#recitale'
nickname: github-bot
message: |-
recitale ${{ env.VERSION_TAG }} was just released. See ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.VERSION_TAG }} for the release notes.
recitale ${{ github.ref_name }} was just released. See ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }} for the release notes.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ Sessionx.vim
tags
# Persistent undo
[._]*.un~

# VS Code
.vscode
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ graft recitale/themes

prune example
exclude example
prune containers
exclude containers
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<img src="logo.png">
</p>

PLEP

![GitHub](https://img.shields.io/github/license/recitale/recitale?color=brightgreen)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/recitale)
![PyPI - Status](https://img.shields.io/pypi/status/recitale)
Expand All @@ -25,7 +27,7 @@ recitale is sections oriented, make it very flexible, many kinds of section alre
* Paragraph
* Iframe (Youtube, Maps, etc..)
* Quote
* [And more](http://recitale.readthedocs.io/en/latest/sections.html)
* [And more](https://recitale.readthedocs.io/en/latest/sections.html)

Important note: This project is considered in alpha state. There may be significant changes in configuration files, API or user interface at any time.

Expand Down Expand Up @@ -55,10 +57,10 @@ recitale currently supports:

You can find example usages here:

* http://surleschemins.fr
* http://media.faimaison.net/photos/galerie/
* https://surleschemins.fr
* https://media.faimaison.net/photos/galerie/
* https://www.thebrownianmovement.org/
* http://outside.browny.pink
* https://outside.browny.pink
* http://www.street-art.me

## Code example
Expand Down Expand Up @@ -106,17 +108,23 @@ Options:
--version Show version.
```

## Docker
## Container

A container image is available at ghcr.io/recitale/recitale. One can build their website by running the following command:

```
docker run --rm -v <PATH_TO_GALLERY_SOURCE>:/var/www ghcr.io/recitale/recitale build
```

https://hub.docker.com/r/beudbeud/prosopopee/
See https://github.com/recitale/recitale/pkgs/container/recitale for fetching instructions and the list of all available images.

## Licence

GPL-3.0+

## Documentation

http://recitale.readthedocs.org/en/latest/
https://recitale.readthedocs.org/en/latest/

## IRC

Expand Down
13 changes: 13 additions & 0 deletions containers/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from python:slim-bullseye

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y ffmpeg

ARG VERSION

RUN python3 -m pip install -U recitale==$VERSION

RUN mkdir /var/www/

WORKDIR /var/www/

ENTRYPOINT ["recitale"]
2 changes: 1 addition & 1 deletion docs/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You need
1. Create a folder
2. Put all pics you want
3. Create settings.yaml file in the folder
4. Add title, date and cover key in folder/settings.yaml
4. Add title key in folder/settings.yaml. Optionally provide a cover and date key, otherwise they are inferred from the oldest file in the gallery.
5. Use `recitale autogen -d folder`


Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Thx to all new contributors!
0.6 (2017-07-14)

* Compatibility python 2 and 3
* Possibility to add custom css and js http://prosopopee.readthedocs.io/en/latest/theming.html
* Possibility to add custom css and js https://prosopopee.readthedocs.io/en/latest/theming.html
* Add reverse option by titoko https://prosopopee.readthedocs.io/en/latest/configuration.html#reverse

0.5 (2017-06-04)
Expand Down
43 changes: 42 additions & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ recitale can use ffmpeg or libav and each can be configured if needed::
video: "libvpx"
other: "-qmin 10 -qmax 42 -maxrate 500k -bufsize 1500k"

The meaning of the currently supported FFMEG or LIBAV's settings is as follows :
The meaning of the currently supported FFMPEG or LIBAV's settings is as follows:

* `binary` sets the binary to use to convert the video (ffmpeg or avconv)
* `loglevel` sets the logging level used by the library
Expand All @@ -131,6 +131,36 @@ example for MP4::
video: "libx264"
extension: mp4

Audio converter
~~~~~~~~~~~~~~~

recitale can use ffmpeg to reencode audio and can be configured if needed::

title: Gallery
settings:
ffmpeg_audio:
binary: "ffmpeg"
loglevel: "error"
audio: "libvorbis"
extension: "mp3"

The meaning of the currently supported FFMPEG settings is as follows:

* `binary` sets the binary to use to convert the audio (ffmpeg by default)
* `loglevel` sets the logging level used by the library
* `audio` sets the audio codec
* `extension` sets the extension of output file

example for MP3::

title: Gallery
settings:
ffmpeg_audio:
binary: "ffmpeg"
loglevel: "error"
audio: "libmp3lame"
extension: "mp3"

Light Mode
~~~~~~~~~~

Expand Down Expand Up @@ -256,6 +286,8 @@ If you want to protect all the website by password::
title: Gallery
password: my_super_password

Please note that only the HTML page will be password-protected. Media content such as images, videos and audio files can still be accessed without password if someone knows or guesses their URL inside a password-protected gallery.

Date locale
~~~~~~~~~~~

Expand All @@ -268,6 +300,15 @@ If you want to use non-based on LC_TIME locale for human-readable dates on galle
settings:
date_locale: ru_RU

Hide gallery date
~~~~~~~~~~~~~~~~~

By default, recitale shows dates for all galleries in the landing page, just below each gallery title. However, you can hide it by setting the "show_date" setting to "False" in **root** settings.yaml::

title: My exploration of the outside world
sub_title: it's a scary place, don't go there
show_date: False

Gallery settings.yaml
---------------------

Expand Down
7 changes: 3 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ For those of you who don't know what exposure.co is, it allows you to tell a sto

You can find example usages here:

* http://surleschemins.fr
* http://media.faimaison.net/photos/galerie/
* https://surleschemins.fr
* https://media.faimaison.net/photos/galerie/
* https://www.thebrownianmovement.org/
* http://outside.browny.pink
* http://such.life
* https://outside.browny.pink
* http://www.street-art.me

Why
Expand Down
14 changes: 5 additions & 9 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,11 @@ Installation in virtualenv

pip3 install recitale

Docker
------
Container
---------

Get the Docker image::
A container image is available at ghcr.io/recitale/recitale. One can build their website by running the following command::

docker pull beudbeud/prosopopee

Run::
docker run --rm -v <PATH_TO_GALLERY_SOURCE>:/var/www ghcr.io/recitale/recitale build

docker run --rm -v $(pwd):/site beudbeud/prosopopee

More informations https://hub.docker.com/r/beudbeud/prosopopee/
See https://github.com/recitale/recitale/pkgs/container/recitale for fetching instructions and the list of all available images.
2 changes: 1 addition & 1 deletion example/settings-menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ title: "Example gallery"
menu:
- about: "About"
- first_gallery: "My first gallery"
- http://twitter.com: "Twitter"
- https://twitter.com: "Twitter"
2 changes: 1 addition & 1 deletion recitale/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0a1"
__version__ = "2.0.0a6"
37 changes: 34 additions & 3 deletions recitale/audio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import logging
import shlex
import subprocess
import urllib.parse

from json import dumps as json_dumps
from json import loads as json_loads
from pathlib import Path
from zlib import crc32

Expand All @@ -10,7 +14,31 @@
logger = logging.getLogger("recitale." + __name__)


class Reencode:
class AudioCommon:
def __get_infos(self):
if AudioFactory.global_options["binary"] == "ffmpeg":
binary = "ffprobe"
else:
binary = "avprobe"
command = (
binary
+ " -v error -show_entries format=duration "
+ " -print_format json=compact=1 "
+ shlex.quote(str(self.filepath))
)
out = subprocess.check_output(shlex.split(command))
infos = json_loads(out)
self.dur = float(infos["format"]["duration"])

@property
def duration(self):
if not hasattr(self, "dur"):
self.__get_infos()

return self.dur


class Reencode(AudioCommon):
def __init__(self, base_filepath, base_id, extension):
self.filepath = self.__filepath(base_filepath, base_id, "." + extension)

Expand All @@ -24,7 +52,7 @@ def __filepath(self, base_filepath, base_id, extension):
return p.parent / (p.stem + suffix)


class BaseAudio:
class BaseAudio(AudioCommon):
def __init__(self, filepath, global_options):
self.reencodes = dict()
self.options = global_options.copy()
Expand All @@ -34,9 +62,12 @@ def __init__(self, filepath, global_options):
bytes(json_dumps(self.options, sort_keys=True), "utf-8")
)

def _add_reencode(self, reencode):
return self.reencodes.setdefault(reencode.filepath, reencode)

def reencode(self):
reencode = Reencode(self.filepath, self.chksum_opt, self.options["extension"])
return self.reencodes.setdefault(reencode.filepath, reencode).filepath.name
return urllib.parse.quote(self._add_reencode(reencode).filepath.name)


# TODO: add support for looking into parent directories (name: ../other_gallery/pic.jpg)
Expand Down
Loading
Loading