|
1 | 1 | # Configuring SQLPage
|
2 | 2 |
|
3 | 3 | 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`. |
5 | 5 |
|
6 | 6 | You can find an example configuration file in [`sqlpage/sqlpage.json`](./sqlpage/sqlpage.json).
|
7 | 7 | Here are the available configuration options and their default values:
|
8 | 8 |
|
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. | |
28 | 28 |
|
29 | 29 | Multiple configuration file formats are supported:
|
30 | 30 | 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
|
95 | 95 | CREATE TEMPORARY TABLE my_temporary_table(
|
96 | 96 | my_temp_column TEXT
|
97 | 97 | );
|
98 |
| -``` |
| 98 | +``` |
0 commit comments