Fork me on GitHub
Phraseanet Documentation

Configuration

The essential

Phraseanet configuration is stored in config/configuration.yml. After any update, it must be recompiled with bin/console compile:configuration command.

Phraseanet configuration is stored in config/configuration.yml that is automatically generated during install.

This file is in YAML format. For performance reasons, and use opcode cache, confguration is compiled.

It must be recompiled after any update.

Compilation

Configuration compilation is very easy and fast to execute. bin/console compile:configuration should be used.

bin/console compile:configuration

Configuration.yml

Here is a commented configuration file (/lib/conf.d/configuration.yml) :

servername: 'http://local.phrasea/'
languages:
    available:
        - de
        - en
        - fr
        - nl
    default: 'en'
main:
    maintenance: false
    key: ''
    database:
        host: 'sql-host'
        port: 3306
        user: 'sql-user'
        password: 'sql-password'
        dbname: ab_phraseanet
        driver: pdo_mysql
        charset: UTF8
    database-test:
        driver: pdo_sqlite
        path: '/tmp/db.sqlite'
        charset: UTF8
    cache:
        type: ArrayCache
        options: {}
    search-engine:
        type: elasticsearch
        options:
            host: elasticsearch
            port: 9200
            index: ''
            shards: 3
            replicas: 0
            minScore: 2
            highlight: true
            maxResultWindow: 500000
            populate_order: MODIFICATION_DATE
            populate_direction: DESC
            populate_permalinks: false
            activeTab: '#elastic-search'
            facets:
                _base:
                    limit: 10
                _collection:
                    limit: 10
                _doctype:
                    limit: 10
                _camera_model:
                    limit: 10
                _iso:
                    limit: 0
                _aperture:
                    limit: 0
                _shutterspeed:
                    limit: 0
                _flashfired:
                    limit: 0
                _framerate:
                    limit: 0
                _audiosamplerate:
                    limit: 0
                _videocodec:
                    limit: 0
                _audiocodec:
                    limit: 0
                _orientation:
                    limit: 0
                _colorspace:
                    limit: 0
                _mimetype:
                    limit: 0
    task-manager:
        status: started
        enabled: true
        options:
            protocol: tcp
            host: 127.0.0.1
            port: 6660
            linger: 500
        logger:
            max-files: 10
            enabled: true
            level: INFO
    session:
        type: native
        options: []
        ttl: 86400
    binaries:
        ghostscript_binary: null
        php_binary: null
        swf_extract_binary: null
        pdf2swf_binary: null
        swf_render_binary: null
        unoconv_binary: null
        ffmpeg_binary: null
        ffprobe_binary: null
        mp4box_binary: null
        pdftotext_binary: null
        ffmpeg_timeout: 3600
        ffprobe_timeout: 60
        gs_timeout: 60
        mp4box_timeout: 60
        swftools_timeout: 60
        unoconv_timeout: 60
        exiftool_timeout: 60
    storage:
        subdefs: null
        cache: null
        log : null
        download: null
        lazaret: null
        caption: null
        worker_tmp_files: null

trusted-proxies: []
network-proxies:
    http-proxy:
        enabled: false
        host:
        port:
        user:
        password:
    ftp-proxy:
        enabled: false
        host:
        port:
        user:
        password:
debugger:
    allowed-ips: []
border-manager:
    enabled: true
    extension-mapping:
        otc: application/vnd.oasis.opendocument.chart-template
        ttc: application/x-font-ttf
        xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
        docx: application/msword
        pptx: application/vnd.ms-powerpoint
        mxf: application/mxf
        mp4: video/mp4
        svg: image/svg+xml
    checkers:
        -
            type: Checker\Sha256
            enabled: true
        -
            type: Checker\UUID
            enabled: true
        -
            type: Checker\Colorspace
            enabled: false
            options:
                colorspaces: [cmyk, grayscale, rgb]
        -
            type: Checker\Dimension
            enabled: false
            options:
                width: 80
                height: 160
        -
            type: Checker\Extension
            enabled: false
            options:
                extensions: [jpg, jpeg, bmp, tif, gif, png, heic, pdf, doc, docx, xls, xlsx, odt, mpg, mpeg, mov, avi, mp3, mp2, mp4, m4v, m4a, mkv, hevc, aac, aiff, wav]
        -
            type: Checker\Filename
            enabled: false
            options:
                sensitive: true
        -
            type: Checker\MediaType
            enabled: false
            options:
                mediatypes: [Audio, Document, Image, Video]

