Git Product home page Git Product logo

secusu / secusu Goto Github PK

View Code? Open in Web Editor NEW
32.0 3.0 11.0 585 KB

SЁCU is a public API to store self-destructing data payloads with url shortener and handle anonymous chat-rooms.

Home Page: https://secu.su

License: Other

PHP 95.76% Vue 0.39% Shell 0.63% Blade 0.78% Dockerfile 1.07% Makefile 1.38%
destructing-data-payloads encrypt decrypt secu messenger cybercog package application url-shortener privacy

secusu's Introduction

SЁCU

Discord Build Status Latest Stable Version License

Introduction

SЁCU is a public API to store self-destructing data payloads. This repository includes only backend part using Laravel framework.

Frontend could be found in SЁCU web application repository.

Contents

Features

Configuration

Create environment configuration file from example

$ cp .env.example .env

Specify your environment parameters in .env file

$ vi .env

Installation

Install PHP dependencies

$ composer install

Generate application secret key

$ php artisan key:generate

Perform database migrations

$ php artisan migrate

If you need to run node.js chat server install JavaScript dependencies

$ npm install

Add CRON entry to your OS

* * * * * php /path/to/secu/artisan schedule:run >> /dev/null 2>&1

This will run schedule commands every minute. Schedule will delete outdated records.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please refer to CONTRIBUTING.md for information on how to contribute to SЁCU and its related projects.

Testing

Run the tests with:

$ vendor/bin/phpunit

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributors

@antonkomarev
Anton Komarev

SЁCU contributors list

License

The SЁCU application is an open-sourced software licensed under the BSD 3-Clause License.

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research best solutions in product & software development is our passion.

CyberCog

secusu's People

Contributors

antonkomarev avatar dependabot[bot] 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  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

secusu's Issues

Add websocket support

Add websocket support to fire realtime events to frontend as soon as new SЁCU record will be created.

It could be used for:

  • Increment total SЁCU records created count.
  • Receive link to created record without blocking interface and waiting for a server response.

We can use Nginx push stream module to implement this feature.

Private websocket rooms

Add Skype bot

Add Skype bot listener similar to the Telegram bot.

Add terminal command secu

Create terminal command secu using Node.js.

Command should be installable using NPM package manager.

npm install -g secu

After that terminal command will be available.

$ secu -p -t text string -f /path/to/file

Input password

> Sup3rs3cur3dp4ssw0rd

Here you are: https://secu.su/HASH

As result user will get link with created SЁCU.

Rooms API

Define connection

var chat = io.connect({WS_HOSTNAME} + ':' + {WS_PORT} + '/r', {secure: true})

Create room

chat.emit('room.create', {
    password: '{PASSWORD}'
});

On success:

  • room is created;
  • the room's hash is sent to the client;
  • the provided password is encrypted using bcrypt and saved as room.password in database;

After that client should manually perform Join room using password again.

Success events

chat.on('room.create', {
    success: true,
    room: '{ROOM_NAME}'
});

Fail events

chat.on('room.create', {
    success: false,
    errors: ['Error message 1', 'Error message 2']
});

Join room

chat.emit('room.join', {
    room: '{ROOM_NAME}',
    password: '{PASSWORD}'
});

Success events

Name: room.join
Recipients: Initiator
Description: User receives self state in room.

chat.on('room.join', {
    success: true,
    name: user.name
})

Name: room.roster
Recipients: Active room users (including initiator)
Description: All users in room receives updated room roster as users objects.

chat.on('room.roster', [
    {name: "User 1"},
    {name: "User 2"}
])

Fail events

Name: room.join
Recipients: Initiator
Description: User informed that authentication has been failed.

chat.on('room.join', {
    success: false,
    room: room
});

Name: room.join.attempt
Recipients: Active room users
Description: All users in room receives information that somebody has failed authentication.

chat.on('room.join.attempt', {
    success: false,
    room: room,
    errors: ['Somebody tried to join room with empty password']
});

Leave room

chat.emit('room.leave' {
    room: '{ROOM_NAME}'
});

Success events

Name: room.leave
Recipients: Initiator
Description: User receives info that he left the room.

chat.on('room.leave', {
    success: true
})

Name: room.roster
Recipients: Active room users
Description: All users in room receives updated room roster as users objects.

chat.on('room.roster', [
    {name: "User 1"},
    {name: "User 2"}
])

Fail events

chat.on('room.leave', {
    success: false,
    errors: ['Empty arguments']
});

Send message

chat.emit('room.data', {
    room: '{ROOM_NAME}',
    data: 'STRING'
});

Success events

chat.on('room.data', {
    success: true,
    sender: '{USER_NAME}',
    data: '{JSON_DATA}'
});

Fail events

chat.on('room.data', {
    success: false,
    errors: ['Empty arguments']
});
chat.on('room.data.attempt', {
    success: false,
    errors: ['Somebody tried to send message without authorization']
});

Add server-side encryption

Add optional server-side encryption which will be used for 3rd party software data protection (Telegram\Skype bots).

Remove empty chat rooms

Room self-destruction countdown starts when last active user leave it.

Any successful join to room stops and resets countdown.

Telegram bot password protection

Allow Telegram users to set password while sending the message.

Password should be prefixed with /p command and wrapped with spaces or it can be replaced with the new line on the right side.

Password wrapped with spaces:

/p PASSWORD user message goes here

Password with space on the left and new line on the right:

/p PASSWORD
user message
goes here

[todo] Add rooms support

  • Room hash generating automatically on create room command.
  • Guest can join to rooms by their hash and password.
  • Client can send messages to room.
  • #18 Private websocket rooms
  • Clients can see each member in the room.
  • Clients can recieve messages inside in the room if authorized.
  • Client browser ignores self-initiated websocket messages.
  • If room doesn't exists - display password form which will fail all the time.
  • If guest user post fails to join - all authenticated room users will be notified.
  • #14 Design API to provide frontend integration.

PHP WebSockets

Use PHP WebSockets instead of Node.js to make deployment & maintenance processes easier.

Related to: #23 #22 #19

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.