No description
Find a file
Pakin a69ef7b927 disable cache from redis
- reason from value not updated

Signed-off-by: Pakin <pakin.t@forth.co.th>
2026-05-18 09:56:23 +07:00
src disable cache from redis 2026-05-18 09:56:23 +07:00
.dockerignore update: repo & deps 2026-01-08 14:15:27 +07:00
.gitignore feat: add commit, push handler 2026-01-22 17:20:03 +07:00
build.rs v1: initialize 2025-12-16 09:32:37 +07:00
Cargo.lock feat: commit, push, pull 2026-05-05 16:55:09 +07:00
Cargo.toml change: change get from json cache file to multipart 2026-04-27 15:47:11 +07:00
Dockerfile update dockerfile 2026-01-08 14:40:58 +07:00
README.md update usage of commit 2026-05-15 14:38:27 +07:00

tbm-git-service

Git repo as a service with operational endpoints


Endpoints

Checkout file

Get file content or list of file in directory from HEAD

GET .../checkout?path=<path_to_file>

Examples

Get list of files in directory

curl -X GET http://localhost:36593/checkout\?path\=inter
aus,common,dev,gbr,gbr_premium,hkg,ltu,mys,rou,sgp,tha,tha_premium,uae_dubai,usa,whatthecup

Get file

curl -X GET http://localhost:36593/checkout\?path\=inter/mys/xml/page_catalog_group_other.lxml

<Popup>
<Cache> "Enable" </Cache>
<Width> 1080 </Width>
<Height> 1920 </Height>
;<Background> "0xeae6e1" </Background>
<Volume> SoundVolume </Volume>
<EventOpen>
	; On open

Error

curl -X GET http://localhost:36593/checkout\?path\=inter2
File not found

Fetch

Fetching & update index of current repo

GET .../fetch

Expected result

{"result": "fetch success"}

Error

{"error": "..."}

Commit

Commit changes of file i.e. editing, adding, etc.

POST .../commit

Body must be multipart

  • Single file
path: string
file: text/binary is acceptable
signature_username: string
signature_email: stirng
message: string
  • Multiple file
signature_username: string
signature_email: stirng
message: string
fileX1: text/binary is acceptable
pathX1: string
fileX2: text/binary is acceptable
pathX2: string
...

Expected result

{"result": "commit hash id"}

Error

{"error": "..."}

Example

curl --request POST \
  --url http://localhost:36583/commit \
  --header 'content-type: multipart/form-data' \
  --form path=mys/version.dev \
  --form 'signature_username=git api' \
  --form signature_email=supra.m2.dev@forth.co.th \
  --form 'message=test commit' \
  --form file=@./mys.version.test

NOTE: file & path in multiple file must have the same name after


Push

Push local commits to remote

GET .../push

Expected result

{"result": "push completed"}

Error

{"error": "..."}

Pull

Pull commits from remote. This operation always does git reset hard first before pull for reason of no conflicts.

GET .../pull

Expected result

{"result": "pull completed"}

Error

{"error": "..."}

NOTE: Commit did lost but could be checkout later


Recovery

WIP...