A simple JavaEE blog.
All configurations either have a default or are optional.
Name |
Default |
Description |
rblog.category.defaultColor |
#000000 |
default color for a new category |
rblog.pagination.max |
100 |
Max page size |
rblog.categories.autoCreate |
true |
should categories be created on the fly if missing when creating a post |
rblog.posts.top.size |
3 |
how many posts are shown by category for top endpoint (home page) |
rblog.sitemap.pingUrls |
http://www.google.com/webmasters/tools/ping?sitemap=%s,http://www.bing.com/ping?sitemap=%s |
ping url(s) when the sitemap is generated and updated |
rblog.visitor.pageSize |
20 |
page size used to generate the sitemap and RSS feed |
rblog.visitor.base |
- |
site root url used to send to the ping urls (sitemap) and to create the rss feed. |
rblog.security.password.hash_algorithm |
SHA-256 |
algorithm (MessageDigest) used to hash the passwords |
rblog.security.password.round_trip |
3 |
how many time the hash_algorithm is used to compute the password representation used in the database |
rblog.token.eviction |
PT720H |
how often token are evicted (old ones are deleted making them inactive). Default is 30 days, it uses java.time.Duration syntax. |
rblog.analytics.code |
Google Analytics code to use for the website. |
rblog.provisioning.defaultUser.active |
true |
Is a default user provisionned at startup if the database has no user. |
rblog.provisioning.defaultUser.name |
admin |
Default username/password if a default user is created. |
rblog.twitter.token |
- |
Twitter token to use for notifications. |
rblog.twitter.tokenSecret |
- |
Twitter token secret to use for notifications. |
rblog.twitter.consumerKey |
- |
Twitter consumer key to use for notifications. |
rblog.twitter.consumerSecret |
- |
Twitter consumer secret to use for notifications. |
rblog.twitter.api.update.url |
Twitter endpoint to use to send the notification. |
rblog.bitly.url |
|
Bit.ly endpoint to shorten urls. |
rblog.bitly.token |
|
- |
Bit.ly access_token. If not set Bit.ly feature is not active. |
rblog.backup.work |
${openejb.base}/work/rblog |
Where to dump the blog when a backup is done. |
rblog.backup.mail.sessionJndi |
- |
Session JNDI name to send mails on backup. |
rblog.backup.mail.from |
FROM address used to send mail on backup. |
rblog.backup.mail.to |
|
- |
Recipients address for backups. |
rblog.backup.mail.subject |
Configuration uses properties format (java.util.Properties). Read locations are (sorted):
-
rblog.properties
in the classloader of the application -
${rblog.base}/conf/rblog.properties
or${openejb.base}/conf/rblog.properties
if exist
By default RBlog tries to embed as much as possible but there is an attachment service you can use for custom files.
In that case you will need to activated on your server the multi part without an explicit configuration. For tomcat/tomee just add/create a context.xml
:
<Context allowCasualMultipartParsing="true" />
Fe things will limit the max size of the content of a post depending where you deploy. Here are few hints to check:
-
MySQL: by default OpenJPA would use
TEXT
which limits the size to 64k which would be quite small if you embed images in the posts. To fix it alter the column:
alter table rblog_post modify content mediumtext;
-
TomEE: by default tomee 7.0.0 johnzon setup will limit JSON string content to 4k so ensure t adjust it (7.0.1 will accept a bit more):
# whatever fits your need, number of chars
org.apache.johnzon.max-string-length = 655360
Today RBlog supports Twitter integration. When you create a post you can define a tweet and schedule it to be posted when the post is published.
If you configure Bit.ly (token
property, see configuration) you will be able to hit a Bit.ly
button on the post
form to automatically retrieve a bit.ly url.
Often for small or personal blogs the best backup is a mail box (avoid to need a custom server).
When activated configuring sessionJndi
and to
properties, that’s what will do the backup feature.
Note
|
it needs a valid session configuration, here is a sample for gmail: |
<Resource id="mail/gmail" type="javax.mail.Session">
mail.transport.protocol = smtp
mail.smtp.host = smtp.gmail.com
mail.smtp.port = 587
mail.smtp.auth = true
mail.smtp.starttls.enable = true
mail.smtp.user = xxxxx
password = xxxxxx
</Resource>
Then on tomee you can set rblog.backup.mail.sessionJndi
to openejb:Resource/mail/gmail
.
(feel free to PR ;))
-
[enhancement] write endpoints should use a nested tx to ensure to commit before returning a value
-
[feature] theme/theming (hardcoded today)
-
[feature] Support of Markdown and potentially Asciidoctor (optional and async start cause JRuby by default would be a pain) syntax
-
[feature] Attachement GUI and linkage in the content
-
[feature] TomEE Embedded fat jar (
java -jar rblog.jar
orjava -jar rblog.war
orjava -jar tomee-embedded.jar --path rblog.war
) -
[feature] TomEE distribution (pre-packaged rblog zip:
unzip rblog.zip && cd rblog-version && ./bin/startup.sh
) or openshift setup -
…