定制 frdl/smoke-share 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

frdl/smoke-share

Composer 安装命令:

composer require frdl/smoke-share

包简介

Smoke-Share Client forked from cyvax/privatebin_php with additional features.

关键字:

README 文档

README

This is an api client for PrivateBin written on PHP.

Smoke-Share Client forked from Privatebin_PHP cyvax/privatebin_php.

What's new?

In this fork I add the additional features and options provided by Smoke Share which are not in the Privatebin_PHP base class:

  • IP restriction (optional): The new field allowedips in the meta-section allows to send a comma seperated list of IP addresses. ONLY the given IPs are allowed to view the paste, any other clients cannot get the secret. If kept blank this option is disabled and EVERY client can get the paste.
  • Authorization (optional): Authorization will be added to the API (ToDo). Some features, e.g. never expire forever pastes, or less rate limits, will be restricted to registered and authorized clients. This will be added later, and if done, restrictions are applied if no token is send or if it is invalid, e.g. then the paste will be forced to have a time-limit or the client gets a lower traffic rate, or the max size will be limited.

Installing

Via composer: composer require frdl/smoke-share

Source code at Github

Dependencies

Tuupola Base58 : a Base58 encoder by Tuupola

Usage

By default Smoke Share configured to use https://smoke.tel/share/ for sending and receiving pastes.

You can parse config to a PrivatebinPHP object.

Example :
fast one with options passed as argument on creation :

use Frdlweb\SmokeShare;

$private =new SmokeShare(array(
    "url" => "https://smoke.tel/share/",
    "text" => "Because ignorance is bliss!",
    "allowedips" => implode(',', [$_SERVER['SERVER_ADDR'], $_SERVER['REMOTE_ADDR']]),
));
$posted = $private->encode_and_post();

It will send string Because ignorance is bliss! to Smoke Share.

Check Wiki for documentation.
The following methods where added by this fork:

Require valid SSL certificate

Should the PrivateBin Instance be required to have a valid ssl certificate?

public function set_ssl(bool $verify)
// $private->set_ssl(false); // NOT recommended!
$private->set_ssl(true);   // default

IP restriction by whitelist

Optionally you can specify one ore more IP addresses which are allowed to get, read and decrypt the paste. Any client with an IP not listed in this list will not be able to get the paste. The default value is empty and this restriction is disabled. This feature is available in my own fork ONLY and will not be supported by most privatebin instances so far!

public function set_ips(string | array $ips)
$private->set_ips([$_SERVER['SERVER_ADDR'], $_SERVER['REMOTE_ADDR'], '8.8.8.8', 'IP of authorized reciever, invalid IPs are ignored']);  

Send an Authorization header to the API

Optionally you can send an Authorization header along with the HTTP-Request to the privatebin server.

Authorization: [TYPE] [TOKEN]

This can be used optionally to request rate limit rates or features like never expire pastes from the server.

 public function set_token(string $token, string $type = 'Bearer')
$private->set_token('abc123...', 'Basic');  

GET and decrypt a paste [TODO]

Unfortunately this is not working yet. Maybe anyone can help further?

public function privatebin_get(string $url, ?string $password = null)

License

This project is licensed under the MIT license, which can be found in the file LICENSE in the root of the project source code.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固