Skip to content

Commit

Permalink
Merge pull request #17 from basilhendroff/latest
Browse files Browse the repository at this point in the history
Latest
  • Loading branch information
basilhendroff committed May 23, 2021
2 parents 4eae13c + 7de27fa commit cdeb8ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 68 deletions.
10 changes: 9 additions & 1 deletion includes/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#{
# log {
# format json {
# time_format iso8601
# }
# }
#}
#
:80 {
root * /usr/local/www/wordpress
encode gzip
encode gzip zstd
php_fastcgi 127.0.0.1:9000 {
env SERVER_PORT 80
}
Expand Down
47 changes: 0 additions & 47 deletions includes/caddy

This file was deleted.

23 changes: 3 additions & 20 deletions wordpress-jail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ cat <<__EOF__ >/tmp/pkg.json
"php74-ftp","php74-pecl-ssh2","php74-sockets",
"mariadb105-server","unix2dos","ssmtp","phpmyadmin5-php74",
"php74-xmlrpc","php74-ctype","php74-session","php74-xmlwriter",
"redis","php74-pecl-redis","php74-phar"
"redis","php74-pecl-redis","php74-phar","caddy"
]
}
__EOF__
Expand Down Expand Up @@ -176,24 +176,6 @@ iocage fstab -a "${JAIL_NAME}" "${FILES_PATH}" /usr/local/www/wordpress nullfs
iocage exec "${JAIL_NAME}" mkdir -p /mnt/includes
iocage fstab -a "${JAIL_NAME}" "${INCLUDES_PATH}" /mnt/includes nullfs rw 0 0

#####################################################################
print_msg "Caddy download..."

CADDY_VERSION="2.4.1"

FILE="caddy_${CADDY_VERSION}_freebsd_amd64.tar.gz"
if ! iocage exec "${JAIL_NAME}" fetch -o /tmp https://github.com/caddyserver/caddy/releases/download/v"${CADDY_VERSION}"/"${FILE}"
then
print_err "Failed to download Caddy"
exit 1
fi
if ! iocage exec "${JAIL_NAME}" tar xzf /tmp/"${FILE}" -C /usr/local/bin/
then
print_err "Failed to extract Caddy"
exit 1
fi
iocage exec "${JAIL_NAME}" rm /tmp/"${FILE}"

#####################################################################
print_msg "Wordpress download..."

Expand Down Expand Up @@ -321,10 +303,11 @@ print_msg "Configure and start Caddy..."

# Copy and edit pre-written config files
iocage exec "${JAIL_NAME}" cp -f /mnt/includes/Caddyfile /usr/local/www
iocage exec "${JAIL_NAME}" cp -f /mnt/includes/caddy /usr/local/etc/rc.d/
iocage exec "${JAIL_NAME}" sed -i '' "s|configtest|validate|" /usr/local/etc/rc.d/caddy

iocage exec "${JAIL_NAME}" sysrc caddy_enable="YES"
iocage exec "${JAIL_NAME}" sysrc caddy_config="/usr/local/www/Caddyfile"
iocage exec "${JAIL_NAME}" sysrc caddy_logdir="/var/log"

iocage exec "${JAIL_NAME}" service caddy start

Expand Down

0 comments on commit cdeb8ec

Please sign in to comment.