Skip to content

Commit

Permalink
v1.0.0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
guyavrhm committed Jun 14, 2021
1 parent 8240d94 commit 125a50e
Show file tree
Hide file tree
Showing 49 changed files with 3,180 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ifeq ($(OS),Windows_NT)

all: aes-win files-win

aes-win: src/network/aes/aes.c src/network/aes/gmult.c
gcc -fPIC -shared -o src/network/aes/aes.dll src/network/aes/aes.c src/network/aes/gmult.c

files-win: src/hardware/clipboard/_win32/file2clip.cs
cd src/hardware/clipboard/_win32 && csc file2clip.cs

else

UNAME_S := $(shell uname -s)

ifeq ($(UNAME_S),Linux)
all: mod-lin aes-unix
mod-lin:
chmod +x src/hardware/clipboard/_xorg/xcopy.sh; \
chmod +x src/hardware/clipboard/_xorg/xpaste.sh
endif
ifeq ($(UNAME_S),Darwin)
all: mod-mac aes-unix
mod-mac:
chmod +x src/hardware/clipboard/_darwin/mcopy.sh; \
chmod +x src/hardware/clipboard/_darwin/mpaste.sh; \
chmod +x src/hardware/clipboard/_darwin/file2clip.applescript; \
chmod +x src/hardware/clipboard/_darwin/getfiles.applescript
endif

aes-unix: src/network/aes/aes.c src/network/aes/gmult.c
gcc -fPIC -shared -o src/network/aes/aes.so src/network/aes/aes.c src/network/aes/gmult.c

endif
112 changes: 112 additions & 0 deletions docs/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
body {
font-family: "Ubuntu";
margin: 0;
}

h1 {
font-size: 8rem;
font-weight: bold;
}

.nav-bar {
background-color: #f8f9fa;
position: fixed;
top: 0;
width: 100%;
}

.nav-link {
text-decoration: none;
color: inherit;
margin: 0 6px;
color: rgba(0,0,0,.5);
}

.nav-link:hover {
color: #5d5e61;
transition: all 0.3s ease;
}

.nav-items {
padding: 19px;
}

.title {
color: white;
text-align: center;
position: absolute;

left: 50%;
top: 35%;

margin-left: -129.095px;
margin-top: -71.5px;
}

section {
position: relative;
width: 100%;
height: 100vh;
background: #0094d3;
overflow: hidden;
}

section .wave {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100px;
background: url("../images/wave.png");
background-size: 1000px 100px;
}

section .wave.wave1 {
animation: animate 30s linear infinite;
z-index: 1000;
opacity: 1;
animation-delay: 0s;
bottom: 0;
}

section .wave.wave2 {
animation: animate2 15s linear infinite;
z-index: 999;
opacity: 0.5;
animation-delay: -5s;
bottom: 10px;
}

section .wave.wave3 {
animation: animate 30s linear infinite;
z-index: 998;
opacity: 0.2;
animation-delay: -2s;
bottom: 15px;
}

section .wave.wave4 {
animation: animate2 5s linear infinite;
z-index: 997;
opacity: 0.7;
animation-delay: -5s;
bottom: 20px;
}

@keyframes animate {
0% {
background-position-x: 0;
}
100% {
background-position-x: 1000px;
}
}

@keyframes animate2 {
0% {
background-position-x: 1000px;
}
100% {
background-position-x: 0;
}
}
Binary file added docs/images/flow.ico
Binary file not shown.
Binary file added docs/images/wave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>flow</title>
<link rel="icon" href="images/flow.ico">
<link rel="stylesheet" href="css/styles.css">

<link href="https://fonts.googleapis.com/css?family=Montserrat|Ubuntu" rel="stylesheet">
</head>
<body>

<div class="main">

<section>
<div class="title">
<h1><a href="https://github.com/guyavrhm/flow" style="text-decoration: none; color: inherit;">flow</a></h1>
</div>

<div class="wave wave1"></div>
<div class="wave wave2"></div>
<div class="wave wave3"></div>
<div class="wave wave4"></div>
</section>

</div>