registry:
    api-clients:
        api-subdef_service: false
user_account:
    deleting_policies:
        email_confirmation: true
authentication:
    auto-create:
        templates: {  }
    providers:
        facebook:
            enabled: false
            display: false
            title: Facebook
            type: facebook
            options:
                app-id: ''
                secret: ''
                default-graph-version: 'v2.10'
        twitter:
            enabled: false
            display: false
            title: Twitter
            type: twitter
            options:
                consumer-key: ''
                consumer-secret: ''
        github:
            enabled: false
            display: false
            title: Github
            type: github
            options:
                client-id: ''
                client-secret: ''
        viadeo:
            enabled: false
            display: false
            title: Viadeo
            type: viadeo
            options:
                client-id: ''
                client-secret: ''
        linkedin:
            enabled: false
            display: false
            title: LinkedIN
            type: linkedin
            options:
                client-id: ''
                client-secret: ''
        ps_auth_1:
            enabled: false
            display: false
            title: 'PS Auth 1'
            type: 'ps-auth'
            options:
                client-id: ''
                client-secret: ''
                base-url: 'https://api-auth.phrasea.local'
                provider-type: 'oauth'
                provider-name: 'v2'
                icon-uri: null,
                debug: false,
                birth-group: '_firstlog'
                everyone-group: '_everyone'
                metamodel: '_metamodel'
                model-gpfx: '_M_'
                model-upfx: '_U_'
                auto-logout: false
                auto-connect-idp-name: null
registration-fields:
    -
        name: company
        required: true
    -
        name: lastname
        required: true
    -
        name: firstname
        required: true
    -
        name: geonameid
        required: true
xsendfile:
    enabled: false
    type: nginx
    mapping: []
h264-pseudo-streaming:
    enabled: false
    type: nginx
    mapping: []
plugins: []
api_cors:
  enabled: false
  allow_credentials: false
  allow_origin: []
  allow_headers: []
  allow_methods: []
  expose_headers: []
  max_age: 0
  hosts: []
session:
  idle: 0
  # 1 week
  lifetime: 604800
crossdomain:
  allow-access-from:
    -
      domain: '*.cooliris.com'
      secure: 'false'
embed_bundle:
    video:
        player: videojs
        autoplay: false
        cover_subdef: poster
        message_start: StartOfMessage
        available_speeds:
            - 1
            - 1.5
            - 3
    audio:
        player: videojs
        autoplay: false
        cover_subdef: thumbnail
    document:
        #player: flexpaper
        enable_pdfjs: true
geocoding-providers:
    -
        map-provider: 'mapboxWebGL'
        enabled: false
        public-key: ''
        map-layers:
            -
                name: Light
                value: 'mapbox://styles/mapbox/light-v9'
            -
                name: Streets
                value: 'mapbox://styles/mapbox/streets-v9'
            -
                name: Basic
                value: 'mapbox://styles/mapbox/basic-v9'
            -
                name: Satellite
                value: 'mapbox://styles/mapbox/satellite-v9'
            -
                name: Dark
                value: 'mapbox://styles/mapbox/dark-v9'
        transition-mapboxgl:
            -
                animate: true
                speed: '2.2'
                curve: '1.42'
        default-position:
            - 42.488
            - 3.779
        default-zoom: 2
        marker-default-zoom: 11
        position-fields:
            #-
            #   name: GpsCompositePosition
            #   type: latlng
            -
                name: Latitude
                type: lat
            -
                name: Longitude
                type: lon
        geonames-field-mapping: true
        cityfields: 'City, Ville'
        provincefields: Province
        countryfields: 'Country, Pays'
        latitudefields: Latitude
        longitudefields: Longitude
