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

Rebase generic off monolithic #112

Merged
merged 4 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 5 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM lancachenet/ubuntu-nginx:latest
MAINTAINER LanCache.Net Team <[email protected]>
FROM lancachenet/monolithic:switcheroo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option to make this more flexible:

ARG MONOLITHIC_TAG=master
FROM lancachenet/monolithic:${MONOLITHIC_TAG}

We could potentially leverage the current branch name with this (e.g. attempt to pull lancachenet/monolithic:$GITHUB_HEAD_REF, if that works then pass --build-arg MONOLITHIC_TAG="${GITHUB_HEAD_REF}" when building the image; this would allow automatically leveraging matched-name branches on monolithic for pull requests on generic).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, but don't want to make the change now

LABEL version=3
LABEL description="Single agressive caching container for caching game content at lan parties."
VibroAxe marked this conversation as resolved.
Show resolved Hide resolved
LABEL maintainer=" LanCache.Net Team <[email protected]>"
VibroAxe marked this conversation as resolved.
Show resolved Hide resolved

ENV GENERICCACHE_VERSION=2 \
WEBUSER=www-data \
CACHE_MODE=generic \
CACHE_MEM_SIZE=500m \
CACHE_DISK_SIZE=1000000m \
Expand All @@ -15,19 +16,7 @@ ENV GENERICCACHE_VERSION=2 \

COPY overlay/ /

RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
rm /etc/nginx/conf.d/gzip.conf ;\
chmod 754 /var/log/tallylog ; \
id -u ${WEBUSER} &> /dev/null || adduser --system --home /var/www/ --no-create-home --shell /bin/false --group --disabled-login ${WEBUSER} ;\
chmod 755 /scripts/* ;\
mkdir -m 755 -p /data/cache ;\
mkdir -m 755 -p /data/info ;\
mkdir -m 755 -p /data/logs ;\
mkdir -m 755 -p /tmp/nginx/ ;\
chown -R ${WEBUSER}:${WEBUSER} /data/ ;\
mkdir -p /etc/nginx/sites-enabled ;\
ln -s /etc/nginx/sites-available/10_generic.conf /etc/nginx/sites-enabled/10_generic.conf; \
ln -s /etc/nginx/stream-available/10_sni.conf /etc/nginx/stream-enabled/10_sni.conf
RUN rm -rf /data/cachedomains/*

VOLUME ["/data/logs", "/data/cache", "/var/www"]

Expand Down
2 changes: 1 addition & 1 deletion goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ command:
exit-status: 0
stdout:
- Succesfully Cached
timeout: 10000
timeout: 20000
process:
nginx:
running: true
Expand Down
1 change: 0 additions & 1 deletion overlay/etc/nginx/conf.d/20_proxy_cache_path.conf

This file was deleted.

1 change: 1 addition & 0 deletions overlay/etc/nginx/conf.d/30_maps.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#no maps needed in generic
39 changes: 0 additions & 39 deletions overlay/etc/nginx/nginx.conf

This file was deleted.

10 changes: 0 additions & 10 deletions overlay/etc/nginx/sites-available/10_generic.conf

This file was deleted.

19 changes: 0 additions & 19 deletions overlay/etc/nginx/sites-available/generic.conf.d/10_generic.conf

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions overlay/etc/nginx/stream-available/10_sni.conf

This file was deleted.

1 change: 0 additions & 1 deletion overlay/etc/nginx/workers.conf

This file was deleted.

4 changes: 0 additions & 4 deletions overlay/etc/supervisor/conf.d/heartbeat.conf

This file was deleted.

46 changes: 0 additions & 46 deletions overlay/hooks/entrypoint-pre.d/05_config_check.sh

This file was deleted.

14 changes: 0 additions & 14 deletions overlay/hooks/entrypoint-pre.d/10_setup.sh

This file was deleted.

3 changes: 3 additions & 0 deletions overlay/hooks/entrypoint-pre.d/15_generate_maps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

# no maps needed
14 changes: 0 additions & 14 deletions overlay/hooks/entrypoint-pre.d/20_perms_check.sh

This file was deleted.

9 changes: 0 additions & 9 deletions overlay/hooks/supervisord-pre.d/99_config_check.sh

This file was deleted.

28 changes: 22 additions & 6 deletions overlay/scripts/cache_test.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
#!/bin/bash
set -e
pageload1=`curl http://www.lagado.com/tools/cache-test --resolve www.lagado.com:80:127.0.0.1`
pageload1=`curl http://www.worldtimeapi.org/api/timezone/ETC/GMT --resolve www.worldtimeapi.org:80:127.0.0.1`
sleep 5
pageload2=`curl http://www.lagado.com/tools/cache-test --resolve www.lagado.com:80:127.0.0.1`

pageload2=`curl http://www.worldtimeapi.org/api/timezone/ETC/GMT --resolve www.worldtimeapi.org:80:127.0.0.1`
sleep 5
pageload3=`curl http://worldtimeapi.org/api/timezone/ETC/GMT --resolve worldtimeapi.org:80:127.0.0.1`
sleep 5
pageload4=`curl http://worldtimeapi.org/api/timezone/ETC/GMT --resolve worldtimeapi.org:80:127.0.0.1`
if [ "$pageload1" == "$pageload2" ]; then
echo "Succesfully Cached"
exit 0
if [ "$pageload3" == "$pageload4" ]; then
if [ "$pageload1" == "$pageload4" ]; then
echo "Succesfully Cached"
exit 0
else
#In generic pages 1+4 should be identical as all domains are cached equally
echo "Error caching test page, pages 1+4 are different"
exit -3
fi

else
echo "Error caching test page, pages 3+4 different"
exit -2
fi

else
echo "Error caching test page, pages differed"
echo "Error caching test page, pages 1+2 different"
exit -1
fi