Skip to content

Commit

Permalink
nginx: fix fancyindex installation (swizzin#1136)
Browse files Browse the repository at this point in the history
* svn-depreciation

* nginx: fix fancyindex installation

* cleanup

---------

Co-authored-by: Brett Petch <[email protected]>
  • Loading branch information
liaralabs and brettpetch authored Feb 17, 2024
1 parent db719aa commit bce5332
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/install/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ PROX
echo_progress_done "Config installed"

echo_progress_start "Installing fancyindex"
svn export https://github.com/Naereen/Nginx-Fancyindex-Theme/trunk/Nginx-Fancyindex-Theme-dark /srv/fancyindex >> $log 2>&1
git clone https://github.com/Naereen/Nginx-Fancyindex-Theme/ /tmp/fancyindex >> $log 2>&1
mv /tmp/fancyindex/Nginx-Fancyindex-Theme-dark /srv/fancyindex >> $log 2>&1
rm -rf /tmp/fancyindex

cat > /etc/nginx/snippets/fancyindex.conf << FIC
fancyindex on;
fancyindex_localtime on;
Expand Down
6 changes: 6 additions & 0 deletions scripts/update/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ function update_nginx() {
echo_progress_done
done

if [[ ! -d /srv/fancyindex ]]; then
git clone https://github.com/Naereen/Nginx-Fancyindex-Theme/ /tmp/fancyindex >> $log 2>&1
mv /tmp/fancyindex/Nginx-Fancyindex-Theme-dark /srv/fancyindex >> $log 2>&1
rm -rf /tmp/fancyindex
fi

if grep -q -e "-dark" -e "Nginx-Fancyindex" /srv/fancyindex/header.html; then
echo_progress_start "Updating fancyindex theme"
sed -i 's/href="\/[^\/]*/href="\/fancyindex/g' /srv/fancyindex/header.html
Expand Down

0 comments on commit bce5332

Please sign in to comment.