<div class="nav-bar">

<div class="nav-items">
<a class="nav-link" href="https://github.com/guyavrhm/flow/blob/master/README.md#flow">About</a>
<a class="nav-link" href="https://github.com/guyavrhm/flow/blob/master/README.md#flow">Features</a>
<a class="nav-link" href="https://github.com/guyavrhm/flow/blob/master/README.md#installation">Installation</a>
<a class="nav-link" href="https://github.com/guyavrhm/flow/blob/master/README.md#usage">Usage</a>
<a class="nav-link" href="mailto:[email protected]">Contact</a>
</div>

</div>

</body>
</html>
25 changes: 25 additions & 0 deletions flow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
flow
Open-source cross-platform KVM software
Copyright (c) 2021 Guy Avraham
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from src import __main__
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PyQt5
numpy
scapy
pynput
120 changes: 120 additions & 0 deletions src/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import sys
import subprocess

import src.info.computerinfo as computerinfo
import src.network.sockets as socket

from src.ui.components import app, settings, tray_icon, blocker
from src.comms.server import Server
from src.comms.client import Client
from src.data.db import Settings, get_data, get_all_data

from .files import WEB_PAGE


class Main:
"""
flow's main class.
Responsible for initializing gui components, server/client and
exception handling.
"""

def __init__(self):

settings.onSave(self.save)

tray_icon.onSettings(self.open_settings)
tray_icon.onExit(self.exit_flow)
tray_icon.onHelp(self.open_help)
tray_icon.show()

# server or client thread
self.serverclient = None

typ = get_data(Settings.PC)
self.init_serverclient(typ)

sys.exit(app.exec_())

@staticmethod
def open_help():
"""
Opens the flow web-page.
"""
if computerinfo.platform == computerinfo.WINDOWS:
subprocess.Popen(f'start {WEB_PAGE}', shell=True)
elif computerinfo.platform == computerinfo.MACOS:
subprocess.Popen(f'open {WEB_PAGE}', shell=True)
else:
subprocess.Popen(f'sensible-browser {WEB_PAGE}', shell=True)

@staticmethod
def open_settings():
settings.show()

def save(self):
"""
Saves settings.
Will re-initialize server/client if encryption or
or server/client specification has changed.
"""

settings_before = get_all_data()

settings.update()
settings.hide()

settings_after = get_all_data()
if (
settings_before[Settings.PC] != settings_after[Settings.PC] or
settings_before[Settings.ENCRYPTION] != settings_after[Settings.ENCRYPTION] or
settings_before[Settings.PASS] != settings_after[Settings.PASS]
):
self.stop_serverclient()
self.init_serverclient(settings_after[Settings.PC])

def init_serverclient(self, typ):
"""
Initializes and starts server or client thread
based on 'typ' argument.
"""
self.serverclient = None

if typ == Settings.CLIENT:
self.serverclient = Client()
else:
Server.machines.clear()
self.serverclient = Server()
self.serverclient.machine_connected_signal.connect(settings.connect)
self.serverclient.machine_disconnected_signal.connect(settings.disconnect)
self.serverclient.show_blocker_signal.connect(blocker.show)
self.serverclient.hide_blocker_signal.connect(blocker.hide)

self.serverclient.connect_signal.connect(tray_icon.setConnected)
self.serverclient.disconnect_signal.connect(tray_icon.setDisconnected)

if get_data(Settings.ENCRYPTION) == Settings.ENCRYPTION_ON:
socket.key = socket.set_encryption_key(get_data(Settings.PASS))
else:
socket.key = socket.set_encryption_key("")

self.serverclient.start()

def stop_serverclient(self):
"""
Stops the server or client thread from running.
"""
tray_icon.setIcon(tray_icon.ICON_DISCONNECTED)
if self.serverclient is not None:
self.serverclient.stop()
self.serverclient.wait()
self.serverclient.deleteLater()

def exit_flow(self):
self.stop_serverclient()
tray_icon.hide()
app.quit()


if computerinfo.supported():
Main()
Loading

0 comments on commit 125a50e

Please sign in to comment.