[PATCH v2 2/2] Introduce conf/config.dev for development

Frédéric Mangano-Tarumi fmang at mg0.fr
Mon Jun 1 16:50:23 UTC 2020


conf/config.dev’s purpose is to provide a lighter configuration template
for developers, and split development-specific options off the default
configuration file.
---
 TESTING              |  8 +++-----
 conf/config.defaults | 10 ----------
 conf/config.dev      | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 15 deletions(-)
 create mode 100644 conf/config.dev

diff --git a/TESTING b/TESTING
index 31e3bcbd..f62baefa 100644
--- a/TESTING
+++ b/TESTING
@@ -17,12 +17,10 @@ INSTALL.
 
    Ensure to enable the pdo_sqlite extension in php.ini.
 
-3) Copy conf/config.defaults to conf/config and adjust the configuration
-   Pay attention to disable_http_login, enable_maintenance, aur_location and
-   htmldir.
+3) Copy conf/config.dev to conf/config and read its instructions.
 
-   Be sure to change backend to sqlite and name to the file location of your
-   created test database.
+   Note that when the upstream config.dev is updated, you should compare it to
+   your conf/config.
 
 4) Prepare the testing database:
 
diff --git a/conf/config.defaults b/conf/config.defaults
index ed495168..447dacac 100644
--- a/conf/config.defaults
+++ b/conf/config.defaults
@@ -41,16 +41,6 @@ cache = none
 cache_pkginfo_ttl = 86400
 memcache_servers = 127.0.0.1:11211
 
-[php]
-; Address PHP should bind when spawned in development mode by aurweb.spawn.
-bind_address = 127.0.0.1:8081
-; Directory containing aurweb's PHP code, required by aurweb.spawn.
-;htmldir = /path/to/web/html
-
-[fastapi]
-; Address uvicorn should bind when spawned in development mode by aurweb.spawn.
-bind_address = 127.0.0.1:8082
-
 [ratelimit]
 request_limit = 4000
 window_length = 86400
diff --git a/conf/config.dev b/conf/config.dev
new file mode 100644
index 00000000..e9c2112e
--- /dev/null
+++ b/conf/config.dev
@@ -0,0 +1,36 @@
+; Configuration file for aurweb development.
+;
+; Options are implicitly inherited from ${AUR_CONFIG}.defaults, which lists all
+; available options for productions, and their default values. This current file
+; overrides only options useful for development, and introduces
+; development-specific options too.
+;
+; Paths need to be absolute, so please replace $AUR_ROOT with your project root.
+
+[database]
+
+backend = sqlite
+name = $AUR_ROOT/aurweb.sqlite3
+
+; Alternative MySQL configuration
+;backend = mysql
+;name = aurweb
+;user = aur
+;password = aur
+
+[options]
+aur_location = http://127.0.0.1:8080
+disable_http_login = 0
+enable-maintenance = 0
+
+[php]
+; Address PHP should bind when spawned in development mode by aurweb.spawn.
+bind_address = 127.0.0.1:8081
+; Directory containing aurweb's PHP code, required by aurweb.spawn.
+htmldir = $AUR_ROOT/web/html
+
+[fastapi]
+; Address uvicorn should bind when spawned in development mode by aurweb.spawn.
+bind_address = 127.0.0.1:8082
+
+; vim: ft=dosini
-- 
2.26.2


More information about the aur-dev mailing list