1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

Adding MySQL to the documentation (#515)

* Update _index.md

* Adding Mysql to Ubuntu.md and Personal Server configuration

* Update website/site/content/guide/admin/_index.md

Co-authored-by: Jesús Espino <jespinog@gmail.com>

* removed typo 

Unneeded 16)

* Fixing error

* Update _index.md

In-doc editing for formatting and style.

* Update website/site/content/download/personal-edition/ubuntu.md

LGTM

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update website/site/content/download/personal-edition/ubuntu.md

LGTM

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update website/site/content/download/personal-edition/ubuntu.md

LGTM

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update website/site/content/download/personal-edition/ubuntu.md

LGTM

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update website/site/content/download/personal-edition/ubuntu.md

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* replacing <pre>

replacing <pre> with ```

* Removed the last <pre>

Thank you @jespino for noticing the last <pre>

* Update ubuntu.md

Reviewed the code samples and added additional backticks. Also added linebreaks.

* Update _index.md

Minor addition: oxford comma in table.

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
This commit is contained in:
ctlaltdieliet 2021-07-06 19:21:43 +02:00 committed by GitHub
parent 7d1a4f1393
commit 71fe928dd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 21 deletions

View File

@ -41,11 +41,13 @@ You may need to adjust your firewall settings depending on the host, e.g.
### Configure NGINX
Create a new site config:
```
sudo nano /etc/nginx/sites-available/focalboard
```
Copy and paste this configuration:
```
upstream focalboard {
server localhost:8000;
@ -99,6 +101,7 @@ server {
```
Enable the site, test the config, and reload NGINX:
```
sudo ln -s /etc/nginx/sites-available/focalboard /etc/nginx/sites-enabled/focalboard
sudo nginx -t
@ -118,19 +121,22 @@ sudo apt install postgresql postgresql-contrib
```
Then run as the postgres user to create a new database:
```
sudo --login --user postgres
psql
```
On the psql prompt, run the following commands (**change the user/password** to your own values):
<pre>
```
CREATE DATABASE boards;
CREATE USER <b>boardsuser</b> WITH PASSWORD '<b>boardsuser-password</b>';
\q
</pre>
```
Exit the postgres user session:
```
exit
```
@ -142,11 +148,52 @@ nano /opt/focalboard/config.json
```
Change the dbconfig setting to use the postgres database you created:
```
"dbtype": "postgres",
"dbconfig": "postgres://boardsuser:boardsuser-password@localhost/boards?sslmode=disable&connect_timeout=10",
```
## Install MySQL
As an alternative to Postgres, you also can store your data in a MySQL/MariaDB database. To install, run:
```
sudo apt install mariadb-server mariadb-client
```
Log in as `root` in your database:
```
sudo mysql
```
At the MySQL prompt, run the following commands (change `user/password` to your own values):
```
CREATE DATABASE boards;
GRANT ALL on boards.* to <b>'boardsuser'@'localhost'</b> identified by '<b>boardsuser-password</b>';
```
Exit the mysql-prompt:
```
exit
```
Edit the Focalboard `config.json`:
```
nano /opt/focalboard/config.json
```
Change the dbconfig setting to use the MySQL database you created:
```
"dbtype": "mysql",
"dbconfig": "boardsuser:boardsuser-password@tcp(127.0.0.1:3306)/boards",
```
## Configure Focalboard to run as a service
This will keep the server running across reboots. First, create a new service config file:
@ -156,6 +203,7 @@ sudo nano /lib/systemd/system/focalboard.service
```
Paste in the following:
```
[Unit]
Description=Focalboard server
@ -172,6 +220,7 @@ WantedBy=multi-user.target
```
Make systemd reload the new unit, and start it on machine reboot:
```
sudo systemctl daemon-reload
sudo systemctl start focalboard.service
@ -183,12 +232,13 @@ sudo systemctl enable focalboard.service
At this point, the Focalboard server should be running.
Test that it's running locally with:
```
curl localhost:8000
curl localhost
```
The first command checks that the server is running on port 8000 (default), and the second checks that NGINX is proxying requests successfully. Both commands should return the same snippet of html.
The first command checks that the server is running on port 8000 (default), and the second checks that NGINX is proxying requests successfully. Both commands should return the same snippet of HTML.
To access the server remotely, open a browser to its IP address or domain.

View File

@ -5,30 +5,29 @@ section: "guide"
weight: 3
---
## Personal Server configuration
## Personal server configuration
Personal Server settings are stored in `config.json` and is read when the server is launched. The contents are:
Personal server settings are stored in `config.json` and are read when the server is launched. The contents are:
| Key | Description | Example |
| ----------- | ----------- | ---
| serverRoot | Root URL of the server | "http://localhost:8000"
| port | Server port | 8000
| dbtype | Type of database. `sqlite3` or `postgres` | "sqlite3"
| dbconfig | Database connection string | postgres://user:pass@localhost/boards?sslmode=disable&connect_timeout=10
| webpath | Path to web files | "./webapp/pack"
| filespath | Path to uploaded files folder | "./files"
| telemetry | Enable health diagnostics telemetry | true
| prometheus_address | Enables prometheus metrics, if it's empty is disabled | ":9092"
|----------|-------------|---------|
| serverRoot | Root URL of the server | http://localhost:8000
| port | Server port | 8000
| dbtype | Type of database. `sqlite3`, `postgres`, or `mysql` | sqlite3
| dbconfig | Database connection string | `postgres://user:pass@localhost/boards?sslmode=disable&connect_timeout=10`
| webpath | Path to web files | `./webapp/pack`
| filespath | Path to uploaded files folder | `./files`
| telemetry | Enable health diagnostics telemetry | `true`
| prometheus_address | Enables Prometheus metrics, if it's empty is disabled | `:9092`
| session_expire_time | Session expiration time in seconds | 2592000
| session_refresh_time | Session refresh time in seconds | 18000
| localOnly | Only allow connections from localhost | false
| enableLocalMode | Enable Admin APIs on local Unix port | true
| localModeSocketLocation | Location of local Unix port | "/var/tmp/focalboard_local.socket"
| session_refresh_time | Session refresh time in seconds | 18000
| localOnly | Only allow connections from localhost | `false`
| enableLocalMode | Enable admin APIs on local Unix port | `true`
| localModeSocketLocation | Location of local Unix port | `/var/tmp/focalboard_local.socket`
## Resetting passwords
By default, Personal Server exposes admin APIs on a local Unix socket at `/var/tmp/focalboard_local.socket`. This is configurable by the `enableLocalMode` and `localModeSocketLocation` settings in config.json.
By default, personal server exposes admin APIs on a local Unix socket at `/var/tmp/focalboard_local.socket`. This is configurable using the `enableLocalMode` and `localModeSocketLocation` settings in `config.json`.
To reset a user's password, you can use the following `reset-password.sh` script:
@ -43,4 +42,4 @@ fi
curl --unix-socket /var/tmp/focalboard_local.socket http://localhost/api/v1/admin/users/$1/password -X POST -H 'Content-Type: application/json' -d '{ "password": "'$2'" }'
```
After resetting a user's password (e.g. if they forgot it), direct them to change it from the user menu, by clicking on their username at the top of the side bar.
After resetting a user's password (e.g. if they forgot it), direct them to change it from the user menu, by clicking on their username at the top of the sidebar.