Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config files no longer used, now stored in sqlite db, fixed docs spec… #63

Merged
merged 8 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ LABEL maintainer="alex-phillips"

# environment settings
ENV DISKOVERDIR=/config/diskover.conf.d/diskover/
ENV DATABASE=/config/diskoverdb.sqlite3
ENV ES_HOST=elasticsearch

RUN \
echo "**** install build packages ****" && \
Expand All @@ -23,9 +25,7 @@ RUN \
python3-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
libldap \
ncurses \
php83-ldap \
php83-sqlite3 \
python3 && \
echo "**** configure php-fpm to pass env vars ****" && \
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ services:
- elasticsearch
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.22
environment:
- discovery.type=single-node
- xpack.security.enabled=true
- xpack.security.enabled=false
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
Expand Down Expand Up @@ -134,8 +134,6 @@ docker run -d \
-e TZ=Etc/UTC \
-e ES_HOST=elasticsearch \
-e ES_PORT=9200 \
-e ES_USER=elastic \
-e ES_PASS=changeme \
-p 80:80 \
-v /path/to/diskover/config:/config \
-v /path/to/diskover/data:/data \
Expand All @@ -155,8 +153,6 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e ES_HOST=elasticsearch` | ElasticSearch host (optional) |
| `-e ES_PORT=9200` | ElasticSearch port (optional) |
| `-e ES_USER=elastic` | ElasticSearch username (optional) |
| `-e ES_PASS=changeme` | ElasticSearch password (optional) |
| `-v /config` | Persistent config files |
| `-v /data` | Default mount point to crawl |

Expand Down
6 changes: 2 additions & 4 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ param_env_vars:
- { env_var: "TZ", env_value: "America/New_York", desc: "Specify a timezone to use EG America/New_York"}
- { env_var: "ES_HOST", env_value: "elasticsearch", desc: "ElasticSearch host (optional)"}
- { env_var: "ES_PORT", env_value: "9200", desc: "ElasticSearch port (optional)"}
- { env_var: "ES_USER", env_value: "elastic", desc: "ElasticSearch username (optional)"}
- { env_var: "ES_PASS", env_value: "changeme", desc: "ElasticSearch password (optional)"}

custom_compose: |
version: '2'
Expand All @@ -53,10 +51,10 @@ custom_compose: |
- elasticsearch
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.22
environment:
- discovery.type=single-node
- xpack.security.enabled=true
- xpack.security.enabled=false
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
Expand Down
36 changes: 0 additions & 36 deletions root/etc/s6-overlay/s6-rc.d/init-diskover-config/run
Original file line number Diff line number Diff line change
@@ -1,49 +1,13 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# copy config
if [[ ! -e /config/diskover.conf.d ]]; then
cp -r /app/diskover/configs_sample /config/diskover.conf.d
fi

# setup web
mkdir -p \
/config/diskover-web.conf.d

# copy over sample config files
if [[ -d /app/diskover-web/public ]]; then
cd /app/diskover-web/public || exit 1
for file in *.sample; do
dest=${file%.sample}
if [[ ! -e "/config/diskover-web.conf.d/$dest" ]]; then
cp "/app/diskover-web/public/$file" "/config/diskover-web.conf.d/$dest"
fi
ln -sf "/config/diskover-web.conf.d/$dest" "/app/diskover-web/public/$dest"
done
fi

if [[ -d /app/diskover-web/public/tasks ]]; then
cd /app/diskover-web/public/tasks || exit 1
for file in *.sample; do
dest=${file%.sample}
if [[ ! -e "/config/diskover-web.conf.d/$dest" ]]; then
cp "/app/diskover-web/public/tasks/$file" "/config/diskover-web.conf.d/$dest"
fi
ln -sf "/config/diskover-web.conf.d/$dest" "/app/diskover-web/public/tasks/$dest"
done
fi

# touch db
if [[ ! -e "/config/diskoverdb.sqlite3" ]]; then
touch /config/diskoverdb.sqlite3
fi
ln -sf /config/diskoverdb.sqlite3 /app/diskover-web/diskoverdb.sqlite3

# copy and set variables in Constants.php
if [[ ! -e "/config/diskover-web.conf.d/Constants.php" ]]; then
cp /app/diskover-web/src/diskover/Constants.php.sample /config/diskover-web.conf.d/Constants.php
fi

ln -sf /config/diskover-web.conf.d/Constants.php /app/diskover-web/src/diskover/Constants.php

lsiown -R abc:abc /config