Skip to content

Fix directory auto-creation: remove from Secrets, add to Certificates#207

Merged
dkarlovi merged 2 commits intomainfrom
copilot/undo-secrets-change-and-add-certificates
Jan 15, 2026
Merged

Fix directory auto-creation: remove from Secrets, add to Certificates#207
dkarlovi merged 2 commits intomainfrom
copilot/undo-secrets-change-and-add-certificates

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

PR #201 incorrectly added mkdir -p logic to Secrets/common.mk. Secrets requires template files (.secret.dist) to function - if no templates exist, no directory should be created. Certificates, however, generates files on-the-fly via mkcert and needs the directory to exist beforehand.

Changes

  • Secrets/common.mk: Removed ${SECRETS_DIR}: target and its mkdir -p command. Removed directory dependency from ${SECRETS_DIR}/%.secret rule.

  • Certificates/common.mk: Added ${CERTIFICATES_DIR}: target with mkdir -p $@. Added directory dependency to ${CERTIFICATES_DIR}/%.pem rule.

Behavior

Before:

# Secrets (incorrect)
${SECRETS_DIR}:
	mkdir -p $@
${SECRETS_DIR}/%.secret: ${SECRETS_DIR}
	cp $@${SECRETS_DIST} $@

# Certificates (missing)
${CERTIFICATES_DIR}/%.pem:
	(cd ${CERTIFICATES_DIR} && mkcert $*)  # Fails if dir doesn't exist

After:

# Secrets (correct - no auto-creation)
${SECRETS_DIR}/%.secret:
	cp $@${SECRETS_DIST} $@

# Certificates (correct - auto-creates dir)
${CERTIFICATES_DIR}:
	mkdir -p $@
${CERTIFICATES_DIR}/%.pem: ${CERTIFICATES_DIR}
	(cd ${CERTIFICATES_DIR} && mkcert $*)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c
    • Triggering command: /usr/local/bin/php php /tools/composer install --audit (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>mkdir .infra/certificates</issue_title>
<issue_description>Note that this was closed in #201, but that was a brain fart, we've added it to the wrong thing: .infra/secrets doesn't need to have the folder auto-created because it requires the templates to work, if there's no templates, there's no folder with templates and there's nothing to do.

Certificates does need this because the folder doesn't exist upfront, we need to create it. Undo #201 and add the fix for certificates.</issue_description>

<agent_instructions>Check the description, remove the secrets change done in #201 and apply the same type of change for certificates.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: dkarlovi <209225+dkarlovi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix folder creation for certificates in .infra Fix directory auto-creation: remove from Secrets, add to Certificates Jan 15, 2026
Copilot AI requested a review from dkarlovi January 15, 2026 10:35
@dkarlovi dkarlovi marked this pull request as ready for review January 15, 2026 11:48
@dkarlovi dkarlovi merged commit a239385 into main Jan 15, 2026
8 checks passed
@dkarlovi dkarlovi deleted the copilot/undo-secrets-change-and-add-certificates branch January 15, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

mkdir .infra/certificates

2 participants