Merge #2719
2719: Introduce connection string (database url) for roundcube & simplify setup r=mergify[bot] a=Diman0 ## What type of PR? enhancement ## What does this PR do? As discussed in earlier Mailu meetings (#1582), we want to simplify configuring Mailu and make it more user-friendly. Especially the last part is an important mission statement of the Mailu project. This PR will remove the choice of what DB to use from setup. New users are guided now to make the correct choice of using SQLite. For simplifying the configuration, all the database environment variables have been removed and replaced with a single connection string environment variable. For backwards compatibility, the old *DB_* setting can still be used. This is to make sure that master does not immediately break for all users. After X months after the next Mailu release, we can remove the old settings from the software. This provides a transition period. ### Related issue(s) - #2533 ## Prerequisites Before we can consider review and merge, please make sure the following list is done and checked. If an entry in not applicable, you can check it or remove it from the list. - [x] In case of feature or enhancement: documentation updated accordingly - [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file. Co-authored-by: Dimitri Huisman <diman@huisman.xyz> Co-authored-by: Florent Daigniere <nextgens@users.noreply.github.com>main
commit
b243ea084d
@ -1,45 +0,0 @@
|
||||
{% call macros.panel("info", "Database preferences") %}
|
||||
|
||||
<div class="form-group">
|
||||
<label>Which database back end would you like to use?</label>
|
||||
<br/>
|
||||
<select class="btn btn-primary dropdown-toggle" name="db_flavor" id="database">
|
||||
{% for dbflavor in ["sqlite", "postgresql", "mysql"] %}
|
||||
<option value="{{ dbflavor }}" >{{ dbflavor }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-group" id="external_db" style="display: none">
|
||||
<p>Set external database parameters for <b>Admin UI</b></p>
|
||||
<label>DB User</label>
|
||||
<input class="form-control" type="text" name="db_user" placeholder="Username" id="db_user">
|
||||
<label>Db Password</label>
|
||||
<input class="form-control" type="password" name="db_pw" placeholder="Password" id="db_pw">
|
||||
<label>Db URL (for using a different port use the notation host:port )</label>
|
||||
<input class="form-control" type="text" name="db_url" placeholder="URL" id="db_url">
|
||||
<label>Db Name</label>
|
||||
<input class="form-control" type="text" name="db_name" placeholder="Database Name" id="db_name">
|
||||
<br/>
|
||||
<div class="form-group" id="db_flavor_rc_sel" style="display: none">
|
||||
<label>Which database back end would you like to use for roundcube?</label>
|
||||
<br/>
|
||||
<select class="btn btn-primary dropdown-toggle" name=db_flavor_rc id="database_rc">
|
||||
{% for dbflavor_rc in ["sqlite", "postgresql", "mysql"] %}
|
||||
<option value="{{ dbflavor_rc }}" >{{ dbflavor_rc }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-group" id="roundcube_external_db" style="display: none">
|
||||
<p>Set external database parameters for <b>Roundcube</b></p>
|
||||
<label>DB User</label>
|
||||
<input class="form-control" type="text" name="roundcube_db_user" placeholder="Username" id="roundcube_db_user">
|
||||
<label>DB Password</label>
|
||||
<input class="form-control" type="password" name="roundcube_db_pw" placeholder="Password" id="roundcube_db_pw">
|
||||
<label>DB URL (for using a different port use the notation host:port )</label>
|
||||
<input class="form-control" type="text" name="roundcube_db_url" placeholder="URL" id="roundcube_db_url">
|
||||
<label>DB Name</label>
|
||||
<input class="form-control" type="text" name="roundcube_db_name" placeholder="Database Name" id="roundcube_db_name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endcall %}
|
@ -0,0 +1,17 @@
|
||||
Introduce SQLAlchemy database uris for configuring the admin and roundcube database.
|
||||
Remove the database configuration option from the setup utility. Using a different
|
||||
database system than SQLite is not necessary for Mailu. The Mailu database generally
|
||||
contains static data.
|
||||
|
||||
The usage of the *DB_* environment variables is deprecated now.
|
||||
They can still be used in the release after Mailu 1.9, but will be removed
|
||||
after that version. This means it will be removed from master after the upcoming
|
||||
Mailu release.
|
||||
|
||||
To start using the new environment variables, all *DB_* environment variables must be changed to:
|
||||
SQLALCHEMY_DATABASE_URI=<SQLAlchemy database URL>
|
||||
SQLALCHEMY_DATABASE_URI_ROUNDCUBE=<Roundcube database URL>
|
||||
|
||||
If no URI is specified, SQLite is used with these settings:
|
||||
SQLALCHEMY_DATABASE_URI=sqlite:////data/main.db
|
||||
SQLALCHEMY_DATABASE_URI_ROUNDCUBE=sqlite:////data/roundcube.db
|
Loading…
Reference in New Issue