vulsio / go-exploitdb

Tool for searching Exploits from Exploit Databases, etc.
MIT License
248 stars 56 forks source link

chore(deps): use go-git v5 #208

Closed MaineK00n closed 4 months ago

MaineK00n commented 5 months ago

What did you implement:

Fixes:

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

$ docker run --rm -it alpine:3.20 sh
/ # apk add --no-cache go make
/ # wget https://github.com/vulsio/go-exploitdb/archive/refs/heads/MaineK00n/go-git-v5.tar.gz
/ # tar -xvf go-git-v5.tar.gz
/ # cd go-exploitdb-MaineK00n-go-git-v5/
/go-exploitdb-MaineK00n-go-git-v5 # git
sh: git: not found
/go-exploitdb-MaineK00n-go-git-v5 # make build

// first fetch: clone to ~/.cache/go-exploitdb/pocs
/go-exploitdb-MaineK00n-go-git-v5 # ./go-exploitdb fetch githubrepos

// replace ~/.cache/go-exploitdb/pocs with the outdated commit 
/go-exploitdb-MaineK00n-go-git-v5 # cd ~/.cache/go-exploitdb/pocs
~/.cache/go-exploitdb/pocs # apk add --no-cache git
~/.cache/go-exploitdb/pocs # git reset --hard 6168e2025ba3fd0cf34239b31e862a64ac5416c0
~/.cache/go-exploitdb/pocs # apk del git
~/.cache/go-exploitdb/pocs # cd /go-exploitdb-MaineK00n-go-git-v5/

// Second and subsequent fetches: pull ~/.cache/go-exploitdb/pocs
/go-exploitdb-MaineK00n-go-git-v5 # ./go-exploitdb fetch githubrepos

// pull success: check ~/.cache/go-exploitdb/pocs commit hash
/go-exploitdb-MaineK00n-go-git-v5 # cd ~/.cache/go-exploitdb/pocs
~/.cache/go-exploitdb/pocs # apk add --no-cache git
~/.cache/go-exploitdb/pocs # git log -n 2
commit 554be9b7a945b07553637ea35c96419c99f5ff67 (HEAD -> master, origin/master)
Author: motikan2010-bot <k.agena1993@gmail.com>
Date:   Thu Jun 13 21:29:56 2024 +0900

    Auto Update 2024/06/13 12:29:56

commit 6168e2025ba3fd0cf34239b31e862a64ac5416c0
Author: motikan2010-bot <k.agena1993@gmail.com>
Date:   Thu Jun 13 15:29:29 2024 +0900

    Auto Update 2024/06/13 06:29:29

Checklist:

You don't have to satisfy all of the following.

Is this ready for review?: YES

Reference