1
Fork 0
forked from Korbs/4get
This commit is contained in:
Korbs 2024-06-07 20:51:50 -04:00
parent 9faff2f612
commit 060b5b4e31
4 changed files with 15 additions and 21 deletions

View file

@ -8,8 +8,7 @@ COPY ./docker/apache/ /etc/apache2/
COPY . . COPY . .
EXPOSE 80 EXPOSE 80
EXPOSE 443
ENV FOURGET_PROTO=http ENV NS_PROTO=http
CMD ["./docker/docker-entrypoint.sh"] CMD ["./docker/docker-entrypoint.sh"]

View file

@ -1,15 +1,10 @@
services: services:
fourget: navisearch:
image: docker.io/library/4get image: ark.sudovanilla.org/korbs/navisearch:amd64
# image: ark.sudovanilla.org/korbs/navisearch:arm64
restart: unless-stopped restart: unless-stopped
environment: environment:
- FOURGET_VERSION=1 - NS_VERSION=1
- FOURGET_SERVER_NAME=search.sudovanilla.org - NS_SERVER_NAME=search.sudovanilla.org
ports: ports:
- "80:80" - "1998:80"
- "443:443"
volumes:
- ./banners:/var/www/html/narvisearch/banner
- ./captcha:/var/www/html/narvisearch/data/captcha

View file

@ -2,14 +2,14 @@
set -e set -e
# remove quotes from variable if present # remove quotes from variable if present
FOURGET_PROTO="${FOURGET_PROTO%\"}" NS_PROTO="${NS_PROTO%\"}"
FOURGET_PROTO="${FOURGET_PROTO#\"}" NS_PROTO="${NS_PROTO#\"}"
# make lowercase # make lowercase
FOURGET_PROTO=`echo $FOURGET_PROTO | awk '{print tolower($0)}'` NS_PROTO=`echo $NS_PROTO | awk '{print tolower($0)}'`
if [ "$FOURGET_PROTO" = "https" ]; then if [ "$NS_PROTO" = "https" ]; then
echo "Using https configuration" echo "Using https configuration"
cp /etc/apache2/https.conf /etc/apache2/httpd.conf cp /etc/apache2/https.conf /etc/apache2/httpd.conf
else else

View file

@ -7,12 +7,12 @@ $from_config = ($refl->getConstants());
$from_env = array(); $from_env = array();
$env = getenv(); $env = getenv();
$fourget_env = array_filter($env, function($v, $k) { $NS_env = array_filter($env, function($v, $k) {
return str_starts_with($k, "FOURGET"); return str_starts_with($k, "NS");
}, ARRAY_FILTER_USE_BOTH); }, ARRAY_FILTER_USE_BOTH);
foreach($fourget_env as $key => $val) { foreach($NS_env as $key => $val) {
$target_key = preg_replace('/^FOURGET_/', '', $key); $target_key = preg_replace('/^NS_/', '', $key);
$from_env[$target_key] = trim($val, '\'"'); $from_env[$target_key] = trim($val, '\'"');
}; };