Skip to content

Conversation

angelmoya
Copy link

Ensure min lenght for postgresql password

Ensure min lenght for postgresql password
Copy link

@YuriiMotov YuriiMotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angelmoya, thanks for your interest and efforts!

It seems that it doesn't work (or, am I doing it wrongly?):

copier copy --vcs-ref patch-1 https://github.com/angelmoya/full-stack-fastapi-template.git my_project --trust

When it asks me to specify password for the PostgreSQL database I enter ch.
It doesn't give me any errors and I can see POSTGRES_PASSWORD=ch in .env

@YuriiMotov YuriiMotov changed the title Update copier.yml 🚸 Add Postgres password length validation in copier.yml Sep 3, 2025
@YuriiMotov YuriiMotov added feature New feature or request waiting labels Sep 3, 2025
@@ -53,6 +53,7 @@ postgres_password:
you can generate one with:
python -c "import secrets; print(secrets.token_urlsafe(32))"'
default: changethis
validate: "{% if (postgres_password | length) < 8 %} Password must have at least 8 characters{% endif %}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
validate: "{% if (postgres_password | length) < 8 %} Password must have at least 8 characters{% endif %}"
validate: |
{% if postgres_password|length < 8 %}
Password must have at least 8 characters
{% endif %}

Copy link

@youneshenniwrites youneshenniwrites Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YuriiMotov @angelmoya The inline validation didn’t trigger because Jinja in a single-line YAML string can be ignored by Copier. I think it's best to use a multi-line block like the above to make it work.

@github-actions github-actions bot removed the waiting label Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants