Giter Club home page Giter Club logo

rjgit_adapter's Introduction

gollum -- A git-based Wiki

Gem Version Build Status Open Source Helpers Cutting Edge Dependency Status Docker Pulls

See the wiki for extensive documentation, along with screenshots of Gollum's features.

DESCRIPTION

Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a git repository of a specific nature:

  • A Gollum repository's contents are human-editable text or markup files.

  • Pages may be organized into directories any way you choose.

  • Other content can also be included, for example images, PDFs and headers/footers for your pages.

  • Gollum pages:

    • May be written in a variety of markups.
    • Can be edited with your favourite editor (changes will be visible after committing) or with the built-in web interface.
    • Can be displayed in all versions, reverted, etc.
  • Gollum strives to be compatible with GitHub and GitLab wikis.

    • Just clone your GitHub/GitLab wiki and view and edit it locally!
  • Gollum supports advanced functionality like:

SYSTEM REQUIREMENTS

Gollum runs both on Unix-like systems and on Windows.

Gollum runs either using 'normal' Ruby (MRI) or JRuby (Ruby on the Java Virtual Machine). On Windows, Gollum runs only using JRuby (either from source, or prebuilt).

On MRI, Gollum uses the rugged git library, while on JRuby/Java it utilizes the rjgit and JGit libraries. See here for more info.

INSTALLATION

As a Ruby Gem

Ruby is best installed either via RVM or a package manager of choice. Then simply: gem install gollum

Installation examples for individual systems can be seen here.

To run, simply:

  1. Run: gollum /path/to/wiki where /path/to/wiki is an initialized Git repository.
  2. Open http://localhost:4567 in your browser.

Via Docker

See here for instructions on how to run Gollum via Docker.

As a web application resource (Java)

The latest Release of Gollum will always contain a downloadable gollum.war file that can be directly executed on any system with a working Java installation:

java -jar gollum.war -S gollum <your-gollum-arguments-here>

Misc

See below for information on running Gollum from source, as a Rack app, and more.

MARKUPS

Gollum allows using different markup languages on different wiki pages. It presently ships with support for the following markups:

You can easily activate support for other markups by installing additional renderers (any that are supported by github-markup):

  • AsciiDoc -- gem install asciidoctor
  • Creole -- gem install creole
  • MediaWiki -- gem install wikicloth
  • Org -- gem install org-ruby
  • Pod -- requires Perl >= 5.10 (the perl command must be available on your command line)
    • Lower versions should install Pod::Simple from CPAN.
  • ReStructuredText -- requires python >= 3
    • Note that Gollum will also need you to install docutils for python
  • Textile -- gem install RedCloth

Markdown flavors

By default, Gollum ships with the kramdown gem to render Markdown. However, you can use any Markdown renderer supported by github-markup. This includes CommonMark support via the commonmarker gem. The first installed renderer from the list will be used (e.g., redcarpet will NOT be used if github/markdown is installed). Just gem install the renderer of your choice.

See here for instructions on how to use custom rendering gems and set custom options.

RUNNING FROM SOURCE

  1. git clone https://github.com/gollum/gollum
  2. cd gollum
  3. [sudo] bundle install
  4. bundle exec bin/gollum
  5. Open http://localhost:4567 in your browser.

Rack

Gollum can also be run with any rack-compatible web server. More on that over here.

Rack, with an authentication server

Gollum can also be run alongside a CAS (Central Authentication Service) SSO (single sign-on) server. With a bit of tweaking, this adds basic user-support to Gollum. To see an example and an explanation, navigate over here.

Service

Gollum can also be run as a service. More on that over here.

ENVIRONMENT

Gollum uses the environment variable APP_ENV primarily to control how the underlying Sinatra app behaves:

  • development โ€“ reload the app on every request
  • production โ€“ load the app only once

CONFIGURATION

Gollum comes with the command line options listed below. Note that there are some additional 'minor' options to tweak Gollum's behaviour that do not have commandline options, but can be configured in config.rb.

