community/meilisearch: reformat config file

This was already accepted by the upstream, so backport it now to avoid
changes in the config format between versions.
This commit is contained in:
Jakub Jirutka 2023-05-09 14:47:01 +02:00
parent a2ed09e6cd
commit 9a6e96b3e0
3 changed files with 211 additions and 38 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=meilisearch
pkgver=1.1.1
pkgrel=0
pkgrel=1
pkgdesc="A lightning-fast search engine that fits into your apps, websites and workflow"
url="https://www.meilisearch.com/"
# ppc64le, riscv64, s390x: fails to build ring crate
@ -24,6 +24,7 @@ _deserr_rev=4657d42d2c6efb839345718182ab193730db5817
source="https://github.com/meilisearch/meilisearch/archive/v$pkgver/meilisearch-$pkgver.tar.gz
https://github.com/actix/actix-net/archive/$_actixtls_ver/actix-net-$_actixtls_ver.tar.gz
https://github.com/meilisearch/deserr/archive/$_deserr_rev/deserr-$_deserr_rev.tar.gz
reformat-config.patch
unbundle-ca-certs.patch
tokenizer-flags.patch
deserr-features.patch
@ -95,11 +96,12 @@ sha512sums="
22508f10b782c72609d114b5629bc245331c4d5b03306286f25a96ce27c3ce5038b0f1821184bbd3de926ec5884dcaf7d156d3b3206e8cc2db719cf59ae419fa meilisearch-1.1.1.tar.gz
52bb0556cf9e7462d267ec9878d2222d14bbee7176b80acc68d9b35005efa07375d4428b7cad2814d28895f43e6c35b5057ef2276bd3e252a04eed46e7e47a59 actix-net-tls-v3.0.3.tar.gz
332f36c2f3a2615cefd5fcf211e96b4da83921881b7faf761bbf1552170b76870fc70d780534f258e4eb4961f0bd95d47832c33a203d457e98941fac1c58eeb1 deserr-4657d42d2c6efb839345718182ab193730db5817.tar.gz
9a4966501267688b9e98e8b555d486e044386f781f5133cc1ec7576bc1dbefcf59ffaa675be1b9a6a9787cd723c8f903e634da86aa44ff2fb94925653bb99037 reformat-config.patch
63e29d8bb477431d1f5cf9b9589ca77694edba97f695e01beb5dc2041544cee72dc13ced786445173409c06d44488163aceb230233795140f93081420b00595b unbundle-ca-certs.patch
62f74c28a2e755bf2f9e65653b71281e5065ff7276993ed98e2457eca4315a2729181b8238af1ec74911b98c80a4a2955d19223d507215d14f98ebf05f4c44e9 tokenizer-flags.patch
1e934f6ac31352b1c57a90e4c50fc26b1483134f2edaabd8c981f118c9c2a7729213aab6704f8f61e371429a8c59d80df5309075f7be66fbe746ce38a4baec2e deserr-features.patch
bacc82d2d4654930cff3173fb09ece051c45adcb288458fce4be1930c80b59cdac5c4efaa81c2997be0f3833a96811a2485a0f1ef318eabffaa4b6b3ae964eac syslog.patch
8281d064f109c3014f3bd9d311632017f850a79fc92a2ddd390541356e582d7ac53d961fc3c8cce2461ff9f92987d0e30d9f1c30da5c9e59ab324f32b1a50e93 config.patch
41b7a6c0fa049216437e00d8f1cbea336e30d527d8cc626b9bd1885f5d817a67f30af324efc2a498611bd3b781e926de6150dfeb89029433d6163191c671681b config.patch
cc2ca5cc2d7baa3d17bb2d0798211599264d11017e2f8139bec07e719b6bf99de2bb0e2eb64ba99f74ed0c299c30f12a7867c76abfe57279a714a14c030e8543 meilisearch.initd
601a8cd3509a6fc24a6445fd09acca00f082e7767db1d36bfa496ab06c91414a43881e3cdcd2176620c9844776e4a2f1954051a4ec34cc13bba6d5316a0c9e96 meilisearch.confd
"

View File

