Skip to content

Commit

Permalink
Update mail server configuration and display warning for default pass…
Browse files Browse the repository at this point in the history
…words
  • Loading branch information
stephdl committed Apr 24, 2024
1 parent 439aed6 commit 4e9e3b7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import os
import json
import sys
import agent
import subprocess

# Prepare return variable
config = {}
Expand All @@ -31,5 +32,12 @@ for key in agent.list_service_providers(rdb,'imap','tcp'):

# use it inside a dropdown
config['mail_server_URL'] = modules

command = "/usr/bin/podman exec mariadb-app mysql -u root -D piler -e 'SELECT password FROM user WHERE uid=0;'"
output = subprocess.run(command, shell=True, capture_output=True, text=True)
filtered_output = subprocess.run(['grep', '-q', '$1$PItc7d$zsUgON3JRrbdGS11t9JQW1'], input=output.stdout, capture_output=True, text=True)
is_found = filtered_output.returncode == 0
config['is_default_password'] = is_found

# Dump the configuratio to stdout
json.dump(config, fp=sys.stdout)
4 changes: 3 additions & 1 deletion ui/public/i18n/language.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"choose_the_mail_server_to_use": "The mail server will be configured to send emails to Piler",
"mail_server_is_not_valid": "This mail server cannot be used by Piler",
"host_pattern": "Must be a valid fully qualified domain name",
"host_format": "Must be a valid fully qualified domain name"
"host_format": "Must be a valid fully qualified domain name",
"password_warning": "The passwords are the default ones",
"password_warning_description": "Please change the password in the Piler webapp for admin@local(pilerrocks) and auditor@local(auditor)"
},
"about": {
"title": "About"
Expand Down
12 changes: 12 additions & 0 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
/>
</cv-column>
</cv-row>
<cv-row v-if="is_default_password">
<cv-column>
<NsInlineNotification
kind="warning"
:title="$t('settings.password_warning')"
:description="$t('settings.password_warning_description')"
:showCloseButton="false"
/>
</cv-column>
</cv-row>
<cv-row>
<cv-column>
<cv-tile light>
Expand Down Expand Up @@ -139,6 +149,7 @@ export default {
host: "",
mail_server: "",
mail_server_URL: [],
is_default_password: true,
isLetsEncryptEnabled: false,
isHttpToHttpsEnabled: false,
loading: {
Expand Down Expand Up @@ -224,6 +235,7 @@ export default {
this.mail_server = config.mail_server;
});
this.mail_server_URL = config.mail_server_URL;
this.is_default_password = config.is_default_password;
this.loading.getConfiguration = false;
this.focusElement("host");
},
Expand Down

0 comments on commit 4e9e3b7

Please sign in to comment.