Removed keys from broker code, retired keys in commit history, and moved key to secret file.

This commit is contained in:
caes 2020-05-28 03:29:12 -04:00
parent cd969ada4f
commit 3496955095
2 changed files with 36 additions and 14 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
errors
.eslintrc.json
gitlab_read.pat

View File

@ -231,10 +231,12 @@ get_remote_ssh_port () {
get_remote_user () {
local user=$(get_data $* remote user)
if [[ -z $user ]]; then
user=$dealer
if [[ -z $user ]] || [[ $user == "null" ]]; then
echo $dealer
else
echo $user
fi
echo $user
return
}
######################################################################
@ -556,17 +558,9 @@ cluster_info () {
# new gitlab
gitlab_http_port="45080"
gitlab_ssh_port="45022"
gitlab_read_token="uYoP-1HRpvMx3MWoRDHF"
# old gitlab (overwriting new)
gitlab_http_port="45000"
gitlab_ssh_port="45002"
gitlab_read_token="JF1ymVmbfe1cp4z8eKKb"
#master token overwrite
#gitlab_read_token="G3Z9G5HeiTp74zFfeUnN"
gitlab_token="$gitlab_read_token"
gitlab_owner="$dealer"
gitlab_token=$(gitlab_get_token)
gitlab_url="gitlab.adamo.network"
gitlab_http_url="http://${gitlab_url}:${gitlab_http_port}"
gitlab_ssh_url="ssh://git@${gitlab_url}:${gitlab_ssh_port}"
@ -591,6 +585,28 @@ git_update_self () {
cd ${owd}
}
git_pull_all () {
owd=`pwd`
for gitdir in `git_list_dirs_under $1`; do
local dir=$(dirname $gitdir)
if [[ $TESTING_MODE ]]; then
pr_vars dir owd
else
cd $dir
git pull
cd $owd
fi
done
}
git_list_dirs_under () {
find $1 -type d -a -name '.git'
}
gitlab_get_token () {
cat ${program_root}/gitlab_read.pat
}
# $1: directory
# $2: gitlab namespace path (this better exist!)
gitlab_create_project_from_repo () {
@ -609,14 +625,19 @@ gitlab_create_project_from_repo () {
else
local uri="${gitlab_ssh_url}"
fi
echo git push --set-upstream ${uri}/${name}.git $branch
pr_vars uri name branch
if [[ $TESTING_MODE ]]; then
echo git push --set-upstream ${uri}.git $branch
else
git push --set-upstream ${uri}.git $branch
fi
cd $owd
return 0
}
gitlab_create_projects_for_all_in_dir () {
local root=$1
for gitdir in `find $root -type d -a -name '.git'`; do
for gitdir in `git_list_dirs_under $root`; do
local dir=$(dirname $gitdir)
local path=$(echo $dir|sed "s|${root}/||")
gitlab_create_project_from_repo $dir $path