Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lovelace
webLovelace
Commits
b9489938
Commit
b9489938
authored
Feb 26, 2017
by
Alejandro E. Rendon
Browse files
Test in .bashrc
parent
8388ce5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
helpers/user.js
View file @
b9489938
...
...
@@ -69,12 +69,7 @@ exports.getLinuxId = callback => {
};
exports
.
createUser
=
(
uid
,
user
,
callback
)
=>
{
const
path
=
'
useradd -u
'
+
uid
+
'
-G adm,cdrom,dip,plugdev,lpadmin,sambashare -d /homeshare/
'
+
user
.
username
+
'
-m
'
+
user
.
username
;
const
path
=
`useradd -u
${
uid
}
-G adm,cdrom,dip,plugdev,lpadmin,sambashare -d /homeshare/
${
user
.
username
}
-m
${
user
.
username
}
`
;
exec
(
path
,
(
err
,
stdout
,
stderr
)
=>
{
if
(
err
)
...
...
@@ -120,8 +115,16 @@ exports.sshKey = (user, callback) => {
const
pathKey
=
`ssh-keygen -b 2048 -t rsa -f /homeshare/
${
user
.
username
}
/.ssh/id_rsa -q -N ""`
,
autKeys
=
`cat /homeshare/
${
user
.
username
}
/.ssh/id_rsa.pub >> /homeshare/
${
user
.
username
}
/.ssh/authorized_keys`
,
add
=
`'if type keychain >/dev/null 2>/dev/null; then'`
,
pathSSH
=
'
echo
'
+
add
+
'
>> /homeshare/
'
+
user
.
username
+
'
/.bashrc
'
;
pathSSH
=
`echo "if type keychain >/dev/null 2>/dev/null; then
keychain --nogui -q .ssh/id_rsa
[ -f ~/.keychain/$"`
,
pathSSH2
=
`echo "{HOSTNAME}-sh ] && . ~/.keychain/$"`
,
pathSSH3
=
`echo "{HOSTNAME}-sh
[ -f ~/.keychain/$"`
,
pathSSH4
=
`echo "{HOSTNAME}-sh-gpg ] && . ~/.keychain/$"`
,
pathSSH5
=
`echo "{HOSTNAME}-sh-gpg
fi"`
,
fileSSH
=
'
>> /homeshare/
'
+
user
.
username
+
'
/.bashrc
'
;
console
.
log
(
pathSSH
);
ssh
.
exec
(
pathKey
,
{
...
...
@@ -130,18 +133,42 @@ exports.sshKey = (user, callback) => {
return
callback
(
stderr
);
}
})
// .exec(autKeys, {
// err: stderr => {
// console.log(stderr);
// return callback(stderr);
// }
// })
// .exec(pathSSH, {
// err: stderr => {
// console.log(stderr);
// return callback(stderr);
// }
// })
.
exec
(
autKeys
,
{
err
:
stderr
=>
{
console
.
log
(
stderr
);
return
callback
(
stderr
);
}
})
.
exec
(
pathSSH
+
fileSSH
,
{
err
:
stderr
=>
{
console
.
log
(
stderr
);
return
callback
(
stderr
);
}
})
.
exec
(
pathSSH2
+
fileSSH
,
{
err
:
stderr
=>
{
console
.
log
(
stderr
);
return
callback
(
stderr
);
}
})
.
exec
(
pathSSH3
+
fileSSH
,
{
err
:
stderr
=>
{
console
.
log
(
stderr
);
return
callback
(
stderr
);
}
})
.
exec
(
pathSSH4
+
fileSSH
,
{
err
:
stderr
=>
{
console
.
log
(
stderr
);
return
callback
(
stderr
);
}
})
.
exec
(
pathSSH5
+
fileSSH
,
{
err
:
stderr
=>
{
console
.
log
(
stderr
);
return
callback
(
stderr
);
}
})
.
start
();
return
callback
(
null
);
...
...
npm-debug.log
0 → 100644
View file @
b9489938
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'start' ]
2 info using npm@4.1.2
3 info using node@v7.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle webLovelace@0.0.0~prestart: webLovelace@0.0.0
6 silly lifecycle webLovelace@0.0.0~prestart: no script for prestart, continuing
7 info lifecycle webLovelace@0.0.0~start: webLovelace@0.0.0
8 verbose lifecycle webLovelace@0.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle webLovelace@0.0.0~start: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/arendon/Documents/webLovelace/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
10 verbose lifecycle webLovelace@0.0.0~start: CWD: /home/arendon/Documents/webLovelace
11 silly lifecycle webLovelace@0.0.0~start: Args: [ '-c', 'supervisor -e \'js|node|coffee|ejs|json\' ./bin/www' ]
12 silly lifecycle webLovelace@0.0.0~start: Returned: code: 1 signal: null
13 info lifecycle webLovelace@0.0.0~start: Failed to exec start script
14 verbose stack Error: webLovelace@0.0.0 start: `supervisor -e 'js|node|coffee|ejs|json' ./bin/www`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:192:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:192:7)
14 verbose stack at maybeClose (internal/child_process.js:890:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid webLovelace@0.0.0
16 verbose cwd /home/arendon/Documents/webLovelace
17 error Linux 4.4.0-64-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
19 error node v7.5.0
20 error npm v4.1.2
21 error code ELIFECYCLE
22 error webLovelace@0.0.0 start: `supervisor -e 'js|node|coffee|ejs|json' ./bin/www`
22 error Exit status 1
23 error Failed at the webLovelace@0.0.0 start script 'supervisor -e 'js|node|coffee|ejs|json' ./bin/www'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the webLovelace package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error supervisor -e 'js|node|coffee|ejs|json' ./bin/www
23 error You can get information on how to open an issue for this project with:
23 error npm bugs webLovelace
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls webLovelace
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment