├── local.gen
├── model
├── __init__.py
├── aws.py
└── files.py
├── requirements.txt
├── img
├── favicon.ico
├── bg-color-bar.png
└── logo-iiif-34x30.png
├── css
├── themes
│ ├── proton
│ │ ├── 30px.png
│ │ ├── 32px.png
│ │ ├── throbber.gif
│ │ ├── fonts
│ │ │ └── titillium
│ │ │ │ ├── titilliumweb-bold-webfont.eot
│ │ │ │ ├── titilliumweb-bold-webfont.ttf
│ │ │ │ ├── titilliumweb-bold-webfont.woff
│ │ │ │ ├── titilliumweb-regular-webfont.eot
│ │ │ │ ├── titilliumweb-regular-webfont.ttf
│ │ │ │ ├── titilliumweb-regular-webfont.woff
│ │ │ │ ├── titilliumweb-extralight-webfont.eot
│ │ │ │ ├── titilliumweb-extralight-webfont.ttf
│ │ │ │ └── titilliumweb-extralight-webfont.woff
│ │ ├── style.min.css
│ │ └── style.css
│ └── default
│ │ ├── 30px.png
│ │ ├── 32px.png
│ │ ├── 40px.png
│ │ ├── throbber.gif
│ │ ├── style.min.css
│ │ └── style.css
├── normalize.min.css
└── main.css
├── runDocker.sh
├── app.wsgi
├── tests
├── fixtures
│ ├── existing_metadata.json
│ ├── video_desc_only.json
│ └── video_desc_metadata.json
└── TestSuite.py
├── Dockerfile
├── README.md
├── views
├── footer.tpl
├── header.tpl
├── index.tpl
└── info.tpl
├── index.py
├── apache.conf
├── .gitignore
└── LICENSE
/local.gen:
--------------------------------------------------------------------------------
1 | en_US.UTF-8 UTF-8
2 |
--------------------------------------------------------------------------------
/model/__init__.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | boto3
2 | bottle
3 | pymediainfo
4 |
--------------------------------------------------------------------------------
/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/img/favicon.ico
--------------------------------------------------------------------------------
/img/bg-color-bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/img/bg-color-bar.png
--------------------------------------------------------------------------------
/img/logo-iiif-34x30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/img/logo-iiif-34x30.png
--------------------------------------------------------------------------------
/css/themes/proton/30px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/30px.png
--------------------------------------------------------------------------------
/css/themes/proton/32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/32px.png
--------------------------------------------------------------------------------
/css/themes/default/30px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/default/30px.png
--------------------------------------------------------------------------------
/css/themes/default/32px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/default/32px.png
--------------------------------------------------------------------------------
/css/themes/default/40px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/default/40px.png
--------------------------------------------------------------------------------
/css/themes/default/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/default/throbber.gif
--------------------------------------------------------------------------------
/css/themes/proton/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/throbber.gif
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.eot
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.ttf
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.woff
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.eot
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.ttf
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.woff
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.eot
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf
--------------------------------------------------------------------------------
/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/IIIF/fixtures/master/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.woff
--------------------------------------------------------------------------------
/runDocker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | docker build -t iiif-fixtures . && docker run -it --rm -p 8000:80 -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" --name iiif-fixtures iiif-fixtures:latest
4 |
--------------------------------------------------------------------------------
/app.wsgi:
--------------------------------------------------------------------------------
1 | import os
2 | # Change working directory so relative paths (and template lookup) work again
3 | os.chdir(os.path.dirname(__file__))
4 | import sys
5 | print (sys.path)
6 | import bottle
7 | # ... build or import your bottle application here ...
8 | import index
9 | # Do NOT use bottle.run() with mod_wsgi
10 | application = bottle.default_app()
11 |
--------------------------------------------------------------------------------
/tests/fixtures/existing_metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "images/Glen/photos/gottingen.jpg": {
3 | "title": "Picture of Göttingen taken during the 2019 IIIF Conference",
4 | "source": "Picture taken by the IIIF Technical Coordinator",
5 | "attribution": "Glen Robson, IIIF Technical Coordinator. [CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0)]"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM srittau/wsgi-base:latest
2 |
3 | RUN apt-get -y install mediainfo
4 | WORKDIR /app/pylibs
5 | COPY requirements.txt ./
6 | RUN /app/virtualenv/bin/pip install -r requirements.txt
7 | RUN mkdir /app/www-data
8 | RUN a2enmod proxy proxy_http proxy_http2 rewrite headers
9 | RUN chmod 777 .
10 |
11 | COPY . .
12 | RUN if test -f "files.json"; then chmod 777 files.json; fi
13 |
14 | RUN ln -sf /dev/stdout /var/log/apache2/access.log && ln -sf /dev/stderr /var/log/apache2/error.log
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | ## Architecture
8 |
9 | To make responses quicker the filesystem layout is stored in the following file:
10 |
11 | * files.json
12 |
13 | This is generated on boot and then updated by subscribing to the SQS topic for the bucket. The SQS messages are generated when there is a change to the underlying s3 bucket. More info:
14 |
15 | * [S3 Notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html)
16 | * [Python client](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs-example-sending-receiving-msgs.html)
17 |
--------------------------------------------------------------------------------
/model/aws.py:
--------------------------------------------------------------------------------
1 | #!`which python3`
2 |
3 | import os
4 | import boto3
5 |
6 | class AWS:
7 | def __init__(self):
8 | if 'AWS_ACCESS_KEY_ID' in os.environ and 'AWS_SECRET_ACCESS_KEY' in os.environ:
9 | self.session = boto3.Session(aws_access_key_id=os.environ['AWS_ACCESS_KEY_ID'], aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY'])
10 | else:
11 | self.session = boto3.Session()
12 |
13 | def s3(self):
14 | return self.session.resource('s3')
15 |
16 | def client(self, service, region='us-east-1'):
17 | return self.session.client(service, region_name=region)
18 |
--------------------------------------------------------------------------------
/tests/fixtures/video_desc_only.json:
--------------------------------------------------------------------------------
1 | {
2 | "video/indiana/30-minute-clock/medium/30-minute-clock.mp4": {
3 | "metadata": {
4 | "description": {
5 | "title": "30 minute clock",
6 | "source": "The video was created by DrLex1 and was released using a Creative Commons Attribution license",
7 | "attribution": "http://creativecommons.org/licenses/by/3.0/",
8 | "source_url": "https://www.youtube.com/watch?v=Lsq0FiXjGHg",
9 | "description": "Attribution must be added to recipes and manifests that use this video."
10 | }
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/views/footer.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |