Git Product home page Git Product logo

online-clipboard's Introduction

Online Clipboard

Public Service

I have already built a public service. You can just visit or use this tool by below ways.

Web Client

https://oc.to0l.cn

Android App

http://fir.akawa.ink/onlinecb

iOS App

https://apps.apple.com/us/app/%E7%BD%91%E7%BB%9C%E5%89%AA%E5%88%87%E6%9D%BF/id1485974770

Cli Way

# Path: https://oc.to0l.cn/ws/[clipname]/[password]

# Send Case(clipbord name and password are all **public**)
curl https://oc.to0l.cn/ws/public/public -d "this is a test message"
curl https://oc.to0l.cn/ws/public/public -d "$(cat /etc/v2ray/config.json)"

# Receive Case(clipbord name and password are all **public**)
curl https://oc.to0l.cn/ws/public/public

Notation: The cli way only supports https protocol.

Deploy

# Get Code
git clone https://github.com/ety001/online-clipboard.git

# Build a docker image
cd online-clipboard
docker build -t online_clipboard .

# Create a private docker network
docker network create --gateway "172.20.0.1" --subnet "172.20.0.0/24" oc

# Run a redis database
docker run -itd \
  --name db \
  -v /data/redis_data:/data \
  --network oc \
  --ip "172.20.0.2" \
  redis:alpine3.13

# Run the service
docker run -itd \
  -p 80:80 -p 8080:8080 \
  --name online_clipboard \
  --network oc --ip "172.20.0.3" \
  -e "DB_PORT_6379_TCP_ADDR=172.20.0.2" \
  -e "DB_PORT_6379_TCP_PORT=6379" \
  online_clipboard

Manual Deploy

Prepare Env

apt update

apt install redis-server php-pear php7.3-dev php7.3-xml redis-server

pecl install swoole redis

Check Service

php -m | grep redis

php -m | grep swoole

Enable Redis in PHP

echo "<?php phpinfo();" > info.php

php info.php | grep php.ini

If there has no reids or swoole extension displayed

vim /etc/php/7.3/cli/php.ini and add

extension=redis.so
extension=swoole.so

Edit Configuation & Run

git clone https://github.com/ety001/online-clipboard.git php server.php

The App Source Code

https://github.com/ety001/oc_flutter


在线剪切板

公共服务

我已经搭建了可以使用的公共服务

网页版

https://oc.to0l.cn

Android App

http://fir.akawa.ink/onlinecb

iOS App

https://apps.apple.com/us/app/%E7%BD%91%E7%BB%9C%E5%89%AA%E5%88%87%E6%9D%BF/id1485974770

cli端

# Cli端使用说明

# 接口地址: https://oc.to0l.cn/ws/[clipname]/[password]

# 发送示例(剪切板名和密码都是 public)
curl https://oc.to0l.cn/ws/public/public -d "this is a test message"
curl https://oc.to0l.cn/ws/public/public -d "$(cat /etc/v2ray/config.json)"

# 接收示例(剪切板名和密码都是 public)
curl https://oc.to0l.cn/ws/public/public

注意 cli 端只支持 https

部署

#获取服务端代码
git clone https://github.com/ety001/online-clipboard.git

#服务端代码封装成docker镜像
cd online-clipboard
docker build -t ety001/online_clipboard .

#创建网络
docker network create --gateway "172.20.0.1" --subnet "172.20.0.0/24" oc

#运行redis
docker run -itd --name db --network oc --ip "172.20.0.2" microbox/redis

#运行服务端和前端
docker run -itd \
  -p 80:80 -p 8080:8080 \
  --name online_clipboard \
  --network oc --ip "172.20.0.3" \
  -e "DB_PORT_6379_TCP_ADDR=172.20.0.2" \
  -e "DB_PORT_6379_TCP_PORT=6379" \
  ety001/online_clipboard

手动部署

安装环境

apt update

apt install redis-server php-pear php7.3-dev php7.3-xml redis-server

pecl install swoole redis

检查

php -m | grep redis

php -m | grep swoole

检查如果没有开启则修改配置

echo "<?php phpinfo();" > info.php

php info.php | grep php.ini

vim /etc/php/7.3/cli/php.ini 在里面添加

extension=redis.so
extension=swoole.so

修改config并运行server端

git clone https://github.com/ety001/online-clipboard.git

php server.php

App源码

https://github.com/ety001/oc_flutter

online-clipboard's People

Contributors

ancientwood avatar ety001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

online-clipboard's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.