diff --git a/docs/building.md b/docs/building.md index b7a5676..c6593ec 100644 --- a/docs/building.md +++ b/docs/building.md @@ -4,6 +4,8 @@ Consult your Operating System Distribution's manual for installation instructions. It also uses [git](https://git-scm.com/) for source control. +For trouble with starting tomcat see [the install guide](installation.md#1.-install-tomcat). + ## Database Configuration For developer testing, the project's ``context.xml`` is setup to expect a schema called ``blog`` with the following configuration: @@ -21,7 +23,7 @@ ``` CREATE SCHEMA blog; -USE SCHEMA blog; +USE blog; SOURCE src/main/sql/setup.sql; GRANT SELECT, INSERT, UPDATE, DELETE ON blog.* TO 'blogger'@'localhost' IDENTIFIED BY 'bloggingit'; ``` diff --git a/docs/installation.md b/docs/installation.md index 5f06903..08a1de5 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,9 +2,16 @@ ## 1. Install Tomcat -This requires Tomcat version 8.5 or higher is installed. +This requires Tomcat version 8.5 or higher is installed, but not 9. Instructions for installing tomcat can be found on the Apache project's [website](https://tomcat.apache.org/). +if SELinux gives you trouble, this should get you where you want. + +``` +semanage fcontext -a -t bin_t "${TOMCAT_DIR}/bin(/.*)?" +restorecon -vR "${TOMCAT_DIR}/bin" +``` + ## 2. Install MariaDB or MySQL This software is designed to work with MariaDB or MySQL. diff --git a/pom.xml b/pom.xml index 21fe83d..ddd7171 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ 1.8 1.8 2.4.2 - 2.16.0 + 2.17.2 diff --git a/src/main/css/content.css b/src/main/css/content.css index dd861d9..df28a86 100644 --- a/src/main/css/content.css +++ b/src/main/css/content.css @@ -1,5 +1,5 @@ /* - Copyright 2019 Kimberlee Model + Copyright 2019-2021 Kimberlee Model Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,10 +41,18 @@ margin-bottom: 0.5em; padding: 0.125em; padding-left: 0.25em; - border: none; - border-bottom: solid; - border-left: solid; - border-color: #BB0000; + border: solid; + border-top: none; + border-right: none; + border-image: linear-gradient(to right, + rgba(176, 0, 0, 1.0), + rgba(176, 0, 0, 0.8), + rgba(176, 0, 0, 0.8), + rgba(144, 0, 0, 0.8), + rgba(144, 0, 0, 0.6), + rgba(128, 0, 0, 0.4), + rgba(128, 0, 0, 0.0)) 1; + /* border-color: #BB0000; */ border-width: 0.125em; font-weight: bold; @@ -57,12 +65,51 @@ h5 { font-size: 16pt; } h6 { font-size: 14pt; } +h1>a, +h2>a, +h3>a, +h4>a, +h5>a, +h6>a +{ + color: #EEFFDD; + text-decoration: underline; +} + +aside#leftcontent>h1, aside#rightcontent>h1 +{ + font-size: 14pt; +} + +aside#leftcontent h2, aside#rightcontent h2 { font-size: 20pt; } +aside#leftcontent h3, aside#rightcontent h3 { font-size: 18pt; } +aside#leftcontent h4, aside#rightcontent h4 { font-size: 16pt; } +aside#leftcontent h5, aside#rightcontent h5 { font-size: 14pt; } +aside#leftcontent h6, aside#rightcontent h6 { font-size: 12pt; } + +h1>a:hover, +h2>a:hover, +h3>a:hover, +h4>a:hover, +h5>a:hover, +h6>a:hover, +h1>a:focus, +h2>a:focus, +h3>a:focus, +h4>a:focus, +h5>a:focus, +h6>a:focus +{ + color: #CCDDBB; + text-decoration: none; +} + /** * These are the sub-site navigation links on the left and right panels. * Also the page-number pagers on the bottoms of pages. */ -div#leftcontent>ul, -div#rightcontent>ul +aside#leftcontent>ul.actions, +aside#rightcontent>ul.actions { list-style-type: none; margin: 0em; @@ -71,43 +118,46 @@ border-radius: 0.5em; } -div#leftcontent>ul>li, -div#rightcontent>ul>li +aside#leftcontent>ul.actions>li, +aside#rightcontent>ul.actions>li { background-image: linear-gradient(to bottom, #770000, #440000); border-bottom: solid 1px #BB0000; } -div#leftcontent>ul>li:first-child, -div#rightcontent>ul>li:first-child +aside#leftcontent>ul.actions>li:first-child, +aside#rightcontent>ul.actions>li:first-child { margin-top: 0.5em; border-top: solid 1px #BB0000; } -div#leftcontent>ul>li:last-child, -div#rightcontent>ul>li:last-child +aside#leftcontent>ul.actions>li:last-child, +aside#rightcontent>ul.actions>li:last-child { margin-bottom: 0.5em; } -div#leftcontent>ul>li:hover, -div#rightcontent>ul>li:hover, -div.pager>ul>li:hover +aside#leftcontent>ul.actions>li>a:hover, +aside#rightcontent>ul.actions>li>a:hover, +div.pager>ul>li>a:hover, +aside#leftcontent>ul.actions>li>a:focus, +aside#rightcontent>ul.actions>li>a:focus, +div.pager>ul>li>a:focus { background-image: linear-gradient(to top, #770000, #440000); } -div#leftcontent>ul>li>a, -div#rightcontent>ul>li>a, +aside#leftcontent>ul.actions>li>a, +aside#rightcontent>ul.actions>li>a, div.pager>ul>li>a { display: block; padding: 0.5em; margin: 0em; - color: #DDEECC !important; - text-decoration: none !important; + color: #DDEECC; + text-decoration: none; } div.pager @@ -157,14 +207,15 @@ */ a { - color: #77DDDD; + color: #8D8DB0; /* or #A08C8C */ text-decoration: underline; } -a:hover +a:hover, +a:focus { - color: #99DDDD; text-decoration: none; + background-color: #280000; } code @@ -208,9 +259,17 @@ hr { - border: none; - border-top: solid 0.125em #BB0000; - color: #BB0000; + border: solid 0.125em #BB0000; + border-left: none; + border-right: none; + border-bottom: none; + /* color: #BB0000; */ + border-image: linear-gradient(to right, + rgba(176, 0, 0, 0.0), + rgba(176, 0, 0, 0.8), + rgba(176, 0, 0, 1.0), + rgba(176, 0, 0, 0.8), + rgba(176, 0, 0, 0.0)) 1; margin: 0.75em; margin-left: 15%; margin-right: 15%; @@ -319,3 +378,8 @@ { margin-right: 1em; } + +::selection +{ + background: #484040; +} diff --git a/src/main/css/layout.css b/src/main/css/layout.css index 079b9c5..ca85873 100644 --- a/src/main/css/layout.css +++ b/src/main/css/layout.css @@ -149,7 +149,8 @@ margin-right: 0.5em; } -header a:hover +header a:hover, +header a:focus { background-image: linear-gradient(to top, #770000, #440000); } @@ -257,8 +258,8 @@ /** * The three boxes themselves: left, right, and main. */ -div#leftcontent, -div#rightcontent +aside#leftcontent, +aside#rightcontent { width: 20%; flex-grow: 2; @@ -282,7 +283,7 @@ width: 60%; } - div#contentcontainer>div.fallUp + div#contentcontainer>aside.fallUp { order: 0; } diff --git a/src/main/java/kim/redbow/web/blog/Util.java b/src/main/java/kim/redbow/web/blog/Util.java index de90a72..3aee8cc 100644 --- a/src/main/java/kim/redbow/web/blog/Util.java +++ b/src/main/java/kim/redbow/web/blog/Util.java @@ -31,7 +31,7 @@ /** * The default size of a buffer for moving bytes around. */ - private static final int BUFSIZE = 2048; + private static final int BUFSIZE = 16384; /** * Reads the contents of an InputStream into a String. @@ -124,4 +124,18 @@ { return (new SimpleDateFormat(DATE_TIME_FMT)).format(tstmp); } + + /** + * Escape special HTML characters. + * + * @param str input string + */ + public static String escapeHTML(String str) + { + return str.replaceAll("&", "&") + .replaceAll("\"", """) + .replaceAll("\'", "'") + .replaceAll("<", "<") + .replaceAll(">", ">"); + } } diff --git a/src/main/java/kim/redbow/web/blog/queries/Media.java b/src/main/java/kim/redbow/web/blog/queries/Media.java index eb838b5..a4150da 100644 --- a/src/main/java/kim/redbow/web/blog/queries/Media.java +++ b/src/main/java/kim/redbow/web/blog/queries/Media.java @@ -195,7 +195,7 @@ private static Media fromResult(ResultSet rs) throws SQLException { Media ret = new Media(); - + // Magic Numbers correspond to positions in SELECT_STMT ret.id = rs.getInt(1); ret.urlfragment = rs.getString(2); diff --git a/src/main/java/kim/redbow/web/blog/queries/Post.java b/src/main/java/kim/redbow/web/blog/queries/Post.java index c26c718..2e93d57 100644 --- a/src/main/java/kim/redbow/web/blog/queries/Post.java +++ b/src/main/java/kim/redbow/web/blog/queries/Post.java @@ -43,7 +43,7 @@ public Post(){} /** - * Construct a Post from a roe in a ResultSet. this should be constructed + * Construct a Post from a row in a ResultSet. this should be constructed * after rs.first() or rs.next() is called. * * @param rs the result set to get the attributes from diff --git a/src/main/webapp/WEB-INF/author/email.jsp b/src/main/webapp/WEB-INF/author/email.jsp new file mode 100644 index 0000000..2d9dbb2 --- /dev/null +++ b/src/main/webapp/WEB-INF/author/email.jsp @@ -0,0 +1,21 @@ +<%-- + Copyright 2019 Kimberlee Model + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> + +<% if(author.showemail) + { %> + Email + <%= author.email %> +<% } %> diff --git a/src/main/webapp/WEB-INF/author/info.jsp b/src/main/webapp/WEB-INF/author/info.jsp deleted file mode 100644 index 522bbfd..0000000 --- a/src/main/webapp/WEB-INF/author/info.jsp +++ /dev/null @@ -1,22 +0,0 @@ -<%-- - Copyright 2019 Kimberlee Model - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---%> - -

