Skip to content

Commit

Permalink
Update for changes to Crayfish
Browse files Browse the repository at this point in the history
  • Loading branch information
whikloj committed Nov 3, 2021
1 parent d5dfac3 commit db166ba
Show file tree
Hide file tree
Showing 41 changed files with 572 additions and 184 deletions.
2 changes: 1 addition & 1 deletion inventory/vagrant/group_vars/crayfish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
crayfish_version_tag: dev
crayfish_version_tag: issue-1224
crayfish_db: "{{ claw_db }}"

crayfish_fedora_base_url: "http://{{ hostvars[groups['tomcat'][0]].ansible_host }}:8080/fcrepo/rest"
Expand Down
48 changes: 19 additions & 29 deletions roles/internal/Islandora-Devops.crayfish/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ crayfish_services:
- Homarus
- Recast

# Temporary to allow Silex/Symfony 4 differences
crayfish_silex_services:
- Milliner
- Hypercube
- Homarus
- Recast

crayfish_symfony_services:
- Houdini

crayfish_install_dir: /var/www/html/Crayfish

crayfish_syn_token: islandora
Expand Down Expand Up @@ -69,6 +59,7 @@ crayfish_milliner_fedora_base_url: "{{ crayfish_fedora_base_url }}"
crayfish_milliner_drupal_base_url: "{{ crayfish_drupal_base_url }}"
crayfish_milliner_modified_date_predicate: http://schema.org/dateModified
crayfish_milliner_strip_format_jsonld: true
crayfish_milliner_is_fedora_6: true

# OS Dependent variables set in vars can be overridden here
# crayfish_user: www-data
Expand All @@ -91,26 +82,25 @@ crayfish_homarus_fedora_base_url: "{{ crayfish_fedora_base_url }}"

crayfish_homarus_executable_config:
executable: ffmpeg
mime_types:
valid:
- video/mp4
- video/x-msvideo
- video/ogg
- audio/x-wav
- audio/mpeg
- audio/aac
- image/jpeg
default: video/mp4
mime_to_format:
formats:
valid:
- video/mp4_mp4
- video/x-msvideo_avi
- video/ogg_ogg
- audio/x-wav_wav
- audio/mpeg_mp3
- audio/aac_m4a
- image/jpeg_image2pipe
default: mp4
- mimetype: video/mp4
format: mp4
- mimetype: video/x-msvideo
format: avi
- mimetype: video/ogg
format: ogg
- mimetype: audio/x-wav
format: wav
- mimetype: audio/mpeg
format: mp3
- mimetype: audio/aac
format: m4a
- mimetype: image/jpeg
format: image2pipe
default:
mimetype: video/mp4
format: mp4

# recast
crayfish_recast_log_file: /var/log/islandora/recast.log
Expand Down
10 changes: 2 additions & 8 deletions roles/internal/Islandora-Devops.crayfish/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

- name: Install crayfish code
git:
repo: https://github.com/Islandora/Crayfish.git
repo: https://github.com/whikloj/Crayfish.git
dest: "{{ crayfish_install_dir }}"
version: "{{ crayfish_version_tag }}"
force: yes
Expand All @@ -52,15 +52,9 @@
src: "syn-settings.xml.jp2"
dest: "{{ crayfish_install_dir }}/syn-settings.xml"

- name: Configure crayfish code (Silex)
template:
src: "{{ item }}.config.yaml.j2"
dest: "{{ crayfish_install_dir }}/{{ item }}/cfg/config.yaml"
with_items: "{{ crayfish_silex_services }}"

- name: Configure crayfish code (Symfony)
include_tasks: "./tasks/symfony_config.yml"
with_items: "{{ crayfish_symfony_services }}"
with_items: "{{ crayfish_services }}"

- name: Create Islandora log dir
file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
- name: Verify/Create Symfony config directories
file:
state: directory
dest: '{{ crayfish_install_dir }}/{{ crayfish_loop }}/config/{{ item.path }}'
dest: '{{ crayfish_install_dir }}/{{ crayfish_loop }}/config/{{ item_path.path }}'
with_filetree: '../templates/{{ crayfish_loop }}'
when: item.state == 'directory'
loop_control:
loop_var: 'item_path'
when: item_path.state == 'directory'

