mirror of
https://github.com/hassio-addons/addon-thelounge.git
synced 2025-05-04 19:11:27 +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",
|
||||
"themes": [
|
||||
"thelounge-theme-material"
|
||||
]
|
||||
],
|
||||
"users": []
|
||||
},
|
||||
"schema": {
|
||||
"log_level": "match(^(trace|debug|info|notice|warning|error|fatal)$)?",
|
||||
|
@ -48,6 +49,9 @@
|
|||
"default_theme": "str",
|
||||
"themes": [
|
||||
"str"
|
||||
],
|
||||
"users": [
|
||||
"str"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,12 +6,21 @@
|
|||
export THELOUNGE_HOME=/data/thelounge
|
||||
|
||||
if ! bashio::fs.directory_exists "/data/thelounge"; then
|
||||
bashio::log.info "Creating default hassio user.."
|
||||
mkdir -p /data/thelounge/users
|
||||
cp /etc/thelounge/users/hassio.json /data/thelounge/users
|
||||
else
|
||||
for theme in $(bashio::config "themes")
|
||||
do
|
||||
/usr/local/bin/thelounge install "${theme}"
|
||||
done
|
||||
fi
|
||||
|
||||
# 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")
|
||||
do
|
||||
/usr/local/bin/thelounge install "${theme}"
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue