opensearch-dashboards: Fix permissions

Since we moved to using rpm/deb packages, the user has changed.

Related-Bug: #2020152
Change-Id: I2a5a0d761223b4e99c8df59f80261108380d5038
This commit is contained in:
Michal Nasiadka 2023-05-23 16:14:21 +02:00
parent 239f9adff7
commit 6786e4384c
3 changed files with 10 additions and 6 deletions

View File

@ -7,7 +7,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='opensearch', shell='/bin/bash', homedir='/usr/share/opensearch') }}
{{ macros.configure_user(name='opensearch-dashboards', shell='/bin/bash', homedir='/usr/share/opensearch-dashboards') }}
{{ macros.enable_extra_repos(['opensearch-dashboards']) }}
{% set opensearch_dashboards_packages = ['opensearch-dashboards'] %}
@ -30,4 +30,4 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block opensearch_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER opensearch
USER opensearch-dashboards

View File

@ -1,10 +1,10 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/opensearch" ]]; then
mkdir -p /var/log/kolla/opensearch
if [[ ! -d "/var/log/kolla/opensearch-dashboards" ]]; then
mkdir -p /var/log/kolla/opensearch-dashboards
fi
if [[ $(stat -c %a /var/log/kolla/opensearch) != "755" ]]; then
chmod 755 /var/log/kolla/opensearch
if [[ $(stat -c %a /var/log/kolla/opensearch-dashboards) != "755" ]]; then
chmod 755 /var/log/kolla/opensearch-dashboards
fi
export DASHBOARDS_HOME=/usr/share/opensearch-dashboards

View File

@ -337,5 +337,9 @@ USERS = {
'skyline-user': {
'uid': 42491,
'gid': 42491,
},
'opensearch-dashboards-user': {
'uid': 42492,
'gid': 42492,
}
}