This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Support for Knot.x setup in gradle aem multi #65
Open
mierzwid
wants to merge
12
commits into
develop
Choose a base branch
from
feature/support-for-knotx-61
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9d77e1d
Knot.x container running with environment, fixed #61
malaskowski f597792
ugly aem page with knotx snippet #61
malaskowski 7a6e7ae
fix log files on knotx container
malaskowski d8ec342
rebase with develop
malaskowski 6cb245b
map knotx logs volume
malaskowski 113f0ab
merge with develop
malaskowski a12a096
knotx hosts config with trafic router
malaskowski 51d3367
Update Knot.x configs to RC4.
tomaszmichalak 1de63d2
Fixing invalid DNS resolution. Bump Knot.x version to RC5.
tomaszmichalak 16bda85
Healthcheck added
tomaszmichalak 209a064
Updated README.md, changed domain to knotx.demo.ezample.com.
tomaszmichalak d2a8267
Update travis
tomaszmichalak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
aem/gradle/environment/httpd/conf/vhost/knotx.example.com.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<VirtualHost *:80> | ||
ServerName knotx.example.com | ||
|
||
RewriteEngine On | ||
|
||
RewriteCond %{REQUEST_METHOD} =GET | ||
RewriteRule ^(.*\.html)$ - [E=KNOTX_REQ:true] | ||
|
||
RewriteCond %{ENV:KNOTX_REQ} ^true$ | ||
RewriteRule ^/(.*)$ http://knotx:8092/$1 [P,L] | ||
|
||
RewriteRule ^/(.*)$ http://demo.example.com/$1 [P,L] | ||
|
||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
########### Modules to start ########### | ||
# Modules map specify a list of verticles to be started by Knot.x. | ||
# Each line should have a form of <alias>=<verticle-class-name> | ||
# where alias is just a name that you can use later in order to define configuration for the module | ||
# verticle-class-name is a fully qualified class name of the verticle. | ||
# | ||
# This JSON object is filled in included files. | ||
modules {} | ||
|
||
|
||
include required(classpath("server.conf")) | ||
include required(classpath("knots/templateEngineStack.conf")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"configRetrieverOptions": { | ||
"scanPeriod": 5000, | ||
"stores": [ | ||
{ | ||
"type": "file", | ||
"format": "conf", | ||
"config": { | ||
"path": "${KNOTX_HOME}/conf/application.conf" | ||
}, | ||
"optional": false | ||
} | ||
] | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
aem/gradle/environment/knotx/conf/knots/templateEngineKnot.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Vert.x event bus delivery options used when communicating with other verticles | ||
address = knotx.knot.te.handlebars | ||
|
||
engine { | ||
factory = handlebars | ||
config = { | ||
# Algorithm used to build a hash key of the compiled handlebars snippets. | ||
# The hash is computed for the snippet handlebars source code using a selected algorithm. | ||
# The name should be a standard Java Security name (such as "SHA", "MD5", and so on). | ||
# Default value is MD5 | ||
# | ||
# cacheKeyAlgorithm = MD5 | ||
|
||
# Size of the compiled snippets cache. After reaching the max size, new elements will replace the oldest one. | ||
cacheSize = 1000 | ||
|
||
# Symbol used as a start delimiter of handlebars expression. If not use, a default '{{' is used | ||
# | ||
# startDelimiter = | ||
|
||
# Symbol used as a end delimiter of handlebars expression. If not use, a default '}}' is used | ||
# | ||
# endDelimiter = | ||
} | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
aem/gradle/environment/knotx/conf/knots/templateEngineStack.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
########### Data Bridge Stack ########### | ||
modules { | ||
templateEngine = "io.knotx.te.core.TemplateEngineKnot" | ||
} | ||
|
||
########### Modules configurations ########### | ||
config.templateEngine { | ||
options.config { | ||
include required(classpath("knots/templateEngineKnot.conf")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright (C) 2019 Knot.x Project | ||
|
||
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. | ||
|
||
--> | ||
<configuration> | ||
<property name="LOG_PATH" value="/var/log/knotx"/> | ||
|
||
<include resource="io/knotx/logging/logback/defaults.xml"/> | ||
<include resource="io/knotx/logging/logback/file-appender.xml"/> | ||
<include resource="io/knotx/logging/logback/access.xml"/> | ||
|
||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<layout class="ch.qos.logback.classic.PatternLayout"> | ||
<Pattern> | ||
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n | ||
</Pattern> | ||
</layout> | ||
</appender> | ||
|
||
<logger name="io.knotx" level="TRACE"/> | ||
<logger name="io.vertx" level="TRACE"/> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="FILE"/> | ||
<appender-ref ref="CONSOLE"/> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: Knot.x Stack OAS | ||
description: This is the server API specification. | ||
|
||
servers: | ||
- url: https://{domain}:{port} | ||
description: The local API server | ||
variables: | ||
domain: | ||
default: localhost | ||
description: api domain | ||
port: | ||
enum: | ||
- '8092' | ||
- '443' | ||
default: '8092' | ||
|
||
paths: | ||
/products/*: | ||
get: | ||
operationId: products-get | ||
responses: | ||
default: | ||
description: Remote repository template processing with http action and te | ||
/assets/*: | ||
get: | ||
operationId: assets-get | ||
responses: | ||
default: | ||
description: Return assets as is from the repository |
34 changes: 34 additions & 0 deletions
34
aem/gradle/environment/knotx/conf/routes/handlers/fragmentsHandler.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
########### This configuration is overloaded in integration tests! ########### | ||
tasks { | ||
hello-world { | ||
action = hello-inline | ||
onTransitions { | ||
_success { | ||
action = te-hbs | ||
} | ||
} | ||
} | ||
} | ||
|
||
actions { | ||
hello-inline { | ||
factory = inline-payload | ||
config { | ||
alias = hello | ||
payload { | ||
_result { | ||
message = "Hello Knot.x with GAP" | ||
} | ||
} | ||
} | ||
} | ||
te-hbs { | ||
factory = knot | ||
config { | ||
address = knotx.knot.te.handlebars | ||
deliveryOptions { | ||
sendTimeout = 3000 | ||
} | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
aem/gradle/environment/knotx/conf/routes/handlers/httpRepoConnectorHandler.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Vert.x event bus delivery options used when communicating with other verticles | ||
# see http://vertx.io/docs/vertx-core/dataobjects.html#HttpClientOptions for the details what can be configured | ||
# | ||
clientOptions { | ||
maxPoolSize = 1000 | ||
idleTimeout = 120 # seconds | ||
tryUseCompression = true | ||
|
||
# If you're going to use SSL (clientDestination.scheme='https') then here you'd need to configure | ||
# some aspects related to the SSL negotiation and validation. | ||
# | ||
# Whether all server certificated should be trusted or not (e.g. self-signed certificates) | ||
# trustAll = true | ||
# | ||
# Hostname verification | ||
# verifyHost = false | ||
# | ||
# It will force SSL SNI (Server Name Indication). The SNI will be set to the same value as 'hostHeader' (set in ClientDestination) | ||
# forceSni = true | ||
} | ||
|
||
# HTTP Repository connection details | ||
clientDestination { | ||
# Connection scheme: http or https | ||
scheme = http | ||
|
||
# domain or the IP of the host: e.g. localhost, 10.0.11.2 | ||
domain = httpd | ||
|
||
## Port on which the host listens, e.g. 8080, 3001, etc. | ||
port = 80 | ||
|
||
# Host header override to be used with a communication to the repository. If it's set, it overrides any value in the 'Host' header, and sets the SNI SSL to the same value. | ||
hostHeader = demo.example.com | ||
} | ||
|
||
# List of allowed request headers that will be send to HTTP repository. | ||
# Each item is a string that defines regex, e.g. to match any char use `.*` | ||
# | ||
allowedRequestHeaders = [ | ||
"Accept.*" | ||
Authorization | ||
Connection | ||
Cookie | ||
Date | ||
"Edge.*" | ||
"If.*" | ||
Origin | ||
Pragma | ||
Proxy-Authorization | ||
"Surrogate.*" | ||
User-Agent | ||
Via | ||
"X-.*" | ||
"Host.*" | ||
] | ||
|
||
# Statically defined HTTP request header sent in every request to the repository | ||
customHttpHeader = { | ||
name = X-User-Agent | ||
value = Knot.x | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
routingOperations = ${routingOperations} [ | ||
{ | ||
operationId = products-get | ||
handlers = ${config.server.handlers.common.request} [ | ||
{ | ||
name = httpRepoConnectorHandler | ||
config = { include required(classpath("routes/handlers/httpRepoConnectorHandler.conf")) } | ||
}, | ||
{ | ||
name = fragmentsProviderHtmlSplitter | ||
}, | ||
{ | ||
name = fragmentsHandler | ||
config = { include required(classpath("routes/handlers/fragmentsHandler.conf")) } | ||
}, | ||
{ | ||
name = fragmentsAssemblerHandler | ||
} | ||
] ${config.server.handlers.common.response} | ||
} | ||
{ | ||
operationId = assets-get | ||
handlers = ${config.server.handlers.common.request} [ | ||
{ | ||
name = httpRepoConnectorHandler | ||
config = { include required(classpath("routes/handlers/httpRepoConnectorHandler.conf")) } | ||
} | ||
] ${config.server.handlers.common.response} | ||
} | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dislike comments / code looking like a poc. I more like looking like as much as production as it is possible