video-editor:
    ChapterVttFieldName: VideoTextTrackChapters
    seekBackwardStep: 500 # in ms
    seekForwardStep: 500  # in ms
    playbackRates:
        - 1
        - '1.5'
        - 3
workers:
    queue:
        worker-queue:
            registry: alchemy_worker.queue_registry
            host: localhost
            port: 5672
            user: ''
            password: ''
            ssl: false
            vhost: /
            heartbeat: 60
    webhook:
        timeout: 30
        verify_ssl: true
    queues:
        assetsIngest:
            max_retry: 3
            ttl_retry: 10000
        createRecord:
            max_retry: 3
            ttl_retry: 10000
        editRecord:
            max_retry: 3
            ttl_retry: 10000
        exportMail:
            max_retry: 3
            ttl_retry: 10000
        exposeUpload:
            max_retry: 3
            ttl_retry: 10000
        ftp:
            max_retry: 3
            ttl_retry: 180000
        populateIndex:
            max_retry: 3
            ttl_retry: 10000
        pullAssets:
            max_retry: 3
            ttl_retry: 10000
        recordsActions:
            max_retry: 3
            ttl_retry: 10000
        shareBasket:
            max_retry: 3
            ttl_retry: 10000
        subdefCreation:
            max_retry: 3
            ttl_retry: 10000
            ttl_delayed: 5000
        validationReminder:
            max_retry: 3
            ttl_retry: 7200000
        webhook:
            max_retry: 3
            ttl_retry: 10000
        writeMetadatas:
            max_retry: 3
            ttl_retry: 10000
            ttl_delayed: 5000
externalservice:
    ginger:
        AutoSubtitling:
            service_base_url: https://base.uri
            token: 39c6011d
            transcript_format: text/vtt
            subdef_source: preview


Console_logger_enabled_environments: [test]

Languages

Available languages with their respectives codes are:

  • French: fr_FR
  • English: en_GB
  • German: de_DE
  • Dutch: nl_NL

Cache services

cache and opcode-cache cache services can be configures with the following adapters:

Name Service Description Options
RedisCache Cache Cache server using PHP redis extension host, port
ArrayCache cache | opcode-cache No cache  

Sessions handling

Sessions are stored on filesystem by default. It is possible to use another handling system:

Type Description Options
file Filesystem handler  
redis Redis server handler, use PHP redis host, port

Warning

Time-to-live setting (ttl) does not work with filesystem storage. In that case, use PHP gc_maxlifetime setting.

Search Engine service

Elasticsearch is the only service that can be used with Phraseanet.

Name Options
Alchemy\Phrasea\SearchEngine\Elastic\ElasticSearchEngine host, port, index

Trusted proxies

If Phraseanet is behind a reverse proxy, its address must be set as a trusted one so that users IP address will be correctly recognized.

trusted-proxies:
    192.168.27.15
    10.0.0.45

Optional registration fields

registration-fields section allows to customize registration fields and which ones of them are required.

registration-fields:
    -
        name: company
        required: false
    -
        name: firstname
        required: true
id Nom
login Login
gender Gender
firstname First name
lastname Last name
address Address
zipcode Zip Code
geonameid City
position position
company Company
job Job
tel Telephone
fax Fax

Sendfile / XSendFile Configuration

Xsendfile configuration should be handled with commanline tools. Both Nginx and Apache documentation are available.

Plugins configuration

Plugins are configured in the same file. Plugins documentation explains how to configure yours plugins.

Border Manager service configuration

Border Manager checkers are configurable. It is also possible to create your own checker.

