diff --git a/Dockerfile b/Dockerfile index df70ac1..5875e80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,10 @@ RUN apt-get update \ && cd / \ && rm -r dosage -RUN mkdir /Comics +RUN mkdir /Comics && mkdir /templates COPY download.sh . -COPY index.php . +COPY redirect.php /templates +COPY index.php /templates COPY run.sh . RUN chmod +x download.sh && chmod +x run.sh COPY dosage-cron /etc/cron.d/ diff --git a/download.sh b/download.sh index 6d628ce..78222ff 100644 --- a/download.sh +++ b/download.sh @@ -5,6 +5,11 @@ cd / # Fetch all comics, including adult ones and create html and rss pages /usr/local/bin/dosage -o html -o rss @ --adult +# Create index if not existing +if [ ! -f /Comics/html/index.php ]; then + cp /templates/index.php /Comics/html/index.php +fi + # Copy the RSS feed to the html folder #rm /Comics/html/dailydose.rss cp /Comics/dailydose.rss /Comics/html/dailydose.rss diff --git a/index.php b/index.php index 932b3ff..65b9549 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,16 @@ +$files = glob("*.*"); +rsort($files); +echo "