-
Notifications
You must be signed in to change notification settings - Fork 73
Changes to config files over time
Below is a list of changes to Scalar's config files and database scheme as development of the software progresses. For example, a new feature might require a new field in one of the config files. When updating from GitHub to your local Scalar installation, you'll need to add these new fields to the config files or database tables.
ALTER TABLE scalar_db_versions ADD alt_text TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER description;
'alt_text' => 'scalar:altText',
ALTER TABLE scalar_db_rel_annotated ADD position_gis VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER position_3d;
ALTER TABLE scalar_db_books
ADD terms_of_service VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER created,
ADD privacy_policy VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER terms_of_service;
$lang['email.lens_submitted_subject'] = 'New Lens submitted for "%s"';
$lang['email.lens_submitted_intro'] = 'A new Lens has been submitted for the book "%s":';
$lang['email.lens_submitted_outro'] = 'To review this submission, head to Manage Lenses and select the Lens from the list under Submitted Lenses.';
$lang['email.lens_submitted_footer'] = 'Thank you!'."\n\n".'The Scalar Team';
'mbox' => 'foaf:mbox',
ALTER TABLE scalar_db_rel_annotated ADD position_3d VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER points;
// To enable two-factor authentication for admin users (using the Google Authenticator), enter a salt string here
// The string needs to be a 'base32' string 'without equals signs at the end' or the QR barcode will not work
$config['google_authenticator_salt'] = '';
// Enable stronger-password verification (min 16 characters, can't use previous passwords)
$config['strong_password'] = true;
// If 'strong_password' is enabled, number of days until the user is requested to reset their password (e.g., 60)
$config['strong_password_days_to_reset'] = 60;
ALTER TABLE scalar_db_users ADD COLUMN previous_passwords TEXT DEFAULT NULL AFTER is_super;
CREATE TABLE IF NOT EXISTS scalar_db_rel_grouped (
parent_version_id int(10) unsigned DEFAULT '0',
contents TEXT NOT NULL,
KEY parent (parent_version_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE IF NOT EXISTS scalar_db_rel_grouped (
parent_version_id int(10) unsigned DEFAULT '0',
contents TEXT NOT NULL,
KEY parent (parent_version_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
Additional fields have been added to the "LDAP" section of system/application/config/local_settings.php, replace the existing section with these lines:
// LDAP authentication settings.
$config['use_ldap'] = (getenv('SCALAR_USE_LDAP') ? getenv('SCALAR_USE_LDAP') : false); // Default: off
$config['ldap_server'] = (getenv('SCALAR_LDAP_SERVER') ? getenv('SCALAR_LDAP_SERVER') : "ldap://ldap.server.name"); // Use 'ldap://' prefix even if connecting to ldaps.
$config['ldap_port'] = (getenv('SCALAR_LDAP_PORT') ? getenv('SCALAR_LDAP_PORT') : 389);
$config['ldap_basedn'] = (getenv('SCALAR_LDAP_BASEDN') ? getenv('SCALAR_LDAP_BASEDN') : "dc=organization,dc=tld");
$config['ldap_uname_field'] = (getenv('SCALAR_LDAP_UNAME_FIELD') ? getenv('SCALAR_LDAP_UNAME_FIELD') : "uid"); // Default 'uid', For AD use 'sAMAccountName'
$config['ldap_filter'] = (getenv('SCALAR_LDAP_FILTER') ? getenv('SCALAR_LDAP_FILTER') : '');
// Active Directory LDAP settings
$config['use_ad_ldap'] = (getenv('SCALAR_USE_AD_LDAP') ? getenv('SCALAR_USE_AD_LDAP') : false); // Default: off
$config['ad_bind_user'] = (getenv('SCALAR_AD_BIND_USER') ? getenv('SCALAR_AD_BIND_USER') : ""); // Use LDAP Distinguished Name
$config['ad_bind_pass'] = (getenv('SCALAR_AD_BIND_PASS') ? getenv('SCALAR_AD_BIND_PASS') : "");
Run these five MySQL queries on your Scalar database to speed up some API calls and page loads (they compliment indexes already present on these tables but in the "reverse" direction):
CREATE INDEX child_parent ON scalar_db_rel_annotated (child_version_id, parent_version_id);
CREATE INDEX child_parent ON scalar_db_rel_contained (child_version_id, parent_version_id);
CREATE INDEX child_parent ON scalar_db_rel_referenced (child_version_id, parent_version_id);
CREATE INDEX child_parent ON scalar_db_rel_replied (child_version_id, parent_version_id);
CREATE INDEX child_parent ON scalar_db_rel_tagged (child_version_id, parent_version_id);
'gpano' => 'http://ns.google.com/photos/1.0/panorama/'
$config['ontologies']['gpano'] = array(
'UsePanoramaViewer',
'CaptureSoftware',
'StitchingSoftware',
'ProjectionType',
'PoseHeadingDegrees',
'PosePitchDegrees',
'PoseRollDegrees',
'InitialViewHeadingDegrees',
'InitialViewPitchDegrees',
'InitialViewRollDegrees',
'InitialHorizontalFOVDegrees',
'FirstPhotoDate',
'LastPhotoDate',
'SourcePhotosCount',
'ExposureLockUsed',
'CroppedAreaImageWidthPixels',
'CroppedAreaImageHeightPixels',
'FullPanoWidthPixels',
'FullPanoHeightPixels',
'CroppedAreaLeftPixels',
'CroppedAreaTopPixels',
'InitialCameraDolly'
);
// Max login attempts (e.g., 10) and the penalty wait time in seconds (e.g., 120)
$config['max_login_attempts'] = 6;
$config['max_login_attempts_penalty_seconds'] = 120;
$lang['login.attempts'] = 'Too many login attempts, try again in a couple minutes';
Remove
require_once('system/application/arc/ARC2.php');
Add
require_once('system/application/arc/vendor/autoload.php');
Make sure you've also updated the function name that contains the above change, as described under Update: 16 May 2019. The final autoload block should look like this:
spl_autoload_register(function ($class) {
require_once('system/application/arc/vendor/autoload.php');
});
$config['email_from_address'] = (getenv('SCALAR_EMAIL_FROM_ADDRESS') ? getenv('SCALAR_EMAIL_FROM_ADDRESS') : '');
// On the Edit page the first tab, Layout, is the default opened tab; this will allow an override to another tab per book
$config['override_edit_page_default_tab'] = array(
'book_0' => array( // replace 0 with the book's ID
'composite' => '#metadata-pane', // text pages
'media' => '#metadata-pane' // media pages
)
);
Remove
function __autoload($class) {
require_once('system/application/arc/ARC2.php');
}
Add
spl_autoload_register(function ($class) {
require_once('system/application/arc/ARC2.php');
});
Run these six MySQL queries on your Scalar database to enable the Editorial Workflow features, which will become available in the 'Editorial' tab of the new Dashboard:
ALTER TABLE scalar_db_books ADD COLUMN editorial_is_on tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER is_featured;
ALTER TABLE scalar_db_versions ADD COLUMN editorial_state ENUM('draft','edit','editreview','clean','ready','published') DEFAULT 'draft' AFTER sort_number;
ALTER TABLE scalar_db_user_books MODIFY relationship ENUM('author','editor','commentator','reviewer','reader');
ALTER TABLE scalar_db_versions ADD COLUMN usage_rights tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER editorial_state;
ALTER TABLE scalar_db_versions ADD COLUMN editorial_queries TEXT DEFAULT NULL AFTER usage_rights;
ALTER TABLE scalar_db_books ADD COLUMN editions TEXT DEFAULT NULL AFTER publisher_thumbnail;
// Default dashboard ("dashboard", "dashboot") ... setting to "dashboard" will keep the current dashboard but will add an "opt-in" link to dashboot
$config['active_dashboard'] = 'dashboard';
// If true, external hyperlinks will go directly to the external page rather than attempt to be rendered in Scalar's external.php
$config['external_direct_hyperlink'] = false;
// YouTube Data API key
$config['youtube_data_key'] = (getenv('SCALAR_YOUTUBE_DATA_KEY') ? getenv('SCALAR_YOUTUBE_DATA_KEY') : '');
// Custom message displayed beneath the registration key field on the register page
$config['registration_key_msg'] = '';
Add to system/application/config/local_settings.php (above "$config['index_hide_published'] = true;")
// Whether to activate the self-published books feature on the book index page
$config['index_render_published'] = true;
$config['ontologies']['id3'] = array(
'Title',
'Artist',
'Album',
'Year',
'Comment',
'Zero-byte',
'Track',
'Genre'
);
'bibo' => 'http://purl.org/ontology/bibo/',
'id3' => 'http://id3.org/id3v2.4.0#'
Add to system/application/config/local_settings.php and add new Google ReCAPTCHA keys if desired (Scalar will revert to old ReCAPTCHA if values are left empty)
// ReCAPTCHA version 2 key (leave blank for no ReCAPTCHA version 2)
$config['recaptcha2_site_key'] = (getenv('SCALAR_RECAPTCHA2_SITE_KEY') ? getenv('SCALAR_RECAPTCHA2_SITE_KEY') : '');
$config['recaptcha2_secret_key'] = (getenv('SCALAR_RECAPTCHA2_SECRET_KEY') ? getenv('SCALAR_RECAPTCHA2_SECRET_KEY') : '');
ALTER TABLE scalar_db_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL
Any update from a previous Scalar version to the Scalar 2.1 release will involve all Scalar files, not just files kept in system/application
See UPDATE.TXT for more information
// LDAP authentication settings
$config['use_ldap'] = (getenv('SCALAR_USE_LDAP') ? getenv('SCALAR_USE_LDAP') : false); // Default: off
$config['ldap_server'] = (getenv('SCALAR_LDAP_SERVER') ? getenv('SCALAR_LDAP_SERVER') : "ldap.server.name");
$config['ldap_port'] = (getenv('SCALAR_LDAP_PORT') ? getenv('SCALAR_LDAP_PORT') : 389);
$config['ldap_basedn'] = (getenv('SCALAR_LDAP_BASEDN') ? getenv('SCALAR_LDAP_BASEDN') : "dc=organization,dc=tld");
$config['ldap_uname_field'] = (getenv('SCALAR_LDAP_UNAME_FIELD') ? getenv('SCALAR_LDAP_UNAME_FIELD') : "uid");
Add to system/application/config/local_settings.php and fill in a NYPL Digital Collections API key if desired
// New York Public Library key
$config['nypl_key'] = (getenv('SCALAR_NYPL_KEY') ? getenv('SCALAR_NYPL_KEY') : '');
Add:
'custom_style' => 'scalar:customStyle',
'custom_scripts' => 'scalar:customScript',
Remove $config['force_https'] = false;
Remove $config['base_url'] = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') .'://'.$_SERVER['HTTP_HOST'].str_replace('//','/',dirname($_SERVER['SCRIPT_NAME']).'/');
Add $config['is_https'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false;
Add $config['base_url'] = 'http'.(($config['is_https']) ? 's' : '').'://'.$_SERVER['HTTP_HOST'].str_replace('//','/',dirname($_SERVER['SCRIPT_NAME']).'/');
Some updates have been made to .htaccess in the Scalar root folder to support SSL (https). There is also a template for protecting the filesystem against malicious uploads (e.g., *.php).
Change category enum('commentary', 'review')
To category enum('commentary', 'review', 'term')
Add:
'category' => 'scalar:category',
'banner' varchar(255) DEFAULT NULL
Add:
'banner' => 'scalar:banner',
Add:
'mbox_sha1sum' => 'foaf:mbox_sha1sum',
Replace:
$config['iframe_redlist'] = array('youtube.com');
With:
$config['iframe_redlist'] = array('youtube.com', 'google.com');
Replace:
'user' => array('foaf:homepage','prov:wasAttributedTo'),
With:
'user' => 'prov:wasAttributedTo',
$lang['email.new_comment_subject'] = 'New Comment for "%s"';
$lang['email.new_comment_intro'] = 'A new comment has been submitted to the book "%s":';
$lang['email.new_comment_outro'] = 'The comment is already live, but you can manage it by logging in to your book below and visiting the Dashboard's Comments tab:';
$lang['email.new_comment_outro_moderated'] = 'The comment isn't live yet. To moderate, log in to your book below and visit the Dashboard's Comments tab:';
$lang['email.new_comment_footer'] = 'Thank you!'."\n\n".'The Scalar Team';
$config['ontologies']['iptc'] = array(
'2#003' => 'ObjectTypeReference',
'2#004' => 'ObjectAttributeReference',
'2#005' => 'ObjectName',
'2#007' => 'EditStatus',
'2#008' => 'EditorialUpdate',
'2#010' => 'Urgency',
'2#012' => 'SubjectReference',
'2#015' => 'Category',
'2#020' => 'SupplementalCategories',
'2#022' => 'FixtureIdentifier',
'2#025' => 'Keywords',
'2#026' => 'ContentLocationCode',
'2#027' => 'ContentLocationName',
'2#030' => 'ReleaseDate',
'2#035' => 'ReleaseTime',
'2#037' => 'ExpirationDate',
'2#038' => 'ExpirationTime',
'2#040' => 'SpecialInstructions',
'2#042' => 'ActionAdvised',
'2#045' => 'ReferenceService',
'2#047' => 'ReferenceDate',
'2#050' => 'ReferenceNumber',
'2#055' => 'DateCreated',
'2#060' => 'TimeCreated',
'2#062' => 'DigitalCreationDate',
'2#063' => 'DigitalCreationTime',
'2#065' => 'OriginatingProgram',
'2#070' => 'ProgramVersion',
'2#075' => 'ObjectCycle',
'2#080' => 'By-line',
'2#085' => 'By-lineTitle',
'2#090' => 'City',
'2#092' => 'Sub-location',
'2#095' => 'Province-State',
'2#100' => 'Country-PrimaryLocationCode',
'2#101' => 'Country-PrimaryLocationName',
'2#103' => 'OriginalTransmissionReference',
'2#105' => 'Headline',
'2#110' => 'Credit',
'2#115' => 'Source',
'2#116' => 'CopyrightNotice',
'2#118' => 'Contact',
'2#120' => 'Caption-Abstract',
'2#121' => 'LocalCaption',
'2#122' => 'Writer-Editor',
'2#125' => 'RasterizedCaption',
'2#130' => 'ImageType',
'2#131' => 'ImageOrientation',
'2#135' => 'LanguageIdentifier',
'2#150' => 'AudioType',
'2#151' => 'AudioSamplingRate',
'2#152' => 'AudioSamplingResolution',
'2#153' => 'AudioDuration',
'2#154' => 'AudioOutcue',
'2#184' => 'JobID',
'2#185' => 'MasterDocumentID',
'2#186' => 'ShortDocumentID',
'2#187' => 'UniqueDocumentID',
'2#188' => 'OwnerID',
'2#200' => 'ObjectPreviewFileFormat',
'2#201' => 'ObjectPreviewFileVersion',
'2#202' => 'ObjectPreviewData',
'2#221' => 'Prefs',
'2#225' => 'ClassifyState',
'2#228' => 'SimilarityIndex',
'2#230' => 'DocumentNotes',
'2#231' => 'DocumentHistory',
'2#232' => 'ExifCameraInfo',
'2#255' => 'CatalogSets'
);
Remove:
'part_of' => 'dcterms:isPartOf',
Add:
'prov' => 'http://www.w3.org/ns/prov#',
Remove:
'name' => 'foaf:name',
'user' => 'foaf:homepage',
'fullname' => 'dcterms:creator',
Add:
'user' => array('foaf:homepage','prov:wasAttributedTo'),
'fullname' => 'foaf:name',
Replace:
// Emails
$config['email_replyto_address'] = '';
$config['email_replyto_name'] = '';
$config['email_send_live_books_to_admins'] = true;
With:
// Emails
$config['email_replyto_address'] = '';
$config['email_replyto_name'] = '';
// SMTP (leave smtp_host field empty to use phpmailer instead). If using Gmail, you may need to enable access in security settings.
$config['smtp_host'] = '';
$config['smtp_auth'] = true;
$config['smtp_username'] = '';
$config['smtp_password'] = '';
$config['smtp_secure'] = 'ssl'; // 'ssl' or 'tls'
$config['smtp_port'] = 465;
'citation' => 'scalar:citation',
'paywall' => 'scalar:paywall',
paywall TINYINT(1) UNSIGNED DEFAULT 0
Replace: 'is_live' => 'scalar:is_live',
With: 'is_live' => 'scalar:isLive',
'is_live' => 'scalar:is_live',
// chmod permissions when the system creates directories or places uploaded files (e.g., 0775)
$config['chmod_mode'] = 0775;
// Default cover module
$config['active_cover'] = 'cover';
recent_version_id
int(10) unsigned NOT NULL DEFAULT '0'
'publisher' => 'dcterms:publisher',
'publisher_thumbnail' => 'art:thumbnail',
$lang['welcome.featured_books'] = 'Featured Books';
$lang['welcome.other_books'] = 'Self-published Books';
// Default book index module (note that the index can be rerouted completely in /.htaccess)
$config['active_book_list'] = 'book_list';
$lang['login.invalid'] = 'Invalid email or password';
$lang['login.is_reset'] = 'The password for this account has been reset. Please see your email for reset instructions or contact an administrator.';
// Internet Archive allowable filetypes when importing
$config['internet_archive']['filetypes'] = array(
'MPEG4',
'512Kb+MPEG4',
'h.264',
'WAVE',
'QuickTime',
'160Kbps+MP3',
'128Kbps+MP3',
'64Kbps+MP3',
'56Kbps+MP3',
'VBR+MP3',
'JPEG+Thumb',
'JPEG',
'Text+PDF'
);
'user' => 'foaf:homepage',
Replace:
$config['ontologies']['artstor'] = array(
... with:
$config['ontologies']['art'] = array(
// Default melon (Scalar skin), must have a corresponding folder in system/application/views/mellons/
$config['active_melon'] = 'honeydew';
// Blank wrapper for outputting XML, JSON, or single widgets, etc
$template['blank']['template'] = 'arbors/blank/wrapper';
$template['blank']['regions'] = array('content');
// External wrapper for loading external pages in an iframe
$template['external']['template'] = 'arbors/external/wrapper';
$template['blank']['regions'] = array('content');
// Admin wrapper including book index page, login, and dashboard area
$template['admin']['template'] = 'arbors/admin/wrapper';
$template['admin']['regions'] = array('cover', 'content');
// Scalar's first generation wrapper (2010-2012)
$template['html']['template'] = 'arbors/html/wrapper';
$template['html']['regions'] = array('content');
// Scalar's second generation wrapper (2012-)
$template['html5_RDFa']['template'] = 'arbors/html5_RDFa/wrapper';
$template['html5_RDFa']['regions'] = array('content');
$lang['login.index'] = 'Index';
$lang['login.guide'] = 'Guide';
$lang['page.no_content_author'] = 'Content hasn't yet been added to this page, click Edit below to add some.';
$lang['page.no_content'] = 'Content hasn't yet been added to this page.';
$lang['login.manage_content'] = 'Dashboard';
// Soundcloud client id
$config['soundcloud_id'] = '';
// Digital Public Library of America key
$config['dpla_key'] = '';
// Flowplayer key
$config['flowplayer_key'] = '';
// Google Maps key
$config['google_maps_key'] = '';
// Custom message displayed inside a book. Will remain hidden after user closes the popup for the first time.
$config['book_msg'] = '';
$config['book_msg_cookie_name'] = 'ci_hide_scalar_book_msg';
// If true, keep self-published books on the book index page hidden under a tab
$config['index_hide_published'] = true;
'has_part' => 'dcterms:hasPart',