}
}, getContainers:async ( req, res, next ) => {
try {
- const { all } = req.body;
+ const { all } = req.query;
const containers = await docker.listContainers( { all } );
res.json( {
containers:containers.map( c => ({
const conn = new Client();
conn.on( 'ready', () => {
const commands = type === 'private' ? [`mkdir /opt/git/${ name }.git`, `cd /opt/git/${ name }.git`, `git init --bare`, `chown -R ${ user }:git /opt/git/${ name }.git`, `chmod -R u+rwX,go-rwx /opt/git/${ name }.git`,] : [`mkdir /opt/git/${ name }.git`, `cd /opt/git/${ name }.git`, `git init --bare --shared=group`, `chown -R ${ user }:git /opt/git/${ name }.git`, `chmod -R g+rwX /opt/git/${ name }.git`, `find /opt/git/${ name }.git -type d -exec chmod g+s {} \\;`, `git config core.sharedRepository group`,];
- console.log( commands );
- console.log( [...commands].join( ' && ' ) );
+
conn.exec( commands.join( ' && ' ), ( err, stream ) => {
if (err) {
conn.end();