mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-25 09:36:14 +01:00
Fix Baikal build
Signed-off-by: main <magic_rb@redalder.org>
This commit is contained in:
parent
1de865fe93
commit
051a7da66a
|
@ -19,12 +19,15 @@ nglib.makeSystem {
|
|||
baikal =
|
||||
pkgs.fetchzip {
|
||||
url = "https://github.com/sabre-io/Baikal/releases/download/0.9.2/baikal-0.9.2.zip";
|
||||
sha256 = "sha256-xOxO7Ppuw+d8KUJWAM9SNl/U0pezzWvY8bpTvFQrZN0=";
|
||||
sha256 = "sha256-/LdwMVy0aGaj2B5db107duYl7oKcA/BuMXt/zZxlsZw=";
|
||||
extraPostFetch = ''
|
||||
patch -p1 -d "$out" < ${./baikal/baikal-project-uri.patch}
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.writeShellScript "baikal-script"
|
||||
''
|
||||
set -e
|
||||
set -ex
|
||||
mkdir -p /var/www
|
||||
if ! [ -z "$(ls -A /var/www)" ] ; then
|
||||
rm -r /var/www/*
|
||||
|
@ -117,6 +120,7 @@ nglib.makeSystem {
|
|||
[ "authn_dbd_module" "modules/mod_authn_dbd.so" ]
|
||||
[ "authz_user_module" "modules/mod_authz_user.so" ]
|
||||
[ "authz_host_module" "modules/mod_authz_host.so" ]
|
||||
[ "headers_module" "modules/mod_headers.so" ]
|
||||
];
|
||||
}
|
||||
{
|
||||
|
@ -149,27 +153,22 @@ nglib.makeSystem {
|
|||
}
|
||||
|
||||
{
|
||||
Directory = {
|
||||
"/" = {
|
||||
Directory."/" = {
|
||||
Require = [ "all" "denied" ];
|
||||
Options = "SymlinksIfOwnerMatch";
|
||||
};
|
||||
};
|
||||
|
||||
VirtualHost = {
|
||||
"*:80" = {
|
||||
DocumentRoot = "/var/www/html/";
|
||||
RewriteEngine = "on";
|
||||
VirtualHost."*:80" = {
|
||||
DocumentRoot = "/var/www/";
|
||||
RewriteEngine = "off";
|
||||
LogLevel = [ "alert" "rewrite:trace3" ];
|
||||
|
||||
RewriteRule =
|
||||
[ [ "/.well-known/carddav" "/dav.php" "[R=308,L]" ]
|
||||
[ "/.well-known/caldav" "/dav.php" "[R=308,L]" ]
|
||||
# [ "^/baikal/(.*)\.php$" "unix:${config.services.php-fpm.pools.main.socket}|fcgi:///var/www/html/$0" ]
|
||||
# [ "^/dav(.*)$" "/webdav/%{LA-U:REMOTE_USER}" "" ]
|
||||
];
|
||||
|
||||
ProxyPassMatch =
|
||||
[
|
||||
"^/(.*\.php(/.*)?)$"
|
||||
"unix:${config.services.php-fpm.pools.main.socket}|fcgi://./var/www/html/"
|
||||
# [ "^/baikal(.*)$" "/var/www/html/$1" "" ]
|
||||
];
|
||||
|
||||
# DBDriver = "sqlite3";
|
||||
|
@ -180,16 +179,23 @@ nglib.makeSystem {
|
|||
# DBDMax = 20;
|
||||
# DBDExptime = 300;
|
||||
|
||||
# Alias =
|
||||
# [ [ "/webdav" "/var/webdav" ]
|
||||
# ];
|
||||
# Location."/var/www/html/baikal" = {
|
||||
# Require = [ "all" "granted" ];
|
||||
# AllowOverride = [ "all" ];
|
||||
# Options = [ "-Indexes" "+FollowSymlinks" ];
|
||||
# DirectoryIndex = "index.php";
|
||||
# RewriteRule = [ "^/baikal/(.*)$" "/" ];
|
||||
# };
|
||||
|
||||
Directory = {
|
||||
"/var/www/html" = {
|
||||
Location."/var/www/html/" = {
|
||||
Header =
|
||||
[ [ "set" "X-Baikal-Uri" "http://localhost:8088/baikal" ]
|
||||
[ "set" "Host" "http://localhost:8088/baikal" ]
|
||||
];
|
||||
Options = [ "-Indexes" "+FollowSymlinks" ];
|
||||
Require = [ "all" "granted" ];
|
||||
AllowOverride = [ "all" ];
|
||||
Options = [ "-Indexes" "+FollowSymlinks" ];
|
||||
DirectoryIndex = "index.php";
|
||||
# ProxyPass = [ "unix:${config.services.php-fpm.pools.main.socket}|fcgi:///var/www/html/" ];
|
||||
};
|
||||
|
||||
# "/var/webdav" = {
|
||||
|
@ -207,8 +213,6 @@ nglib.makeSystem {
|
|||
# AllowOverride = [ "all" ];
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
14
containers/baikal/baikal-project-uri.patch
Normal file
14
containers/baikal/baikal-project-uri.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
diff --git a/Core/Frameworks/Flake/Framework.php b/Core/Frameworks/Flake/Framework.php
|
||||
index 73f6b9d..139ee75 100644
|
||||
--- a/Core/Frameworks/Flake/Framework.php
|
||||
+++ b/Core/Frameworks/Flake/Framework.php
|
||||
@@ -239,7 +239,8 @@ class Framework extends \Flake\Core\Framework {
|
||||
$sHttpBaseUrl = self::rmQuery($sHttpBaseUrl);
|
||||
$sHttpBaseUrl = self::rmScriptName($sHttpBaseUrl, $sScript);
|
||||
$sHttpBaseUrl = self::rmProjectContext($sHttpBaseUrl);
|
||||
- define("PROJECT_URI", $sProtocol . "://" . $_SERVER["HTTP_HOST"] . $sHttpBaseUrl);
|
||||
+ define("PROJECT_URI", $_SERVER['HTTP_X_BAIKAL_URI']);
|
||||
+ echo $PROJECT_URI
|
||||
unset($sScript);
|
||||
unset($sDirName);
|
||||
unset($sBaseUrl);
|
Loading…
Reference in a new issue