Repository for GitDOX, a GitHub Data-storage Online XML editor
Switch branches/tags
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
codemirror-5.15.2 Add basic conllu mode to codemirror Sep 30, 2018
css move common <head> content into shared_head_content Oct 31, 2018
img replace login logo with gitdox logo Sep 19, 2018
js enable update for corpus metadata Nov 14, 2018
modules Track doc_id in parse_ether Nov 8, 2018
schemas Add support for fixed values in template export Oct 30, 2018
templates EtherCalc -> Spreadsheet Nov 4, 2018
users sync with dev Sep 29, 2018
.gitignore add popupPage*, gitdox.db to gitignore Oct 24, 2018
.netrc .netrc file Jul 11, 2017
Dockerfile link node to nodejs Oct 29, 2018
LICENSE Initial commit Dec 1, 2016
README.md modify ether_url and install instructions to sidestep ethercalc path … Sep 21, 2018
admin.py finish making as much html templating as possible happen w/ mustache Nov 1, 2018
corpus_metadata_fields.tab Add corpus metadata field selectors Feb 12, 2018
editor.py Remove decode utf8 bug on clone document Nov 8, 2018
editor_metadata_service.py allow editing metadata Nov 11, 2018
export.py utf-8 header lowercase Sep 21, 2018
favicon.ico Generic favicon Jul 11, 2017
gitdox.db Fix DB initialization Apr 13, 2018
index.py remove popup meta code Oct 31, 2018
metadata_fields.tab Added image management metadata fields Jun 22, 2017
paths.py don't add 'missing' os.sep to empty url Oct 8, 2018
requirements.txt add missing dep on six Oct 29, 2018
status.tab Added needs_facsimile status Jun 22, 2017
validate.py Track doc_id in parse_ether Nov 8, 2018
validation_rules.py make renderer provide navbar_html and skin Oct 25, 2018
validation_rules_service.py forbid demo user from making changes using jtables Oct 31, 2018

README.md

GitDox

GitDox is an online editor for version controlled XML editing.

The editor interface is based on CodeMirror. GitHub is used as a remote backend, and SQLite is used for local storage.

GitDox is used by Coptic SCRIPTORIUM as an xml editor/transcription tool for Coptic texts.

Installation

You have three choices:

  1. Pull the latest GitDox Docker image
  2. Build and run a GitDox Docker image
  3. Manually install GitDox on your machine

Unless you have a good reason to do (2) or (3), we recommend you do (1).

Pull the latest Docker image

Note: currently, only the gucorpling/gitdox:dev image is available. We hope to provide a stable release soon.

First, install Docker. You may be able to install it using your platform's package manager.

(Note: if your machine has Apache running, you should stop it first by running sudo service apache2 stop.)

docker run -dit --restart unless-stopped --name gitdox-dev -p 80:80 gucorpling/gitdox:dev

GitDox should now be running the docker container you've set up, and you may visit http://localhost on your machine to verify that it works. GitDox should now always be running on your machine, even if you reboot it. If for some reason you need to stop it manually, you may do so:

docker stop gitdox
# since you stopped it manually, it will no longer start automatically, even on
# reboot. to start again:
docker start gitdox

If you need to manually edit GitDox files, you may start a bash session inside of the Docker container:

docker exec -it gitdox-instance bash
# now you are inside--install vim so you can edit files
apt install vim 
cd /var/www/html
vim user/admin.ini # or whatever you need to edit

If you anticipate that you will need to heavily modify GitDox's files, you may wish to have your GitDox folders live in your host machine's filesystem:

sudo git clone https://github.com/gucorpling/gitdox /opt/gitdox
sudo chown -R www-data:www-data /opt/gitdox
docker run -dit --restart unless-stopped --name gitdox -v /opt/gitdox:/var/www/html -p 80:80 gucorpling/gitdox:dev gitdox

