Skip to content
This repository has been archived by the owner on Aug 8, 2019. It is now read-only.
/ svn-server Public archive

A small collection of scripts for the KentProjects faux SVN server.

License

Notifications You must be signed in to change notification settings

kentprojects/svn-server

Repository files navigation

KentProjects SVN Server

The KentProjects SVN Server is a simple NodeJS application that allows direct manipulation of SVN repositories via a simple HTTP API. Written in NodeJS so that the server this runs on will only be running:

No PHP!

Introduction

The purpose of this SVN server is to simulate a service where an institute running an SVN server and requires repositories to be created and destroyed on demand.

Installation

Check out the Vagrant provisioning script, which executes whenever we build a new Vagrant box from scratch. It contains all the packages and all the various permission changes and symlinks which are required when building a relatively complex system. Saying that, it's not relatively complex. It was to setup. But from this angle it seems relatively simple!

Documentation

Here is a list of endpoints & methods that this API supports.

Get a list of all repositories

This endpoint gets a list of all the repositories currently active on this SVN server.

Request

GET / HTTP/1.1
Host: code.kentprojects.com

Response

HTTP/1.1 200 OK
Content-Type: application/json
[
	"2014/KettleProject",
	"2014/FlyingMachineProject"
]

Create repositories

This endpoint is used to create a new repository & Trac instance.

Request

POST / HTTP/1.1
Host: code.kentprojects.com
{
	"name": "KettleProject"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json
{
	"name": "KettleProject",
	"svn": "svn://code.kentprojects.com/2014/KettleProject",
	"trac": "http://code.kentprojects.com/2014/KettleProject"
}

If the project already exists (for this year) then you will get back:

HTTP/1.1 400 Bad Request
Content-Type: application/json
{
	"error": true,
	"message": "This repository (2014/KettleProject) already exists.",
	"reason": "already_exists"
}

Delete a repository

POST /:YEAR/:REPOSITORY/delete HTTP/1.1
Host: code.kentprojects.com

This is used to delete a repository & it's associated Trac instance.

Request

POST /2014/KettleProject/delete HTTP/1.1
Host: code.kentprojects.com

Response

HTTP/1.1 200 OK
Content-Type: application/json
"Repository 2014/KettleProject deleted."

Add user to repository

POST /:YEAR/:REPOSITORY/user HTTP/1.1
Host: code.kentprojects.com

This is used to add any number of users to the repository.

Request

POST /2014/KettleProject/user HTTP/1.1
Host: code.kentprojects.com
{
  "jsd24": "somepassword1",
  "mh472": "somepassword2",
  "mjw43": "somepassword3"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json
"Users jsd24,mh472,mjw43 added to 2014/KettleProject"

Remove user from repository

POST /:YEAR/:REPOSITORY/delete/:USER HTTP/1.1
Host: code.kentprojects.com

This is used to delete a user from a repository.

Unlike the Add A User endpoint earlier, this endpoint requires you delete users one at a time.

Request

POST /2014/KettleProject/delete/mh472 HTTP/1.1
Host: code.kentprojects.com

Response

HTTP/1.1 200 OK
Content-Type: application/json
"User mh472 deleted from 2014/KettleProject"

Contact

For more information, contact any of us developers individually on Github or collectively at developer@kentprojects.com.

About

A small collection of scripts for the KentProjects faux SVN server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published