mirror of
https://github.com/hassio-addons/addon-thelounge.git
synced 2025-05-05 11:31:33 +00:00
✨ Support multiple users
This commit is contained in:
parent
88c0f8c4ad
commit
db7a338de8
2 changed files with 21 additions and 8 deletions
|
@ -38,7 +38,8 @@
|
||||||
"default_theme": "default",
|
"default_theme": "default",
|
||||||
"themes": [
|
"themes": [
|
||||||
"thelounge-theme-material"
|
"thelounge-theme-material"
|
||||||
]
|
],
|
||||||
|
"users": []
|
||||||
},
|
},
|
||||||
"schema": {
|
"schema": {
|
||||||
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)?",
|
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)?",
|
||||||
|
@ -48,6 +49,9 @@
|
||||||
"default_theme": "str",
|
"default_theme": "str",
|
||||||
"themes": [
|
"themes": [
|
||||||
"str"
|
"str"
|
||||||
|
],
|
||||||
|
"users": [
|
||||||
|
"str"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,21 @@
|
||||||
export THELOUNGE_HOME=/data/thelounge
|
export THELOUNGE_HOME=/data/thelounge
|
||||||
|
|
||||||
if ! bashio::fs.directory_exists "/data/thelounge"; then
|
if ! bashio::fs.directory_exists "/data/thelounge"; then
|
||||||
bashio::log.info "Creating default hassio user.."
|
|
||||||
mkdir -p /data/thelounge/users
|
mkdir -p /data/thelounge/users
|
||||||
cp /etc/thelounge/users/hassio.json /data/thelounge/users
|
fi
|
||||||
else
|
|
||||||
|
# List current users
|
||||||
|
/usr/local/bin/thelounge list
|
||||||
|
|
||||||
|
for user in $(bashio::config "users")
|
||||||
|
do
|
||||||
|
if ! bashio::fs.file "/data/thelounge/users/${user}.json"; then
|
||||||
|
bashio::log.info "Creating user ${user} with default password.."
|
||||||
|
cp /etc/thelounge/users/hassio.json "/data/thelounge/users/${user}.json"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
for theme in $(bashio::config "themes")
|
for theme in $(bashio::config "themes")
|
||||||
do
|
do
|
||||||
/usr/local/bin/thelounge install "${theme}"
|
/usr/local/bin/thelounge install "${theme}"
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue