working remote update uwu
This commit is contained in:
parent
abe9de3773
commit
2271bd86ba
2 changed files with 20 additions and 18 deletions
16
server.js
16
server.js
|
@ -79,12 +79,8 @@ module.exports = (client) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
app.get('/update', async (req, res) => {
|
app.get('/update', async (req, res) => {
|
||||||
if (req.headers.authorization !== 'Update') {
|
console.log(req.headers['user-agent']);
|
||||||
res.status(400).jsonp({
|
if (req.headers.authorization === 'Update') {
|
||||||
success: false,
|
|
||||||
message: 'You are not authorized to access this Endpoint'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
await exec('git pull')
|
await exec('git pull')
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
console.log('Pulled latest changes');
|
console.log('Pulled latest changes');
|
||||||
|
@ -92,7 +88,7 @@ module.exports = (client) => {
|
||||||
success: true,
|
success: true,
|
||||||
message: 'Successfully pulled latest changes'
|
message: 'Successfully pulled latest changes'
|
||||||
});
|
});
|
||||||
trying.edit('```fix\n' + r.stdout + '```');
|
//trying.edit('```fix\n' + r.stdout + '```');
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
res.status(400).jsonp({
|
res.status(400).jsonp({
|
||||||
|
@ -101,6 +97,12 @@ module.exports = (client) => {
|
||||||
});
|
});
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
res.status(400).jsonp({
|
||||||
|
success: false,
|
||||||
|
message: 'You are not authorized to access this Endpoint'
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(port /* , hostname */, () => {
|
app.listen(port /* , hostname */, () => {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<divide></divide>
|
<divide></divide>
|
||||||
<div class="socials">
|
<div class="socials">
|
||||||
{{#each social}}
|
{{#each social}}
|
||||||
<a rel="me" href="https://{{link}}" class="{{name}}">x
|
<a rel="me" href="https://{{link}}" class="{{name}}">
|
||||||
<svg width="40" height="40" role="img" viewBox="0 0 24 24">
|
<svg width="40" height="40" role="img" viewBox="0 0 24 24">
|
||||||
<title>{{name}} Icon</title>
|
<title>{{name}} Icon</title>
|
||||||
<path d="{{icon.path}}"></path>
|
<path d="{{icon.path}}"></path>
|
||||||
|
|
Loading…
Reference in a new issue