Skip to content

codelibs/gitbucket-fess-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitbucket-fess-plugin: Search All of GitBucket on Fess

gitbucket-fess-plugin is a GitBucket plugin that provides global search, that is, search across multiple repositories.

Users can search for:

  • Code in all public repositories
  • Code in private repositories where you can access
  • Issues / Pull requests
  • Wiki pages

ScreenShot

This plugin cooperates with Fess, which is a full-text search server powered by Elasticsearch. But, special knowledge is NOT required to use both Fess and this plugin.

Overview

Why Fess?

  • open source software provided under Apache license
  • easy to deploy
  • powerful search engine based on Elasticsearch
  • can index/search documents in 30+ languages
  • supports many file formats (pdf, MS Office, etc.)

Links

Release

See Maven Repository.

Plugin version GitBucket version Fess version
1.7.x 4.35 - 11.0.1 -, 12.x
1.6.x 4.34 11.0.1 -, 12.x
1.5.x 4.32 - 11.0.1 -, 12.x
1.4.x 4.24.1 - 11.0.1 -, 12.x
1.3.x 4.20 - 11.0.1 -, 12.x
1.2.x 4.15 - 11.0.1 -, 12.x
1.1.x 4.{11, 12, 13, 14} 11.0.1 -, 12.x
1.0.0 4.10 11.0.1
1.0.0-beta2 4.7 10.3
1.0.0-beta1 4.6 10.3

Getting Started

Installation

Download gitbucket-fess-plugin jar file from the release page and put it into ~/.gitbucket/plugins (If the directory does not exist, create it by hand).

Setting Up

After the installation, the admin user sets up both of GitBucket and Fess.

The flow of the setting is like the following:

Step 1. Run GitBucket and Fess

Run GitBucket and Fess. If you run the both applications on localhost, use different port numbers.

Example

GitBucket: http://localhost:8080/gitbucket/
$ java -jar gitbucket.war --port=8080 --prefix=gitbucket
Fess: http://localhost:8081/fess/
$ ./bin/fess -Dfess.port=8081 -Dfess.context.path=/fess/

Step 2. Generate Token for Crawler @GitBucket

Access to http://[GitBucket URL]/[User Name]/_application as a GitBucket's admin user and generate an access token. This token will be used by crawlers of Fess.

Generate GitBucket's token

Step 3. Set up Crawler @Fess

Access to http://[Fess URL]/admin/dataconfig/ as a Fess's admin user and set up a data crawler.

Then, fill each form as below:

  • Name: String
  • Handler Name: GitBucketDataStore
  • Parameter:
url=http://[GitBucket URL]
token=[GitBucket's Token generated in Step 2]

You don't have to change other values.

GitBucketDataStore config

After you create a configuration successfully, you can find it in http://[Fess URL]/admin/dataconfig/. Then, click it and create a new crawling job.

Create a new job

You can set up a crawling schedule here, but you can also change it later. Thus, if you are new to Fess, you don't need to change any value here. (For more details about scheduling, see a later section.)

Step 4. Run Crawler @Fess

Move to http://[Fess URL]/admin/scheduler/. Then, you will find the job created in Step 3 on the top of the list. Choose and start it.

Start a crawler

If a crawler starts successfully, the status of the job scheduler becomes Running like the following:

Crawler is running

Crawling process takes time, depending on a number of contents in GitBucket. Fess stores codes on the default branch in each repository. After the crawling job finishes, you can search GitBucket's contents on Fess.

Step 5. Register Fess's URL @GitBucket

This is the final step. Access to http://[GitBucket URL]/fess/settings as an admin user and register the URL of Fess's top page. Note that the following image uses the URL of Fess started with flags -Dfess.port=8081 -Dfess.context.path=/fess/.

You can also register a Fess's access token here. It is required for private repository search, but you can leave this form empty now. For more details, see the next section.

Register a token

Then, global search will be enabled!

Private Repository Search

If the admin user registers a Fess's access token at http://[GitBucket URL]/fess/settings, users can explore their private repositories.

How to generate Fess's access token

Access to http://[Fess URL]/admin/accesstoken/ as an admin user and click the Create New button.

Next, fill in the form like the following:

  • Name: String
  • Permissions: empty
  • Parameter Name: permission

Generate a token on Fess

Then, access token will be created.

Generated token

Continuous Crawl

By setting up job schedulers on Fess, you can run data crawlers periodically to keep search results up to date.

Access to http://[FessURL]/admin/scheduler/ and choose a crawler job. Then, you can setting up the value of Schedule in Cron-format.

Development Information

Build

You need to install sbt to build this plugin from source code.

$ sbt package

Code Format

$ sbt scalafmt

Contribution

Any contribution will be appreciated! Please send issues or pull requests.

For Maintainers

If you want to increment the version number, please update values in:

  • build.sbt
  • src/main/scala/Plugin.scala