Option Arguments Description
--host [HOST] Specify the hostname or IP address to listen on. Default: '0.0.0.0'.1
--port [PORT] Specify the port to bind Gollum with. Default: 4567.
--config [FILE] Specify path to Gollum's configuration file.
--ref [REF] Specify the git branch to serve. Default: master.
--bare none Tell Gollum that the git repository should be treated as bare.
--adapter [ADAPTER] Launch Gollum using a specific git adapter. Default: rugged.2
--base-path [PATH] Specify the leading portion of all Gollum URLs (path info). Setting this to /wiki will make the wiki accessible under http://localhost:4567/wiki/. Default: /.
--page-file-dir [PATH] Specify the subdirectory for all pages. If set, Gollum will only serve pages from this directory and its subdirectories. Default: repository root.
--static, --no-static none Use static assets. Defaults to false in development/test, true in production/staging.
--assets [PATH] Set the path to look for static assets.
--css none Tell Gollum to inject custom CSS into each page. Uses custom.css from wiki root.3
--js none Tell Gollum to inject custom JS into each page. Uses custom.js from wiki root.3
--no-edit none Disable the feature of editing pages.
--allow-uploads [MODE] Enable file uploads. If set to dir, Gollum will store all uploads in the /uploads/ directory in repository root. If set to page, Gollum will store each upload at the currently edited page.4
--math [RENDERER] Enable rendering of mathematical equations. Valid renderers: mathjax, katex. Default: katex. Add custom configuration for the renderer to math.config.js and commit it to the repo.
--critic-markup none Enable support for annotations using CriticMarkup.
--irb none Launch Gollum in "console mode", with a predefined API.
--h1-title none Tell Gollum to use the first <h1> as page title.
--no-display-metadata none Do not render metadata tables in pages.
--user-icons [MODE] Tell Gollum to use specific user icons for history view. Can be set to gravatar, identicon or none. Default: none.
--template-dir [PATH] Specify custom mustache template directory. Only overrides templates that exist in this directory.
--template-page none Use _Template in root as a template for new pages. Must be committed.
--emoji none Parse and interpret emoji tags (e.g. :heart:) except when the leading colon is backslashed (e.g. \:heart:).
--lenient-tag-lookup none Internal links resolve case-insensitively, will treat spaces as hyphens, and will match the first page found with a certain filename, anywhere in the repository. Provides compatibility with Gollum 4.x.
--help none Display the list of options on the command line.
--version none Display the current version of Gollum.
--versions none Display the current version of Gollum and auxiliary gems.

Notes:

  1. The 0.0.0.0 IP address allows remote access. Should you wish for Gollum to turn into a personal Wiki, use 127.0.0.1.
  2. Before using --adapter, you should probably read this first.
  3. When --css or --js is used, respective files must be committed to your git repository or you will get a 302 redirect to the create a page.
  4. Files can be uploaded simply by dragging and dropping them onto the editor's text area when --allow-uploads is used.

Config file

When --config option is used, certain inner parts of Gollum can be customized. This is used throughout our wiki for certain user-level alterations, among which customizing supported markups will probably stand out.

See here for documentation about settings configurable in config.rb.

All of the mentioned alterations and options work both for Gollum's config file (config.rb) and Rack's config file (config.ru).

CONTRIBUTING

Please consider helping out! See CONTRIBUTING for information on how to submit issues, and how to start hacking on gollum.

rjgit_adapter's People

Contributors

bartkamphorst avatar dahie avatar dometto avatar heavywatal avatar jhominal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rjgit_adapter's Issues

`apply_patch` only works with non-bare repositories

It looks like the apply_patch method (which we will have to rework into a revert method) currently only works with non-bare repositories, since RJGit just wraps jgit's porcelain ApplyCommand, which reads files from the worktree.

Looks like working around this will require us to somehow re-implement ApplyCommand#apply in such a way that it will operate on a string or input stream that's not on-disk.

Gollum-lib throwing errors after latest RJGit update

From the test output:

TypeError: cannot convert instance of class org.jruby.RubyString to class org.eclipse.jgit.revwalk.RevCommit
org/jruby/java/proxies/JavaProxy.java:364:in `java_send'
/~/.rvm/gems/jruby-9.2.0.0@gollum-lib/gems/rjgit-5.4.2.0/lib/git.rb:271:in `checkout'
[...]/gollum-rjgit_adapter/lib/rjgit_adapter/git_layer_rjgit.rb:191:in `checkout'

Searching throws ArgumentError - invalid byte sequence in UTF-8

Searching in gollum using the RJGit adapter throws an ArgumentError. The relevant part of the stack trace:

ArgumentError - invalid byte sequence in UTF-8:
	org/jruby/RubyString.java:3806:in `scan'
	[...]/gollum-lib/lib/gollum-lib/wiki.rb:518:in `block in search'
	[...]/gollum-lib_rjgit_adapter/lib/rjgit_adapter/git_layer_rjgit.rb:173:in `block in grep'
	org/jruby/RubyArray.java:1734:in `each'
	[...]/gollum-lib_rjgit_adapter/lib/rjgit_adapter/git_layer_rjgit.rb:170:in `grep'
	[...]/gollum-lib/lib/gollum-lib/wiki.rb:512:in `search'
	[...]/gollum/lib/gollum/app.rb:473:in `block in GET /gollum/search'

Error on bundle install

Hi, I try to bundle the gem in order to run spec tests and get the error below. I run OSX 10.15 with jruby-9.2.6.0. Can somebody help?

--- ERROR REPORT TEMPLATE -------------------------------------------------------

Error Report

Questions

Please fill out answers to these questions, it'll help us figure out
why things are going wrong.

  • What did you do?

    I ran the command /Users/danielsenff/.rvm/gems/jruby-9.2.6.0@global/bin/bundle

  • What did you expect to happen?

    I expected Bundler to...

  • What happened instead?

    Instead, what happened was...

  • Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?

    I tried...

  • Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?

    ...

Backtrace

