Skip to content

Commit

Permalink
loris2 => loris
Browse files Browse the repository at this point in the history
  • Loading branch information
bcail committed Nov 11, 2020
1 parent 36b4486 commit 2b01de0
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion bin/loris-cache_clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# CAUTION - This script deletes files. Be careful where you point it!
#

LOG="/var/log/loris2/cache_clean.log"
LOG="/var/log/loris/cache_clean.log"

echo -ne "$(date +[%c]) " >> $LOG
echo "starting" >> $LOG
Expand Down
6 changes: 3 additions & 3 deletions doc/apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ ExpiresDefault "access plus 5184000 seconds"
AllowEncodedSlashes On
WSGIDaemonProcess loris2 user=loris group=loris processes=10 threads=15 maximum-requests=10000
WSGIScriptAlias /loris /var/www/loris2/loris2.wsgi
WSGIProcessGroup loris2
WSGIDaemonProcess loris user=loris group=loris processes=10 threads=15 maximum-requests=10000
WSGIScriptAlias /loris /var/www/loris/loris.wsgi
WSGIProcessGroup loris
```

Explanation:
Expand Down
4 changes: 2 additions & 2 deletions doc/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Configuration and Options
=========================

See `etc/loris2.conf`.
See `etc/loris.conf`.

In addition to a bunch of directory paths (items that end with `_dp`) which should be self-explanatory and the [transformation options explained below](#image-transformations), there are some options:

Expand Down Expand Up @@ -76,4 +76,4 @@ To use this option, you need to install Pillow/PIL with [Little CMS](http://www.

Proceed to [Cache Maintenance](cache_maintenance.md) or go [Back to README](../README.md)

[string interpolation]: http://www.voidspace.org.uk/python/configobj.html#string-interpolation
[string interpolation]: http://www.voidspace.org.uk/python/configobj.html#string-interpolation
6 changes: 3 additions & 3 deletions doc/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ config = {

which is then available in the `config` attribute of the application. The sub-dictionaries are then used to configure other objects, by passing the values of individual entries or just the entire dict, depending on how complex the situation is. Generally, the naming conventions and principals behind how this is intended to work should be clear.

__N.B.:__ When developing or extending, i.e., instantiating the application instance in debug mode (by calling `webapp.create_app(debug=True)`), __some properties in `etc/loris.conf` are overridden in the `create_app` function__. This is done so that we can calculate some locations based on the application directory. Therefore, if you need to add additional configuration, e.g. in your resolver or transformations, you may need to add/set them in two places if you want an option to be different when developing/running tests: in `etc/loris2.conf` and in the first `if` block of `webapp.create_app`.
__N.B.:__ When developing or extending, i.e., instantiating the application instance in debug mode (by calling `webapp.create_app(debug=True)`), __some properties in `etc/loris.conf` are overridden in the `create_app` function__. This is done so that we can calculate some locations based on the application directory. Therefore, if you need to add additional configuration, e.g. in your resolver or transformations, you may need to add/set them in two places if you want an option to be different when developing/running tests: in `etc/loris.conf` and in the first `if` block of `webapp.create_app`.

Running Tests
-------------
Expand Down Expand Up @@ -69,11 +69,11 @@ Using the Development Server

Image Transformations
---------------------
Loris is designed to make it possible for you to implement image transformations using any libraries or utilities you choose. The transformers are loaded dynamically at startup, and are configured in `etc/loris2.conf`. See `transforms.py` for details. Transformers for JPEG, TIFF, GIF, and JP2 (JP2 as long as you provide the Kakadu dependencies) using Pillow are provided.
Loris is designed to make it possible for you to implement image transformations using any libraries or utilities you choose. The transformers are loaded dynamically at startup, and are configured in `etc/loris.conf`. See `transforms.py` for details. Transformers for JPEG, TIFF, GIF, and JP2 (JP2 as long as you provide the Kakadu dependencies) using Pillow are provided.

More about this. Every `_AbstractTransformer` implementation must implement a `transform()` method that receives the path to the source file (`src_fp`), the path to where the output file should go (`target_fp`), and an instance of an `img.ImageRequest` object. This object should contain all of the attributes you could ever possbily need for working with an image library. See `img.ImageRequest.__slots__` for details.

`[transforms][[{fmt}]]` is the naming convention for of these sections in `etc/loris2.conf`. This MUST be followed, and {fmy} MUST be one of the extension strings listed in the IIIF Image API specification.
`[transforms][[{fmt}]]` is the naming convention for of these sections in `etc/loris.conf`. This MUST be followed, and {fmy} MUST be one of the extension strings listed in the IIIF Image API specification.

Every section requires an `impl` key, and any other options provided will be automatically be available to the impl in its config dictionary.

Expand Down
6 changes: 3 additions & 3 deletions doc/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ Just before the closing of the last '}' bracket, add:

This will load the reverse-proxy configuration stored in the loris.conf you created.

Create a new file called `loris.wsgi` and place it, for instance, inside the `/var/www/loris2` folder. Open it with your editor of choice, and populate it with the following code:
Create a new file called `loris.wsgi` and place it, for instance, inside the `/var/www/loris` folder. Open it with your editor of choice, and populate it with the following code:

```
#!/your/python/path python
#-*- coding: utf-8 -*-
from loris.webapp import create_app
application = create_app(debug=False, config_file_path='/root/python_ve/loris/etc/loris2.conf')
application = create_app(debug=False, config_file_path='/root/python_ve/loris/etc/loris.conf')
```

Now create a new file called `uwsgi.ini` and place it wherever you want. Its content will be:
Expand All @@ -54,7 +54,7 @@ Now create a new file called `uwsgi.ini` and place it wherever you want. Its con
[uwsgi]
http-socket = :8888
processes = 16
wsgi-file = /var/www/loris2/loris.wsgi # or wherever your loris.wsgi is.
wsgi-file = /var/www/loris/loris.wsgi # or wherever your loris.wsgi is.
```

Now you're ready to launch your application:
Expand Down
16 changes: 8 additions & 8 deletions doc/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Create a user that will own the loris application, e.g.:
$ sudo adduser loris
```

This user needs to have a home directory (unless you want to override it in the WSGI [`home=` directive](https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess)) and the user and group name should match the `run_as_user` and `run_as_group` options in the `[loris.Loris]` section of `loris2.conf` and the `--loris-owner` and `--loris-group` options that you pass to `setup.py` (see below).
This user needs to have a home directory (unless you want to override it in the WSGI [`home=` directive](https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess)) and the user and group name should match the `run_as_user` and `run_as_group` options in the `[loris.Loris]` section of `loris.conf` and the `--loris-owner` and `--loris-group` options that you pass to `setup.py` (see below).

Finally, from the `loris` (not `loris/loris`) directory, run

Expand All @@ -25,13 +25,13 @@ There are a bunch of flags that can be passed to `setup.py install` to customize
```
--kdu-expand Path to the Kakadu executable [Default: /usr/local/bin/kdu_expand]
--libkdu Path to __the directory that contains__ libkdu.so [Default: /usr/local/lib]
--image-cache Path to image cache directory [Default: /var/cache/loris2]
--tmp-dir Path to temporary directory (loris will make its temporary files and pipes here) [Default: /tmp/loris2]
--www-dir Path to www directory (wsgi and index file will be here) [Default: /var/www/loris2]
--log-dir Path to directory for logs [Default: /var/log/loris2]
--image-cache Path to image cache directory [Default: /var/cache/loris]
--tmp-dir Path to temporary directory (loris will make its temporary files and pipes here) [Default: /tmp/loris]
--www-dir Path to www directory (wsgi and index file will be here) [Default: /var/www/loris]
--log-dir Path to directory for logs [Default: /var/log/loris]
--source-images Path to source images directory [Default: /usr/local/share/images]
--config-dir Where to put the config file. loris2.conf will be here after install. [Default: /etc/loris2]
--info-cache Path to info cache directory [Default: /var/cache/loris2]
--config-dir Where to put the config file. loris.conf will be here after install. [Default: /etc/loris]
--info-cache Path to info cache directory [Default: /var/cache/loris]
--loris-owner User that will own the application and has permission to write to caches. [Default: loris]
--loris-group Group that will own the application and has permission to write to caches. [Default: loris]
```
Expand All @@ -48,7 +48,7 @@ For Ubuntu 20:

$ sudo python3 ./bin/setup_directories.py

The `loris2.wsgi` WSGI file should now have been created and can be found in the directory that is configured as the `www_dp` directory in the `loris2.conf` file (by default: `/var/www/loris2`).
The `loris.wsgi` WSGI file should now have been created and can be found in the directory that is configured as the `www_dp` directory in the `loris.conf` file (by default: `/var/www/loris`).

Note again that __Kakadu is no longer installed__ by the setup script; it didn't work for too many people. You may use the copy that is bundled with Loris, provided you comply with the [terms outlined by NewSouth Innovations](http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22) and this version works on your system. Either of these may well not be the case, in which case you will need to obtain a copy of Kakadu 7+ separately and may need to compile it for your system.

Expand Down
8 changes: 4 additions & 4 deletions doc/two_lorises.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Deactiveate the virtualenv:
deactivate
```

