summaryrefslogtreecommitdiff
path: root/src/web/config.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/web/config.php41
1 files changed, 26 insertions, 15 deletions
diff --git a/src/web/config.php b/src/web/config.php
index 8689b8e..4a4e830 100644
--- a/src/web/config.php
+++ b/src/web/config.php
@@ -1,26 +1,33 @@
<?php /* Copyright (c) 2024 Freya Murphy */
-// ENVIRONMENT
+// CONFIG
+// config values needed across the website
//
-// devlopment - do not cache any assets
-// - use http host provided by user
+// domain - the default domain for the website
//
-// production - use generated timestamps for each file
-// - hard code http host to 'domain' lang string
+// allowed_hosts - accepted domains to use for the website
//
-define('ENVIRONMENT', 'devlopment');
-
-// CONFIG
+// base_path - the base path the website is located at
//
-// config values needed across the website
-
-define('CONFIG', array(
+// theme_color - html hex color used for browser metadata
+//
+// routes - array of regex keys that match the request path and
+// - place it with the value if it matches
+// - e.g. '' => 'home' sends / to /home
+//
+// style - single or list of css styles to load on specific routes
+//
+// js - single or list of js script to load on specific routes
+//
+// autoload - list of directories to autoload all PHP files in them
+//
+define('SITE_CONFIG', array(
/* core config settings */
- 'domain' => 'freya.cat',
- 'allowed_hosts' => ['freya.cat', 'www.freya.cat'],
- 'base_path' => '/',
+ 'domain' => getenv("WEBSITE_HOST"),
+ 'allowed_hosts' => explode(" ", getenv("WEBSITE_ALLOWED_HOSTS")),
+ 'base_path' => getenv("WEBSITE_BASE_PATH"),
'theme_color' => '#181818',
- 'git_url' => 'https://g.freya.cat/freya',
+ 'git_url' => 'https://g.freya.cat',
/* route overides */
'routes' => array(
'' => 'home',
@@ -39,4 +46,8 @@ define('CONFIG', array(
'js' => array(
'blog' => 'js/prism.js',
),
+ /* directories to autoload php code */
+ 'autoload' => array('/third_party', '/lib'),
));
+
+define('ASSET_ROOT', PHP_ROOT . '/assets');