GithubHelp home page GithubHelp logo

sand-knight / sshtm Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 563 KB

SSH client and remote script manager for Android

Kotlin 0.11% Swift 0.37% Objective-C 0.04% Dart 71.76% HTML 3.63% CMake 7.64% C++ 15.77% C 0.68%

sshtm's Introduction

sshtm

A new Flutter project for a class assignment. This app aims to manage connections to ssh servers, store scripts, execute rapid actions on defined servers, define event driven tasks, sort execution logs.

Last test-able build: 28 May 2022 16:45 What you can do: add hosts, open terminals, execute scripts on selected hosts, visualize logs, open logs folder with external file manager. Everything is in Android/data/[app]/.

o_screen-20220528-163921.mp4

Implementation idea

The state of the main scaffold is the last visited section; every section has a different appmenu and body, which will be implemented trying to separate the code of the following areas:

  1. Hosts : Known machines, towards which terminals can be opened. Each host is uniquely identified by address, username and port, and is associated with (instances) the collection of terminals opened towards it. When starting the app, every terminal collection will be empty. There is one special host, which represent the local Android shell.
  2. Scripts : Simple text files, which can be imported or written in-app. Maybe the app will understand the shebang? On tap, the user can select a subset of the hosts on which the tapped script will be executed.
  3. Actions : (script, subset(Host)) associations, for a quick script execution. Maybe a homescreen widget can make use of actions?
  4. Tasks : (Actions, AndroidEvent) associations, for automation.
  5. Logs : stdin,stdout e stderr will be saved in text files, grouped by their execution batch of origin.

Diary of state management

Cubit to manage <Host< Terminal[] >>[] (1) is "global" (wraps Material App) because many routes are going need the state of the hosts. Terminals are saved from route change by holding a reference to the terminal view. The terminal page is stateless.

Discovered that it is necessary to have an unloaded state to emulate futurebuilder with bloc.

Another Cubit is responsible for fetching scripts.

A bloc exposes the queue of running scripts and relays running events, for toasts and notifications to listen.

The above are children of a settings cubit which loads data needed by both UI, data structures and logics.

Diary of storage choices

Script are actual files stored inside Android/data/com.example.sshtm/files/Scripts. Their name is their actual filename, their comment is the commented line starting with ##SSHTM, wich must be the last one (excluding empty lines).

The list of hosts is encoded in an exportable json. Being able to export that file, might mean being able to back up on firestore. Ideally, users should choose whether to use cloud capabilites or not, but with limited time, I should focus on one solution first.

Scripts and logs are text files accessible easily with a file manager.

sshtm's People

Contributors

sand-knight avatar

Stargazers

 avatar  avatar  avatar KAYUII avatar

Watchers

 avatar

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.