mirror of
https://github.com/oupala/apaxy.git
synced 2025-09-15 12:02:07 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
aae02e06fe | ||
|
8f85f2c8ab | ||
|
8f7897495f | ||
|
b525e7e19c | ||
|
367722a973 | ||
|
049ff109f8 | ||
|
ca63ea21a8 |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,3 +1,21 @@
|
||||
# [2.1.0](https://github.com/oupala/apaxy/compare/2.0.1...2.1.0) (2019-05-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* install script can set a header and a footer message ([8f85f2c](https://github.com/oupala/apaxy/commit/8f85f2c))
|
||||
|
||||
|
||||
|
||||
## [2.0.1](https://github.com/oupala/apaxy/compare/2.0.0...2.0.1) (2019-05-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make the script apaxy-configure.sh more robust ([367722a](https://github.com/oupala/apaxy/commit/367722a))
|
||||
|
||||
|
||||
|
||||
# [2.0.0](https://github.com/oupala/apaxy/compare/1.0.0...2.0.0) (2019-05-29)
|
||||
|
||||
|
||||
|
32
apaxy-configure.sh
Normal file → Executable file
32
apaxy-configure.sh
Normal file → Executable file
@@ -21,6 +21,10 @@ defaultLogFile="$(basename "${0}" .sh).log"
|
||||
defaultApacheWebRootPath="/var/www/html"
|
||||
defaultInstallWebPath=""
|
||||
defaultEnableGallery=false
|
||||
defaultHeaderMessage="default header message"
|
||||
defaultFooterMessage="default footer message"
|
||||
|
||||
workingDirectory="$(dirname "${0}")"
|
||||
|
||||
# functions
|
||||
|
||||
@@ -42,6 +46,8 @@ Available optionnal parameters are :
|
||||
-d - set path/to/dir/ directory where apaxy will be installed on the filesystem
|
||||
-w - set path/to/dir/ directory where apaxy will be available on the httpd server
|
||||
-g - enable or disable gallery feature
|
||||
-hm - set the default header message displayed on top of each page
|
||||
-fm - set the default footer message displayed on bottom of each page
|
||||
-ll - set the log level
|
||||
-lf - set the log file
|
||||
EOF
|
||||
@@ -52,7 +58,7 @@ EOF
|
||||
##
|
||||
displayUsage () {
|
||||
cat <<EOF
|
||||
usage - $(basename "${0}") [-h] [-d path/to/dir/] [-w path/to/dir/] [-g true|false] [-ll logLevel] [-lf logFile]
|
||||
usage - $(basename "${0}") [-h] [-d path/to/dir/] [-w path/to/dir/] [-g true|false] [-hm "header message"] [-fm "footer message"] [-ll logLevel] [-lf logFile]
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -84,8 +90,6 @@ log () {
|
||||
}
|
||||
|
||||
# getting parameters value from config file (can be overloaded by cli values)
|
||||
workingDirectory=$(dirname "$0")
|
||||
|
||||
if [ -f "${workingDirectory}/apaxy.config" ]; then
|
||||
# shellcheck source=apaxy.config
|
||||
source "${workingDirectory}/apaxy.config"
|
||||
@@ -113,6 +117,14 @@ while [ "$#" -ge 1 ] ; do
|
||||
shiftStep=2
|
||||
enableGallery="${2}"
|
||||
;;
|
||||
-hm) # set the default header message displayed on top of each page
|
||||
shiftStep=2
|
||||
headerMessage="${2}"
|
||||
;;
|
||||
-fm) # set the default footer message displayed on bottom of each page
|
||||
shiftStep=2
|
||||
footerMessage="${2}"
|
||||
;;
|
||||
-ll) # set the log level
|
||||
shiftStep=2
|
||||
logLevel="${2}"
|
||||
@@ -159,6 +171,16 @@ then
|
||||
enableGallery="${defaultEnableGallery}"
|
||||
fi
|
||||
|
||||
if [ -z "${headerMessage}" ]
|
||||
then
|
||||
headerMessage="${defaultHeaderMessage}"
|
||||
fi
|
||||
|
||||
if [ -z "${footerMessage}" ]
|
||||
then
|
||||
footerMessage="${defaultFooterMessage}"
|
||||
fi
|
||||
|
||||
if [ -z "${logLevel}" ]
|
||||
then
|
||||
logLevel="${defaultLogLevel}"
|
||||
@@ -189,7 +211,7 @@ if [ ! -d "${installDir}" ] || [ ! -w "${installDir}" ]; then
|
||||
fi
|
||||
|
||||
log 1 "- copying apaxy in install directory"
|
||||
cp -r apaxy/* "${installDir}/"
|
||||
cp -r ${workingDirectory}/apaxy/* "${installDir}/"
|
||||
|
||||
log 1 "- configuring apaxy in install directory"
|
||||
|
||||
@@ -212,6 +234,8 @@ log 2 "- setting path in html files"
|
||||
files=$(find ${installDir} -name "*.html")
|
||||
while read -r file; do
|
||||
sed -i "s|{FOLDERNAME}|${installWebPath}|g" "${file}"
|
||||
sed -i "s|{HEADER-MESSAGE}|${headerMessage}|g" "${file}"
|
||||
sed -i "s|{FOOTER-MESSAGE}|${footerMessage}|g" "${file}"
|
||||
done <<< "${files}"
|
||||
|
||||
log 2 "- syncing filesystem"
|
||||
|
@@ -50,3 +50,9 @@ installWebPath=""
|
||||
# please enable it with caution
|
||||
#
|
||||
enableGallery=false
|
||||
|
||||
# set the default header message displayed on top of each page
|
||||
defaultHeaderMessage="default header message"
|
||||
|
||||
# set the default footer message displayed on bottom of each page
|
||||
defaultFooterMessage="default footer message"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<div class="block">
|
||||
You can add your own HTML above or below the directory listing. Simply explore the <code>header.html</code> and <code>footer.html</code> files.
|
||||
{FOOTER-MESSAGE}
|
||||
</div><!--/.postlisting-->
|
||||
|
||||
</div><!--/.wrapper-->
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<div class="block">
|
||||
You can add your own HTML above or below the directory listing. Simply explore the <code>header.html</code> and <code>footer.html</code> files.
|
||||
{FOOTER-MESSAGE}
|
||||
</div><!--/.postlisting-->
|
||||
|
||||
</div><!--/.wrapper-->
|
||||
|
@@ -7,3 +7,5 @@
|
||||
</ol>
|
||||
|
||||
<input type="search" id="filter" placeholder="filter contents" />
|
||||
|
||||
{HEADER-MESSAGE}
|
||||
|
@@ -5,3 +5,5 @@
|
||||
</ol>
|
||||
|
||||
<input type="search" id="filter" placeholder="filter contents" />
|
||||
|
||||
{HEADER-MESSAGE}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "apaxy",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"description": "A simple, customisable theme for your Apache directory listing.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Reference in New Issue
Block a user