- name: Template Symfony config files
template:
src: '{{ item.src }}'
dest: '{{ crayfish_install_dir }}/{{ crayfish_loop }}/config/{% if item.path.endswith(".j2") %}{{ item.path[:-3] }}{% else %}{{ item.path }}{% endif %}'
src: '{{ item_path.src }}'
dest: '{{ crayfish_install_dir }}/{{ crayfish_loop }}/config/{% if item_path.path.endswith(".j2") %}{{ item_path.path[:-3] }}{% else %}{{ item_path.path }}{% endif %}'
with_filetree: '../templates/{{ crayfish_loop }}'
when: item.state == 'file'
loop_control:
loop_var: item_path
when: item_path.state == 'file'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
crayfish_commons:
fedora_base_uri: {{ crayfish_homarus_fedora_base_url }}
syn_config: {{ crayfish_homarus_jwt_config }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# This file managed by Ansible

monolog:

handlers:

homarus:
type: rotating_file
path: {{ crayfish_homarus_log_file }}
level: {{ crayfish_homarus_log_level }}
max_files: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# This file managed by Ansible

monolog:

handlers:

homarus:
type: rotating_file
path: {{ crayfish_homarus_log_file }}
level: {{ crayfish_homarus_log_level }}
max_files: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file managed by Ansible

# To disable Syn checking, set syn_enabled=false in crayfish_commons.yaml and remove this configuration file.
security:

# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
jwt_user_provider:
id: Islandora\Crayfish\Commons\Syn\JwtUserProvider

firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
# Need stateless or it reloads the User based on a token.
stateless: true
{%if crayfish_homarus_jwt_enabled == true %}
anonymous: false

provider: jwt_user_provider
guard:
authenticators:
- Islandora\Crayfish\Commons\Syn\JwtAuthenticator

# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication

# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true


# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
{% else %}
anonymous: true
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# This file managed by Ansible

monolog:

handlers:

homarus:
type: rotating_file
path: {{ crayfish_homarus_log_file }}
level: {{ crayfish_homarus_log_level }}
max_files: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

# Managed by Ansible

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration

parameters:
app.executable: {{ crayfish_homarus_executable_config.executable }}
app.formats.valid:
{% for valid_format in crayfish_homarus_executable_config.formats.valid %}
- mimetype: {{ valid_format['mimetype'] }}
format: {{ valid_format['format'] }}
{% endfor %}
app.formats.defaults:
mimetype: {{ crayfish_homarus_executable_config.formats.default.mimetype }}
format: {{ crayfish_homarus_executable_config.formats.default.format }}

services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\Islandora\Homarus\:
resource: '../src/*'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'

# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Islandora\Homarus\Controller\HomarusController:
public: false
arguments:
$formats: '%app.formats.valid%'
$defaults: '%app.formats.defaults%'
$executable: '%app.executable%'
tags: ['controller.service_arguments']
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
crayfish_commons:
fedora_base_uri: {{ crayfish_houdini_fedora_base_url }}
syn_config: {{ crayfish_houdini_jwt_config }}
syn_enabled: {{ crayfish_houdini_jwt_enabled }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# This file managed by Ansible

monolog:

handlers:

houdini:
type: rotating_file
path: {{ crayfish_houdini_log_file }}
level: {{ crayfish_houdini_log_level }}
max_files: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# This file managed by Ansible

monolog:

handlers:

houdini:
type: rotating_file
path: {{ crayfish_houdini_log_file }}
level: {{ crayfish_houdini_log_level }}
max_files: 1
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,28 @@ parameters:
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\Islandora\Houdini\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'

# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Islandora\Houdini\Controller\HoudiniController:
public: false
bind:
$formats: '%app.formats.valid%'
$default_format: '%app.formats.default%'
$executable: '%app.executable%'
tags: ['controller.service_arguments']
public: false
arguments:
$formats: '%app.formats.valid%'
$default_format: '%app.formats.default%'
$executable: '%app.executable%'
tags: ['controller.service_arguments']

# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
crayfish_commons:
fedora_base_uri: {{ crayfish_hypercube_fedora_base_url }}
syn_config: {{ crayfish_hypercube_jwt_config }}
Loading

0 comments on commit db166ba

Please sign in to comment.