<%= author.fname %> <%= author.lname %>

-<% if(author.showemail) - { %> - Email - <%= author.email %> -<% } %> diff --git a/src/main/webapp/WEB-INF/author/long.jsp b/src/main/webapp/WEB-INF/author/long.jsp index 8608d11..7323999 100644 --- a/src/main/webapp/WEB-INF/author/long.jsp +++ b/src/main/webapp/WEB-INF/author/long.jsp @@ -14,11 +14,12 @@ limitations under the License. --%> -
- <%@ include file="/WEB-INF/author/info.jsp" %> +
+

<%= author.fname %> <%= author.lname %>

+ <%@ include file="/WEB-INF/author/email.jsp" %>

<%@ include file="/WEB-INF/author/image.jsp" %> <%= author.brief %> <%= author.biography %>

-
+ diff --git a/src/main/webapp/WEB-INF/author/short.jsp b/src/main/webapp/WEB-INF/author/short.jsp index b13d9b1..d689afe 100644 --- a/src/main/webapp/WEB-INF/author/short.jsp +++ b/src/main/webapp/WEB-INF/author/short.jsp @@ -14,8 +14,9 @@ limitations under the License. --%> -
- <%@ include file="/WEB-INF/author/info.jsp" %> +
+

<%= author.fname %> <%= author.lname %>

+ <%@ include file="/WEB-INF/author/email.jsp" %>

<%@ include file="/WEB-INF/author/image.jsp" %> <%= author.brief %> @@ -24,4 +25,4 @@ More about <%= author.fname %>

-
+ diff --git a/src/main/webapp/WEB-INF/header.jsp b/src/main/webapp/WEB-INF/header.jsp index 2c11e19..702cf26 100644 --- a/src/main/webapp/WEB-INF/header.jsp +++ b/src/main/webapp/WEB-INF/header.jsp @@ -22,7 +22,7 @@