From 0622363f32676c19985396177c93dbc58785925f Mon Sep 17 00:00:00 2001 From: jwansek Date: Tue, 20 Sep 2022 23:38:36 +0100 Subject: Renamed scripts, improved README.md --- README.md | 17 ++++++++++++++++- add_git_key | 5 ----- add_git_key.sh | 6 ++++++ del_repo | 10 ---------- del_repo.sh | 10 ++++++++++ gitscripts.conf.example | 2 +- restart_ui | 4 ---- restart_ui.sh | 4 ++++ rm_repo | 1 - rm_repo.sh | 1 + 10 files changed, 38 insertions(+), 22 deletions(-) delete mode 100755 add_git_key create mode 100755 add_git_key.sh delete mode 100755 del_repo create mode 100755 del_repo.sh delete mode 100755 restart_ui create mode 100755 restart_ui.sh delete mode 120000 rm_repo create mode 120000 rm_repo.sh diff --git a/README.md b/README.md index d7aa964..54a0ea1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # git-scripts -Scripts used for configuration of my git server - git.eda.gay +Interactive scripts used for configuration of my git server - git.eda.gay + +## Scripts + +It is recommended to make symlinks to the home directory- e.g.: +`ln -s $(pwd)/add_git_key.sh ~/add_git_key && chmod +x ~/add_git_key` +`ln -s $(pwd)/del_repo.sh ~/del_repo && chmod +x ~/del_repo` +`ln -s $(pwd)/make_repo.py ~/make_repo && chmod +x ~/make_repo` +`ln -s $(pwd)/show_gitkey.py ~/show_gitkey && chmod +x ~/show_gitkey` +`ln -s $(pwd)/del_repo.sh ~/rm_repo && chmod +x ~/rm_repo` + +Then repositories can be created with `ssh git@git.eda.gay "./make_repo"` or removed with `ssh git@git.eda.gay "./rm_repo"`. + +## Web UI + +Repositories that are set to public are rendered using [klaus](https://github.com/jonashaag/klaus), using a custom CSS file and Dockerfile. This is in the `klaus/` directory. diff --git a/add_git_key b/add_git_key deleted file mode 100755 index 6c2f3c4..0000000 --- a/add_git_key +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -gh ssh-key add $1 --title $2 - -rm $1 diff --git a/add_git_key.sh b/add_git_key.sh new file mode 100755 index 0000000..222993f --- /dev/null +++ b/add_git_key.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +gh ssh-key add $1 --title $2 + +rm $1 +echo "Successfully added new key with title " $2 diff --git a/del_repo b/del_repo deleted file mode 100755 index 5f2f1c3..0000000 --- a/del_repo +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -echo -n "Input repo name to delete (excluding the .git suffix): " -read repo - -rm -fvr /srv/git/$repo.git -rm -fvr ~/$repo* -rm -fv /srv/www/repositories/$repo* - -bash /srv/www/git-scripts/restart_ui diff --git a/del_repo.sh b/del_repo.sh new file mode 100755 index 0000000..efd3421 --- /dev/null +++ b/del_repo.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo -n "Input repo name to delete (excluding the .git suffix): " +read repo + +rm -fvr /srv/git/$repo.git +rm -fvr ~/$repo* +rm -fv /srv/www/repositories/$repo* + +bash /srv/www/git-scripts/restart_ui.sh diff --git a/gitscripts.conf.example b/gitscripts.conf.example index ee273b0..f35faba 100755 --- a/gitscripts.conf.example +++ b/gitscripts.conf.example @@ -4,7 +4,7 @@ repo_meta_path = /srv/www/repositories domain = git.eda.gay gitignore_templates = /srv/www/gitignore license_templates = /srv/www/license-templates/templates -restart_ui_cmd = bash /srv/www/git-scripts/restart_ui +restart_ui_cmd = bash /srv/www/git-scripts/restart_ui.sh [github] user = jwansek diff --git a/restart_ui b/restart_ui deleted file mode 100755 index 806358d..0000000 --- a/restart_ui +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "Restarting web UI docker container..." -ssh root@192.168.1.5 "cd /media/gitwww/git-scripts/klaus && docker-compose restart" diff --git a/restart_ui.sh b/restart_ui.sh new file mode 100755 index 0000000..806358d --- /dev/null +++ b/restart_ui.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Restarting web UI docker container..." +ssh root@192.168.1.5 "cd /media/gitwww/git-scripts/klaus && docker-compose restart" diff --git a/rm_repo b/rm_repo deleted file mode 120000 index 872ba03..0000000 --- a/rm_repo +++ /dev/null @@ -1 +0,0 @@ -del_repo \ No newline at end of file diff --git a/rm_repo.sh b/rm_repo.sh new file mode 120000 index 0000000..467611c --- /dev/null +++ b/rm_repo.sh @@ -0,0 +1 @@ +del_repo.sh \ No newline at end of file -- cgit v1.2.3