Allow specifying xaseco operators and admins
This commit is contained in:
parent
df1077ffe8
commit
f259592064
2 changed files with 30 additions and 1 deletions
|
@ -12,6 +12,7 @@ data="/data"
|
|||
runDir="/opt/xaseco"
|
||||
entrypoint="$cache/aseco.php"
|
||||
config="$runDir/config.xml"
|
||||
adminConfig="$runDir/adminops.xml"
|
||||
dbConfig="$runDir/localdatabase.xml"
|
||||
dediConfig="$runDir/dedimania.xml"
|
||||
pluginConfig="$runDir/plugins.xml"
|
||||
|
@ -20,6 +21,8 @@ serverPath="$settingsPath/tmserver"
|
|||
pluginTag="plugin"
|
||||
pluginPath="/aseco_plugins"
|
||||
|
||||
userPattern="^(.+?)(@([[:digit:]]+(.[[:digit:]]+){3}))?\$"
|
||||
|
||||
tmOptions=(
|
||||
TM_SERVER_HOST ip
|
||||
TM_SERVER_PORT port
|
||||
|
@ -28,6 +31,11 @@ tmOptions=(
|
|||
TM_TIMEOUT timeout
|
||||
)
|
||||
|
||||
groups=(
|
||||
ADMINS admins
|
||||
OPERATORS operators
|
||||
)
|
||||
|
||||
sqlOptions=(
|
||||
MYSQL_HOST mysql_server
|
||||
MYSQL_USER mysql_login
|
||||
|
@ -114,6 +122,23 @@ for i in $(seq 0 2 $((${#tmOptions[@]} - 1))); do
|
|||
fi
|
||||
done
|
||||
|
||||
for i in $(seq 0 2 $((${#groups[@]} - 1))); do
|
||||
var="${groups[$i]}"
|
||||
group="${groups[$(($i + 1))]}"
|
||||
value="${!var}"
|
||||
path="/lists/$group"
|
||||
|
||||
echo "$value" | while read user; do
|
||||
name="$(echo "$user" | LC_ALL="C" perl -pe "s/$userPattern/\1/")"
|
||||
ip="$(echo "$user" | LC_ALL="C" perl -pe "s/$userPattern/\3/")"
|
||||
xmlstarlet edit --inplace --subnode "$path" --type elem -n "tmlogin" --value "$name" "$adminConfig"
|
||||
|
||||
if [ -n "$ip" ]; then
|
||||
xmlstarlet edit --inplace --subnode "$path" --type elem -n "ipaddress" --value "$ip" "$adminConfig"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for i in $(seq 0 2 $((${#sqlOptions[@]} - 1))); do
|
||||
var="${sqlOptions[$i]}"
|
||||
option="${sqlOptions[$(($i + 1))]}"
|
||||
|
|
|
@ -11,7 +11,8 @@ RUN apk update \
|
|||
# xmlstarlet dependencies
|
||||
musl \
|
||||
libxslt \
|
||||
libxml2
|
||||
libxml2 \
|
||||
perl
|
||||
RUN update-ca-certificates
|
||||
RUN docker-php-ext-install mysql
|
||||
COPY --from=base /usr/bin/xmlstarlet /usr/bin
|
||||
|
@ -29,6 +30,9 @@ ENV \
|
|||
MASTERADMIN_USER="" \
|
||||
MASTERADMIN_IP="" \
|
||||
\
|
||||
ADMINS="" \
|
||||
OPERATORS="" \
|
||||
\
|
||||
X1_EXTRA_PLUGINS="" \
|
||||
X1_DISABLED_PLUGINS="" \
|
||||
\
|
||||
|
|
Loading…
Reference in a new issue