@ -4,90 +4,88 @@ Subject: [PATCH] Adjust default config for Alpine Linux
--- a/config.toml
+++ b/config.toml
@@ -1,27 +1,24 @@
-# This file shows the default configuration of Meilisearch.
# All variables are defined here: https://docs.meilisearch.com/learn/configuration/instance_options.html#environment-variables
@@ -3,25 +3,23 @@
-db_path = "./data.ms"
+db_path = "/var/lib/meilisearch/data.ms"
# Designates the location where database files will be created and retrieved.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#database-path
-db_path = "./data.ms"
+db_path = "/var/lib/meilisearch/data.ms"
-env = "development"
+env = "production"
# Configures the instance's environment. Value must be either `production` or `development`.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#environment
-env = "development"
+env = "production"
# The address on which the HTTP server will listen.
-http_addr = "localhost:7700"
+http_addr = "127.0.0.1:7700"
# The address on which the HTTP server will listen.
# master_key = "YOUR_MASTER_KEY_VALUE"
# Sets the instance's master key, automatically protecting all routes except GET /health.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#master-key
+#
+# NOTE: If this option is not set, the init script writes a random key to file
+# /etc/meilisearch/master_key, if it doesn't already exist, and loads it into
+# env. variable MEILI_MASTER_KEY at each start.
# master_key = "YOUR_MASTER_KEY_VALUE"
-# no_analytics = true
-# Deactivates Meilisearch's built-in telemetry when provided.
-# Meilisearch automatically collects data from all instances that do not opt out using this flag.
-# All gathered data is used solely for the purpose of improving Meilisearch, and can be deleted at any time.
-# https://docs.meilisearch.com/learn/configuration/instance_options.html#disable-analytics
-# no_analytics = true
-
http_payload_size_limit = "100 MB"
# Sets the maximum size of accepted payloads.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#payload-limit-size
@@ -43,11 +40,11 @@
### DUMPS ###
#############
http_payload_size_limit = "100 MB"
@@ -45,11 +43,11 @@
-dump_dir = "dumps/"
+dump_dir = "/var/lib/meilisearch/dumps/"
# Sets the directory where Meilisearch will create dump files.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#dump-directory
-dump_dir = "dumps/"
+dump_dir = "/var/lib/meilisearch/dumps/"
-# import_dump = "./path/to/my/file.dump"
+# import_dump = "/var/lib/meilisearch/dumps/file.dump"
# Imports the dump file located at the specified path. Path must point to a .dump file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#import-dump
-# import_dump = "./path/to/my/file.dump"
+# import_dump = "/var/lib/meilisearch/dumps/file.dump"
@@ -70,11 +67,11 @@
# between each snapshot, in seconds.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#schedule-snapshot-creation
# Prevents Meilisearch from throwing an error when `import_dump` does not point to a valid dump file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ignore-missing-dump
@@ -72,11 +70,11 @@
-snapshot_dir = "snapshots/"
+snapshot_dir = "/var/lib/meilisearch/snapshots/"
# Sets the directory where Meilisearch will store snapshots.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#snapshot-destination
-snapshot_dir = "snapshots/"
+snapshot_dir = "/var/lib/meilisearch/snapshots/"
-# import_snapshot = "./path/to/my/snapshot"
+# import_snapshot = "/var/lib/meilisearch/snapshots/my-snapshot"
# Launches Meilisearch after importing a previously-generated snapshot at the given filepath.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#import-snapshot
-# import_snapshot = "./path/to/my/snapshot"
+# import_snapshot = "/var/lib/meilisearch/snapshots/my-snapshot"
@@ -91,19 +88,19 @@
### SSL ###
###########
# Prevents a Meilisearch instance from throwing an error when `import_snapshot` does not point to a valid snapshot file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ignore-missing-snapshot
@@ -93,19 +91,19 @@
-# ssl_auth_path = "./path/to/root"
+# ssl_auth_path = "/etc/meilisearch/client-ca.crt"
# Enables client authentication in the specified path.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-authentication-path
-# ssl_auth_path = "./path/to/root"
+# ssl_auth_path = "/etc/meilisearch/client-ca.crt"
-# ssl_cert_path = "./path/to/certfile"
+# ssl_cert_path = "/etc/meilisearch/server.crt"
# Sets the server's SSL certificates.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-certificates-path
-# ssl_cert_path = "./path/to/certfile"
+# ssl_cert_path = "/etc/meilisearch/server.crt"
-# ssl_key_path = "./path/to/private-key"
+# ssl_key_path = "/etc/meilisearch/server.key"
# Sets the server's SSL key files.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-key-path
-# ssl_key_path = "./path/to/private-key"
+# ssl_key_path = "/etc/meilisearch/server.key"
-# ssl_ocsp_path = "./path/to/ocsp-file"
+# ssl_ocsp_path = "/etc/meilisearch/server.ocsp"
# Sets the server's OCSP file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-ocsp-path
-# ssl_ocsp_path = "./path/to/ocsp-file"
+# ssl_ocsp_path = "/etc/meilisearch/server.ocsp"
# Makes SSL authentication mandatory.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-require-auth

View File

