Paste tool with inline commenting support.
# Cloning repo
git clone [email protected]:tunglam14/pikabin.git
cd pikabin/
# Setup
export RAILS_ENV=production
bundle install
# Config db
vim config/database.yml
cat config/database.yml
#production:
# adapter: sqlite3
# pool: 5
# timeout: 5000
# database: /var/run/pikabin_production.sqlite3
bundle exec rake db:migrate
bundle exec rake assets:precompile
# Start service with puma
SECRET_KEY_BASE=$(bundle exec rake secret) bundle exec puma
# Listening on tcp://127.0.0.1:8080
curl -X POST -H "content-type: application/json" -d '{ "document": { "content": "asdasdsd" } }' "http://localhost:3000"
# Response
{"message":"","uri":"http://localhost:3000/31037f223195e451e0ebe56e8e041d0c756bc"}
Header:
* Conten-type: application/json
Body:
{
"document": {
"content": "Paste content",
"title": "Paste title | can be empty | Default: empty",
"expired_at": "Expiration time in minute | 0: delete after reading | -1: No expire | Default: 0",
"syntax": "Paste color syntax | See more: https://github.com/tunglam14/pikabin/blob/master/config/initializers/00contants.rb#L1 | Default: plain"
}
}
Code: 201
Body:
{
"message": "",
"uri": "https://pikab.in/e90e9f9ff807091bb589b0e4db203bc3e92c4"
}
Code: 400
Body:
{
"message": [
"Content can't be blank"
],
"uri": ""
}
raw:
curl https://pikab.in/936279c6f3.raw
assasasss
json:
curl https://pikab.in/936279c6f3.json
{"content_decrypted":"assasasss ","title":"","expired_at":"-1","syntax":"plain"}
- Python: pikapy by @kinhvan017
- Golang: pikago by @Gnouc
-
Security:
- Encrypt content with random password: [...]
- Don't log password, request URI in production environment
- Remove expired document immediately [...]
- Remove document after reading
-
UI:
- Front-end framework: Semantic-UI
- Editor: ACE Editor
- Syntax highlighting: SyntaxHighlighter
Your contribution are welcome, desired features are in TODO.md