Skip to content

Commit

Permalink
initial config
Browse files Browse the repository at this point in the history
SDESK-6886
  • Loading branch information
petrjasek committed Apr 27, 2023
1 parent 51eb12d commit 2c0327a
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 101 deletions.
11 changes: 7 additions & 4 deletions client/superdesk.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ module.exports = function() {

view: {
timeformat: 'HH:mm',
dateformat: 'DD.MM.YYYY',
dateformat: 'YYYY-MM-DD',
},

shortTimeFormat: 'HH:mm, DD.MM.YYYY',
shortDateFormat: 'HH:mm, DD.MM.YYYY',
shortWeekFormat: 'HH:mm, DD.MM.YYYY',
shortTimeFormat: 'HH:mm, YYYY-MM-DD',
shortDateFormat: 'HH:mm, YYYY-MM-DD',
shortWeekFormat: 'HH:mm, YYYY-MM-DD',
startingDay: '1',

defaultTimezone: 'Europe/Prague',

editor3: { browserSpellCheck: true, },
Expand Down Expand Up @@ -79,6 +80,7 @@ module.exports = function() {

list: {
priority: [
'priority',
'urgency'
],
firstLine: [
Expand All @@ -89,6 +91,7 @@ module.exports = function() {
'versioncreated'
],
secondLine: [
'language',
'state',
'update',
'scheduledDateTime',
Expand Down
187 changes: 90 additions & 97 deletions server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# at https://www.sourcefabric.org/superdesk/license

from pathlib import Path
from superdesk.default_settings import strtobool, env
from superdesk.default_settings import strtobool, env, BROKER_URL, WS_HOST, WS_PORT

ABS_PATH = str(Path(__file__).resolve().parent)

Expand All @@ -25,61 +25,37 @@

PLANNING_EVENT_TEMPLATES_ENABLED = True

RENDITIONS = {
"picture": {
"thumbnail": {"width": 220, "height": 120},
"viewImage": {"width": 640, "height": 640},
"baseImage": {"width": 1400, "height": 1400},
},
"avatar": {
"thumbnail": {"width": 60, "height": 60},
"viewImage": {"width": 200, "height": 200},
},
}

WS_HOST = env("WSHOST", "0.0.0.0")
WS_PORT = env("WSPORT", "5100")

LOG_CONFIG_FILE = env("LOG_CONFIG_FILE", "logging_config.yml")

REDIS_URL = env("REDIS_URL", "redis://localhost:6379")
if env("REDIS_PORT"):
REDIS_URL = env("REDIS_PORT").replace("tcp:", "redis:")
BROKER_URL = env("CELERY_BROKER_URL", REDIS_URL)
# Highcharts Export Server - default settings
ANALYTICS_ENABLE_SCHEDULED_REPORTS = strtobool(env("ANALYTICS_ENABLE_SCHEDULED_REPORTS", "true"))

SECRET_KEY = env("SECRET_KEY", "")
MACROS_MODULE = env("MACROS_MODULE", "macros")

# Highcharts Export Server - default settings
ANALYTICS_ENABLE_SCHEDULED_REPORTS = strtobool(
env('ANALYTICS_ENABLE_SCHEDULED_REPORTS', 'true')
)

MACROS_MODULE = env('MACROS_MODULE', 'macros')

HIGHCHARTS_SERVER_HOST = env('HIGHCHARTS_SERVER_HOST', 'localhost')
HIGHCHARTS_SERVER_PORT = env('HIGHCHARTS_SERVER_PORT', '6060')
HIGHCHARTS_LICENSE_ID = env('HIGHCHARTS_LICENSE_ID', '')
HIGHCHARTS_LICENSE_TYPE = 'OEM'
HIGHCHARTS_LICENSEE = 'Sourcefabric Ventures s.r.o.'
HIGHCHARTS_LICENSEE_CONTACT = '[email protected]'
HIGHCHARTS_LICENSE_CUSTOMER_ID = '2'
HIGHCHARTS_LICENSE_EXPIRY = 'Perpetual'

DEFAULT_LANGUAGE = 'en'
HIGHCHARTS_SERVER_HOST = env("HIGHCHARTS_SERVER_HOST", "localhost")
HIGHCHARTS_SERVER_PORT = env("HIGHCHARTS_SERVER_PORT", "6060")
HIGHCHARTS_LICENSE_ID = env("HIGHCHARTS_LICENSE_ID", "")
HIGHCHARTS_LICENSE_TYPE = "OEM"
HIGHCHARTS_LICENSEE = "Sourcefabric Ventures s.r.o."
HIGHCHARTS_LICENSEE_CONTACT = "[email protected]"
HIGHCHARTS_LICENSE_CUSTOMER_ID = "2"
HIGHCHARTS_LICENSE_EXPIRY = "Perpetual"

DEFAULT_LANGUAGE = "en"
LANGUAGES = [
{'language': 'en', 'label': 'English', 'source': True, 'destination': True},
{'language': 'en-GB', 'label': 'English (GB)', 'source': True, 'destination': True},
{'language': 'fr', 'label': 'French', 'source': True, 'destination': True},
{'language': 'ar', 'label': 'Arabic', 'source': True, 'destination': True},
{'language': 'de', 'label': 'German', 'source': True, 'destination': True},
{'language': 'no', 'label': 'Norwegian', 'source': True, 'destination': True},
{'language': 'pt-PT', 'label': 'Portugese', 'source': True, 'destination': True},
{'language': 'pt-BR', 'label': 'Portugese (Brazil)', 'source': True, 'destination': True},
{'language': 'zh-Hans', 'label': 'Chinese (分类)', 'source': True, 'destination': True},
{'language': 'dk', 'label': 'Danish', 'source': True, 'destination': True},
{'language': 'es', 'label': 'Spanish', 'source': True, 'destination': True},
{'language': 'se', 'label': 'Swedish', 'source': True, 'destination': True},
{'language': 'cz', 'label': 'Czech', 'source': True, 'destination': True}
{"language": "en", "label": "English", "source": True, "destination": True},
{"language": "en-GB", "label": "English (GB)", "source": True, "destination": True},
{"language": "fr", "label": "French", "source": True, "destination": True},
{"language": "ar", "label": "Arabic", "source": True, "destination": True},
{"language": "de", "label": "German", "source": True, "destination": True},
{"language": "no", "label": "Norwegian", "source": True, "destination": True},
{"language": "pt-PT", "label": "Portugese", "source": True, "destination": True},
{"language": "pt-BR", "label": "Portugese (Brazil)", "source": True, "destination": True},
{"language": "zh-Hans", "label": "Chinese (分类)", "source": True, "destination": True},
{"language": "dk", "label": "Danish", "source": True, "destination": True},
{"language": "es", "label": "Spanish", "source": True, "destination": True},
{"language": "se", "label": "Swedish", "source": True, "destination": True},
{"language": "cz", "label": "Czech", "source": True, "destination": True},
]

GENERATE_SHORT_GUID = True
Expand All @@ -91,80 +67,97 @@
# publishing of associated and related items
PUBLISH_ASSOCIATED_ITEMS = True

FTP_TIMEOUT = int(env('FTP_TIMEOUT', 10))
FTP_TIMEOUT = int(env("FTP_TIMEOUT", 10))

PLANNING_EVENT_TEMPLATES_ENABLED = True

PLANNING_AUTO_ASSIGN_TO_WORKFLOW = True

# special characters that are disallowed
DISALLOWED_CHARACTERS = ['!', '$', '%', '&', '"', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
'>', '?', '@', '[', ']', '\\', '^', '_', '`', '{', '|', '}', '~']
DISALLOWED_CHARACTERS = [
"!",
"$",
"%",
"&",
'"',
"(",
")",
"*",
"+",
",",
".",
"/",
":",
";",
"<",
"=",
">",
"?",
"@",
"[",
"]",
"\\",
"^",
"_",
"`",
"{",
"|",
"}",
"~",
]

# This value gets injected into NewsML 1.2 and G2 output documents.
NEWSML_PROVIDER_ID = 'sourcefabric.org'
ORGANIZATION_NAME = env('ORGANIZATION_NAME', 'Sourcefabric')
ORGANIZATION_NAME_ABBREVIATION = env('ORGANIZATION_NAME_ABBREVIATION', 'SoFab')
NEWSML_PROVIDER_ID = "sourcefabric.org"
ORGANIZATION_NAME = env("ORGANIZATION_NAME", "Sourcefabric")
ORGANIZATION_NAME_ABBREVIATION = env("ORGANIZATION_NAME_ABBREVIATION", "SoFab")

SCHEMA = {
'picture': {
'slugline': {'required': False},
'headline': {'required': False},
'description_text': {'required': True},
'byline': {'required': False},
'copyrightnotice': {'required': False},
'usageterms': {'required': False},
'ednote': {'required': False},
},
'video': {
'slugline': {'required': False},
'headline': {'required': False},
'description_text': {'required': True},
'byline': {'required': True},
'copyrightnotice': {'required': False},
'usageterms': {'required': False},
'ednote': {'required': False},
"picture": {
"headline": {"required": True},
"alt_text": {"required": False, "type": "string", "nullable": True},
"description_text": {"required": True},
"creditline": {"required": False},
"copyrightholder": {"required": False},
"usageterms": {"required": False},
"copyrightnotice": {"required": False},
},
}

# editor for images, video, audio
EDITOR = {
'picture': {
'headline': {'order': 1, 'sdWidth': 'full'},
'description_text': {'order': 2, 'sdWidth': 'full', 'textarea': True},
'byline': {'order': 3, 'displayOnMediaEditor': True},
'copyrightnotice': {'order': 4, 'displayOnMediaEditor': True},
'slugline': {'displayOnMediaEditor': True},
'ednote': {'displayOnMediaEditor': True},
'usageterms': {'order': 5, 'displayOnMediaEditor': True},
},
'video': {
'headline': {'order': 1, 'sdWidth': 'full'},
'description_text': {'order': 2, 'sdWidth': 'full', 'textarea': True},
'byline': {'order': 3, 'displayOnMediaEditor': True},
'copyrightnotice': {'order': 4, 'displayOnMediaEditor': True},
'slugline': {'displayOnMediaEditor': True},
'ednote': {'displayOnMediaEditor': True},
'usageterms': {'order': 5, 'displayOnMediaEditor': True},
"picture": {
"headline": {"order": 1, "sdWidth": "full", "editor3": True},
"alt_text": {"order": 2, "sdWidth": "full", "textarea": True, "editor3": True},
"description_text": {"order": 3, "sdWidth": "full", "textarea": True, "editor3": True},
"creditline": {"order": 4, "sdWidth": "full", "displayOnMediaEditor": True, "editor3": True},
"copyrightholder": {"order": 5, "displayOnMediaEditor": True, "editor3": True},
"usageterms": {"order": 6, "displayOnMediaEditor": True},
"copyrightnotice": {"order": 7, "displayOnMediaEditor": True},
},
}

SCHEMA['audio'] = SCHEMA['video']
EDITOR['audio'] = EDITOR['video']
SCHEMA["audio"] = SCHEMA["video"] = SCHEMA["picture"]
EDITOR["audio"] = EDITOR["video"] = EDITOR["picture"]


# media required fields for upload
VALIDATOR_MEDIA_METADATA = {
"slugline": {
"required": False,
},
"headline": {
"required": True,
},
"alt_text": {
"required": False,
},
"description_text": {
"required": True,
},
"byline": {
"creditline": {
"required": False,
},
"copyrightholder": {
"required": False,
},
"usageterms": {
"required": False,
},
"copyrightnotice": {
Expand Down

0 comments on commit 2c0327a

Please sign in to comment.