-
Notifications
You must be signed in to change notification settings - Fork 390
feat: Casdoor support postgresql #4068
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
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
apps/casdoor/1.925.0/data.yml
Outdated
| - label: MariaDB | ||
| value: mariadb | ||
| - label: PostgreSQL | ||
| value: postgresql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: postgres
直接把 value 设为 postgres 就行,这样脚本里就不用再重新判断赋值了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个思路应该是driverName=$PANEL_DB_TYPE,但是如果选择 mariadb 时,仍然需要在 init.sh 脚本特殊处理下。
我会改为value: postgres,然后 init.sh 脚本改成如下,你看是否可以?
#!/bin/bash
[ -f ./.env ] && source ./.env
# Default configuration
CASDOOR_DRIVER_NAME=${PANEL_DB_TYPE}
CASDOOR_DATASOURCE_NAME="${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@tcp(${PANEL_DB_HOST}:${PANEL_DB_PORT})/"
# Reset mariadb driver
if [ "$PANEL_DB_TYPE" = "mariadb" ]; then
CASDOOR_DRIVER_NAME="mysql"
fi
# Reset postgresql datasource
if [ "$PANEL_DB_TYPE" = "postgres" ]; then
CASDOOR_DATASOURCE_NAME="user=${PANEL_DB_USER} password=${PANEL_DB_USER_PASSWORD} host=${PANEL_DB_HOST} port=${PANEL_DB_PORT} dbname=${PANEL_DB_NAME} sslmode=disable"
fi
{
# Retain the original environment variables
grep -vE '^(CASDOOR_DRIVER_NAME|CASDOOR_DATASOURCE_NAME)' ./.env 2>/dev/null
# Add CASDOOR_xx environment variables
echo "CASDOOR_DRIVER_NAME=\"${CASDOOR_DRIVER_NAME}\""
echo "CASDOOR_DATASOURCE_NAME=\"${CASDOOR_DATASOURCE_NAME}\""
echo ""
} > ./.env.tmp && mv ./.env.tmp ./.env以上已在本地测试通过
| # Construct the postgresql connection configuration | ||
| if [ "$PANEL_DB_TYPE" = "postgresql" ]; then | ||
| CASDOOR_DRIVER_NAME="postgres" | ||
| CASDOOR_DATASOURCE_NAME="user=${PANEL_DB_USER} password=${PANEL_DB_USER_PASSWORD} host=${PANEL_DB_HOST} port=${PANEL_DB_PORT} dbname=${PANEL_DB_NAME} sslmode=disable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问这是官方提供的 datasource 吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本地环境测试没问题的话?再同步一下最新代码,应用版本有更新。
…ish-byte-muse-1.x chore(deps): update envyafish/byte-muse docker tag to v1.26.8

No description provided.