diff --git a/apps/casdoor/1.645.0/data.yml b/apps/casdoor/1.645.0/data.yml index 9c7f0a58..5e6d3d10 100644 --- a/apps/casdoor/1.645.0/data.yml +++ b/apps/casdoor/1.645.0/data.yml @@ -59,7 +59,7 @@ additionalProperties: type: select values: - label: PostgreSQL - value: postgresql + value: postgres - label: MySQL (MariaDB, Percona) value: mysql - default: "127.0.0.1" diff --git a/apps/casdoor/1.645.0/docker-compose.yml b/apps/casdoor/1.645.0/docker-compose.yml index 93ec9bb8..80297eae 100644 --- a/apps/casdoor/1.645.0/docker-compose.yml +++ b/apps/casdoor/1.645.0/docker-compose.yml @@ -20,6 +20,10 @@ services: dockerfile: Dockerfile target: STANDARD entrypoint: /bin/sh -c './server --createDatabase=true' + env_file: + - /etc/1panel/envs/global.env + - /etc/1panel/envs/casdoor/casdoor.env + - ${ENV_FILE:-/etc/1panel/envs/default.env} volumes: - ${CASDOOR_ROOT_PATH}/data/files:/home/user/casdoor/files environment: diff --git a/apps/casdoor/1.645.0/scripts/init.sh b/apps/casdoor/1.645.0/scripts/init.sh index 8d37dc47..ca375e4a 100644 --- a/apps/casdoor/1.645.0/scripts/init.sh +++ b/apps/casdoor/1.645.0/scripts/init.sh @@ -11,11 +11,11 @@ if [ -f .env ]; then echo "dataSourceName=\"$DB_USER:$DB_PASSWD@tcp($DB_HOSTNAME:$DB_PORT)/\"" >> .env fi - if [ "$DB_TYPE" == "postgresql" ]; then + if [ "$DB_TYPE" == "postgres" ]; then echo "dataSourceName=\"user=$DB_USER password=$DB_PASSWD host=$DB_HOSTNAME port=$DB_PORT sslmode=disable dbname=$DB_NAME\"" >> .env fi - if [ -z "$REDIS_PASSWORD" ]; then + if [ -n "$REDIS_PASSWORD" ]; then echo "redisEndpoint=\"$REDIS_HOSTNAME:$REDIS_PORT,$REDIS_DBINDEX,$REDIS_PASSWORD\"" >> .env else echo "redisEndpoint=\"$REDIS_HOSTNAME:$REDIS_PORT,$REDIS_DBINDEX\"" >> .env diff --git a/apps/casdoor/README.md b/apps/casdoor/README.md index d77dbc7a..6558a8ca 100644 --- a/apps/casdoor/README.md +++ b/apps/casdoor/README.md @@ -62,6 +62,8 @@ Casdoor 支持将用户头像等文件存储在本地文件系统中。默认情 如果您的网络环境受到地区网络限制,您可以通过配置 `Socks5 代理` 来解决这个问题。 +格式:host:port + socks5Proxy 是 SOCKS 代理服务器 IP 地址。 设置代理端口,因为我们有与Google相关的服务,或者使用Google、GitHub、Facebook、LinkedIn或Steam作为OAuth提供商,这在某些地区可能会受到网络限制。 diff --git a/envs/casdoor/casdoor.env b/envs/casdoor/casdoor.env index 70eaeccc..e446a4e8 100644 --- a/envs/casdoor/casdoor.env +++ b/envs/casdoor/casdoor.env @@ -1,31 +1,31 @@ -appname = casdoor -httpport = 8000 -runmode = prod -copyrequestbody = true -driverName = mysql -dataSourceName = root:123456@tcp(localhost:3306)/ -dbName = casdoor -tableNamePrefix = -showSql = false -redisEndpoint = -defaultStorageProvider = -isCloudIntranet = false -authState = "casdoor" -socks5Proxy = "127.0.0.1:10808" -verificationCodeTimeout = 10 -initScore = 0 -logPostOnly = true -isUsernameLowered = false -origin = -originFrontend = -staticBaseUrl = "https://cdn.casbin.org" -isDemoMode = false -batchSize = 100 -enableGzip = true -ldapServerPort = 389 -radiusServerPort = 1812 -radiusSecret = "secret" -quota = {"organization": -1, "user": -1, "application": -1, "provider": -1} -logConfig = {"filename": "logs/casdoor.log", "maxdays":99999, "perm":"0770"} -initDataFile = "./init_data.json" -frontendBaseDir = "../casdoor" +appname="casdoor" +httpport=8000 +runmode="prod" +copyrequestbody=true +driverName="mysql" +dataSourceName="root:123456@tcp(localhost:3306)/" +dbName="casdoor" +tableNamePrefix= +showSql=false +redisEndpoint= +defaultStorageProvider= +isCloudIntranet=false +authState="casdoor" +socks5Proxy="127.0.0.1:10808" +verificationCodeTimeout=10 +initScore=0 +logPostOnly=true +isUsernameLowered=false +origin= +originFrontend= +staticBaseUrl="https://cdn.casbin.org" +isDemoMode=false +batchSize=100 +enableGzip=true +ldapServerPort=389 +radiusServerPort=1812 +radiusSecret="secret" +quota={"organization": -1, "user": -1, "application": -1, "provider": -1} +logConfig={"filename": "logs/casdoor.log", "maxdays":99999, "perm":"0770"} +initDataFil="./init_data.json" +frontendBaseDi="../casdoor"