Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for easily importing themes and plugins #22

Open
leonstafford opened this issue Jan 16, 2021 · 7 comments
Open

Allow for easily importing themes and plugins #22

leonstafford opened this issue Jan 16, 2021 · 7 comments

Comments

@leonstafford
Copy link
Contributor

As recently mentioned by Jonathon Grove and one of the first things my mate Donnacha commented on when first talking about Lokl.

Trying to think like a user who actually creates WordPress sites and for my own needs for rapidly testing different WP configurations, I'd like to see these features:

  • allow passing additional provisioning commands when running a lokl image with major tag, like php8-5.0.0

Why not allow users to easily bundle desired plugins/themes during base image builds of Lokl?

Quick answer: it's difficult!

Long answer: running Lokl is aimed to be as simple as possible - copy paste a command and that's it. Building multiple Docker images and understanding provisioning shell scripts is a different level and I can just help those kind of developer-users to make modifications for their own build processes.

Alternative (thinking out loud)

The way I use docker commit to build the main Lokl releases could work well, via lokl-cli wizard, even, to allow users to "Save this site as a template"

  • they get a site setup with all their favourite plugins/themes, maybe WordPress language changed to French, local timezone set, etc.
  • from site management menu, they choose "Save this site as template", which saves as tag "lokltemplateTEMPLATENAME", ie "lokltemplateREALESTATECLIENTS"
  • when they then navigate to the Create site menu in wizard, if Lokl templates are detected on system, it will offer to create using one of their own templates

That seems like a nice option that may suffice even for developer users.

Back to how to actually install themes/plugins and make other site modifications

TBC

@leonstafford
Copy link
Contributor Author

Continuing:

A few ideas of methods to load plugins/themes:

  • options in site management menu to Load plugin(s) from directory and Load themes(s) from directory, which could be zips or folders. May be able to parse the files to know if they're a theme/plugin and avoid the extra menu option
  • custom config file, like YAML (eww) or such, listing which plugins/themes/common Lokl site modifications to make
  • shell script template. barrier of entry would be high for many, but could provide a template and a ## CHANGE THIS BIT TO ADD PLUGINS ##.
  • interactive option in wizard to add plugins/themes, which asks for location (wp.org directory, local zip/dir, remote zip/dir, git repos)
  • host OS directory, oragnized with target plugins/themes/additional scripts

I like the idea of shell script or HCL style config file, so that it can be passed in when launching a container noninteractively, applying those directives. The shell scripts can then be community-shared, no magic parsers required, it just applies them directly.

It shouldn't need aim to be beautifully idempotent, like a full-blown provisioning system. If in doubt, take a snapshot before. Besides the stored data, if container's env gets messed up, it should be reversible/fixable, else just backup/import site into a fresh one.

Multisite management commands

Extra topic, but it should be little work for nice reward to allow applying same commands to all sites, be it updating WordPress and plugins, taking backups, installing plugins or what not. Basically, like an Ansible/Rubdeck/Chef style

Overall priorities

Things which are easily done in WordPress, like backup/import/installing plugins are nice if we can do them in a smooth way that takes advantage of and compliments Lokl, but there is the usual WP way in the meantime.

@grovejc
Copy link

grovejc commented Jan 16, 2021

I like the idea of local templates or even an option for a user to pass in their own image. I also like keeping things simple so I would think creating a site, doing the normal wordpress stuff from UI, and then backing up would suffice. As I understand now that workflow is possible with lokl.

When using this image with lokl-cli it seems uploading from UI is broken:
https://hub.docker.com/layers/lokl/lokl/php8-5.0.0-dev/images/sha256-2bf5764d99149be6f199e6510c67a6e9e2b071c11116d07f59464470333fc5b4?context=explore

However, if I hardcode lokl-cli to point to this image I am able to upload a theme through the UI:
https://hub.docker.com/layers/lokl/lokl/0.0.19/images/sha256-5f77852c0fa30cbf2df7a1d56c1bfd95d295f34fbf7fe4bbf1fa481e19fee3ae?context=explore

@grovejc
Copy link

grovejc commented Jan 16, 2021

Perhaps I am conflating lokl and lokl-cli. Sorry for any confusion.

@leonstafford
Copy link
Contributor Author

Thanks, I'll check it out. A difference between those two should be using root everywhere, but I did notice some nginx owned things recently, that may lead me to the issue.

@leonstafford
Copy link
Contributor Author

Yep, just confirmed, that's my mistake, I'd taken a line out of the provisioning scripts which explicitly set all the webroot to root:root, which I didn't catch, as could activate through the CLI.

You can run this once in one of the newer containers and will sort that out:

sudo chown -R root:root .

Using the SSH into container option in Lokl

@leonstafford
Copy link
Contributor Author

@grovejc re

Perhaps I am conflating lokl and lokl-cli. Sorry for any confusion.

It does get a bit confusing :D

lokl-cli is just the code that runs the wizard, creates and "drives" the containers, which are built with lokl.

I'm pleasantly suprised that you could use the latest lokl-cli to drive an older version (tag) of the Lokl image. Obviously, it then misses out on ability to choose PHP 7 or 8, but most of the rest should work fine. Slightly older PHPMyAdmin, etc.

@leonstafford
Copy link
Contributor Author

related to elementor/lokl-cli#21

I'll start work on a templating system to initially mount volumes and can later expand to extra provisioning steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants