Database dialects, proper database shutdown, pagination in configuration.

Added possibility to use different database (storage) backends. Currently
supported: flatfiles and mysql. Fixes #2.

Added database shutdown call. This call will properly shutdown database
connections (in case of RDBMS) or flush pastes index cache on disk (in
case of flatfiles).

De-hardcoded pagination count. Fixes #12.
This commit is contained in:
2018-05-27 12:25:01 +05:00
parent 296e2771d6
commit 0cca0f453f
22 changed files with 854 additions and 175 deletions

View File

@@ -1,6 +1,13 @@
# Database configuration.
# Only MySQL database is supported for now.
# Only MySQL database and flatfiles are supported for now.
database:
# Database type. The only supported ATM is "mysql" and "flatfiles".
type: "mysql"
# Path for data stored with "flatfiles" database adapter.
# Will be comletely ignored for MySQL/MariaDB.
path: "./data"
# Next parameters are strictly for MySQL/MariaDB connections and
# will be ignored by "flatfiles" adapter.
address: "localhost"
port: "3306"
username: "fastpastebin"
@@ -18,9 +25,14 @@ logging:
# HTTP server configuration.
http:
address: "localhost"
address: "192.168.0.14"
port: "25544"
# By default we're allowing only HTTPS requests. Setting this to true
# will allow HTTP requests. Useful for developing or if you're
# running Fast Pastebin behind reverse proxy that does SSL termination.
allow_insecure: false
allow_insecure: true
# Pastes configuration.
pastes:
# Pastes per page.
pagination: 10