Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/sitectl-create-smoke-test.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ FROM ${BASE_IMAGE}

ARG TARGETARCH

ENV COMPOSER_ALLOW_SUPERUSER=1
ENV \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1
WORKDIR /var/www/drupal

COPY --link composer.json composer.lock /var/www/drupal/
Expand Down
30 changes: 18 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

DEFAULT_HTTP=80
DEFAULT_HTTPS=443
SITECTL ?= sitectl
SITECTL_CONTEXT ?=
SITECTL_ARGS := $(if $(SITECTL_CONTEXT),--context $(SITECTL_CONTEXT),)

help: ## Show this help message
echo 'Usage: make [target]'
Expand All @@ -18,22 +21,24 @@ help: ## Show this help message
awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%s\033[0m\t%s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | column -t -s $$'\t'

status: ## Show the current status of the development environment
./scripts/status.sh
$(SITECTL) $(SITECTL_ARGS) validate
$(SITECTL) $(SITECTL_ARGS) traefik ingress-status

traefik-http: ## Switch to HTTP mode (default)
./scripts/traefik-http.sh
$(SITECTL) $(SITECTL_ARGS) traefik tls http

traefik-https-mkcert: ## Switch to HTTPS mode using mkcert self-signed certificates
./scripts/traefik-https-mkcert.sh
$(SITECTL) $(SITECTL_ARGS) traefik tls mkcert

traefik-https-letsencrypt: ## Switch to HTTPS mode using Let's Encrypt ACME
./scripts/traefik-https-letsencrypt.sh
$(SITECTL) $(SITECTL_ARGS) traefik tls letsencrypt

pull:
docker compose pull --ignore-buildable --ignore-pull-failures
$(SITECTL) $(SITECTL_ARGS) compose pull --ignore-buildable --ignore-pull-failures

build: pull ## Build the drupal container
./scripts/build.sh
id -u > ./certs/UID
$(SITECTL) $(SITECTL_ARGS) compose build

lint: ## Lint custom Drupal code
./scripts/lint.sh
Expand All @@ -48,25 +53,26 @@ up: ## Start docker compose project with smart port allocation
./scripts/up.sh

up-%: ## Start a specific service (e.g., make up-drupal)
docker compose up $* -d
$(SITECTL) $(SITECTL_ARGS) compose up $*

down: ## Stop/remove the docker compose project's containers and network.
docker compose down
$(SITECTL) $(SITECTL_ARGS) compose down

down-%: ## Stop/remove a specific service (e.g., make down-traefik)
docker compose down $*
$(SITECTL) $(SITECTL_ARGS) compose stop $*
$(SITECTL) $(SITECTL_ARGS) compose rm -f $*

logs-%: ## Look at logs for a specific service (e.g., make logs-drupal)
docker compose logs $* --tail 20 -f
$(SITECTL) $(SITECTL_ARGS) compose logs $* --tail 20 -f

clean: ## Delete all stateful data.
./scripts/clean.sh

ping: ## Ensure site is available.
./scripts/ping.sh
$(SITECTL) $(SITECTL_ARGS) healthcheck

rollout: ## Roll out the currently checked out Drupal stack.
./scripts/rollout.sh

sequelace:
./scripts/sequelace.sh
$(SITECTL) $(SITECTL_ARGS) sequelace
14 changes: 7 additions & 7 deletions assets/default_settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ $content_directories['sync'] = '/var/www/drupal/content/sync';
// Container environment variable path.
$path = "/var/run/s6/container_environment/";

$config['search_api.server.default_solr_server']['backend_config']['connector_config']['host'] = file_get_contents($path . 'DRUPAL_DEFAULT_SOLR_HOST');
$config['search_api.server.default_solr_server']['backend_config']['connector_config']['port'] = file_get_contents($path . 'DRUPAL_DEFAULT_SOLR_PORT');
$config['search_api.server.default_solr_server']['backend_config']['connector_config']['host'] = file_exists($path . 'DRUPAL_DEFAULT_SOLR_HOST') ? file_get_contents($path . 'DRUPAL_DEFAULT_SOLR_HOST') : 'solr';
$config['search_api.server.default_solr_server']['backend_config']['connector_config']['port'] = file_exists($path . 'DRUPAL_DEFAULT_SOLR_PORT') ? file_get_contents($path . 'DRUPAL_DEFAULT_SOLR_PORT') : '8983';
$config['search_api.server.default_solr_server']['backend_config']['connector_config']['core'] = file_get_contents($path . 'DRUPAL_DEFAULT_SOLR_CORE');

$smtp_host = file_exists($path . 'LIBOPS_SMTP_HOST') ? trim(file_get_contents($path . 'LIBOPS_SMTP_HOST')) : 'host.docker.internal';
Expand All @@ -47,11 +47,11 @@ $settings['trusted_host_patterns'] = [

// Database settings are also derived from environment variables.
$databases['default']['default'] = [
'database' => file_get_contents($path . 'DRUPAL_DEFAULT_DB_NAME'),
'username' => file_get_contents($path . 'DRUPAL_DEFAULT_DB_USER'),
'password' => file_get_contents($path . 'DRUPAL_DEFAULT_DB_PASSWORD'),
'host' => file_get_contents($path . 'DB_MYSQL_HOST'),
'port' => file_get_contents($path . 'DB_MYSQL_PORT'),
'database' => file_get_contents($path . 'DB_NAME'),
'username' => file_get_contents($path . 'DB_USER'),
'password' => file_get_contents($path . 'DB_PASSWORD'),
'host' => file_get_contents($path . 'DB_HOST'),
'port' => file_get_contents($path . 'DB_PORT'),
'prefix' => '',
'driver' => 'mysql',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ services:
DRUPAL_DEFAULT_NAME: "Drupal-Website"
DRUPAL_DEFAULT_PROFILE: "minimal"
DRUPAL_DEFAULT_SITE_URL: "${DOMAIN}"
DRUPAL_DEFAULT_SOLR_HOST: "solr"
DRUPAL_DEFAULT_SOLR_CORE: "default"
DRUPAL_DEFAULT_SOLR_PORT: "8983"
DRUSH_OPTIONS_URI: "${URI_SCHEME}://${DOMAIN}"
NGINX_REAL_IP_RECURSIVE: ${REVERSE_PROXY}
NGINX_SET_REAL_IP_FROM: ${FRONTEND_IP_1}
Expand All @@ -100,6 +102,7 @@ services:
- source: DB_ROOT_PASSWORD
- source: DRUPAL_DEFAULT_ACCOUNT_PASSWORD
- source: DRUPAL_DEFAULT_DB_PASSWORD
target: DB_PASSWORD
- source: DRUPAL_DEFAULT_SALT
- source: CERT_AUTHORITY
- source: UID
Expand Down
10 changes: 0 additions & 10 deletions scripts/build.sh

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/init-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ chmod +x /usr/local/bin/mkcert

./scripts/generate-certs.sh
./scripts/generate-secrets.sh

if [ -n "${HOST_UID:-}" ]; then
chown -R "${HOST_UID}:${HOST_GID:-${HOST_UID}}" /certs /secrets
fi
23 changes: 20 additions & 3 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,25 @@ if command -v "sestatus" >/dev/null; then
fi
fi

docker compose run --rm init

chown -R "$(whoami)" ./certs ./secrets > /dev/null 2>&1 || sudo chown -R "$(whoami)" ./certs ./secrets
host_uid="$(id -u)"
host_gid="$(id -g)"

docker compose run --rm \
-e HOST_UID="${host_uid}" \
-e HOST_GID="${host_gid}" \
init

if [ "${host_uid}" -eq 0 ]; then
chown -R "${host_uid}:${host_gid}" ./certs ./secrets
else
unowned_path="$(find ./certs ./secrets ! -user "${host_uid}" -print -quit)"
if [ -n "${unowned_path}" ]; then
if command -v sudo > /dev/null 2>&1 && sudo -n true 2> /dev/null; then
sudo chown -R "${host_uid}:${host_gid}" ./certs ./secrets
else
echo "Could not change certs/secrets ownership without sudo; continuing after container-side ownership fix." >&2
fi
fi
fi

make build
46 changes: 0 additions & 46 deletions scripts/sequelace.sh

This file was deleted.

Loading