Skip to content

Commit

Permalink
🎉 Ready to release version 1.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhartman committed Jul 3, 2018
1 parent e92662c commit 39eaeaa
Show file tree
Hide file tree
Showing 35 changed files with 8,575 additions and 17 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
Below is a detailed change-log, along with specific tasks completed, for each
version released to date.

## Version 1.0.0 (03/07/2018)

This is the first production release since the first commit almost two months
ago. The following changes enable this major branch release.

- [#new](#new)
- Included `./websites/localhost/` folder which contains a template for
bootstrapping your development projects. This folder includes:
- HTML5 Boilerplate version 6.1.0
- Twitter Bootstrap version 3.3.7
- jQuery version 1.11.2
- Modernizr version 2.8.3
- Symlink to `php` configuration folder to enable editing of `php.ini` file.
- Added `restart_apache.sh` for inclusion in `add_domains` script.
- [#enhancement](#enhancement)
- `apache_config.sh` script now installs the `localhost` website.
- Changed output message to new format in `folder_permissions.sh`.
- [#bugfix](#bugfix)
- Set file permissions correctly.
- Added a delete method for `keychain_certificate.sh` that removes the old
certificate before adding a new one when running `add_domains`.

## Version 0.6.2 (02/07/2018)

- [#new](#new)
- File permission changes to files from machine migration.
- [#enhancement](#enhancement)
- Changed the output messages.

## Version 0.6.1 (12/06/2018)

- [#new](#new)
Expand Down
2 changes: 2 additions & 0 deletions add_domains
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ main_application ()
source "$scripts"/git_setup.sh # git initial structure, files and check-in
# shellcheck source=scripts/folder_permissions.sh
source "$scripts"/folder_permissions.sh # Setting correct folder permissions
# shellcheck source=scripts/restart_apache.sh
source "$scripts"/restart_apache.sh # Restart Apache 2

printf "${GRN}%s\\n" "$TOP"
printf "* %-76s %s\\n" "Congratulations! Your domain has been added and you can begin using it" "*"
Expand Down
1 change: 1 addition & 0 deletions dist/php
16 changes: 16 additions & 0 deletions scripts/apache_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ final_configuration ()
echo -e "\\n${GRN}\\xE2\\x9C\\x94${NOC} ${CYA}Your website folder has been created at ${websites} and you can edit your files in the 'dist' folder.${NOC}\\n"
}

#######################################
# Installs localhost website folder.
# Globals:
# None
# Arguments:
# None
# Returns:
# None
#######################################
install_localhost ()
{
cp -Rp "${source}"/websites/localhost "${dist}"/websites/
echo -e "\\n${GRN}\\xE2\\x9C\\x94${NOC} ${CYA}Successfully installed the localhost website accessed at https://localhost. You can edit these files in the 'dist/websites/localhost' folder.${NOC}\\n"
}

file_backup
copy_files
final_configuration
install_localhost
11 changes: 4 additions & 7 deletions scripts/folder_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@
#######################################
folder_ownership ()
{
echo "" >&2
echo -e "${GRY} ----------------------------------------------" >&2
echo "| |" >&2
echo "| Setting correct folder permissions to your |" >&2
echo "| user account for the application folders. |" >&2
echo "| |" >&2
echo -e " ---------------------------------------------- ${NOC}\\n" >&2
printf "${GRY}%s\\n" "$TOP"
printf "* %-76s %s\\n" "Setting correct folder permissions to your user account for" "*"
printf "* %-76s %s\\n" "the application folders." "*"
printf "%s${NOC}\\n\\n" "$BOTTOM"
chown -R "${username}":"${group}" "${main}"
chown -R "${username}":"${group}" "${httpd}"
echo -e "\\n${GRN}\\xE2\\x9C\\x94${NOC} ${CYA}Successfully set folder permissions recursively on ${main} and ${httpd}.${NOC}\\n"
Expand Down
38 changes: 28 additions & 10 deletions scripts/keychain_certificate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

#######################################
# Removes any server certificates
# from macOS' Keychain.
# Globals:
# None
# Arguments:
# None
# Returns:
# String Success message.
#######################################
remove_keychain_certificate ()
{
printf "${BRO}%s\\n" "$TOP"
printf "* %-76s %s\\n" "Removing old SSL certificates from macOS' Keychain." "*"
printf "%s${NOC}\\n\\n" "$BOTTOM"
security delete-certificate -c localhost '/Library/Keychains/System.keychain'
echo -e "\\n${GRN}\\xE2\\x9C\\x94${NOC} ${CYA}Successfully removed any old certificates from the macOS Keychain.${NOC}\\n" >&2
}

#######################################
# Adds the updated server certificate
# to macOS' Keychain.
Expand All @@ -34,19 +53,18 @@
# Returns:
# String Success message.
#######################################
keychain_certificate ()
add_keychain_certificate ()
{
echo "" >&2
echo -e "${BRO} ----------------------------------------------" >&2
echo "| |" >&2
echo "| Adding new SSL cert to macOS' Keychain so |" >&2
echo "| that you don't get browser errors when |" >&2
echo "| accessing your new domain over https. |" >&2
echo "| |" >&2
echo -e " ---------------------------------------------- ${NOC}\\n" >&2
printf "${BRO}%s\\n" "$TOP"
printf "* %-76s %s\\n" "Adding new SSL cert to macOS' Keychain so that you don't get browser" "*"
printf "* %-76s %s\\n" "errors when accessing your new domain over https." "*"
printf "%s${NOC}\\n\\n" "$BOTTOM"
security add-trusted-cert -d -r trustAsRoot -p ssl \
-k '/Library/Keychains/System.keychain' "$ssl"/localhost_server.crt
echo -e "\\n${GRN}\\xE2\\x9C\\x94${NOC} ${CYA}Successfully updated the macOS Keychain with a new SSL certificate with ${domain} added.${NOC}\\n" >&2
}

keychain_certificate
# Remove old certs
remove_keychain_certificate
# Add new certs
add_keychain_certificate
46 changes: 46 additions & 0 deletions scripts/restart_apache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# Restarts Apache.
#
# Copyright: Copyright (C) 2018 Justin Hartman <[email protected]> (https://justin.hartman.me)
# Author : Justin Hartman <[email protected]> (https://justin.hartman.me)
# License : https://opensource.org/licenses/AGPL-3.0 AGPL-3.0
# Version : 0.5.1
# Link : https://github.com/22digital/Automated-LAMP-trusted-localhost-SSL
# Link : https://justin.hartman.me
# Since : 0.4.0
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

#######################################
# Restart Apache.
# Globals:
# None
# Arguments:
# None
# Returns:
# String Success message.
#######################################
restart_apache ()
{
printf "${RED}%s\\n" "$TOP"
printf "* %-76s %s\\n" "Restarting Apache 2." "*"
printf "%s${NOC}\\n\\n" "$BOTTOM"
apachectl restart
echo -e "\\n${GRN}\\xE2\\x9C\\x94${NOC} ${CYA}Successfully restarted Apache 2.${NOC}\\n"
}

# Output the method
restart_apache
13 changes: 13 additions & 0 deletions src/websites/localhost/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
194 changes: 194 additions & 0 deletions src/websites/localhost/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################

## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto

## SOURCE CODE
*.bat text eol=crlf
*.coffee text
*.css text
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text

## DOCKER
*.dockerignore text
Dockerfile text

## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text

## TEMPLATES
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl text
*.twig text

## LINTERS
.babelrc text
.csslintrc text
.eslintrc text
.htmlhintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.prettierrc text
.stylelintrc text

## CONFIGS
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text

## HEROKU
Procfile text
.slugignore text

## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary

## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary

## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary

## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary

## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary

## EXECUTABLES
*.exe binary
*.pyc binary
Loading

0 comments on commit 39eaeaa

Please sign in to comment.