Checker Description Options
CheckerSha256 Checks for duplicated files based on their sha256 check sum  
CheckerUUID Checks for duplicated files based on their UUID  
CheckerDimension Checks file dimension (if applicable) width : file width height : file height
CheckerExtension Checks file extension extensions : authorized file extensions
CheckerFilename Checks for duplicated files based on their filename sensitive : enable case sensitivity
CheckerMediaType Checks media type (Audio, Video...) mediatypes : authorized media types
CheckerColorspace Checks colorspace (if applicable) colorspaces : authorized colorspaces

Border manager service allow to customize mime-type detection with the extension-mapping parameter. Mime type detection can be wrong on some platforms. Use this array to force a mime-type given a file extension.

Collections restrictions

It is possible to restrict the validation constraint on a set of collections by passing a list of base_id:

#services.yml
Border:
    border_manager:
        type: Border\BorderManager
        options:
            enabled: true
            checkers:
                -
                    type: Checker\Sha256
                    enabled: true
                    collections:
                        - 4
                        - 5

Databoxes restrictions

The same restriction can be done at databoxes level:

#services.yml
Border:
    border_manager:
        type: Border\BorderManager
        options:
            enabled: true
            checkers:
                -
                    type: Checker\Sha256
                    enabled: true
                    databoxes:
                        - 3
                        - 7

Note

It is not possible to restrict at databoxes and collections levels at the same time.

Implement a custom checker

Checker’s object are declared in the Alchemy\Phrasea\Border\Checker namespace. The checker has to be in this namespace and must implement Alchemy\Phrasea\Border\Checker\Checker interface.

Example of GPS based checker:

<?php
namespace Alchemy/Phrasea/Border/Checker;

use Alchemy\Phrasea\Border\File;
use Doctrine\ORM\EntityManager;
use MediaVorus\Media\DefaultMedia as Media;

class NorthPole implements Checker
{
    private $options;

    public function __construct(Array $options)
    {
        $this->options = $options;
    }

    public function check(EntityManager $em, File $file)
    {
        $media = $file->getMedia();

        if (null !== $latitude = $media->getLatitude() && null !== $ref = $media->getLatitudeRef()) {
            if($latitude > 60 && $ref == Media::GPSREF_LATITUDE_NORTH) {
                return true;
            }
        }

        return false;
    }
}

Enable the checker

border-manager:
    enabled: true
    checkers:
        -
            type: Checker\NorthPole
            enabled: true

Users settings

It is possible to customize default users settings. Available parameters are:

Name Description Defaut value Available values
view Results display thumbs thumbs (thumbnail view) list (list view)
images_per_page Results quantity per page 20  
images_size Result thumbnail size 120  
editing_images_size Editing thumbnail size 134  
editing_top_box Editing top block (percentage) 30  
editing_right_box Editing right block (percentage) 48  
editing_left_box Editing left block (percentage) 33  
basket_sort_field Basket sort index name name (by name) or date (by date)
basket_sort_order Basket sort index ASC ASC (ascending) or DESC (descending)
warning_on_delete_story Alert before remove a story true true (yes) or false (no)
client_basket_status Display baskets in Classic 1 1 (yes) or 0 (no)
css Production CSS theme 000000 000000 (dark) or 959595 (bright)
advanced_search_reload Reload previous search options on Prod loading 1 1 (yes) or 0 (no)
start_page_query Default question last  
start_page Production start page QUERY PUBLI (publications) or QUERY (query) ou LAST_QUERY (last query)
rollover_thumbnail Rollover display caption caption (notice) or preview (preview)
technical_display Display technical data 1 1 (yes) or 0 (no) or group (inside the caption)
doctype_display Display a record type icon 1 1 (yes) or 0 (no)
basket_caption_display Display basket records notice 0 1 (yes) or 0 (no)
basket_status_display Display basket records status 0 1 (yes) or 0 (no)
basket_title_display Display basket records title 0 1 (yes) or 0 (no)

Session durations

idle

Set the inactivity time (in seconds) before the user is automatically disconnected from application.

The setting “idle” has priority over “lifetime”. If “idle” is set, the option “Remember me” is not displayed on the homepage.

lifetime

Checking “Remember me” on homepage allows to access the application later without authentifying again. Access is allowed for this duration (in seconds).

Thumbnails

lazyload

Boolean that triggers lazy load for thumbnails in Phraseanet production, this option is not obsolete if static file mode is enabled.

static-file

If this option is enabled, thumbnails are served as static content. Symlinks to images will be created.

static-file:
    enabled: true
    type: nginx
    symlink-directory: ''

Embed bundle

Videojs audiovideo player

Phraseanet includes Videojs player for audio and video type document preview.

It can be customized in the configuration.yml file:

embed_bundle:                                  # (array)     Embed_bundle configuration
    video:
        player: videojs                        # (array)     Set active player for video - videojs only
        autoplay: false                        # (boolean)   Autoplay setting for video
        video_message_start: StartOfMessage    # (string)    The field name where the start reading value (in second) is stored
        coverSubdef: previewx4                 # (string)    Cover sub-definition to be used in player
        available-speeds:                      # (array)     Set available speed in player
            - 1
            - 1.5
            - 3
    audio:
        player: videojs                        # (array)     Set active player for audio
        autoplay: false                        # (boolean)   Autoplay setting for audio

Note

High speed playbacks increases bandwidth consumption.

Pdf.js viewer

The Pdf.js viewer can be used to display previews of PDF documents instead of the default FlexPaper viewer.

Pdf.js allows a native display of PDF files in modern browsers while default FlexPaper viewer requires Adobe Flash Player plugin to be installed, enabled as well as allowed in it.

embed_bundle:
    document:
        player: flexpaper                      # (string)    For Office document, use flexpaper or pdfjs
        enable-pdfjs: true                     # (boolean)   Use pdfjs as PDF viewer for PDFs documents

Note

Flexpaper or Pdfjs can be used display Office based documents previews. Please set Document Preview subdef according to your choice in each databox subdef setting.

Video Editor

The section allows the configuration of options in the video editing tools in Production

video-editor:
    ChapterVttFieldName: VideoTextTrackChapters # (string)   The name of the document field storing the chaptering data
    seekBackwardStep: 500                       # (integer)  In milliseconds, the displacement value of the reading head back
    seekForwardStep: 500                        # (integer)  In milliseconds, the displacement value of the reading head forward
    playbackRates:                              # (array)    Available reading speeds in the player
        - 1
        - '1.5'
        - 3

Geocoding providers

The section allows the configuration of geolocation options in Production.

A MapBox API public-key is required to use this service. It can be get on Mapbox web site.

For using GeoNames input assistance in Phraseanet edit form, please provide a geonames-server address in Webservice section in configuration file.

geocoding-providers:                           # (array)     Configuration of geolocation options in Production
    -
        map-provider: mapboxWebGL              # (string)    The library used for displaying maps
        enabled: false                         # (string)    Activate or deactivate the functionality in Production
        public-key: ''                         # (string)    The required MapBox API key
        map-layers:                            # (array)     An array grouping the proposed base maps
            -
                name: Streets
                value: 'mapbox://styles/mapbox/streets-v9'
            -
                name: Basic
                value: 'mapbox://styles/mapbox/basic-v9'
        transition-mapboxgl:
            -
                animate: true
                speed: '2.2'
                curve: '1.42'
        default-position:                      # (array)     Default position on the map
            - '48.879162'
            - '2.335062'
        default-zoom: 5
        marker-default-zoom: 9
        geonames-field-mapping: true           # (boolean)   Enable GeoNames input assistance in Phraseanet edit form
        cityfields: City, Ville                # (array)     Mapping of Phraseanet fields for the GeoName Name property (the city)
        provincefields: Province               # (array)     Mapping of Phraseanet fields for the GeoName Region property
        countryfields: Country, Pays           # (array)     Mapping of Phraseanet fields for the GeoName Country property