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 . .
EXPOSE 80
EXPOSE 443
ENV FOURGET_PROTO=http
ENV NS_PROTO=http
CMD ["./docker/docker-entrypoint.sh"]

View file

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

View file

@ -2,14 +2,14 @@
set -e
# remove quotes from variable if present
FOURGET_PROTO="${FOURGET_PROTO%\"}"
FOURGET_PROTO="${FOURGET_PROTO#\"}"
NS_PROTO="${NS_PROTO%\"}"
NS_PROTO="${NS_PROTO#\"}"
# 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"
cp /etc/apache2/https.conf /etc/apache2/httpd.conf
else

View file

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