Skip to content

Commit

Permalink
feat(elasticms): add file structure commands for static websites (#917)
Browse files Browse the repository at this point in the history
Co-authored-by: David mattei <[email protected]>
  • Loading branch information
theus77 and Davidmattei authored Jun 16, 2024
1 parent 5804ed5 commit db29d64
Show file tree
Hide file tree
Showing 3 changed files with 412 additions and 0 deletions.
343 changes: 343 additions & 0 deletions recipes/websites/directory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
{
"class": "EMS\\CoreBundle\\Entity\\ContentType",
"arguments": [],
"properties": {
"name": "directory",
"pluralName": "Directories",
"singularName": "Directory",
"icon": null,
"description": null,
"indexTwig": null,
"extra": null,
"lockBy": null,
"lockUntil": null,
"deleted": false,
"askForOuuid": false,
"color": null,
"fieldType": {
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\ContainerFieldType",
"name": "source",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": null,
"class": null,
"lastOfRow": false,
"helptext": null,
"icon": null
},
"restrictionOptions": {
"minimum_role": null
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": null
}
},
"orderKey": 0,
"children": [
{
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\TextStringFieldType",
"name": "identifier",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": "Identifier",
"class": "col-md-12",
"lastOfRow": false,
"helptext": null,
"prefixIcon": null,
"prefixText": null,
"suffixIcon": null,
"suffixText": null,
"placeholder": null,
"icon": null
},
"mappingOptions": {
"index": null,
"analyzer": "keyword",
"copy_to": null
},
"restrictionOptions": {
"mandatory": false,
"mandatory_if": null,
"minimum_role": null
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": null
},
"raw_data": [],
"migrationOptions": {
"protected": false
}
},
"orderKey": 0,
"children": []
},
"replaced": []
},
{
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\JsonMenuNestedEditorFieldType",
"name": "structure",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": "Structure",
"class": "col-md-12",
"lastOfRow": false,
"helptext": null,
"icon": "fa fa-sitemap"
},
"mappingOptions": {
"index": null,
"analyzer": null
},
"restrictionOptions": {
"mandatory": false,
"mandatory_if": null,
"minimum_role": null,
"json_nested_deny": [],
"json_nested_max_depth": null
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": null
},
"raw_data": [],
"migrationOptions": {
"protected": false
}
},
"orderKey": 1,
"children": [
{
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\ContainerFieldType",
"name": "folder",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": "Folder",
"class": "col-md-12",
"lastOfRow": false,
"helptext": null,
"icon": "fa fa-folder"
},
"mappingOptions": [],
"restrictionOptions": {
"minimum_role": null,
"json_nested_deny": [],
"json_nested_is_leaf": false
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": null
},
"raw_data": []
},
"orderKey": 0,
"children": []
},
"replaced": []
},
{
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\ContainerFieldType",
"name": "file",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": "File",
"class": "col-md-12",
"lastOfRow": false,
"helptext": null,
"icon": "fa fa-file"
},
"mappingOptions": [],
"restrictionOptions": {
"minimum_role": null,
"json_nested_deny": [],
"json_nested_is_leaf": true
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": null
},
"raw_data": []
},
"orderKey": 1,
"children": [
{
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\TextStringFieldType",
"name": "label",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": "Label",
"class": "hidden",
"lastOfRow": false,
"helptext": null,
"prefixIcon": null,
"prefixText": null,
"suffixIcon": null,
"suffixText": null,
"placeholder": null,
"icon": null
},
"mappingOptions": [],
"restrictionOptions": {
"mandatory": false,
"mandatory_if": null,
"minimum_role": null
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": "{{ _source.file.filename|json_encode|raw }}"
},
"raw_data": [],
"migrationOptions": {
"protected": false
}
},
"orderKey": 0,
"children": []
},
"replaced": []
},
{
"class": "EMS\\CoreBundle\\Entity\\FieldType",
"arguments": [],
"properties": {
"type": "EMS\\CoreBundle\\Form\\DataField\\AssetFieldType",
"name": "file",
"contentType": null,
"deleted": false,
"description": null,
"options": {
"displayOptions": {
"label": "File",
"class": "col-md-12",
"lastOfRow": false,
"helptext": null,
"multiple": false,
"icon": null,
"imageAssetConfigIdentifier": null
},
"mappingOptions": [],
"restrictionOptions": {
"mandatory": true,
"mandatory_if": null,
"minimum_role": null
},
"extraOptions": {
"extra": null,
"clear_on_copy": false,
"postProcessing": null
},
"raw_data": [],
"migrationOptions": {
"protected": false
}
},
"orderKey": 1,
"children": []
},
"replaced": []
}
]
},
"replaced": []
}
]
},
"replaced": []
}
]
},
"replaced": []
},
"refererFieldName": null,
"sortOrder": null,
"orderKey": 2,
"rootContentType": true,
"editTwigWithWysiwyg": true,
"webContent": true,
"autoPublish": false,
"templates": [],
"views": [],
"defaultValue": null,
"versionTags": [],
"versionOptions": {
"dates_read_only": true,
"dates_interval_one_day": false
},
"versionFields": {
"date_from": null,
"date_to": null,
"version_tag": null
},
"roles": {
"view": "ROLE_AUTHOR",
"create": "ROLE_AUTHOR",
"edit": "ROLE_AUTHOR",
"publish": "ROLE_PUBLISHER",
"delete": "ROLE_WEBMASTER",
"trash": "not-defined",
"archive": "not-defined",
"show_link_create": "ROLE_USER",
"show_link_search": "ROLE_USER"
},
"fields": {
"display": null,
"label": null,
"color": null,
"sort": null,
"tooltip": null,
"circles": null,
"business_id": null,
"category": null,
"asset": null
},
"settings": {
"tasks_enabled": false,
"tasks_titles": [],
"hide_revision_sidebar": false
}
},
"replaced": []
}
33 changes: 33 additions & 0 deletions recipes/websites/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "2.4"

services:

website:
image: "nginxinc/nginx-s3-gateway"
environment:
- AWS_ACCESS_KEY_ID=accesskey
- AWS_SECRET_ACCESS_KEY=secretkey
- AWS_SIGS_VERSION=4
- S3_BUCKET_NAME=website
- S3_SERVER=minio
- S3_SERVER_PORT=9000
- S3_SERVER_PROTO=http
- S3_REGION=us-east-1
- S3_STYLE=path
- ALLOW_DIRECTORY_LIST=false
- APPEND_SLASH_FOR_POSSIBLE_DIRECTORY=true
- PROVIDE_INDEX_PAGE=true
- PROXY_CACHE_VALID_OK=1m
- PROXY_CACHE_INACTIVE=1m
- DEBUG=false
labels:
- "traefik.enable=true"
- "traefik.http.routers.website.rule=Host(`website.localhost`)"
- "traefik.http.routers.website.entrypoints=web"
- "traefik.http.routers.website.service=website"
- "traefik.http.services.website.loadbalancer.server.port=80"


networks:
default:
name: skeleton
Loading

0 comments on commit db29d64

Please sign in to comment.