mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
add dns for proxy inside container
This commit is contained in:
parent
ce34f302a1
commit
0d98667650
9 changed files with 37 additions and 12 deletions
|
|
@ -66,4 +66,22 @@ then
|
|||
cp /etc/supervisor/blackfire.conf /etc/supervisor/enabled/
|
||||
fi
|
||||
|
||||
if [ -n "${PROXY_BASE:-}" ]; then
|
||||
UPSTREAM_DNS=$(cat /etc/resolv.conf | grep nameserver | cut -d' ' -f 2)
|
||||
(
|
||||
RC=$(sed '/nameserver/d' /etc/resolv.conf)
|
||||
echo "$RC" > /etc/resolv.conf
|
||||
)
|
||||
echo 'nameserver 127.0.0.22' >> /etc/resolv.conf
|
||||
|
||||
echo "s/UPSTREAM_DNS/${UPSTREAM_DNS}"
|
||||
sed -i "s/UPSTREAM_DNS/${UPSTREAM_DNS}/" /etc/dnsmasq.conf
|
||||
echo "s/PROXY_BASE/${PROXY_BASE}"
|
||||
sed -i "s/PROXY_BASE/${PROXY_BASE}/" /etc/dnsmasq.conf
|
||||
echo "s/HOST_IP/${HOST_IP}"
|
||||
sed -i "s/HOST_IP/${HOST_IP}/" /etc/dnsmasq.conf
|
||||
|
||||
cp /etc/supervisor/dnsmasq.conf /etc/supervisor/enabled/
|
||||
fi
|
||||
|
||||
exec supervisord -c /etc/supervisor/supervisord.conf
|
||||
|
|
@ -1,15 +1,7 @@
|
|||
{runCommand}:
|
||||
runCommand "configs" {} ''
|
||||
mkdir -p $out/etc
|
||||
mkdir -p $out/etc/sudoers.d
|
||||
mkdir -p $out/conf
|
||||
cp ${./configs/cron.conf} $out/etc/oc-cron.conf
|
||||
cp ${./configs/nginx-app.conf} $out/conf/nginx-app.conf
|
||||
cp ${./configs/sudoers} $out/etc/sudoers.d/haze
|
||||
cp -r ${./configs/nc} $out/etc/nc
|
||||
cp ${./configs/php-fpm.conf} $out/etc/php-fpm.conf
|
||||
cp ${./configs/nginx.conf} $out/etc/nginx.conf
|
||||
cp -r ${./configs/supervisor} $out/etc/supervisor
|
||||
chmod +w $out/etc/supervisor
|
||||
mkdir -p $out
|
||||
cp -r ${./configs} $out/etc
|
||||
chmod -R +w $out/etc
|
||||
mkdir $out/etc/supervisor/enabled/
|
||||
''
|
||||
|
|
|
|||
6
nix/image/configs/dnsmasq.conf
Normal file
6
nix/image/configs/dnsmasq.conf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
listen-address=127.0.0.22
|
||||
no-resolv
|
||||
|
||||
address=/PROXY_BASE/HOST_IP
|
||||
|
||||
server=UPSTREAM_DNS
|
||||
|
|
@ -79,7 +79,7 @@ http {
|
|||
}
|
||||
}
|
||||
|
||||
include /conf/nginx-app.conf;
|
||||
include /etc/nginx-app.conf;
|
||||
|
||||
location ~ \.php(?:$|/) {
|
||||
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
|
||||
|
|
|
|||
2
nix/image/configs/supervisor/dnsmasq.conf
Normal file
2
nix/image/configs/supervisor/dnsmasq.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[program:dnsmasq]
|
||||
command = /bin/dnsmasq --keep-in-foreground -u root
|
||||
|
|
@ -34,6 +34,7 @@
|
|||
vim,
|
||||
helix,
|
||||
python3Packages,
|
||||
dnsmasq,
|
||||
}: let
|
||||
inherit (builtins) toString;
|
||||
inherit (lib) readFile getExe concatStringsSep splitString take;
|
||||
|
|
@ -149,6 +150,7 @@
|
|||
vim
|
||||
helix
|
||||
python3Packages.supervisor
|
||||
dnsmasq
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue