Giter Club home page Giter Club logo

osc-tui's Introduction

osc-tui

Project Sandbox

Description (╯°□°)╯︵ ┻━┻

Designed to be a POC of a Outscale's Cockpit inside the terminal using curses.
The officially supported python version is currently 3.
The code is currently a bit dirty... Maybe big changes are coming!
To refresh any table, press [F5].
Feel free to suggest oher architectures, libs...
The src/ folder contains the project's sources.
The tests/ folder contain some crappy code used to test API calls or any other things...

Options

  • --help: show help
  • --profile [PROFILE]: auto-choose the profile, and skip selection screen, just list all profiles if no profile pass as argument
  • --mode MODE: jump directly to a mode (like Vms, Images, Security...)
  • --ascii-logo: use ascii logo, instead of UTF one.

Costum Rules

osc-tui support some very simple "costum rule" store in ~/.osc/osc-tui-rules.json

Examples:

{
    "Val de heim": {
	"mode": "SECURITY-RULES",
	"ports": [2456, 2457],
	"protocols": ["udp", "tcp"]
    },
    "Mie raft": {
	"mode": "SECURITY-RULES",
	"ports": [25565],
	"protocols": ["udp", "tcp"]
    },
    "ssh ips": {
        "mode": "SECURITY-RULES",
        "ips": ["41.41.41.41", "43.43.43.43"],
        "ports": [25565],
        "protocols": ["udp", "tcp"]
    }

}

Will add 3 options Val de heim, Mie raft and ssh ips to the SECURITY-RULES menu. when Val de heim or Mie raft menu are click, osc-tui will ask for an IP, and allow each protocols for each ports describe in "ports" and in "protocols" with ssh ips is click osc-tui will automatically open the port 25565 for udp and tcp for "41.41.41.41" and "43.43.43.43" IPs.

Installation

You can either use pip on macos/windows/linux, the appimage in release, or the AUR on Arch Linux

Running the client.

If installed:

  • osc-tui

If not installed (for devs):

oscscreen is a submodule of this project, and need to be installed with it.

Move to the osc-tui folder, then run:

  • python3 -m venv env
  • source env/bin/activateto activate the virtual env.
  • pip install -e .
  • then just call osc-tui

Then you can deactivate the virtual env:

  • deactivate

Packaging the app with pip (BETA, WIP).

build and install the package:

  • python3 setup.py build install

Distributions Package

Arch Linux

yay -Sy osc-tui-git # you can replace yay by any AUR helper, like paru

Contributing

Just a few rules:

  • Format correctly your code (you can do autopep8 --in-place --aggressive --aggressive osc_tui/*.py).
  • Add external dependencies as less as possible.

Release plan:

Release are time base, up to now, we had no release plan, from now on, we will release a new version every 3 month, if there is any commits.

if a major security issue happen, we'll backport the patch and create an update of old version with an updated revision.

when release a new version:

  • update VERSION in osc_tui/main.py and setup.py
  • update automatic_release_tag in .github/workflows/make_release_bins.yml (note having to do this is a bug and could be simplify)
  • VERSION format is time base, 2 first numbers are for years, 2 next one are for month, and 2 last are for revisions
  • push a tag at the current version, a runner should build the appimage.

osc-tui's People

Contributors

dependabot[bot] avatar jerome-jutteau avatar lgtm-migrator avatar outscale-fne avatar outscale-mal avatar outscale-mdr avatar outscale-mgo avatar outscale-rjt avatar pierre570 avatar ryohkhn avatar tgn-outscale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

osc-tui's Issues

Crash after selecting a profile

I tested this project by curiosity, but after having created a profile, the application crashed:

└> python --version
Python 3.8.10
Traceback (most recent call last):
  File "/home/leo/sources/osc-tui/osc_tui/main.py", line 94, in <module>
    sys.exit(main())
  File "/home/leo/sources/osc-tui/osc_tui/main.py", line 85, in main
    APP.run()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/apNPSApplication.py", line 30, in run
    return npyssafewrapper.wrapper(self.__remove_argument_call_main)
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/npyssafewrapper.py", line 41, in wrapper
    wrapper_no_fork(call_function)
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
    return_code = call_function(_SCREEN)    
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
    return self.main()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/apNPSApplicationManaged.py", line 172, in main
    self._THISFORM.edit()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/fm_form_edit_loop.py", line 47, in edit
    self.edit_loop()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/fm_form_edit_loop.py", line 38, in edit_loop
    self._widgets__[self.editw].edit()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/wgwidget.py", line 447, in edit
    self._edit_loop()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/wgwidget.py", line 463, in _edit_loop
    self.get_and_use_key_press()
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/wgwidget.py", line 599, in get_and_use_key_press
    self.handle_input(ch)
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/wgwidget.py", line 71, in handle_input
    self.handlers[_input](_input)
  File "/home/leo/sources/osc-tui/env/lib/python3.8/site-packages/npyscreen/wgbutton.py", line 99, in h_toggle
    self.whenPressed()
  File "/home/leo/sources/osc-tui/osc_tui/profileSelector.py", line 43, in __call__
    main.GATEWAY.log.config(type=LOG_MEMORY, what=LOG_KEEP_ONLY_LAST_REQ)
AttributeError: 'compiled_function' object has no attribute 'config'

Is it something known?

Credentials set in the profile are working elsewhere.

Thanks!

Letter shortcut to jump to some actions

It would be very useful to have letter shortcut to jump to some actions:
for examples C could be use to Create (Instance/Volume...)
I,N,V,M, S could be use to jump to Instance, Nets, Volumes, Image, Security grid.

It would be nice to have the letter use for the shortcut in Color in the menu too.

Note that the colour could be complex to implement, so this might be made in another PR, with a new issue.

window does not resize

Hi,
osc-tui does not seems to react to window size change. That is pretty annoying when working with tmux for instance.
This occurs on profile selection but maybe elsewhere

ssh add my ip button seems broken

pretty self explanatory :)

It would be nice to fix the button, but we can also remove it if, it take too much time too fix it, as adding you ssh ip is already pretty easy the normal way.

normalize python case

variable name doesn't respect standard python case, and some are incoherent with the projects (like a variable called F).
We need standardisation.

Arch Package

It's very easy to push Arch packages on AUR, we should do that :)

use libcloud, curl, or anycode to handle more API than OSC API without 1 dependency per providers

It would be nice to support more than just OSC.
AWS, azure and GCP come top mind.

What I absolutely want to avoid is to have 1 dependency par API, like for a project like ScoutSuit which is very hard to install due to the number of dependency it have, so we need a lib that support multiple provider (like libecloud, or libcurl).
It would also enable osc-tui to support oss (Outscale storage) at some point.

Phone Screen are badly split

phone screen have more vertical than horizontal space, so on some screen we should have the menu on top or button, but not on side.

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.