remove server::* commands (they no longer work inside of the docker container)
This commit is contained in:
parent
711ea15347
commit
486f5c837e
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
require_once (__DIR__ . '/../internals/website.php');
|
||||
|
||||
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
|
||||
/** @var URLRoute $ROUTE */ global $ROUTE;
|
||||
/** @var Website $SITE */ global $SITE;
|
||||
|
||||
|
||||
if (!isset($API_OPTIONS['folder'])) { $FRAME_OPTIONS->forceResult(400, "Wrong parameters."); return; }
|
||||
if (!isset($API_OPTIONS['filename'])) { $FRAME_OPTIONS->forceResult(400, "Wrong parameters."); return; }
|
||||
|
||||
$folder = $API_OPTIONS['folder'];
|
||||
$filename = $API_OPTIONS['filename'];
|
||||
$uri = $ROUTE->full_url;
|
||||
|
||||
$reltarget = "Backup/$folder/$filename";
|
||||
|
||||
$putdata = fopen("php://input", "r");
|
||||
$fp = tmpfile();
|
||||
$tmppath = stream_get_meta_data($fp)['uri'];
|
||||
while ($data = fread($putdata, 1024)) fwrite($fp, $data);
|
||||
fclose($putdata);
|
||||
|
||||
$std = shell_exec("ncc_upload " . '"' . $tmppath . '" "' . $reltarget . '" 2>&1');
|
||||
|
||||
fclose($fp);
|
||||
|
||||
$content = "REQUEST: " . $uri . "\n\n" .
|
||||
"IP: " . get_client_ip() . "\n\n" .
|
||||
"TARGET: " . $reltarget . "\n\n" .
|
||||
"OUTPUT: " . $std . "\n\n";
|
||||
|
||||
sendMail("Fileupload to '$folder' triggered", $content, 'virtualadmin@mikescher.de', 'webserver-info@mikescher.com');
|
||||
|
||||
echo "OK.\n\n";
|
||||
echo $content;
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
require_once (__DIR__ . '/../internals/website.php');
|
||||
|
||||
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
|
||||
/** @var URLRoute $ROUTE */ global $ROUTE;
|
||||
/** @var Website $SITE */ global $SITE;
|
||||
|
||||
|
||||
if (!isset($API_OPTIONS['target'])) { $FRAME_OPTIONS->forceResult(400, "Wrong parameters."); return; }
|
||||
|
||||
$hook = $API_OPTIONS['target'];
|
||||
$uri = $ROUTE->full_url;
|
||||
|
||||
$cmd = "";
|
||||
|
||||
if ($hook == 'website_mikescher')
|
||||
$cmd = 'git fetch ; git reset origin/master --hard';
|
||||
else if ($hook == 'griddominance')
|
||||
$cmd = 'update-gdapi';
|
||||
else
|
||||
{
|
||||
$FRAME_OPTIONS->forceResult(400, "Unknown webhook: $hook");
|
||||
return;
|
||||
}
|
||||
|
||||
$std = shell_exec($cmd);
|
||||
|
||||
$content = "REQUEST: " . $uri . "\n\n" .
|
||||
"IP: " . get_client_ip() . "\n\n" .
|
||||
"TARGET: " . $hook . "\n\n" .
|
||||
"OUTPUT: " . $std . "\n\n";
|
||||
|
||||
sendMail("Webhook '$hook' triggered", $content, 'virtualadmin@mikescher.de', 'webserver-info@mikescher.com');
|
||||
|
||||
echo "{ 'status': 'ok', 'message': 'Webhook '$hook' triggered' }";
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
require_once (__DIR__ . '/../internals/website.php');
|
||||
|
||||
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
|
||||
/** @var URLRoute $ROUTE */ global $ROUTE;
|
||||
/** @var Website $SITE */ global $SITE;
|
||||
|
||||
$ip = get_client_ip();
|
||||
|
||||
file_put_contents(__DIR__ . '/../dynamic/self_ip_address.auto.cfg', $ip);
|
||||
|
||||
system('ipguard add "' . $ip . '"');
|
||||
|
||||
echo 'Ok.';
|
@ -22,10 +22,6 @@ $API_COMMANDS =
|
||||
'site::selftest' => [ 'src' => __DIR__.'/../commands/site_selftest.php', 'auth' => 'admin' ],
|
||||
'site::gitinfo' => [ 'src' => __DIR__.'/../commands/site_gitinfo.php', 'auth' => 'admin' ],
|
||||
|
||||
'server::setselfaddress' => [ 'src' => __DIR__.'/../commands/server_setselfaddress.php', 'auth' => 'none' ],
|
||||
'server::gitwebhook' => [ 'src' => __DIR__.'/../commands/server_gitwebhook.php', 'auth' => 'webhook_secret' ],
|
||||
'server::backupupload' => [ 'src' => __DIR__.'/../commands/server_backupupload.php', 'auth' => 'upload_secret' ],
|
||||
|
||||
'extendedgitgraph::status' => [ 'src' => __DIR__.'/../commands/extendedgitgraph_status.php', 'auth' => 'ajax_secret' ],
|
||||
'extendedgitgraph::redraw' => [ 'src' => __DIR__.'/../commands/extendedgitgraph_redraw.php', 'auth' => 'ajax_secret' ],
|
||||
'extendedgitgraph::refresh' => [ 'src' => __DIR__.'/../commands/extendedgitgraph_refresh.php', 'auth' => 'ajax_secret' ],
|
||||
|
Loading…
Reference in New Issue
Block a user