These commands install GitDox under /opt in your host machine and allows you to modify them just as you would modify any other file on your machine. But in the Docker command, with the -v flag we tell it to mount this folder as /var/www/html in the container's filesystem. The files are shared bidirectionally: changes made in the container will flow to the host, and vice versa.

Build and run a Docker image

First, install Docker. You may be able to install it using your platform's package manager.

Run the following code:

git clone https://github.com/gucorpling/gitdox ~/gitdox
# compile the docker image
docker build -t gitdox .
# launch the image on your machine, mapping the image's port 80 to your machine's 80
docker run -dit --restart unless-stopped --name gitdox -p 5000:80 gitdox

GitDox should now be running the docker container you've set up, and you may visit http://localhost:5000 on your machine to verify that it works. GitDox should now always be running on your machine, even if you reboot it. If for some reason you need to stop it manually, you may do so:

docker stop gitdox
# since you stopped it manually, it will no longer start automatically, even on
# reboot. to start again:
docker start gitdox

If for whatever reason you need to manually edit GitDox files, you may start a bash session inside of the Docker container:

docker exec -it gitdox-instance bash
# now you are inside--install vim so you can edit files
apt install vim 
cd /var/www/html
vim user/admin.ini # or whatever you need to edit

Manual Installation

The following instructions assume you are installing on a recent (16.04-18.04) version of Ubuntu.

Install Redis

Ethercalc has an optional dependency on Redis. We assume you will be using Redis for these instructions.

sudo apt update
sudo apt install redis-server
redis-cli ping #=> "PONG", if all has gone well

Install Ethercalc

# install deps
sudo apt install gzip git curl python libssl-dev pkg-config build-essential npm
# install ethercalc
sudo npm install -g ethercalc
# start ethercalc in background and continue using terminal
ethercalc &

By default, Ethercalc runs on port 8000.

Install and Configure Apache2

Install, and enable CGI module

sudo apt install apache2
# enable CGI module and reload
sudo a2enmod cgi

Add these lines to /etc/apache2/apache2.conf. This tells Apache to execute Python files that the client requests, and to serve index.py by default. (Note that we're assuming you're installing GitDox under /var/www/html--you should replace this path with the one you're going to install under.)

<Directory "/var/www/html">
	Options +ExecCGI
	AddHandler cgi-script .py
	DirectoryIndex index.py
</Directory>

Restart Apache:

sudo service apache2 restart

Install GitDox

Decide where you want GitDox to live under your Apache directories. In these instructions we'll assume it's /var/www/html

  1. Install xmllint for xml validation:
sudo apt install libxml2-utils
  1. Execute the following to set up GitDox's files:
# clear /var/www/html and clone gitdox to it, changing ownership to www-data
sudo rm -rf /var/www/html
sudo git clone https://github.com/gucorpling/gitdox.git /var/www/html
sudo chown -R www-data:www-data /var/www/html

# allow apache to execute python files
sudo chmod +x /var/www/html/*.py
sudo chmod +x /var/www/html/modules/*.py

# install dependencies--use pip
sudo apt install python-pip
sudo pip install -r /var/www/html/requirements.txt
  1. Edit the contents of users/config.ini to your liking. In particular, pay attention to xml_nlp_api and spreadsheet_nlp_api if you plan to make use of those features.

  2. Modify the value of ether_url in users/config.ini so that it reflects where GitDox can find your Ethercalc service over HTTP. It defaults to assuming that you will serve Ethercalc via reverse proxy into a subdirectory of your website, /ethercalc/. If you want to serve it over its original port, you should change it to something like yourdomain.com:8000, and if you want to serve it over a subdomain, change it to something like your.subdomain.yourdomain.com.

  3. Navigate to http://localhost. The default login is admin, pass1.

Credits

(c) 2016-2018 Shuo Zhang (@zangsir), Amir Zeldes (@amir-zeldes), and Luke Gessler (@lukegessler)

This work was supported by the KELLIA project, NEH grant #HG-229371, co-sponsored by the German DFG.