GithubHelp home page GithubHelp logo

doytsujin / gitwiki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smolijar/gitwiki

0.0 1.0 0.0 463 KB

A git based wiki system with in-repository permission control, web user interface and Git CLI over SSH access.

License: MIT License

JavaScript 100.00%

gitwiki's Introduction

Gitwiki

Gitwiki is a git based wiki system with in-repository permisison control, web user interface and Git CLI over SSH access.

About

It uses Gitolite authorization layer allowing complex, in-repository access control.

Gitwiki is part of an implementation for the Git-based Wiki System.

It uses Emily editor for document editting.

Install

The installation process is complicated, because repository hosting service over SSHd must be established.

Gitolite

Gitolite installation

This installation prociess is thoroughly explained here. Here is a step-by-step solution for Debian-based distributions.

Generate SSH keys:

# install git, sshd
sudo apt-get install openssh-server git
# generate a keypair for administration
ssh-keygen -t rsa -b 4096 -C "gitolite-admin" -f "$HOME/.ssh/gitolite-admin"
# copy the "~/.ssh/gitolite-admin.pub" for gitolite setup
cp ~/.ssh/gitolite-admin.pub /tmp

Install Gitolite:

# create new `git` user with home directory and set password
sudo useradd -m git
sudo passwd git

# switch to git user
su - git

# download and install gitolite
cd $HOME
git clone https://github.com/sitaramc/gitolite
mkdir -p bin
gitolite/install -to $HOME/bin # use abs path in argument

# setup gitolite with copied admin key from workstation
$HOME/bin/gitolite setup -pk /tmp/gitolite-admin.pub

Additional Gitolite setup

Wee need gitwiki to be able to access Gitolite. If you will be running gitwiki from a different user (assume username jack), you must perform additional setup.

Create group, add users git, jack, allow to write in /home/git/.gitolite

sudo groupadd gitolite
sudo usermod -a -G gitolite jack
sudo usermod -a -G gitolite git
sudo chgrp -R gitolite /home/git/
sudo chmod -R 2775 /home/git/.gitolite

Set setgid bit

chmod g+s /home/git/

Set default permissions for new log files

sudo setfacl -d -m g::rwx /home/git/.gitolite/logs/

Gitwiki

Install

npm install

Setup

Authentication

  1. Register a new OAuth application
    • Set callback to <host>/api/v1/auth/github/cb
  2. Remember client_id and client_secret

Configuration

Create a .gitwiki.config.js and fill the data as in .gitwiki.config.example.js.

module.exports = {
  auth: {
    oauth2: {
      github: {
        // Information from the newly registered app
        client_id: '...',
        client_secret: '...',
      }
    }
  },
  gitolite: {
    // Path to gitolite bin
    bin: '/home/git/bin/gitolite',
    // Home directory of the gitolite's user
    home: '/home/git',
  },
  // Valid storage path for keyv(https://github.com/lukechilds/keyv)
  storage: 'sqlite:///home/git/database.sqlite',
};

Running

  1. Add ssh key identity ssh-add ~/.ssh/gitolite-admin (path to private key you configured gitolite with)
  2. npm run start

Usage

Repository providers

  • Gitolite
  • GitHub

To access GitHub repositories, you will be prompted to enter your personal access token in repository index. When provided, you can access your GitHub repositories apart from the default local (gitolite) repositories.

Adding SSH keys

The SSH keys are downloaded from GitHub on the first login and added to the Gitolite configuration. Apart from that, they can be added using Gitolite.

Permission control

This option is only available for Gitolite provider, for self-hosted repos. After a succesful Gitolite setup, there is a repository gitolite-admin, where you can add users and chagne their permissions. If you are new to Gitolite, see Basic administration manual.

License

This project is licensed under the MIT license.

gitwiki's People

Contributors

smolijar avatar

Watchers

 avatar

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.