This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit b4f4a3bfb660b8fae8e18de984f1580022a12238 Author: Julien Masnada <[email protected]> AuthorDate: Tue Mar 2 17:57:23 2021 +0100 Moved documentation to jspwiki-wiki.a.o --- jspwiki-kendra-searchprovider/Dockerfile | 88 ------------- jspwiki-kendra-searchprovider/README.md | 40 ------ .../cloudformation/index-and-datasource.yaml | 139 --------------------- .../cloudformation/jspwiki-iam-role.yaml | 67 ---------- .../docker-files/jspwiki-custom.properties | 3 - .../docs/images/JSPWiki_Search.png | Bin 61411 -> 0 bytes 6 files changed, 337 deletions(-) diff --git a/jspwiki-kendra-searchprovider/Dockerfile b/jspwiki-kendra-searchprovider/Dockerfile deleted file mode 100644 index 4627e2a..0000000 --- a/jspwiki-kendra-searchprovider/Dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -#FROM maven:3.6-jdk-8 as package -#WORKDIR /tmp -#COPY . . -#RUN set -x \ -## fastest, minimum build -# && mvn clean package -pl jspwiki-war,jspwiki-kendra-searchprovider,jspwiki-wikipages/en -am -DskipTests - -FROM tomcat:9.0 - -#COPY --from=package /tmp/jspwiki-war/target/JSPWiki.war /tmp -#COPY --from=package /tmp/jspwiki-wikipages/en/target/jspwiki-wikipages-en-*.zip /tmp -#COPY --from=package /tmp/jspwiki-kendra-searchprovider/target/jspwiki-kendra-searchprovider-*.jar /tmp -COPY jspwiki-war/target/JSPWiki.war /tmp -COPY jspwiki-wikipages/en/target/jspwiki-wikipages-en-*.zip /tmp -#COPY jspwiki-kendra-searchprovider/target/jspwiki-kendra-searchprovider-*.jar /tmp - -COPY docker-files/log4j.properties /tmp -COPY docker-files/tomcat-users.xml $CATALINA_HOME/conf/tomcat-users.xml -COPY jspwiki-kendra-searchprovider/docker-files/jspwiki-custom.properties /tmp -# -# set default environment entries to configure jspwiki -ENV CATALINA_OPTS -Djava.security.egd=file:/dev/./urandom -ENV LANG en_US.UTF-8 -ENV jspwiki_basicAttachmentProvider_storageDir /var/jspwiki/pages -ENV jspwiki_fileSystemProvider_pageDir /var/jspwiki/pages -ENV jspwiki_jspwiki_frontPage Main -ENV jspwiki_pageProvider VersioningFileProvider -ENV jspwiki_use_external_logconfig true -ENV jspwiki_workDir /var/jspwiki/work -ENV jspwiki_xmlUserDatabaseFile /var/jspwiki/etc/userdatabase.xml -ENV jspwiki_xmlGroupDatabaseFile /var/jspwiki/etc/groupdatabase.xml - -RUN set -x \ - && export DEBIAN_FRONTEND=noninteractive \ - && apt install --fix-missing --quiet --yes unzip - -# -# install jspwiki -RUN set -x \ - && mkdir /var/jspwiki \ -# remove default tomcat applications, we dont need them to run jspwiki - && cd $CATALINA_HOME/webapps \ - && rm -rf examples host-manager manager docs ROOT \ -# remove other stuff we don't need - && rm -rf /usr/local/tomcat/bin/*.bat \ -# create subdirectories where all jspwiki stuff will live - && cd /var/jspwiki \ - && mkdir pages logs etc work \ -# deploy jspwiki - && mkdir $CATALINA_HOME/webapps/ROOT \ - && unzip -q -d $CATALINA_HOME/webapps/ROOT /tmp/JSPWiki.war \ - && rm /tmp/JSPWiki.war \ -# deploy wiki pages - && cd /tmp/ \ - && unzip -q jspwiki-wikipages-en-*.zip \ - && mv jspwiki-wikipages-en-*/* /var/jspwiki/pages/ \ - && rm -rf jspwiki-wikipages-en-* \ -# move the userdatabase.xml and groupdatabase.xml to /var/jspwiki/etc - && cd $CATALINA_HOME/webapps/ROOT/WEB-INF \ - && mv userdatabase.xml groupdatabase.xml /var/jspwiki/etc \ -# arrange proper logging (jspwiki.use.external.logconfig = true needs to be set) - && mv /tmp/log4j.properties $CATALINA_HOME/lib/log4j.properties \ -# Copy Kendra Search Provider configuration - && cp /tmp/jspwiki-custom.properties $CATALINA_HOME/webapps/ROOT/WEB-INF/classes - -# make port visible in metadata -EXPOSE 8080 - -# -# by default we start the Tomcat container when the docker container is started. -CMD ["/usr/local/tomcat/bin/catalina.sh", "run", ">/usr/local/tomcat/logs/catalina.out"] diff --git a/jspwiki-kendra-searchprovider/README.md b/jspwiki-kendra-searchprovider/README.md deleted file mode 100644 index f483cbe..0000000 --- a/jspwiki-kendra-searchprovider/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# JSPWiki Kendra Search provider - -## What is AWS Kendra - - Amazon Kendra is an intelligent search service powered by machine learning. - -## How to use Kendra with JSPWiki - -1. AWS Account - -You will need an AWS Account if you have not one already: [create-account](https://aws.amazon.com/resources/create-account/) - -2. Create the Kendra Index and DataSource - -In you can use the [index-and-datasource](cloudformation/index-and-datasource.yaml) Cloudformation stack to create the Kendra Index and DataSource. -This require that you have either the [AWS Cli](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) or the [SAM Cli](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) installed. -Once installed you can simply run the following command to create your Kendra Index and DataSource: - -```shell -sam build --template cloudformation/index-and-datasource.yaml -sam deploy --guided -``` - -*Note*: it is important that the name for your Index and DataSource match the names setup in your JSPWiki Installation. -Namely make sure the properties `jspwiki.kendra.indexName` and `jspwiki.kendra.dataSourceName` are properly configured. - -4. Testing in Docker - -You can test your search index by running docker (*Note* you'll be using your AWS credentials) - -```shell -mvn package -pl jspwiki-war,jspwiki-wikipages/en -am -DskipTests -docker build -t jspwiki-kendra-searchprovider:latest -f jspwiki-kendra-searchprovider/Dockerfile . -docker run -p 8080:8080 -v ~/.aws:/root/.aws jspwiki-kendra-searchprovider:latest -``` - -Then you can create a Page, upload some PDF, and search for some content in the PDF document - - - diff --git a/jspwiki-kendra-searchprovider/cloudformation/index-and-datasource.yaml b/jspwiki-kendra-searchprovider/cloudformation/index-and-datasource.yaml deleted file mode 100644 index 7715cad..0000000 --- a/jspwiki-kendra-searchprovider/cloudformation/index-and-datasource.yaml +++ /dev/null @@ -1,139 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: > - index-and-datasource. Create the Kendra Index and Datasource. -Metadata: - - AWS::CloudFormation::Interface: - ParameterGroups: - - Label: - default: Parameters related to the Kendra Index and DataSource - Parameters: - - IndexName - - DataSourceName - - KendraEdition - ParameterLabels: - IndexName: - default: "The Kendra Index's Name" - DataSourceName: - default: "The Kendra DataSource's Name" - KendraEdition: - default: "The Kendra Edition" - -Parameters: - - IndexName: - Description: "The name of the Kendra Index to create" - Type: String - Default: "JSPWikiIndex" - - DataSourceName: - Description: "The name of the Kendra DataSource to create" - Type: String - Default: "JSPWikiDataSource" - - KendraEdition: - Description: "The name of the Kendra DataSource to create" - Type: String - AllowedValues: [ "DEVELOPER_EDITION", "ENTERPRISE_EDITION" ] - Default: "DEVELOPER_EDITION" - -Resources: - - KendraServiceRole: - Type: AWS::IAM::Role - Properties: - AssumeRolePolicyDocument: - Version: 2012-10-17 - Statement: - - Effect: Allow - Principal: - Service: - - kendra.amazonaws.com - Action: - - sts:AssumeRole - Path: "/" - Policies: - - PolicyName: AllowKendra - PolicyDocument: - Version: 2012-10-17 - Statement: - - Effect: Allow - Action: - - cloudwatch:PutMetricData - Resource: "*" - Condition: - StringEquals: - cloudwatch:namespace: AWS/Kendra - - Effect: Allow - Action: - - logs:DescribeLogGroups - Resource: "*" - - Effect: Allow - Action: - - logs:CreateLogGroup - Resource: - - Fn::Sub: arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/kendra/* - - Effect: Allow - Action: - - logs:DescribeLogStreams - - logs:CreateLogStream - - logs:PutLogEvents - Resource: - - Fn::Sub: arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/kendra/* - - Index: - Type: AWS::Kendra::Index - Properties: - Description: "Index for JSPWiki KendraSearchProvider" - Edition: - Ref: KendraEdition - Name: - Ref: IndexName - RoleArn: - Fn::GetAtt: KendraServiceRole.Arn - Tags: - - Key: Origin - Value: JSPWIKI - - DataSource: - Type: AWS::Kendra::DataSource - Properties: - Description: "DataSource for JSPWiki KendraSearchProvider" - IndexId: - Ref: Index - Name: - Ref: DataSourceName - Tags: - - Key: Origin - Value: JSPWIKI - Type: CUSTOM - -Outputs: - - Index: - Description: The Index - Value: - Ref: Index - - DataSource: - Description: The DataSource - Value: - Ref: DataSource - diff --git a/jspwiki-kendra-searchprovider/cloudformation/jspwiki-iam-role.yaml b/jspwiki-kendra-searchprovider/cloudformation/jspwiki-iam-role.yaml deleted file mode 100644 index 1eb60b4..0000000 --- a/jspwiki-kendra-searchprovider/cloudformation/jspwiki-iam-role.yaml +++ /dev/null @@ -1,67 +0,0 @@ -AWSTemplateFormatVersion: "2010-09-09" -Description: > - Create an IAM Role that allows that can be attached to an EC2 Instance Profile in order to access a Kendra Index -Metadata: - - AWS::CloudFormation::Interface: - ParameterGroups: - - Label: - default: Parameters related to the Kendra Index and DataSource - Parameters: - - IndexName - - DataSourceName - ParameterLabels: - IndexName: - default: "The Kendra Index's Name" - DataSourceName: - default: "The Kendra DataSource's Name" - -Parameters: - - IndexName: - Description: "The name of the Kendra Index to create" - Type: String - Default: "JSPWikiIndex" - - DataSourceName: - Description: "The name of the Kendra DataSource to create" - Type: String - Default: "JSPWikiDataSource" - -Resources: - - JSPWikiRole: - Type: AWS::IAM::Role - Properties: - AssumeRolePolicyDocument: - Version: 2012-10-17 - Statement: - - Effect: "Allow" - Principal: - Service: - - ec2.amazonaws.com - Action: - - sts:AssumeRole - Path: "/" - Policies: - - PolicyName: AllowJSPWikiAccessToKendra - PolicyDocument: - Version: 2012-10-17 - Statement: - - Sid: AllowAccessToListOfIndices - Effect: Allow - Action: - - kendra:ListIndices - Resource: "*" - - Sid: AllowAccessToJSPWikiIndex - Effect: Allow - Action: - - kendra:Query - - kendra:StopDataSourceSyncJob - - kendra:BatchPutDocument - - kendra:StartDataSourceSyncJob - - kendra:ListDataSources - - kendra:BatchDeleteDocument - Resource: - - Fn::Sub: "arn:${AWS::Partition}:kendra:${AWS::Region}:${AWS::AccountId}:index/${IndexName}" - - Fn::Sub: "arn:${AWS::Partition}:kendra:${AWS::Region}:${AWS::AccountId}:index/${IndexName}/data-source/${DataSourceName}" \ No newline at end of file diff --git a/jspwiki-kendra-searchprovider/docker-files/jspwiki-custom.properties b/jspwiki-kendra-searchprovider/docker-files/jspwiki-custom.properties deleted file mode 100644 index b862a79..0000000 --- a/jspwiki-kendra-searchprovider/docker-files/jspwiki-custom.properties +++ /dev/null @@ -1,3 +0,0 @@ -jspwiki.searchProvider = org.apache.wiki.search.kendra.KendraSearchProvider -jspwiki.kendra.indexName = JSPWikiIndex -jspwiki.kendra.dataSourceName = JSPWikiDataSource diff --git a/jspwiki-kendra-searchprovider/docs/images/JSPWiki_Search.png b/jspwiki-kendra-searchprovider/docs/images/JSPWiki_Search.png deleted file mode 100644 index cfa5525..0000000 Binary files a/jspwiki-kendra-searchprovider/docs/images/JSPWiki_Search.png and /dev/null differ
