The CWRC-GitServer is a node.js Express server acting as a proxy between cwrc-git-dialogs and the GitHub API. The CWRC-GitServer in turn invokes CWRC-Git which is used to make the actual calls to GitHub.
CWRC-GitServer provides http endpoints for listing, creating, and updating XML documents.
The CWRC-GitWriter Sandbox is running an instance of CWRC-GitWriter, which uses the code from CWRC-WriterBase and cwrc-git-dialogs. There is a corresponding server component running this code and using the CWRC-Git module. The same code is easily (for someone with modest development experience) installed on any server to run your own instance. If you are looking to put together your own CWRC-Writer, CWRC-GitWriter is a good place to start.
There are two approached to install the sandbox version of the CWRC-GitWriter.
-
Install the dockerized verion of Git-Server/Git-Writer. The instruction for this approach is descibed in the CWRC-GitWriter-Docker repo.
-
Manually install each component. Instruction is down below:
Install node.js on a server (one approach for ubuntu is described here: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Clone this repository to the server, or copy the files to the server.
On the server switch into the CWRC-GitServer directory and run:
npm install
(to install the npm packages on the server)
Install pm2 to run Express.js as a service:
sudo npm install pm2 -g
cd ~/cwrcserver
pm2 start ./src/index.js
Next you'll need to create an OAuth app so that CWRC-GitServer can access GitHub on behalf of the user.
Once you have the client ID and client secret for your OAuth app, you'll need to edit the config.json file. The following fields need to customized:
Set to true
if CWRC-GitServer is at a different origin than CWRC-GitWriter.
The origin for CWRC-GitWriter (used if github_client_cors
is true).
The client ID for your OAuth app.
The client secret for your OAuth app.
The URL that GitHub should redirect to, after the user authorizes the OAuth app. It should lead to the github/callback
route as seen here.
The URL that CWRC-GitServer should redirect to, after handling the OAuth callback. It should lead to your installation of CWRC-GitWriter.
You will also have to install the CWRC-GitWriter code on the server, as explained in its README.