[#33] Ckeditor4 LTS integration
Check list to complete before assigning a MR to someone:
-
Link related issues on Related Issues
; -
Update documentation; -
Comment relevant changes, why/what lead us to make this change; -
Review at least once you own MR; -
Tests green;
Related issues:
- #33 (closed) (Integrate CKEditor 4 LTS)
- drupalsite-operator#100 (closed) (Update the Operator to pass the secret for ckeditor4lts as an environmental variable)
Merge request reports
Activity
added 1 commit
- 24f0548c - First iteration of adding LTS + improving post-setup-actions
mentioned in issue #33 (closed)
requested review from @ldelpian
requested review from @jyde
Missing:
- The license should be kept secret, and as such the path
/admin/config/ckeditor-lts/settings
should be inaccessible to users, and key injection should be done outside the image code-base to avoid exposing it. - The license key is not yet injected automatically
Otherwise, looks good. Tested on https://easy-start-site-carina.web.cern.ch/ Before
- The license should be kept secret, and as such the path
As discussed, I have rebased against
dev10.2-0-pack-fix
and also bumped theckeditor_lts
version to"1.0.1"
instead of^1.0
, so as to be consistent with how we set versions to composer.json lately.I have noticed when applying the image to a newly created test site on
drupal-stg
that CKEditor 4 - LTS is installed but to have theText format: CERN Full HTML
that @crdeoliv shows in the screenshot above, we have to installCERN Full Html format
. For this to be enabled, we also have to enable the CKEditor Color Button, Panel Button, CKEditor Font, CKEditor 5 modules. Is my understanding correct?https://cked4lts.web.cern.ch/node/add/article
Also, the module is installed on path
/app/web/modules/contrib/ckeditor_lts
inphp-fpm
container and has a configuration schema/app/web/modules/contrib/ckeditor_lts/config/schema
:...... ckeditor.lts.settings: type: config_object label: 'Ckeditor4 - LTS settings' mapping: license_key: type: string label: 'License key' ......
So when we set the license key from browser and then run
drush config:export
we can see that the license_key exists in ackeditor.lts.settings.yml
file:/app/config/sync $ cat ckeditor.lts.settings.yml license_key: <key-value>
Possible way to begin
An idea would be to add key variable
CKEDITOR_LICENSE_KEY
in Gitlab's project settings with the actual ckeditor4_lts key as the value.Then we could access the
CKEDITOR_LICENSE_KEY
variable in gitlab-ci.yml by reffering to it as $CKEDITOR_LICENSE_KEY in the environment section:- echo "CKEDITOR_LICENSE_KEY=$CKEDITOR_LICENSE_KEY" >> env.env
After the above are completed succesfully, as a next step, we must identify how this env variable can be used by the module itself".
I agree the key should be configured via gitlab CI and it can be mounted into a secret and passed as a configuration variable. See https://gitlab.cern.ch/paas-tools/okd4-install/-/blob/master/docs/components/drupal/deployment-design.md#configuration-secrets and an example https://gitlab.cern.ch/drupal/paas/drupalsite-operator/-/blob/master/controllers/drupalsite_resources.go#L918
This would allow us to run an initial export into configuration via drush config set
drush -y config-set ckeditor.lts.settings license_key: $CKEDITOR_LICENSE_KEY
.However we need to persist this to all new websites as well and clones. One option could be to add this call to the runupdb script and the ensure-site-install which are already called from the operator side (https://gitlab.cern.ch/drupal/paas/cern-drupal-distribution/-/blob/v10.2-0/images/drupal-operations-scripts) another option would be to create a new script to set this key.
We should investigate as well if its possible to mount this configuration/file directly in order to avoid using drush commands. Perhaps via settings.php https://www.drupal.org/docs/administering-a-drupal-site/configuration-management/managing-your-sites-configuration#s-override-site-uuid-using-settingsphp?
Christina mentioned another option could be to use https://gitlab.cern.ch/drupal/paas/cern-drupal-distribution/-/blob/v10.2-0/scripts/post-setup-actions.sh?ref_type=heads
added 8 commits
-
fc6291a0...101d1c96 - 6 commits from branch
v10.2-0
- 456e6b52 - First iteration of adding LTS + improving post-setup-actions
- 16a20d24 - reverting old ckeditor
-
fc6291a0...101d1c96 - 6 commits from branch
added 8 commits
-
16a20d24...149c22f6 - 7 commits from branch
dev10.2-0-pack-fix
- 34fe4218 - First iteration of adding LTS + improving post-setup-actions
-
16a20d24...149c22f6 - 7 commits from branch
added 1 commit
- 2d2882b2 - revert post-setup-actions.sh and change Dockerfile