Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Updates #13

Open
ibnesayeed opened this issue May 14, 2016 · 3 comments
Open

Documentation Updates #13

ibnesayeed opened this issue May 14, 2016 · 3 comments

Comments

@ibnesayeed
Copy link
Contributor

ibnesayeed commented May 14, 2016

Lately, there were some big changes such as #5 and #11. I think we should consider updating the documentation in the README and well as in the Wiki to better reflect the current state and simplified installation and run instructions, both from pip (when released) and from the checked out code.

@jirikuncar
Copy link
Contributor

Shall we move the Wiki to docs? IMHO it's easier to keep the documentation up-to-date when it's part of the source code.

@tiborsimko
Copy link
Contributor

Shall we move the Wiki to docs?

I had actually started something in this direction. Can issue a PR to illustrate this.

@ibnesayeed
Copy link
Contributor Author

Somewhere there should be a step by step guide for downloading, installing, running, and making the first change. Perhaps the Getting Started would be a good place to put such instructions (current getting started document is obsolete). Please note that these are just illustrative steps that might not be accurate or complete.


The instructions might look something like this:

Install the TimeGate (and uWSGI) globally:

$ pip install -e "git+https://github.com/mementoweb/timegate.git#egg=TimeGate[uwsgi]"

Alternatively, clone the repository in the current working directory, change the working directory and install dependencies:

$ git clone [email protected]:mementoweb/timegate.git
$ cd timegate
$ pip install -e .[uwsgi]

Run an example instance of TimeGate proxy:

$ uwsgi --http :9999 -s /tmp/mysock.sock --module timegate.application --callable application

This will run the TimeGate proxy service on port 9999 with a built-in example simple example handler. To make sure every thing is setup correctly, fetch an example TimeMap from this instance, run the following command in a separate terminal and watch :

$ curl -i http://localhost:9999/simple/timemap/json/http://www.example.com/resourceA

This should return the following response:

HTTP/1.1 200 OK
Headers: Values

{"actual": "json response"}

To verify that the Datetime negotiation works well, make a TimeGate request with custom Accept-Datetime header:

$ curl -i -H "Accept-Datetime: Sun, 17 Oct 2010 21:42:31 GMT" http://localhost:9999/simple/timegate/http://www.example.com/resourceA

It should return:

HTTP/1.1 302 Found
Headers: Values
Link: <links>
Location: http://www.example.com/resourceA_v2

If everything worked as described so far then your environment is configured properly. Open the timegate/conf/config.ini file in a text editor (assuming that the repository was cloned in the installation step) and make the following changes:

handler_class = timegate.examples.webcite:WebCiteHandler
is_vcs = false

Now, stop the service and start again for the changes to take effect. Then run the following command to verify that the WebCite Timegate proxy is running properly:

$ curl -i http://localhost:9999/webcite/timemap/link/http://www.example.com/

The response should look like this:

A truncated response in Link format

Please read the detailed documentation to learn about other configuration options and to implement your custom proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants