This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 99
Northflank上部署找不到密码,使用shell输入alist admin得到的密码登陆提示密码错误 #12
Comments
密码,在最早的日志里面。如果还是找不到,删除数据库重来。 shell 里面敲 alist admin 得不到密码的,你这么做没有连接数据库。 需要先执行下面的代码才行: PARSE_DB_URL() {
# extract the protocol
proto="$(echo $DATABASE_URL | grep '://' | sed -e's,^\(.*://\).*,\1,g')"
if [[ "${proto}" =~ postgres ]]; then
export DB_TYPE=postgres
export DB_SSL_MODE=require
elif [[ "${proto}" =~ mysql ]]; then
export DB_TYPE=mysql
export DB_SSL_MODE=true
fi
# remove the protocol
url=$(echo $DATABASE_URL | sed -e s,${proto},,g)
# extract the user and password (if any)
userpass="$(echo $url | grep @ | cut -d@ -f1)"
export DB_PASS=$(echo $userpass | grep : | cut -d: -f2)
if [ -n "$DB_PASS" ]; then
export DB_USER=$(echo $userpass | grep : | cut -d: -f1)
else
export DB_USER=$userpass
fi
# extract the host -- updated
hostport=$(echo $url | sed -e s,$userpass@,,g | cut -d/ -f1)
export DB_PORT=$(echo $hostport | grep : | cut -d: -f2)
if [ -n "$DB_PORT" ]; then
export DB_HOST=`echo $hostport | grep : | cut -d: -f1`
else
export DB_HOST=$hostport
fi
if [[ ${DB_TYPE} = postgres ]] && [[ ${DB_PORT} = "" ]]; then
export DB_PORT=5432
fi
# extract the name (if any)
export DB_NAME="`echo $url | grep / | cut -d/ -f2- | sed 's|?.*||'`"
}
if [ "${DATABASE_URL}" != "" ]; then
PARSE_DB_URL
fi |
谢谢大佬,我明白了🥰 |
我也是部署了,好像密码自动换了,能改一个密码定制的吗?用一段时间密码好像就变了 |
没有看懂上面代码怎么使用,我应该填写哪个部分。。。 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
No description provided.
The text was updated successfully, but these errors were encountered: