Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Script: Zitadel #2141

Merged
merged 31 commits into from
Feb 10, 2025
Merged

New Script: Zitadel #2141

merged 31 commits into from
Feb 10, 2025

Conversation

dave-yap
Copy link
Contributor

@dave-yap dave-yap commented Feb 7, 2025

✍️ Description

Zitadel is an open-source identity and access management (IAM) solution designed to provide secure authentication, authorization, and user management for modern applications and services. Built with a focus on flexibility, scalability, and security, Zitadel offers a comprehensive set of features for developers and organizations looking to implement robust identity management.


  • Related Issue: #
  • Related PR: #
  • Related Discussion: #

✅ Prerequisites

The following steps must be completed for the pull request to be considered:

  • [✅] Self-review performed (I have reviewed my code to ensure it follows established patterns and conventions.)
  • [✅] Testing performed (I have thoroughly tested my changes and verified expected functionality.)

🛠️ Type of Change

Please check the relevant options:

  • [] Bug fix (non-breaking change that resolves an issue)
  • [] New feature (non-breaking change that adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to change unexpectedly)
  • [✅] New script (a fully functional and thoroughly tested script or set of scripts)

📋 Additional Information (optional)

Provide any extra context or screenshots about the feature or fix here.

This script exposes port 8080 with TLS disabled but users are able to easily change the config.yaml to include TLS solutions. The service needed to be ran twice in the install-script as initially the console is only accessible via localhost. As it is a LXC script, I do not see a way to access the console externally. Thus, the setup was ran again in order to have a nice admin username + access externally. Any changes done to the config.yaml file required an execution of the included bash script to ensure the database is migrated properly. This is based on Zitadel's own documentations.

@dave-yap dave-yap requested a review from a team as a code owner February 7, 2025 15:59
@github-actions github-actions bot added new script A change that adds a new script website A change to the website labels Feb 7, 2025
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
dave-yap and others added 5 commits February 8, 2025 01:25
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
dave-yap and others added 2 commits February 8, 2025 01:32
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
Copy link
Member

@tremor021 tremor021 left a comment

Choose a reason for hiding this comment

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

Small things

@tremor021 tremor021 requested a review from a team February 7, 2025 17:35
@dave-yap
Copy link
Contributor Author

dave-yap commented Feb 7, 2025

Small things

No worries, thanks for letting me know. Was following the Zitadel docs and didn't realize I scripted around it instead of following the community guide. My bad!

Co-authored-by: bvdberg01 <74251551+bvdberg01@users.noreply.github.com>
@dave-yap
Copy link
Contributor Author

Should all be fixed now

@dave-yap dave-yap requested a review from bvdberg01 February 10, 2025 07:48
@MickLesk
Copy link
Member

ive updated the whole update block to our defaults:

Old:

    RELEASE=$(curl -si https://github.com/zitadel/zitadel/releases/latest | grep location: | cut -d '/' -f 8 | tr -d '\r')
    if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt | grep -oP '\d+\.\d+\.\d+')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
        msg_info "Updating ${APP} (Patience)"
        wget -qc https://github.com/zitadel/zitadel/releases/download/$RELEASE/zitadel-linux-amd64.tar.gz -O - | tar -xz
        systemctl stop zitadel.service
        sudo mv zitadel-linux-amd64/zitadel /usr/local/bin
        rm -rf zitadel-linux-amd64
        zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true &>/dev/null
        systemctl start zitadel.service
        echo -e "$(zitadel -v | grep -oP 'v\d+\.\d+\.\d+')" > /opt/${APP}_version.txt
        msg_ok "Updated ${APP} to ${RELEASE}"
    else
        msg_ok "No update required. ${APP} is already at ${RELEASE}"
    fi
    exit
}

New:

    RELEASE=$(curl -si https://github.com/zitadel/zitadel/releases/latest | grep location: | cut -d '/' -f 8 | tr -d '\r')
    if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt | grep -oP '\d+\.\d+\.\d+')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
        msg_info "Stopping $APP"
        systemctl stop zitadel
        msg_ok "Stopped $APP"
        
        msg_info "Updating $APP to v${RELEASE}"
        cd /tmp
        wget -qc https://github.com/zitadel/zitadel/releases/download/$RELEASE/zitadel-linux-amd64.tar.gz -O - | tar -xz
        mv zitadel-linux-amd64/zitadel /usr/local/bin
        zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true &>/dev/null
        echo "${RELEASE}" >/opt/${APP}_version.txt
        msg_ok "Updated $APP to v${RELEASE}"

        msg_info "Starting $APP"
        systemctl start zitadel
        msg_ok "Started $APP"

        msg_info "Cleaning Up"
        rm -rf /tmp/zitadel-linux-amd64
        msg_ok "Cleanup Completed"
        msg_ok "Update Successful"
      else
        msg_ok "No update required. ${APP} is already at ${RELEASE}"
    fi
    exit
}

MickLesk
MickLesk previously approved these changes Feb 10, 2025
@michelroegl-brunner michelroegl-brunner changed the title New Script: Zitadel LXC New Script: Zitadel Feb 10, 2025
@dave-yap
Copy link
Contributor Author

dave-yap commented Feb 10, 2025

There'll be a recurring v here at this line: msg_info "Updating $APP to v${RELEASE}", no need for the v before calling the RELEASE variable.

The RELEASE variable contains a v in front of the version number.

bvdberg01
bvdberg01 previously approved these changes Feb 10, 2025
@michelroegl-brunner michelroegl-brunner dismissed stale reviews from bvdberg01, MickLesk, and themself via 736845d February 10, 2025 08:22
@michelroegl-brunner
Copy link
Member

Removed the v before ${RELEASE} and added the Version to File part in zitadel-install.sh

@MickLesk MickLesk merged commit b05858c into community-scripts:main Feb 10, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new script A change that adds a new script website A change to the website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants