ryuko

image effect service for elixire instances.

install

shards build --progress --release

build ryuko effects

build dependencies (on the machine running ./build_effects.sh):

runtime dependencies (on the machine running ryuko):

./build_effects.sh

running

env CRYSTAL_ENV=debug ELIXIRE_URL=http://localhost:9090 NGINX=1 ./bin/ryuko

available env variables

operational concerns

ryuko stores cached versions of the images with its effects applied in /tmp/ryuko.

there is a janitor task that cleans up that directory off images that are deemed old enough (configurable via the MAX_CACHE_MIN variable).

it is important to check the mount flags set for /tmp so that it can't grow over desirable limits.

nginx configuration

it is highly recommended to deploy ryuko behind a reverse proxy such as nginx.

assumes:

    map $request_uri $proxy_pass_elixire_img_port {
        default 8081;

        # only match ryuko if "?effect" is in the original request url
        "~*\?effect" 3000;
    }

    server {
        <...>

        location / {
            proxy_set_header Host $http_host;
            proxy_pass http://localhost:8081;
        }

        location /i {
            proxy_set_header Host $http_host;

            # ryuko only acts on /i/ and even when only when an effect is needed
            proxy_pass http://127.0.0.1:$proxy_pass_elixire_img_port;
        }

    }