To /var/www/loris/loris2.wsgi, add:
To /var/www/loris/loris.wsgi, add:

```
# CHANGE /home/jstroop to whatever...
Expand All @@ -112,7 +112,7 @@ To the Apache vhost:
```
# Loris 2
AllowEncodedSlashes On
WSGIDaemonProcess loris2 user=loris group=loris processes=5 threads=5 maximum-requests=10000
WSGIScriptAlias /loris2 /var/www/loris/loris2.wsgi
WSGIProcessGroup loris2
WSGIDaemonProcess loris user=loris group=loris processes=5 threads=5 maximum-requests=10000
WSGIScriptAlias /loris /var/www/loris/loris.wsgi
WSGIProcessGroup loris
```
8 changes: 4 additions & 4 deletions loris/data/loris2.conf → loris/data/loris.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# loris2.conf
# loris.conf
#
# This file is parsed by the ConfigObj library:
#
Expand All @@ -23,8 +23,8 @@
#

[loris.Loris]
tmp_dp = '/tmp/loris2/tmp' # r--
www_dp = '/var/www/loris2' # r-x
tmp_dp = '/tmp/loris/tmp' # r--
www_dp = '/var/www/loris' # r-x
run_as_user = 'loris'
run_as_group = 'loris'
enable_caching = True
Expand All @@ -50,7 +50,7 @@ max_size_above_full = 200
[logging]
log_to = 'file' # 'console'|'file'
log_level = 'INFO' # 'DEBUG'|'INFO'|'WARNING'|'ERROR'|'CRITICAL'
log_dir = '/var/log/loris2' # rw-
log_dir = '/var/log/loris' # rw-
max_size = 5242880 # 5 MB
max_backups = 5
format = '%(asctime)s (%(name)s) [%(levelname)s]: %(message)s'
Expand Down
6 changes: 3 additions & 3 deletions loris/user_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from configobj import ConfigObj


CONFIG_FILE_NAME = 'loris2.conf'
CONFIG_DIR_TARGET_DEFAULT = '/etc/loris2'
WSGI_FILE_NAME = 'loris2.wsgi'
CONFIG_FILE_NAME = 'loris.conf'
CONFIG_DIR_TARGET_DEFAULT = '/etc/loris'
WSGI_FILE_NAME = 'loris.wsgi'


def _data_directory_path():
Expand Down
2 changes: 1 addition & 1 deletion loris/webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_debug_config(debug_jp2_transformer):
# change a few things, read the config and set up logging
project_dp = path.dirname(path.dirname(path.realpath(__file__)))
data_directory = path.join(project_dp, 'loris', 'data')
config_file_path = path.join(data_directory, 'loris2.conf')
config_file_path = path.join(data_directory, 'loris.conf')

config = read_config(config_file_path)

Expand Down

0 comments on commit 2b01de0

Please sign in to comment.