minBoxVersion set to 7.5.1, make migrate_ldap_users_to_oidc() always running on startup

This commit is contained in:
Vladimir D 2023-09-26 16:19:24 +04:00
parent e176d6c705
commit bbae02fa50
2 changed files with 2 additions and 5 deletions

View file

@ -37,7 +37,7 @@
"tags": [ "version control", "git", "code hosting", "development", "github", "bitbucket", "gitlab" ], "tags": [ "version control", "git", "code hosting", "development", "github", "bitbucket", "gitlab" ],
"changelog": "file://CHANGELOG.md", "changelog": "file://CHANGELOG.md",
"postInstallMessage": "file://POSTINSTALL.md", "postInstallMessage": "file://POSTINSTALL.md",
"minBoxVersion": "7.3.0", "minBoxVersion": "7.5.1",
"forumUrl": "https://forum.cloudron.io/category/19/gitea", "forumUrl": "https://forum.cloudron.io/category/19/gitea",
"documentationUrl": "https://docs.cloudron.io/apps/gitea/" "documentationUrl": "https://docs.cloudron.io/apps/gitea/"
} }

View file

@ -72,11 +72,8 @@ setup_auth() {
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
setup_oidc_source setup_oidc_source
ldap_users_to_migrate=$(mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -N -B -e "select count(*) from user WHERE login_type=2 AND login_source=1")
if [ "${ldap_users_to_migrate:0}" -gt 0 ]; then
migrate_ldap_users_to_oidc migrate_ldap_users_to_oidc
fi fi
fi
user_count=$(mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -N -B -e "SELECT count(*) FROM user") user_count=$(mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -N -B -e "SELECT count(*) FROM user")
# be careful, not to create root user for existing LDAP based installs # be careful, not to create root user for existing LDAP based installs