{"id":16022016,"url":"https://github.com/cfstras/wiki-api","last_synced_at":"2025-03-06T07:18:47.643Z","repository":{"id":57581861,"uuid":"67590068","full_name":"cfstras/wiki-api","owner":"cfstras","description":"API layer for new gitwiki","archived":false,"fork":false,"pushed_at":"2016-12-20T23:19:57.000Z","size":6366,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-16T18:35:55.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfstras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-07T08:58:37.000Z","updated_at":"2018-10-09T15:03:43.000Z","dependencies_parsed_at":"2022-09-26T19:31:31.620Z","dependency_job_id":null,"html_url":"https://github.com/cfstras/wiki-api","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfstras%2Fwiki-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfstras%2Fwiki-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfstras%2Fwiki-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfstras%2Fwiki-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfstras","download_url":"https://codeload.github.com/cfstras/wiki-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242163952,"owners_count":20082228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T18:20:28.535Z","updated_at":"2025-03-06T07:18:47.609Z","avatar_url":"https://github.com/cfstras.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wiki-api [![Build Status](https://travis-ci.org/cfstras/wiki-api.svg?branch=master)](https://travis-ci.org/cfstras/wiki-api)\n`TODO: find a better name.`\n\nThis is a prototype backend to a new wiki built for flipdot.\n\nBasically, it uses libgit2 to expose a git repository as a simple web-server.\nAll template rendering (except for \"Index of\") should be done in the separate front-end.\n\n## Usage\n\n[Download binary here](https://github.com/cfstras/wiki-api/releases). Then start it, and point at your data repository.\n```bash\n./wiki-api ~/path-to/wiki-data.git\n\n# help:\n./wiki-api ~/path-to/wiki-data.git --help\n```\n\n### For development:\n```bash\ngo get github.com/cfstras/wiki-api\ncd $GOPATH/github.com/cfstras/wiki-api \u0026\u0026 go generate -v ./...  # regenerate asset files if you changed them\ngo get -v \u0026\u0026 wiki-api -debug ~/path-to/wiki-data.git\n```\n\n## API\nThe API is as follows:\n\n### `GET /`  |  `GET /folder/subfolder/`  \nReturns an index-of listing, rendered in HTTPD style.\n\n### `GET /file.md`  |  `GET /folder/file.md`  \nReturns the file content.\n\n### `GET /file.md.json`  |  `GET /folder/.json` | `GET /.json`  \nReturns file/folder information rendered as JSON, along with history entries.\n\n### _not implemented_ `GET /file.md.history/`  |  `GET /folder.history/`  \nReturns index-of listing of file/folder history.\n\n### _not implemented_ `GET /file.md.history/[12-]954abcf2` / `GET /folder.history/[12-]954abcf2/`  \nReturns file/folder contents at commit-id. The number in front is used for sorting and\ncan be omitted.\n\n### `PUT /file.md` | `PUT /foo/file.md`\nCreates or updates a file. The directory does not have to exist, and will be created on-the-fly if necessary.  \nThe body of the request will be used verbatim as the file contents.\n\nAdditional headers:  \n\n- `Auth: token`: Token used for authorization\n- `Wiki-Last-Id: \u003csha256\u003e` (optional): the sha256 of the object to be replaced.\n  Can be used to verify that the file was not updated by somebody else.  \n  Set to `null` to ensure the file does not exist before creating it.\n- `Wiki-Commit-Msg` (optional): Set a commit message describing the changes.\n\nResponds with the Commit ID of the newly generated commit, or an error message.\n\nResponse codes:\n\n- 200 OK: everything was okay!\n- 409 Conflict: the `Last-Id` header did not match. Please re-fetch file information and merge changes.  \n    Also occurs on other conflicts, e.g. creating a file ending in `.json`.\n- 410 Gone: a `Last-Id` header was supplied, but the file did not exist before.\n\n\n`TODO: DELETE, auth`\n\n# License\nGPLv2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfstras%2Fwiki-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfstras%2Fwiki-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfstras%2Fwiki-api/lists"}