NoMethodError: undefined method `[]' for nil:NilClass
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/source/git/git_proxy.rb:90:in `version'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/source/git/git_proxy.rb:147:in `block in copy_to'
  org/jruby/RubyDir.java:399:in `chdir'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/shared_helpers.rb:52:in `block in chdir'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/stdlib/monitor.rb:226:in `mon_synchronize'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/shared_helpers.rb:51:in `chdir'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/source/git/git_proxy.rb:136:in `copy_to'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/source/git.rb:163:in `specs'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/definition.rb:764:in `block in converge_locked_specs'
  org/jruby/RubyArray.java:1792:in `each'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/definition.rb:750:in `converge_locked_specs'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/definition.rb:247:in `resolve'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/definition.rb:158:in `resolve_remotely!'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/installer.rb:303:in `resolve_if_needed'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/installer.rb:84:in `block in run'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/process_lock.rb:12:in `block in lock'
  org/jruby/RubyIO.java:1157:in `open'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/process_lock.rb:9:in `lock'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/installer.rb:73:in `run'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/installer.rb:25:in `install'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/cli/install.rb:66:in `run'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/cli.rb:256:in `block in install'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/settings.rb:124:in `temporary'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/cli.rb:255:in `install'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/exe/bundle:46:in `block in <main>'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
  /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/lib/ruby/gems/shared/gems/bundler-2.1.4/exe/bundle:34:in `<main>'
  org/jruby/RubyKernel.java:1008:in `load'
  /Users/danielsenff/.rvm/gems/jruby-9.2.6.0@global/bin/bundle:23:in `<main>'

Environment

Bundler             2.1.4
  Platforms         ruby, universal-java-9
Ruby                2.5.3p0 (2019-02-11 revision 66309) [java]
  Full Path         /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/bin/jruby
  Config Dir        /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/etc
RubyGems            2.7.6
  Gem Home          /Users/danielsenff/.rvm/gems/jruby-9.2.6.0
  Gem Path          /Users/danielsenff/.rvm/gems/jruby-9.2.6.0:/Users/danielsenff/.rvm/gems/jruby-9.2.6.0@global
  User Home         /Users/danielsenff
  User Path         /Users/danielsenff/.gem/jruby/2.5.0
  Bin Dir           /Users/danielsenff/.rvm/gems/jruby-9.2.6.0/bin
OpenSSL             
  Compiled          JRuby-OpenSSL 0.10.4
  Loaded            JRuby-OpenSSL 0.10.4
  Cert File         /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/lib/security/cacerts
  Cert Dir          /etc/ssl/certs
Tools               
  Git               
  RVM               1.29.9 (latest)
  rbenv             not installed
  chruby            not installed
  rubygems-bundler  (1.4.5)
Gem.ruby            /Users/danielsenff/.rvm/rubies/jruby-9.2.6.0/bin/jruby
bundle #!           /usr/bin/env jruby

Bundler Build Metadata

Built At          2020-01-05
Git SHA           32a4159325
Released Version  true

Bundler settings

gem.test
  Set for the current user (/Users/danielsenff/.bundle/config): "minitest"
gem.mit
  Set for the current user (/Users/danielsenff/.bundle/config): true
gem.coc
  Set for the current user (/Users/danielsenff/.bundle/config): true

Gemfile

Gemfile

source 'https://rubygems.org'

gemspec
gem 'rake', '>= 12.3.3'
gem 'adapter_specs', :git => 'https://github.com/gollum/adapter_specs.git'

group :test do
  gem "simplecov"
end

Gemfile.lock

<No /Users/danielsenff/Produktion/Ruby/Gems/caramelize/gollum/rjgit_adapter/Gemfile.lock found>

Gemspecs

gollum-rjgit_adapter.gemspec

# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "rjgit_adapter/version"

Gem::Specification.new do |s|
  s.name        = "gollum-rjgit_adapter"
  s.version     = Gollum::Lib::Git::VERSION
  s.platform    = "java"
  s.authors     = ["Bart Kamphorst, Dawa Ometto"]
  s.email       = ["[email protected]"]
  s.homepage    = "https://github.com/repotag/gollum-lib_rjgit_adapter"
  s.summary     = %q{Adapter for Gollum to use RJGit at the backend.}
  s.description = %q{Adapter for Gollum to use RJGit at the backend.}

  s.add_runtime_dependency "rjgit", "> 5.6.0", "~> 5.6.0"
  s.add_development_dependency "rspec", "3.4.0"

  s.files         = Dir['lib/**/*.rb'] + ["README.md", "Gemfile"]
  s.require_paths = ["lib"]

  # = MANIFEST =
  s.files = %w(
    Gemfile
    LICENSE
    README.md
    Rakefile
    gollum-rjgit_adapter.gemspec
    lib/rjgit_adapter.rb
    lib/rjgit_adapter/git_layer_rjgit.rb
    lib/rjgit_adapter/version.rb
  )
  # = MANIFEST =
end

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=undefined+method+%60%5B%5D%27+for+nil+NilClass&type=Issues

If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.