Skip to content

Commit b47f703

Browse files
authored
Improve configuration documentaition (#153)
* Fix typo * Add default values for different RDBMS I optimized for a nicer looking rendered table, but the not rendered one looks slightly less beautiful now.
1 parent cb39986 commit b47f703

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

configuration.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Configuring SQLPage
22

33
SQLPage can be configured through either [environment variables](https://en.wikipedia.org/wiki/Environment_variable)
4-
on a [JSON](https://en.wikipedia.org/wiki/JSON) file placed in `sqlpage/sqlpage.json`.
4+
or a [JSON](https://en.wikipedia.org/wiki/JSON) file placed in `sqlpage/sqlpage.json`.
55

66
You can find an example configuration file in [`sqlpage/sqlpage.json`](./sqlpage/sqlpage.json).
77
Here are the available configuration options and their default values:
88

9-
| variable | default | description |
10-
| ------------------------------------------ | ---------------------------- | ------------------------------------------------------------------------ |
11-
| `listen_on` | 0.0.0.0:8080 | Interface and port on which the web server should listen |
12-
| `database_url` | sqlite://sqlpage.db?mode=rwc | Database connection URL |
13-
| `port` | 8080 | Like listen_on, but specifies only the port. |
14-
| `max_database_pool_connections` | depends on the database | How many simultaneous database connections to open at most |
15-
| `database_connection_idle_timeout_seconds` | depends on the database | Automatically close database connections after this period of inactivity |
16-
| `database_connection_max_lifetime_seconds` | depends on the database | Always close database connections after this amount of time |
17-
| `database_connection_retries` | 6 | Database connection attempts before giving up. Retries will happen every 5 seconds. |
18-
| `database_connection_acquire_timeout_seconds` | 10 | How long to wait when acquiring a database connection from the pool before giving up and returning an error. |
19-
| `sqlite_extensions` | | An array of SQLite extensions to load, such as `mod_spatialite` |
20-
| `web_root` | `.` | The root directory of the web server, where the `index.sql` file is located. |
21-
| `allow_exec` | false | Allow usage of the `sqlpage.exec` function. Do this only if all users with write access to sqlpage query files and to the optional `sqlpage_files` table on the database are trusted. |
22-
| `max_uploaded_file_size` | 5242880 | Maximum size of uploaded files in bytes. Defaults to 5 MiB. |
23-
| `https_domain` | | Domain name to request a certificate for. Setting this parameter will automatically make SQLPage listen on port 443 and request an SSL certificate. The server will take a little bit longer to start the first time it has to request a certificate. |
24-
| `https_certificate_email` | contact@<https_domain> | The email address to use when requesting a certificate. |
25-
| `https_certificate_cache_dir` | ./sqlpage/https | A writeable directory where to cache the certificates, so that SQLPage can serve https traffic immediately when it restarts. |
26-
| `https_acme_directory_url` | https://acme-v02.api.letsencrypt.org/directory | The URL of the ACME directory to use when requesting a certificate. |
27-
| `environment` | development | The environment in which SQLPage is running. Can be either `development` or `production`. In `production` mode, SQLPage will hide error messages and stack traces from the user, and will cache sql files in memory to avoid reloading them from disk. |
9+
| variable | default | description |
10+
| --------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
11+
| `listen_on` | 0.0.0.0:8080 | Interface and port on which the web server should listen |
12+
| `database_url` | sqlite://sqlpage.db?mode=rwc | Database connection URL |
13+
| `port` | 8080 | Like listen_on, but specifies only the port. |
14+
| `max_database_pool_connections` | PostgreSQL: 50<BR> MySql: 75<BR> SQLite: 16<BR> MSSQL: 100 | How many simultaneous database connections to open at most |
15+
| `database_connection_idle_timeout_seconds` | SQLite: None<BR> All other: 30 minutes | Automatically close database connections after this period of inactivity |
16+
| `database_connection_max_lifetime_seconds` | SQLite: None<BR> All other: 60 minutes | Always close database connections after this amount of time |
17+
| `database_connection_retries` | 6 | Database connection attempts before giving up. Retries will happen every 5 seconds. |
18+
| `database_connection_acquire_timeout_seconds` | 10 | How long to wait when acquiring a database connection from the pool before giving up and returning an error. |
19+
| `sqlite_extensions` | | An array of SQLite extensions to load, such as `mod_spatialite` |
20+
| `web_root` | `.` | The root directory of the web server, where the `index.sql` file is located. |
21+
| `allow_exec` | false | Allow usage of the `sqlpage.exec` function. Do this only if all users with write access to sqlpage query files and to the optional `sqlpage_files` table on the database are trusted. |
22+
| `max_uploaded_file_size` | 5242880 | Maximum size of uploaded files in bytes. Defaults to 5 MiB. |
23+
| `https_domain` | | Domain name to request a certificate for. Setting this parameter will automatically make SQLPage listen on port 443 and request an SSL certificate. The server will take a little bit longer to start the first time it has to request a certificate. |
24+
| `https_certificate_email` | contact@<https_domain> | The email address to use when requesting a certificate. |
25+
| `https_certificate_cache_dir` | ./sqlpage/https | A writeable directory where to cache the certificates, so that SQLPage can serve https traffic immediately when it restarts. |
26+
| `https_acme_directory_url` | https://acme-v02.api.letsencrypt.org/directory | The URL of the ACME directory to use when requesting a certificate. |
27+
| `environment` | development | The environment in which SQLPage is running. Can be either `development` or `production`. In `production` mode, SQLPage will hide error messages and stack traces from the user, and will cache sql files in memory to avoid reloading them from disk. |
2828

2929
Multiple configuration file formats are supported:
3030
you can use a [`.json5`](https://json5.org/) file, a [`.toml`](https://toml.io/) file, or a [`.yaml`](https://en.wikipedia.org/wiki/YAML#Syntax) file.
@@ -95,4 +95,4 @@ You can also use this to create *temporary tables* to store intermediate results
9595
CREATE TEMPORARY TABLE my_temporary_table(
9696
my_temp_column TEXT
9797
);
98-
```
98+
```

0 commit comments

Comments
 (0)