Skip to main content

Welance Starter (ATM: CraftCMS 3.x + Docker)

The project is the base to fork to create new projects using craft cms. The repository contains:

  • docker configuration for craft container
  • docker-compose configuration to run the craft+mysql enviroment
  • base schema customization of the craft installation
  • apache configuration
  • base template for craft frontend
  • utility scripts to start/stop the enviroment
  • utility scripts to import/export craft schema changes

More info about this project: here.

Installation

To install waldcli run pip install waldcli

For preview releases run pip install --extra-index-url https://test.pypi.org/simple/ waldcli

Workflow

The following is the standard workflow to use with the projects using craft/docker for development.

0. Setup

⚠️ note: Execute point nr. 4, only if the setup has not yet been done

  1. Fork the starter project create a fork of the latest release of the base repo : https://github.com/welance/welance-craft-starter
  2. Install python/libs and bash completion (make sure to have python3 installed, use virtualenv if necessary).
  3. run:
    • pip install -r bin/requirements.txt to install the required libraries and
    • source bin/butler.bash-completion to enable commands autocompletion
  4. Run bin/butler.py setup script. (required: docker). The script will ask for:

!!! ATTENTION !!! customer and project number are used to setup the containers environment, they cannot be easily changed once the project is on-going.

  1. Commit commit the chagnes to the repository, in particular the changes reated to:
./bin/.butler.json
./docker/docker-compose.yml
./docker/docker-compose-staging.yml

1. Development

During the development here are the most used commands:

  1. Start! Start The docker dev environment bin/butler.py start --port [PORT_NUMBER] script starts the docker containers

  2. Work! The development phase of the project will involve 3 main resources:

  • the templatesfolder
  • the config/project.yaml
  • the plugins folder
  1. Stop! Stop the docker dev environment bin/butler.py stop stops the docker conatiners. It doesn't delete the database or cms data.

Import/Export (Project/DB) Schema

The schema is imported/exported automatically by Craft v3+ into config/project.yml, so just make sure tommit it

Local Plugin Development:

If you would like to develop a local plugin, we need to put it inside the plugins folder such as /plugins/VENDOR_NAME/PLUGIN_NAME

Import/Export database seed

To import/export the dump of the database that it is used to setup/seed the database

  • bin/butler.py seed-import -f=path/to/file
  • bin/butler.py seed-export -f=path/to/file

the seed sql file is imported/exported from build/dump/base.sql

TODO: change this!

Accessing the database

Since the database use in the containers is not accessible from outside docker a database web interface is provided to dump/load/edit the database directly. The interface of the database is Adminer and is available via http or https.

The urls are:

The parameters to log in are:

  • System: MySQL or PostgreSQL depending on the driver selected
  • Server: database
  • Username: craft
  • Password: craft
  • Database: craft

Apache configuration and .htaccess

The website apache configuration is stored in ./docker/craft/conf/apache2/conf.d/welance.conf. The welance.conf contains all the settings for the installation to work and should be taken as a reference for production installation. By default .htaccess is DISABLED, because. Changes to the apache configuration require to restart the environment (bin/butler.py local-stop, bin/butler.py local-start) to be enabled.

Applying Craftcms updates

TODO

Troubleshooting

Docker: the project folder must be located in one of the Docker File Sharing paths. You can add a folder (for example the mamp one) by edit the prefernces of your docker installation

CraftCMS: if you log in using HTTPS login with HTTP fails. This has someting to do with sessions and CSRF protection. To solve the issue clear the browser application data and retry.

Adminer: if you log in using HTTPS login with HTTP fails. This has someting to do with sessions and CSRF protection. To solve the issue clear the browser application data and retry.

SSL

the certificate shipped with the project has been created using:

localhost:/# openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout welance.ssl.key -out welance.ssl.crt
Generating a 2048 bit RSA private key
....................+++
....................................................................+++
writing new private key to 'welance.ssl.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) []:DE
State or Province Name (full name) []:Berlin
Locality Name (eg, city) []:Berlin
Organization Name (eg, company) []:Welance
Organizational Unit Name (eg, section) []:
Common Name (eg, fully qualified host name) []:
Email Address []:info@welance.de

2. Deploy on Staging

For staging environment are available the commands:

  • bin/butler.py open-staging

they are used by the welance clerk system

3. Create a Release Package

To create an tar.gz archive of the craft installation use the command

  • bin/butler.py release-package

it will create a file release.tar.gz file in the root of the project containing the craft installation with a fresh database dump in the build/dump/base.sql location

Project removal

Once the project is finished to remove the resources associated with the project (containers and data) the bin/butler.py teardownscript is provided.

License

https://commonsclause.com/

Metadata

Release files for waldcli 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waldcli 0.2.3
File Size Uploaded Provenance Actions
waldcli-0.2.3.tar.gz 18.5 kB Without provenance Details for waldcli-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for waldcli 0.2.3
File Interpreter ABI Platform Actions
waldcli-0.2.3-py3-none-any.whl Python 3 none any Details for waldcli-0.2.3-py3-none-any.whl

Total release size: 34.8 kB

Release files / waldcli-0.2.3.tar.gz

Download URL waldcli-0.2.3.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
09236ba1f48df39c14600243eae0f6dfd064b71df64602dd2d91dd6de30c8e22
BLAKE2b-256 checksum
How to use checksums
ba1b4a802fbb5563fb2c6ad11f307717cba2d987c48e1b8365e7757aa5b944b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.16 CPython/3.7.2 Darwin/18.6.0

Release files / waldcli-0.2.3-py3-none-any.whl

Download URL waldcli-0.2.3-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f845f7c977e69c88e57f4923a98edea0f652b61f02813e458178689b3a0adde6
BLAKE2b-256 checksum
How to use checksums
2475f3a33ad4c0b680a70049fce077884e3a674ed79aafb87c8b90efab410cf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.16 CPython/3.7.2 Darwin/18.6.0

Security for waldcli 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page