💡 Added database upgrade warning for required MySQL 8 in Ghost 5.0

no issue

- Ghost 5.0 will require MySQL 8 when running in production so we've added a warning to the whats new/about screen to give some visibility for self-hosters to prepare
- updated `whatsnew` controller to native class syntax
This commit is contained in:
Kevin Ansfield 2022-01-14 13:27:32 +00:00
parent 4e9a78c36d
commit c4083967df
2 changed files with 31 additions and 11 deletions

View File

@ -1,17 +1,26 @@
import Controller from '@ember/controller';
import {computed} from '@ember/object';
import {inject as service} from '@ember/service';
/* eslint-disable ghost/ember/alias-model-in-controller */
export default Controller.extend({
config: service(),
upgradeStatus: service(),
whatsNew: service(),
export default class WhatsNewController extends Controller {
@service config;
@service upgradeStatus;
@service whatsNew;
queryParams: ['entry'],
queryParams = ['entry'];
copyrightYear: computed(function () {
let date = new Date();
get copyrightYear() {
const date = new Date();
return date.getFullYear();
})
});
}
get showDatabaseWarning() {
const isProduction = !!this.config.get('environment').match?.(/production/i);
const isPro = !!this.config.get('hostSettings')?.siteId;
if (isProduction && !isPro) {
return true;
}
return false;
}
}

View File

@ -40,6 +40,7 @@
<div class="gh-about-logo">
{{svg-jar "ghost-logo-orb" alt="Ghost"}}
</div>
{{#if this.upgradeStatus.message}}
<section class="gh-upgrade-notification">
<p>
@ -47,6 +48,7 @@
</p>
</section>
{{/if}}
<ul class="gh-env-list">
<li><strong>Version:</strong> {{this.config.version}}</li>
<li><strong>Environment:</strong> <span class="ttc">{{this.config.environment}}</span></li>
@ -56,6 +58,15 @@
<li><strong>Developer experiments:</strong> <span class="gh-badge">Enabled</span></li>
{{/if}}
</ul>
{{#if this.showDatabaseWarning}}
<section class="gh-upgrade-notification">
<p>
<strong>Warning:</strong> MySQL 8 will be the required database in the next major release of Ghost. Make sure your database is up to date to ensure forwards compatibility.
</p>
</section>
{{/if}}
<footer class="gh-copyright-info">
Copyright &copy; 2013 &ndash; {{this.copyrightYear}} Ghost Foundation, released under the <a href="https://github.com/TryGhost/Ghost/blob/master/LICENSE" target="_blank">MIT license</a>. <a href="https://ghost.org/" target="_blank">Ghost</a> is a registered trademark of <a href="https://ghost.org/trademark/" target="_blank">Ghost Foundation Ltd</a>.
</footer>