@ -0,0 +1,173 @@
Patch-Source: https://github.com/meilisearch/meilisearch/pull/3731 (rebased)
--
From 8095f21999965429e46b6e12d2bc1ffab83414c8 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sat, 6 May 2023 18:10:54 +0200
Subject: [PATCH] Move comments above keys in config.toml
The current style is very unusual, confusing and breaks compatibility
with tools for parsing config files including comments. Everyone writes
comments above the items to which they refer (maybe except pythonists),
so let's stick to that.
diff --git a/config.toml b/config.toml
index 71087f25f9..71872d0d4d 100644
--- a/config.toml
+++ b/config.toml
@@ -1,130 +1,130 @@
# This file shows the default configuration of Meilisearch.
# All variables are defined here: https://docs.meilisearch.com/learn/configuration/instance_options.html#environment-variables
-db_path = "./data.ms"
# Designates the location where database files will be created and retrieved.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#database-path
+db_path = "./data.ms"
-env = "development"
# Configures the instance's environment. Value must be either `production` or `development`.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#environment
+env = "development"
-http_addr = "localhost:7700"
# The address on which the HTTP server will listen.
+http_addr = "localhost:7700"
-# master_key = "YOUR_MASTER_KEY_VALUE"
# Sets the instance's master key, automatically protecting all routes except GET /health.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#master-key
+# master_key = "YOUR_MASTER_KEY_VALUE"
-# no_analytics = true
# Deactivates Meilisearch's built-in telemetry when provided.
# Meilisearch automatically collects data from all instances that do not opt out using this flag.
# All gathered data is used solely for the purpose of improving Meilisearch, and can be deleted at any time.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#disable-analytics
+# no_analytics = true
-http_payload_size_limit = "100 MB"
# Sets the maximum size of accepted payloads.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#payload-limit-size
+http_payload_size_limit = "100 MB"
-log_level = "INFO"
# Defines how much detail should be present in Meilisearch's logs.
# Meilisearch currently supports six log levels, listed in order of increasing verbosity: `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`
# https://docs.meilisearch.com/learn/configuration/instance_options.html#log-level
+log_level = "INFO"
-# max_indexing_memory = "2 GiB"
# Sets the maximum amount of RAM Meilisearch can use when indexing.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#max-indexing-memory
+# max_indexing_memory = "2 GiB"
-# max_indexing_threads = 4
# Sets the maximum number of threads Meilisearch can use during indexing.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#max-indexing-threads
+# max_indexing_threads = 4
#############
### DUMPS ###
#############
-dump_dir = "dumps/"
# Sets the directory where Meilisearch will create dump files.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#dump-directory
+dump_dir = "dumps/"
-# import_dump = "./path/to/my/file.dump"
# Imports the dump file located at the specified path. Path must point to a .dump file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#import-dump
+# import_dump = "./path/to/my/file.dump"
-ignore_missing_dump = false
# Prevents Meilisearch from throwing an error when `import_dump` does not point to a valid dump file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ignore-missing-dump
+ignore_missing_dump = false
-ignore_dump_if_db_exists = false
# Prevents a Meilisearch instance with an existing database from throwing an error when using `import_dump`.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ignore-dump-if-db-exists
+ignore_dump_if_db_exists = false
#################
### SNAPSHOTS ###
#################
-schedule_snapshot = false
# Enables scheduled snapshots when true, disable when false (the default).
# If the value is given as an integer, then enables the scheduled snapshot with the passed value as the interval
# between each snapshot, in seconds.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#schedule-snapshot-creation
+schedule_snapshot = false
-snapshot_dir = "snapshots/"
# Sets the directory where Meilisearch will store snapshots.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#snapshot-destination
+snapshot_dir = "snapshots/"
-# import_snapshot = "./path/to/my/snapshot"
# Launches Meilisearch after importing a previously-generated snapshot at the given filepath.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#import-snapshot
+# import_snapshot = "./path/to/my/snapshot"
-ignore_missing_snapshot = false
# Prevents a Meilisearch instance from throwing an error when `import_snapshot` does not point to a valid snapshot file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ignore-missing-snapshot
+ignore_missing_snapshot = false
-ignore_snapshot_if_db_exists = false
# Prevents a Meilisearch instance with an existing database from throwing an error when using `import_snapshot`.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ignore-snapshot-if-db-exists
+ignore_snapshot_if_db_exists = false
###########
### SSL ###
###########
-# ssl_auth_path = "./path/to/root"
# Enables client authentication in the specified path.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-authentication-path
+# ssl_auth_path = "./path/to/root"
-# ssl_cert_path = "./path/to/certfile"
# Sets the server's SSL certificates.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-certificates-path
+# ssl_cert_path = "./path/to/certfile"
-# ssl_key_path = "./path/to/private-key"
# Sets the server's SSL key files.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-key-path
+# ssl_key_path = "./path/to/private-key"
-# ssl_ocsp_path = "./path/to/ocsp-file"
# Sets the server's OCSP file.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-ocsp-path
+# ssl_ocsp_path = "./path/to/ocsp-file"
-ssl_require_auth = false
# Makes SSL authentication mandatory.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-require-auth
+ssl_require_auth = false
-ssl_resumption = false
# Activates SSL session resumption.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-resumption
+ssl_resumption = false
-ssl_tickets = false
# Activates SSL tickets.
# https://docs.meilisearch.com/learn/configuration/instance_options.html#ssl-tickets
+ssl_tickets = false
#############################
### Experimental features ###
#############################
-experimental_enable_metrics = false
# Experimental metrics feature. For more information, see: <https://github.com/meilisearch/meilisearch/discussions/3518>
# Enables the Prometheus metrics on the `GET /metrics` endpoint.
+experimental_enable_metrics = false