diff --git a/inc/config.php b/inc/config.php index 0e255118..d575418e 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1931,17 +1931,6 @@ // Example: Add links to dashboard (will all be in a new "Other" category). // $config['mod']['dashboard_links']['Something'] = '?/something'; - // Remote servers. I'm not even sure if this code works anymore. It might. Haven't tried it in a while. - // $config['remote']['static'] = array( - // 'host' => 'static.example.org', - // 'auth' => array( - // 'method' => 'plain', - // 'username' => 'username', - // 'password' => 'password!123' - // ), - // 'type' => 'scp' - // ); - // Create gzipped static files along with ungzipped. // This is useful with nginx with gzip_static on. $config['gzip_static'] = false; diff --git a/inc/functions.php b/inc/functions.php index 6c25cd34..fed808c7 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -636,14 +636,8 @@ function file_write($path, $data, $simple = false, $skip_purge = false) { global $config, $debug; if (preg_match('/^remote:\/\/(.+)\:(.+)$/', $path, $m)) { - if (isset($config['remote'][$m[1]])) { - require_once 'inc/remote.php'; - - $remote = new Remote($config['remote'][$m[1]]); - $remote->write($data, $m[2]); - return; - } else { - error('Invalid remote server: ' . $m[1]); + if (isset($config['remote'])) { + error('Remote server support has been removed'); } } diff --git a/inc/remote.php b/inc/remote.php deleted file mode 100644 index 6a685e82..00000000 --- a/inc/remote.php +++ /dev/null @@ -1,64 +0,0 @@ - $value) { - $this->{$name} = $value; - } - - $methods = array(); - - if (!isset($this->auth['method'])) - error('Unspecified authentication method.'); - - // Connect - $this->connection = ssh2_connect($this->host, isset($this->port) ? $this->port : 22, $methods); - - switch ($this->auth['method']) { - case 'pubkey': - - if (!isset($this->auth['public'])) - error('Public key filename not specified.'); - if (!isset($this->auth['private'])) - error('Private key filename not specified.'); - - if (!ssh2_auth_pubkey_file($this->connection, $this->auth['username'], $this->auth['public'], $this->auth['private'], isset($this->auth['passphrase']) ? $this->auth['passphrase']: null)) - error('Public key authentication failed.'); - break; - case 'plain': - if (!ssh2_auth_password($this->connection, $this->auth['username'], $this->auth['password'])) - error('Plain-text authentication failed.'); - break; - default: - error('Unknown authentication method: "' . $this->auth['method'] . '".'); - } - - } - - public function write($data, $remote_path) { - global $config; - - switch ($this->type) { - case 'sftp': - $sftp = ssh2_sftp($this->connection); - file_write('ssh2.sftp://' . $sftp . $remote_path, $data, true); - break; - case 'scp': - $file = tempnam($config['tmp'], 'tinyboard-scp'); - // Write to temp file - file_write($file, $data); - - ssh2_scp_send($this->connection, $file, $remote_path, 0755); - break; - default: - error('Unknown send method.'); - } - } -}; -