Skip to content

Commit

Permalink
we can't nest mohunt points inside a container, make them siblings in…
Browse files Browse the repository at this point in the history
…stead (#169)
  • Loading branch information
mmguero committed Apr 12, 2023
1 parent bd78af7 commit 9c006aa
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Dockerfiles/htadmin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ RUN apt-get -q update && \
cd /var/www/htadmin && \
( grep -rhoPi "(src|href)=['\"]https?://.+?['\"]" ./includes/* | sed "s/^[a-zA-Z]*=['\"]*//" | sed "s/['\"]$//" | xargs -r -l curl -s -S -L -J -O ) && \
sed -i "s@http[^'\"]*/@@gI" ./includes/* && \
mkdir fonts && cd fonts && \
mkdir fonts config auth default && \
cd fonts && \
curl -s -S -L -J -O "https://maxcdn.bootstrapcdn.com/bootstrap/$BOOTSTRAP_VERSION/fonts/glyphicons-halflings-regular.ttf" && \
curl -s -S -L -J -O "https://maxcdn.bootstrapcdn.com/bootstrap/$BOOTSTRAP_VERSION/fonts/glyphicons-halflings-regular.woff" && \
curl -s -S -L -J -O "https://maxcdn.bootstrapcdn.com/bootstrap/$BOOTSTRAP_VERSION/fonts/glyphicons-halflings-regular.woff2" && \
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ services:
- ./nginx/ca-trust:/var/local/ca-trust:ro
- ./htadmin/config.ini:/var/www/htadmin/config/config.ini:rw
- ./htadmin/metadata:/var/www/htadmin/config/metadata:rw
- ./nginx/htpasswd:/var/www/htadmin/config/auth/htpasswd:rw
- ./nginx/htpasswd:/var/www/htadmin/auth/htpasswd:rw
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost"]
interval: 60s
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ services:
- ./nginx/ca-trust:/var/local/ca-trust:ro
- ./htadmin/config.ini:/var/www/htadmin/config/config.ini:rw
- ./htadmin/metadata:/var/www/htadmin/config/metadata:rw
- ./nginx/htpasswd:/var/www/htadmin/config/auth/htpasswd:rw
- ./nginx/htpasswd:/var/www/htadmin/auth/htpasswd:rw
healthcheck:
test: ["CMD", "curl", "--silent", "--fail", "http://localhost"]
interval: 60s
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing-local-modifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $ grep -P "^( - ./| [\w-]+:)" docker-compose-standalone.yml
- ./nginx/ca-trust:/var/local/ca-trust:ro
- ./htadmin/config.ini:/var/www/htadmin/config/config.ini:rw
- ./htadmin/metadata:/var/www/htadmin/config/metadata:rw
- ./nginx/htpasswd:/var/www/htadmin/config/htpasswd:rw
- ./nginx/htpasswd:/var/www/htadmin/auth/htpasswd:rw
freq:
- ./nginx/ca-trust:/var/local/ca-trust:ro
api:
Expand Down
10 changes: 6 additions & 4 deletions htadmin/htadmin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

HTADMIN_ENABLED=${NGINX_BASIC_AUTH:-"true"}

if [[ ! -f /var/www/htadmin/config/config.ini ]]; then
cp /var/www/htadmin/config/default/config.ini /var/www/htadmin/config/config.ini
if [[ ! -f /var/www/htadmin/config/config.ini ]] && [[ -f /var/www/htadmin/default/config.ini ]]; then
mkdir -p /var/www/htadmin/config/
cp /var/www/htadmin/default/config.ini /var/www/htadmin/config/config.ini
fi

if [[ ! -f /var/www/htadmin/config/metadata ]]; then
cp /var/www/htadmin/config/default/metadata /var/www/htadmin/config/metadata
if [[ ! -f /var/www/htadmin/config/metadata ]] && [[ -f /var/www/htadmin/default/metadata ]]; then
mkdir -p /var/www/htadmin/config/
cp /var/www/htadmin/default/metadata /var/www/htadmin/config/metadata
fi

if [[ "$HTADMIN_ENABLED" == "true" ]]; then
Expand Down
8 changes: 8 additions & 0 deletions htadmin/nginx/sites-available/default
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ server {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}

location /auth {
deny all;
return 404;
}
location /config {
deny all;
return 404;
}
location /default {
deny all;
return 404;
}
}
8 changes: 4 additions & 4 deletions kubernetes/19-htadmin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ spec:
volumeMounts:
- mountPath: /var/local/ca-trust/configmap
name: htadmin-var-local-catrust-volume
- mountPath: /var/www/htadmin/config/auth
- mountPath: /var/www/htadmin/auth
name: htadmin-config-volume
subPath: "auth"
- mountPath: /var/www/htadmin/config/default/configmap
name: htadmin-config-default-volume
- mountPath: /var/www/htadmin/config/
- mountPath: /var/www/htadmin/default/configmap
name: htadmin-config-default-volume
- mountPath: /var/www/htadmin/config
name: htadmin-config-volume
subPath: "htadmin"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion scripts/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ def authSetup(wipe=False):
f.write('; Change this to customize your title:\n')
f.write('app_title = Malcolm User Management\n\n')
f.write('; htpasswd file\n')
f.write('secure_path = ./config/auth/htpasswd\n')
f.write('secure_path = ./auth/htpasswd\n')
f.write('; metadata file\n')
f.write('metadata_path = ./config/metadata\n\n')
f.write('; administrator user/password (htpasswd -b -c -B ...)\n')
Expand Down

0 comments on commit 9c006aa

Please sign in to comment.