|
|
|
|
|
|
|
|
module.exports = ((name, options)=>{ |
|
|
module.exports = ((name, options)=>{ |
|
|
|
|
|
|
|
|
options = options || { username : ``, reposerver : `https://git.bbh.org.in` } |
|
|
|
|
|
|
|
|
options = options || { username : `guest`, reposerver : `https://git.bbh.org.in`, password : `noneforguest` } |
|
|
utils = options.utils |
|
|
utils = options.utils |
|
|
|
|
|
|
|
|
// Default set of users in main repos. |
|
|
// Default set of users in main repos. |
|
|
|
|
|
|
|
|
'chess' : { |
|
|
'chess' : { |
|
|
priority : 0, |
|
|
priority : 0, |
|
|
// PB : TODO -- Handle cases where a repository url can be accessed by multiple users... |
|
|
// PB : TODO -- Handle cases where a repository url can be accessed by multiple users... |
|
|
server : `${options.reposerver}`, user : options.username || '', path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/chess/${this.path}`} // fetch |
|
|
|
|
|
|
|
|
server : `${options.reposerver}`, user : { username : options.username || ''}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.owner}`} // fetch |
|
|
, push : 'no-pushing' |
|
|
, push : 'no-pushing' |
|
|
, title : 'chess' |
|
|
, title : 'chess' |
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, owner : 'chess' |
|
|
} |
|
|
} |
|
|
, 'chess-public' : { priority : 1, |
|
|
, 'chess-public' : { priority : 1, |
|
|
server : `https://git.bbh.org.in`, user : options.username || '', path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/chess/${this.path}`} |
|
|
|
|
|
|
|
|
server : `https://git.bbh.org.in`, user : { username : options.username || ''}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.owner}`} |
|
|
, title : 'chess-public' // PB : TODO -- rename... |
|
|
, title : 'chess-public' // PB : TODO -- rename... |
|
|
, accessibility : ['public'] |
|
|
, accessibility : ['public'] |
|
|
, push : 'no-pushing' |
|
|
, push : 'no-pushing' |
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, owner : 'chess' |
|
|
} |
|
|
} |
|
|
// PB : TODO -- Load private repositories from private config... |
|
|
// PB : TODO -- Load private repositories from private config... |
|
|
, 'chess-private' : { priority : 2, |
|
|
, 'chess-private' : { priority : 2, |
|
|
server : `http://git.bbh`, user : options.username || '', path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/chess/${this.path}`} |
|
|
|
|
|
|
|
|
server : `http://git.bbh`, user : { username : options.username || ''}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.owner}`} |
|
|
, title : 'chess-private' |
|
|
, title : 'chess-private' |
|
|
, accessibility : ['private'] |
|
|
, accessibility : ['private'] |
|
|
, push : 'no-pushing', private : true |
|
|
, push : 'no-pushing', private : true |
|
|
} |
|
|
|
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, owner : 'chess' |
|
|
|
|
|
} |
|
|
, 'chess-github' : { priority : 3, |
|
|
, 'chess-github' : { priority : 3, |
|
|
server : `https://github.com`, user : 'baptistdev', path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch |
|
|
|
|
|
|
|
|
server : `https://github.com`, user : { username : 'baptistdev'}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.owner}`} // fetch |
|
|
, title : 'chess-github' |
|
|
, title : 'chess-github' |
|
|
, accessibility : ['public'] |
|
|
, accessibility : ['public'] |
|
|
, push : 'no-pushing' //, external : true, public : true |
|
|
|
|
|
|
|
|
, push : 'no-pushing' //, external : true, public : true |
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, owner : 'chess' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
utils.assign_core( { arraymergetype : utils.assign_core.DISTINCT_UNION } |
|
|
utils.assign_core( { arraymergetype : utils.assign_core.DISTINCT_UNION } |
|
|
, remotes |
|
|
, remotes |
|
|
, { 'userfork' : { |
|
|
, { 'userfork' : { |
|
|
priority : 1, |
|
|
|
|
|
server : `${options.reposerver}`, user : `${options.username}`, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch |
|
|
|
|
|
, title : 'userfork' |
|
|
|
|
|
|
|
|
priority : 1, |
|
|
|
|
|
server : `${options.reposerver}`, user : { username : `${options.username}`}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user.username}`} // fetch |
|
|
|
|
|
, title : 'userfork' |
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, get owner(){ return this.username } |
|
|
|
|
|
, pushable : true |
|
|
} |
|
|
} |
|
|
, 'userfork-public' : { |
|
|
, 'userfork-public' : { |
|
|
priority : 1, |
|
|
priority : 1, |
|
|
server : `https://git.bbh.org.in`, user : `${options.username}`, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user}/${this.path}`} |
|
|
|
|
|
|
|
|
server : `https://git.bbh.org.in`, user : {username : `${options.username}`}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user.username}`} |
|
|
// PB : TODO - Other users may have access to this users repo. However that needs to be defined as a new remote |
|
|
// PB : TODO - Other users may have access to this users repo. However that needs to be defined as a new remote |
|
|
, title : 'userfork-public' |
|
|
, title : 'userfork-public' |
|
|
, accessibility : ['public'] /*public : true, external: true */ |
|
|
, accessibility : ['public'] /*public : true, external: true */ |
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, get owner(){ return this.username } |
|
|
|
|
|
, pushable : true |
|
|
} |
|
|
} |
|
|
// PB : TODO -- Load private repositories from private config... |
|
|
// PB : TODO -- Load private repositories from private config... |
|
|
, 'userfork-private' : { priority : 2, |
|
|
, 'userfork-private' : { priority : 2, |
|
|
server : `http://git.bbh`, user : options.username || '', path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${options.username}/${this.path}`} |
|
|
|
|
|
|
|
|
server : `http://git.bbh`, user : { username : options.username || ''}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user.username}`} |
|
|
, title : 'userfork-private' |
|
|
, title : 'userfork-private' |
|
|
, accessibility : ['private'] |
|
|
, accessibility : ['private'] |
|
|
} |
|
|
|
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, get owner(){ return this.username } |
|
|
|
|
|
} |
|
|
, 'userfork-unc' : { |
|
|
, 'userfork-unc' : { |
|
|
priority : 3, |
|
|
priority : 3, |
|
|
server : `//172.16.0.27/repos`, user : `${options.username}`, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user}/${this.path}`} // fetch |
|
|
|
|
|
|
|
|
server : `//172.16.0.27/repos`, user : { username : `${options.username}`}, path : `` |
|
|
|
|
|
, get url(){ return `${this.server}/${this.user.username}`} // fetch |
|
|
, title : 'userfork-unc' |
|
|
, title : 'userfork-unc' |
|
|
, accessibility : ['unc'] |
|
|
, accessibility : ['unc'] |
|
|
// , unc : true, private : true |
|
|
// , unc : true, private : true |
|
|
} |
|
|
|
|
|
|
|
|
, get username(){ return this.user.username } |
|
|
|
|
|
, get owner(){ return this.username } |
|
|
|
|
|
, pushable : true |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
reposervers : Object.keys(reposerverinstances) |
|
|
reposervers : Object.keys(reposerverinstances) |
|
|
, reposerverinstances |
|
|
, reposerverinstances |
|
|
, remotes |
|
|
, remotes |
|
|
, get reposindexed(){ |
|
|
|
|
|
// PB : TODO -- Implement -- One time gettor and then cached... |
|
|
|
|
|
var indexed = {} |
|
|
|
|
|
this.repos.forEach(r => { indexed[r.repo] = r }) |
|
|
|
|
|
return indexed; |
|
|
|
|
|
} |
|
|
|
|
|
, repos : [ |
|
|
, repos : [ |
|
|
{ repo : 'elxr' } |
|
|
{ repo : 'elxr' } |
|
|
] |
|
|
] |