Show mailu version in web interface after logging in

main
Alexander Graf 2 years ago
parent 8b0b87984d
commit f00059d10c
No known key found for this signature in database
GPG Key ID: B8A9DC143E075629

@ -18,6 +18,7 @@ DEFAULT_CONFIG = {
'TEMPLATES_AUTO_RELOAD': True, 'TEMPLATES_AUTO_RELOAD': True,
'MEMORY_SESSIONS': False, 'MEMORY_SESSIONS': False,
'FETCHMAIL_ENABLED': True, 'FETCHMAIL_ENABLED': True,
'MAILU_VERSION': 'unknown',
# Database settings # Database settings
'DB_FLAVOR': None, 'DB_FLAVOR': None,
'DB_USER': 'mailu', 'DB_USER': 'mailu',
@ -157,6 +158,10 @@ class ConfigManager:
self.config['HOSTNAME'] = hostnames[0] self.config['HOSTNAME'] = hostnames[0]
self.config['DEFAULT_SPAM_THRESHOLD'] = int(self.config['DEFAULT_SPAM_THRESHOLD']) self.config['DEFAULT_SPAM_THRESHOLD'] = int(self.config['DEFAULT_SPAM_THRESHOLD'])
self.config['PROXY_AUTH_WHITELIST'] = set(ipaddress.ip_network(cidr, False) for cidr in (cidr.strip() for cidr in self.config['PROXY_AUTH_WHITELIST'].split(',')) if cidr) self.config['PROXY_AUTH_WHITELIST'] = set(ipaddress.ip_network(cidr, False) for cidr in (cidr.strip() for cidr in self.config['PROXY_AUTH_WHITELIST'].split(',')) if cidr)
try:
self.config['MAILU_VERSION'] = open('/version', 'r').read()
except FileNotFoundError:
pass
# update the app config # update the app config
app.config.update(self.config) app.config.update(self.config)

@ -78,6 +78,7 @@
<i class="fa fa-code-branch" aria-hidden="true"></i><span class="sr-only">fork</span> <i class="fa fa-code-branch" aria-hidden="true"></i><span class="sr-only">fork</span>
on <a href="https://github.com/Mailu/Mailu">Github</a> on <a href="https://github.com/Mailu/Mailu">Github</a>
</span> </span>
<div style="font-size:60%;line-height:0"><span class="fa-pull-right">{{ config["MAILU_VERSION"] }}</span></div>
</footer> </footer>
</div> </div>
<script src="{{ url_for('static', filename='vendor.js') }}"></script> <script src="{{ url_for('static', filename='vendor.js') }}"></script>

Loading…
Cancel
Save