** opengrok-restful *** Setup opengrok (v1.3) - Start opengrok server and limit the cpu usage of opengrok indexer. - Period of automatic mirroring/reindexing (10min). - The volume mounted to ~/Projects should contain the projects you want to make searchable. - Open http://127.0.0.1:8080 to enjoy. #+begin_src shell $ sudo docker run -d --cpus="1.0" \ --name opengrok \ -p 8080:8080/tcp \ -e REINDEX="10" \ -v ~/Projects:/opengrok/src/ \ opengrok/docker:1.3 #+end_src - You can avoid to sync source code from upstream. #+begin_src shell $ sudo docker exec -it opengrok sed -i 's/opengrok-mirror/#opengrok-mirror/g' /scripts/index.sh #+end_src - You can manually trigger an reindex using docker exec. #+begin_src shell $ sudo docker exec -it opengrok /scripts/index.sh #+end_src *** Setup opengrok (v1.13) #+begin_src shell $ docker run -d --name opengrok -p 8080:8080/tcp -e NOMIRROR=1 -e SYNC_PERIOD_MINUTES=0 -v /Users/bytedance/opengrok:/opengrok/src/ opengrok/docker:1.13 tail -f /dev/null $ docker exec -it opengrok bash > apt update && apt install -y vim > vim /scripts/start.py # Comment out the -H parameter (appears twice) and the --noIndex parameter in the code > source /venv/bin/activate > nohup env INDEXER_OPT="-I *.cpp -I *.hpp -I *.h -I *.c" python /scripts/start.py & #+end_src *** Setup opengrok-restful #+begin_src shell $ git clone https://github.com/RainMark/opengrok-restful.git ~/opengrok-restful #+end_src - Emacs config. #+begin_src elisp ;; opengrok-restful (add-to-list 'load-path "~/opengrok-restful") (require 'opengrok-restful) (setq opengrok-restful-source-directory "~/Projects") (global-set-key (kbd "M-d") 'opengrok-restful-lookup-def) (global-set-key (kbd "M-f") 'opengrok-restful-lookup-full) (global-set-key (kbd "M-s") 'opengrok-restful-lookup-symbol) (global-set-key (kbd "M-p") 'opengrok-restful-lookup-path) #+end_src - When you lookup symbol with opengrok-restful, Input nothing to lookup all projects that indexed, Input 'c' to lookup current project. [[./opengrok-restful.gif]] [[./opengrok-restful.png]]