mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-03 15:47:18 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43351fd66f | ||
|
|
096bdb0773 | ||
|
|
330396c5f1 | ||
|
|
8576f63479 | ||
|
|
393f241538 | ||
|
|
c557d5bfee | ||
|
|
acca7d888c | ||
|
|
2f3b3c67ba | ||
|
|
88d2402e88 |
@@ -0,0 +1,72 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ "main" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '34 22 * * 5'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'python' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
|
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
|
||||||
|
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||||
|
# queries: security-extended,security-and-quality
|
||||||
|
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||||
|
|
||||||
|
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||||
|
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||||
|
|
||||||
|
# - run: |
|
||||||
|
# echo "Run, Build Application using script"
|
||||||
|
# ./location_of_script_within_repo/buildscript.sh
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -1,5 +1,7 @@
|
|||||||

|

|
||||||
|
|
||||||
|
[](https://github.com/rwinkhart/sshyp/actions/workflows/codeql-analysis.yml)
|
||||||
|
|
||||||
sshyp is a very simple self-hosted, synchronized password manager for UNIX(-like) systems (currently Haiku/FreeBSD/Linux).
|
sshyp is a very simple self-hosted, synchronized password manager for UNIX(-like) systems (currently Haiku/FreeBSD/Linux).
|
||||||
|
|
||||||
sshyp is compatible with entries created by pass/password-store, as its original goal was to be like pass/password-store, but far more user-friendly to synchronize with a self-hosted server.
|
sshyp is compatible with entries created by pass/password-store, as its original goal was to be like pass/password-store, but far more user-friendly to synchronize with a self-hosted server.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import random
|
|||||||
from shutil import get_terminal_size, move, rmtree
|
from shutil import get_terminal_size, move, rmtree
|
||||||
import sshync
|
import sshync
|
||||||
import string
|
import string
|
||||||
from subprocess import Popen, PIPE, STDOUT
|
from subprocess import CalledProcessError, Popen, PIPE, run
|
||||||
from sys import argv, exit as s_exit
|
from sys import argv, exit as s_exit
|
||||||
from textwrap import fill
|
from textwrap import fill
|
||||||
|
|
||||||
@@ -155,9 +155,9 @@ def decrypt(_entry_dir, _shm_folder, _shm_entry):
|
|||||||
_command = f"{gpg} -qd --output /dev/null {path.expanduser('~/.config/sshyp/lock.gpg')}"
|
_command = f"{gpg} -qd --output /dev/null {path.expanduser('~/.config/sshyp/lock.gpg')}"
|
||||||
else:
|
else:
|
||||||
_command = f"{gpg} -qd --output {tmp_dir}{_shm_folder}/{_shm_entry} {_entry_dir}.gpg"
|
_command = f"{gpg} -qd --output {tmp_dir}{_shm_folder}/{_shm_entry} {_entry_dir}.gpg"
|
||||||
_output = Popen(_command, shell=True, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
try:
|
||||||
_block = _output.communicate()[0].strip()
|
run(_command, shell=True, stderr=PIPE, check=True, close_fds=True)
|
||||||
if _output.returncode == 2:
|
except CalledProcessError:
|
||||||
print(f"\n\u001b[38;5;9merror: could not decrypt - ensure the correct gpg key is present\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: could not decrypt - ensure the correct gpg key is present\u001b[0m\n")
|
||||||
s_exit(1)
|
s_exit(1)
|
||||||
|
|
||||||
@@ -174,15 +174,14 @@ def edit_note(_shm_folder, _shm_entry):
|
|||||||
def copy_name_check(_port, _username_ssh, _ip, _client_device_name):
|
def copy_name_check(_port, _username_ssh, _ip, _client_device_name):
|
||||||
_command = f"ssh -o ConnectTimeout=3 -i '{path.expanduser('~/.ssh/sshyp')}' -p {_port} {_username_ssh}@{_ip} " \
|
_command = f"ssh -o ConnectTimeout=3 -i '{path.expanduser('~/.ssh/sshyp')}' -p {_port} {_username_ssh}@{_ip} " \
|
||||||
f"\"touch '/home/{_username_ssh}/.config/sshyp/devices/{_client_device_name}'\""
|
f"\"touch '/home/{_username_ssh}/.config/sshyp/devices/{_client_device_name}'\""
|
||||||
_output = Popen(_command, shell=True, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
try:
|
||||||
_block = _output.communicate()[0].strip()
|
run(_command, shell=True, stderr=PIPE, check=True, close_fds=True)
|
||||||
if _output.returncode != 0:
|
except CalledProcessError:
|
||||||
print('\n\u001b[38;5;9mwarning: ssh connection could not be made - ensure the public key (~/.ssh/sshyp.pub) is '
|
print('\n\u001b[38;5;9mwarning: ssh connection could not be made - ensure the public key (~/.ssh/sshyp.pub) is '
|
||||||
'registered on the remote server and that the entered ip, port, and username are correct\n\nsyncing '
|
'registered on the remote server and that the entered ip, port, and username are correct\n\nsyncing '
|
||||||
'functionality will be disabled until this is addressed\u001b[0m\n')
|
'functionality will be disabled until this is addressed\u001b[0m\n')
|
||||||
open(path.expanduser('~/.config/sshyp/ssh-error'), 'w').write('1')
|
open(path.expanduser('~/.config/sshyp/ssh-error'), 'w').write('1')
|
||||||
return 1
|
return 1
|
||||||
else:
|
|
||||||
open(path.expanduser('~/.config/sshyp/ssh-error'), 'w').write('0')
|
open(path.expanduser('~/.config/sshyp/ssh-error'), 'w').write('0')
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -311,7 +310,7 @@ def print_info(): # prints help text based on argument
|
|||||||
'randall winkhart\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
|
'randall winkhart\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
|
||||||
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m '
|
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m '
|
||||||
'\u001b[38;5;7;48;5;8m/\u001b[0m')
|
'\u001b[38;5;7;48;5;8m/\u001b[0m')
|
||||||
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mversion 1.0.0'
|
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mversion 1.0.1'
|
||||||
'\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
|
'\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
|
||||||
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mthe polished trotters '
|
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mthe polished trotters '
|
||||||
'update\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
|
'update\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
|
||||||
@@ -590,7 +589,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
|
|||||||
system('clipboard -c ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
|
system('clipboard -c ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
||||||
system('clipboard -c ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'")
|
system('clipboard -c ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
Popen('sleep 30; clipboard -r', shell=True)
|
Popen('sleep 30; clipboard -r', shell=True, close_fds=True)
|
||||||
elif Path("/data/data/com.termux").exists(): # Termux (Android) clipboard detection
|
elif Path("/data/data/com.termux").exists(): # Termux (Android) clipboard detection
|
||||||
if argument_list[1] == 'username' or argument_list[1] == '-u':
|
if argument_list[1] == 'username' or argument_list[1] == '-u':
|
||||||
system('termux-clipboard-set ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'")
|
system('termux-clipboard-set ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
@@ -600,7 +599,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
|
|||||||
system('termux-clipboard-set ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
|
system('termux-clipboard-set ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
||||||
system('termux-clipboard-set ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'")
|
system('termux-clipboard-set ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
Popen("sleep 30; termux-clipboard-set ''", shell=True)
|
Popen("sleep 30; termux-clipboard-set ''", shell=True, close_fds=True)
|
||||||
elif environ.get('WAYLAND_DISPLAY') == 'wayland-0': # Wayland clipboard detection
|
elif environ.get('WAYLAND_DISPLAY') == 'wayland-0': # Wayland clipboard detection
|
||||||
if argument_list[1] == 'username' or argument_list[1] == '-u':
|
if argument_list[1] == 'username' or argument_list[1] == '-u':
|
||||||
system('wl-copy ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'")
|
system('wl-copy ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
@@ -610,7 +609,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
|
|||||||
system('wl-copy ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
|
system('wl-copy ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
||||||
system('wl-copy ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'")
|
system('wl-copy ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'")
|
||||||
Popen('sleep 30; wl-copy -c', shell=True)
|
Popen('sleep 30; wl-copy -c', shell=True, close_fds=True)
|
||||||
else: # X11 clipboard detection
|
else: # X11 clipboard detection
|
||||||
if argument_list[1] == 'username' or argument_list[1] == '-u':
|
if argument_list[1] == 'username' or argument_list[1] == '-u':
|
||||||
system('echo -n ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
|
system('echo -n ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
|
||||||
@@ -620,7 +619,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
|
|||||||
system('echo -n ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
|
system('echo -n ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
|
||||||
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
elif argument_list[1] == 'note' or argument_list[1] == '-n':
|
||||||
system('echo -n ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
|
system('echo -n ' + "'" + _copy_line[3].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
|
||||||
Popen("sleep 30; echo -n '' | xclip -sel c", shell=True)
|
Popen("sleep 30; echo -n '' | xclip -sel c", shell=True, close_fds=True)
|
||||||
rmtree(f"{tmp_dir}{_shm_folder}")
|
rmtree(f"{tmp_dir}{_shm_folder}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
sshyp v1.0.1
|
||||||
|
|
||||||
|
The Polished Trotters Update - Patch 1
|
||||||
|
|
||||||
|
This is a hotfix for the Haiku decryption bug.
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- subprocess.Popen has been replaced with subprocess.run where applicable
|
||||||
|
- stdout is no longer captured with any subprocess.Popen or subprocess.run usages
|
||||||
|
^ this fixes decryption on Haiku
|
||||||
|
|
||||||
|
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||||
|
|
||||||
sshyp v1.0.0
|
sshyp v1.0.0
|
||||||
|
|
||||||
The Polished Trotters Update
|
The Polished Trotters Update
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
sshyp v1.0.1
|
||||||
|
|
||||||
|
The Polished Trotters Update - Patch 1
|
||||||
|
|
||||||
|
This is a hotfix for the Haiku decryption bug.
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- subprocess.Popen has been replaced with subprocess.run where applicable
|
||||||
|
- stdout is no longer captured with any subprocess.Popen or subprocess.run usages
|
||||||
|
^ this fixes decryption on Haiku
|
||||||
|
|
||||||
|
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||||
|
|
||||||
sshyp v1.0.0
|
sshyp v1.0.0
|
||||||
|
|
||||||
The Polished Trotters Update
|
The Polished Trotters Update
|
||||||
|
|||||||
Reference in New Issue
Block a user