{"id":13550941,"url":"https://github.com/K4rian/twserver-go","last_synced_at":"2025-04-03T01:30:41.650Z","repository":{"id":57576995,"uuid":"221077279","full_name":"K4rian/twserver-go","owner":"K4rian","description":"TiddlyWiki HTTP Server written in Go.","archived":false,"fork":false,"pushed_at":"2024-03-18T02:59:44.000Z","size":15,"stargazers_count":20,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-03T21:33:48.311Z","etag":null,"topics":["go","http-server","tiddlywiki","tiddlywiki5","wiki"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/K4rian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-11T21:55:39.000Z","updated_at":"2024-03-17T15:31:41.000Z","dependencies_parsed_at":"2024-06-19T04:00:53.217Z","dependency_job_id":null,"html_url":"https://github.com/K4rian/twserver-go","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/K4rian%2Ftwserver-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K4rian%2Ftwserver-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K4rian%2Ftwserver-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/K4rian%2Ftwserver-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/K4rian","download_url":"https://codeload.github.com/K4rian/twserver-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246921946,"owners_count":20855339,"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":["go","http-server","tiddlywiki","tiddlywiki5","wiki"],"created_at":"2024-08-01T12:01:39.986Z","updated_at":"2025-04-03T01:30:41.340Z","avatar_url":"https://github.com/K4rian.png","language":"Go","funding_links":[],"categories":["Go","go"],"sub_categories":[],"readme":"twserver-go\n=====\n\nA [TiddlyWiki][1] HTTP Server written in Go.\n\n## Features\n- Automatic backup on each save.\n- Customizable settings.\n- Easy to deploy.\n- Works on macOS, Linux and Windows.\n\n## Getting started\n### Prerequisites\n- [An empty copy of TiddlyWiki][2].\n\n### Setup\n- __[Download the latest build][3]__ for your platform.\n- Extract the archive.\n- `cd` into the directory that was just created.\n- Put the TiddlyWiki's `empty.html` file inside the `www` subfolder.\n- Rename the `empty.html` file to `index.html`.\n- Run the server: `./twserver`.\n- Open your web browser and browse to: [http://localhost:8080](http://localhost:8080)\n\n### Customizing\nAll server settings can be tweaked using a configuration file located beside the server binary.\nThe configuration file must use the same name as the binary and saved with the `.json` extension.\n\n- Create a configuration file in `JSON` format (on Linux/macOS):\n```bash\ntouch twserver.json\n```\n\n- Open the file with your favorite text editor and write the following values *(default)*:\n```json\n{\n  \"Host\": \"\",\n  \"Port\": 8080,\n  \"DocumentRootDir\": \"./www\",\n  \"IndexFile\": \"index.html\",\n  \"BackupDir\": \"./backup\",\n  \"BackupFileFormat\": \":name:.:date:.html\",\n  \"ServeDirs\": [],\n  \"LogFileName\": \"./logs/twserver.log\",\n  \"LogMaxSize\": 4,\n  \"LogMaxBackups\": 16,\n  \"LogMaxAge\": 28,\n  \"LogCompress\": true\n}\n```\n- Tweak the values as needed, save the file and restart the server.\n\nBy default, the HTTP server only serves the index file and rejects any other request. To serve one or more custom directories containing extra resources (such as images), you have to add them by tweaking the `ServeDirs` value in the configuration file.\n\n- __Example__: Add the `images` directory located in `./images` and accessed via the URL `\u003cwiki_url\u003e/img/`:\n```json\n{\n  \"ServeDirs\": [\n    {\n      \"URL\": \"/img/\",\n      \"Path\": \"./images\"\n    }\n  ]\n}\n```\n- Any image from the `./images` directory can now be reached via `\u003cwiki_url\u003e/img/` and displayed inside any wiki post.\n\n## Building\nBuilding is done with the `go` tool. If you have setup your `GOPATH` correctly, the following should work:\n```bash\ngo get github.com/k4rian/twserver-go\ngo build -ldflags \"-w -s\" github.com/k4rian/twserver-go\n```\n\n## Dependencies\nThe rotating logging system is powered by [lumberjack][4]:\n```\ngopkg.in/natefinch/lumberjack.v2=\"v2.2.1\"\n```\n\n## Docker Image\nA Docker image is available on Docker Hub under [k4rian/twserver][5] and its corresponding [source repository][6] on GitHub.\n\n## License\n[MIT][7]\n\n[1]: https://github.com/Jermolene/TiddlyWiki5 \"TiddlyWiki 5 GitHub repository\"\n[2]: https://tiddlywiki.com/#GettingStarted \"TiddlyWiki: Getting Started\"\n[3]: https://github.com/k4rian/twserver-go/releases \"Latest twserver-go releases\"\n[4]: https://github.com/natefinch/lumberjack \"Lumberjack GitHub repository\"\n[5]: https://hub.docker.com/r/k4rian/twserver \"twserver-go Docker Image\"\n[6]: https://github.com/K4rian/docker-twserver \"twserver-go Docker Image GitHub repository\"\n[7]: https://github.com/K4rian/twserver-go/blob/master/LICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FK4rian%2Ftwserver-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FK4rian%2Ftwserver-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FK4rian%2Ftwserver-go/lists"}