Skip to content

Improve install_cert.sh: validation, backup, and UX enhancements #230

@DerekRoberts

Description

@DerekRoberts

Suggestions for install_cert.sh improvements

  1. File existence and format validation

    • Check that ${DOMAIN}.pem, ${DOMAIN}.key, and ${DOMAIN}.ca-cert exist and are non-empty before proceeding.
    • Optionally, use openssl to verify that the certificate and key match (modulus check).
  2. Automatic route backup

    • Before making any changes, export the current route YAML to a timestamped backup file (e.g., using: oc get route -o yaml > backup).
    • This allows quick rollback if something goes wrong.
  3. Safer route replacement

    • If the route already exists, handle it gracefully (e.g., use oc replace, oc apply, or delete the old route first).
    • Echo a clear error message if route creation fails.
  4. CA chain handling

    • If the CA chain is split across multiple files, concatenate them into ${DOMAIN}.ca-cert before running the script.
  5. User experience improvements

    • Echo the full oc command before running it so the user can see exactly what will be executed.
    • Add clear error messages and confirmations at each step.

These changes will make the script safer, more robust, and easier to use and recover from errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions