ConsolePi | Raspberry Pi Based Serial Console Server, with PushBullet Notification of IP changes, Automatic VPN

 by   Pack3tL0ss Python Version: v2021-1.1 License: No License

kandi X-RAY | ConsolePi Summary

kandi X-RAY | ConsolePi Summary

ConsolePi is a Python library typically used in Telecommunications, Media, Media, Entertainment, Internet of Things (IoT), Raspberry Pi applications. ConsolePi has no vulnerabilities and it has low support. However ConsolePi has 13 bugs and it build file is not available. You can download it from GitHub.

Acts as a serial Console Server, allowing you to remotely connect to ConsolePi via Telnet/SSH/bluetooth to gain Console Access to devices connected to local or remote ConsolePis via USB to serial adapters (i.e. Switches, Routers, Access Points... anything with a serial port). TL;DR: Single Command Install Script. Run from a RaspberryPi running RaspiOS Buster (ideally a fresh image). The RaspberryPi needs to be able to reach the internet.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ConsolePi has a low active ecosystem.
              It has 135 star(s) with 14 fork(s). There are 17 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 27 have been closed. On average issues are closed in 14 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of ConsolePi is v2021-1.1

            kandi-Quality Quality

              OutlinedDot
              ConsolePi has 13 bugs (7 blocker, 0 critical, 6 major, 0 minor) and 413 code smells.

            kandi-Security Security

              ConsolePi has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ConsolePi code analysis shows 0 unresolved vulnerabilities.
              There are 15 security hotspots that need review.

            kandi-License License

              ConsolePi does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              ConsolePi releases are available to install and integrate.
              ConsolePi has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions, examples and code snippets are available.
              ConsolePi saves you 3887 person hours of effort in developing the same functionality from scratch.
              It has 11350 lines of code, 477 functions and 33 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed ConsolePi and discovered the below as its top functions. This is intended to give you an instant insight into ConsolePi implemented functionality, and help decide if they suit your requirements.
            • Create the power menu
            • Exit
            • Reload udev rules
            • Wait for input
            • Render the main menu
            • Build the adapter dictionary
            • Generate adapter lines
            • Rename the menu
            • Updates the local cloud cache
            • Create the Dli power menu
            • Format a subhead section
            • Print Baud Rate
            • Format the footer
            • Create rshell menu
            • Main loop
            • Reset ZTP configuration
            • Setup the con_menu
            • Get remote hosts
            • Update local cloud cache
            • Handle a service state change
            • Format the legend section
            • Performs auto power on a key
            • Create key distribution menu
            • Get a list of all of the ports
            • Generate next ZTP packet
            • Get a list of all available power devices
            • Update spreadsheet data
            Get all kandi verified functions for this library.

            ConsolePi Key Features

            No Key Features are available at this moment for ConsolePi.

            ConsolePi Examples and Code Snippets

            Installation,3. ConsolePi Image Creator
            Pythondot img1Lines of Code : 130dot img1no licencesLicense : No License
            copy iconCopy
            USAGE: sudo ./consolepi-image-creator.sh [OPTIONS]
            
            Available Options
             --help | -help | help                   Display this help text.
             -C             Look @ Specified config file loc to get command line values vs. the default consolepi-image-creator  
            Local UART Support
            Pythondot img2Lines of Code : 44dot img2no licencesLicense : No License
            copy iconCopy
            sudo mv /etc/udev/rules.d/10-ConsolePi.rules ~/ # move the file out of the rules dir (to your home dir)
            sudo cp /etc/ConsolePi/src/10-ConsolePi.rules /etc/udev/rules.d  # copy the new file template to the rules dir
            cat ~/10-ConsolePi.rules  # cat the  
            Installation,1. Automated Installation,Silent Install
            Pythondot img3Lines of Code : 32dot img3no licencesLicense : No License
            copy iconCopy
            wget -q https://raw.githubusercontent.com/Pack3tL0ss/ConsolePi/master/installer/install.conf.example -O ~/install.conf && nano ~/install.conf
            
            pi@ConsolePi-dev:~$ consolepi-upgrade --help
            
            USAGE: consolepi-upgrade [OPTIONS]
            
            Available Options  

            Community Discussions

            Trending Discussions on Internet of Things (IoT)

            QUESTION

            Display data from two json files in react native
            Asked 2020-May-17 at 23:55

            I have js files Dashboard and Adverts. I managed to get Dashboard to list the information in one json file (advertisers), but when clicking on an advertiser I want it to navigate to a separate page that will display some data (Say title and text) from the second json file (productadverts). I can't get it to work. Below is the code for the Dashboard and next for Adverts. Then the json files

            ...

            ANSWER

            Answered 2020-May-17 at 23:55

            The new object to get params in React Navigation 5 is:

            Source https://stackoverflow.com/questions/61859411

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ConsolePi

            If you have a Linux system available you can use ConsolePi image creator to burn the image to a micro-sd, enable SSH, pre-configure a WLAN (optional), mass-import configurations (if ran from a ConsolePi, optional), and PreConfigure ConsolePi settings (optional). This script is especially useful for doing headless installations. Note Previous versions of ConsolePi supported import from either the users home-dir (i.e. /home/pi) or from a consolepi-stage subdir in the users home-dir (i.e. /home/pi/ConsolePi-stage). The import logic directly from the home-dir has not been removed, but going forward any new imports will only be tested using the consolePi-stage directory for simplicity. ConsolePi will optionally use pre-configured settings for the following if they are placed in the a consolepi-stage subdir in the users home folder (i.e. /home/pi/consolepi-stage). This is optional, the installer will prompt for the information if not pre-configured. It will prompt you to verify either way. Imports only occur during initial install not upgrades. Refer to google for more info, be aware some apt upgrades update the overlays overwriting your customization. I use a separate script I run occasionally which creates a dtbo then compares it to the one in /boot/overlays, and updates if necessary (to revery back to my custom settings). Install RaspiOS on a raspberryPi and connect it to the network. Use the command string below to kick-off the automated installer. The install script is designed to be essentially turn-key. It will prompt to change hostname, set timezone, and update the pi users password if you're logged in as pi. Be sure to checkout the image creator script if doing a headless install, creating multiple ConsolePis, or want to re-image an existing ConsolePi. Command String Breakdown: wget -q https://raw.githubusercontent.com/Pack3tL0ss/ConsolePi/master/installer/install.sh -O /tmp/ConsolePi --> Pull current install script from GitHub and place in /tmp/ConsolePi sudo bash /tmp/ConsolePi --> Execute ConsolePi install script with sudo privs sudo rm -f /tmp/ConsolePi --> Remove the install script (script execution is complete at this point) The && between each command just means the command will execute given there was not an error returned from the previous command.
            ConsolePi.yaml: This is the main configuration file where all configurable settings are defined. If provided in the consolepi-stage dir the installer will ask for verification then create the working config /etc/ConsolePi/ConsolePi.yaml
            ConsolePi.ovpn: If using the automatic OpenVPN feature this file is placed in the appropriate directory during the install. Note: there are a few lines specific to ConsolePi functionality that should be at the end of the file, The installer will verify and add those lines if they don't exist
            ovpn_credentials: Credentials file for OpenVPN. Will be placed in the appropriate OpenVPN dir during the install. This is a simple text file with the openvpn username on the first line and the password on the second line. The script will chmod 600 everything in the /etc/openvpn/client directory for security so the files will only be accessible via sudo (root).
            10-ConsolePi.rules: udev rules file used to automatically map specific adapters to user defined aliases, which map to specific TELNET ports. This file is created automatically during the install if you don't skip the predictable serial port/names workflow toward the end. It's also available after the install via the rn (rename) option in the menu, or via the consolepi-addconsole command. This is highly recommended in most use cases, and is explained further here.
            ser2net.conf: ser2net configuration will be cp to /etc/ser2net.conf if found in the stage-dir.
            wpa_supplicant.conf: If found during install this file will be copied to /etc/wpa_supplicant. The file is parsed to determine if any EAP-TLS SSIDs are configured, and if so the associated certificate files are also copied to the directory specified in the wpa_supplicant.conf file. certs should be pre-staged in consolepi-stage/cert WARNING EAP-TLS RaspiOS buster wpa_supplicant bug: (you can disregard if you are using psk, this only applies to certificate based authentication) The version of wpa_supplicant of an associated dependency that buster still installs has a bug that will prevent EAP-TLS from working (wpa_supplicant v2.8-devel). On my RPi 3 and 4 units I use the ConsolePi_init.sh (described below) file to update wpa_supplicant manually like so: sudo apt install -y ./libreadline8_8.0-2_armhf.deb sudo apt install -y ./wpasupplicant_2.9-1_armhf.deb There may be a better way, but this is working on all my Pi3/4s, on my Pi Zero Ws installing these packages breaks wpa_supplicant entirely. For those I currently just use the psk SSID (which I expect most would do, but good tip anyway for the cool kids using certs)
            authorized_keys/known_hosts: If either of these ssh related files are found they will be placed in both the /home/pi/.ssh and /root/.ssh directories (ownership is adjusted appropriately).
            rpi-poe-overlay.dts: This is a custom overlay file for the official Rpi PoE hat. If the dts is found in the stage dir, a dtbo (overlay binary) is created from it and placed in /boot/overlays. A custom overlay for the PoE hat can be used to adjust what temp triggers the fan, and how fast the fan will run at each temp threshold.
            autohotspot-dhcp(directory): If you have a autohotspot-dhcp directory inside the consolepi-stage dir, it's contents are copied to /etc/ConsolePi/dnsmasq.d/autohotspot. This is useful if you have additional configs you want to use for autohotspot, dhcp-reservations, etc. The main config for the autohotspot feature autohotspot is still managed by ConsolePi.
            wired-dhcp(directory): If you have a wired-dhcp directory inside the consolepi-stage dir, it's contents are copied to /etc/ConsolePi/dnsmasq.d/wired-dhcp. This is useful if you have additional configs you want to use for wired-dhcp, dhcp-reservations, etc. The main config for the wired-dhcp feature wired-dhcp is still managed by ConsolePi.
            ztp(directory): if a ztp directory is found in the consolepi-stage dir, it's contents are copied to /etc/ConsolePi/ztp. This is where your template/variable files, and custom_parsers are configured.
            consolepi-post.sh: Custom post install script. This custom script is triggered after all install steps are complete. It runs just before the post-install message is displayed. Use it to do anything the installer does not cover that you normally setup on your systems. For Example my consolepi-post.sh script does the following: generates an ssh key sudu -u $iam ssh-keygen sends that key to my NAS sudo -u $iam ssh-copy-id pi@omv 2>/dev/null Then it pulls a few files common to all my systems makes executable if it applies etc sftp pi@omv:/export/BACKUP/Linux/common/wlmount ... then make executable etc... I pull cloud credentials for ConsolePi from my main ConsolePi system. modify /etc/nanorc to my liking Update wpa_supplicant if the bug version is installed (unless it's a pi Zero W) This is just an optional mechanism to automatically prep whatever it is you normally prep on your systems after the install completes. The custom Post install script is only executed on initial install, not on upgrade. Some functions/variables available to the script (will be in the environment) that you could leverage: $iam (variable) is the user (script is ran as root hence the sudo -u examples above to run a command as the user that launched the installer) $logit (function) logit "message to log" ["log-level" defaults to "INFO"] log-lvl "ERROR" results in script aborting if it hits, so don't set the log-lvl to ERROR
            A Silent install (Installation runs without prompts) is possible cmd line arguments provided to the installer or a config file, where the path to the config is provided to the installer via the -C </path/to/config/file.conf> argument. A pre configured ConsolePi.yaml should also exist in the consolepi-stage dir described above. Refer to /etc/ConsolePi/installer/install.conf.example for an example config. This command string will download it to your home dir as install.conf and open it in nano for editing. The output below shows consolepi-upgrade as the command to launch, the command will be consolepi-install on an image created using the image creator script. If neither is the case you would call the installer directly (with sudo) and pass in the args (The TL;DR string at the top of this README can be modified to pass in the arguments). Alternatively you can clone this repository to /etc manually, then run the install script. The only real benefit here is it would allow you to cp ConsolePi.yaml.example ConsolePi.yaml and make edits to your liking. If ConsolePi.yaml exists when the installer runs you'll skip a number of user input steps and go straight to verification of the provided settings. You still get the option when using the Automated Installation to stop the install after a default ConsolePi.yaml is created, allowing you to edit then re-run bypassing input prompts. Optionally Pre-Configure parameters, it will result in less time on data-collection/user-input during the install. Just grab the ConsolePi.yaml.example file from the repo, edit it with your settings, and rename/place in ~/consolepi-stage/ConsolePi.yaml. This example copies the configuration to the stage directory to highlight that function (importing settings from the stage directory), you could also place the configured ConsolePi.yaml file in /etc/ConsolePi. NOTE: pre-staging only occurs on the initial install, not when using consolepi-upgrade. Configure parameters to your liking then. 3. ConsolePi Image Creator. !!WARNING!! This script writes RaspiOS to a connected micro-sd card. This will overwrite everything on that card. If something doesn't look right STOP. With that said I've used it 100s of times by now, so image away.
            ctrl + o --> to save
            ctrl + x --> to exit
            Then run the installer
            Insert the micro-sd card you want to image (USB to micro-sd card adapter)
            Launch Script with consolepi-image.
            curl -JLO https://raw.githubusercontent.com/Pack3tL0ss/ConsolePi/master/installer/consolepi-image-creator.sh && sudo chmod +x consolepi-image-creator.sh
            That will download the image creator and make it executable.
            The image creator supports both command line arguments and a configuration file (where the same settings configurable as cmd line arguments can be configured in file... handy for re-use).
            curl -JLO https://raw.githubusercontent.com/Pack3tL0ss/ConsolePi/master/installer/consolepi-image-creator.conf To get the optional conf file for the image creator. The config file will be automatically imported if it's in cwd (current working directory).
            automatically pull the most recent RaspiOS image (lite by default) if one is not found in the script-dir (whatever dir you run it from) It will check to see if a more current image is available and prompt for image selection even if an image exists in the script dir.
            Make an attempt to determine the correct drive to be flashed, and display details ... User to verify/confirm before writing. As a fail-safe the script will exit if it finds more than 1 USB storage device on the system.
            Flash image to micro-sd card
            Enable SSH (handy for headless install) if img_only=true the script stops here
            The entire stage dir (consolepi-stage) is moved to the /home/pi dir on the micro-sd if found in the script dir. This can be used to pre-stage a number of config files the installer will detect and use, along with anything else you'd like on the ConsolePi image.
            Pre-Configure a psk or open WLAN via parameters in script. Useful for headless installation, you just need to determine what IP address ConsolePi gets from DHCP if doing a headless install.
            You can also pre-configure WLAN by placing a wpa_supplicant.conf file in the stage dir. This will be copied to the /etc/wpa_supplicant dir on the micro-sd card. This method supports the typical methods along with EAP-TLS with certificates. Just place the cert files referenced in the provided wpa_supplicant.conf file in a 'cert' folder inside the stage dir. ( Only works for a single EAP-TLS SSID or rather a single set of certs ), the image creator will then move the certs to the micro-sd to the path specified in the provided wap_supplicant.conf.
            create a quick command 'consolepi-install' to simplify the command string to pull the installer from this repo and launch. If cmd_line= argument is provided to consolepi-image-creator.sh those arguments are passed on to the auto-install.
            The ConsolePi installer will start on first login, as long as the RaspberryPi has internet access. This can be disabled with --auto_install=false. If you set --auto_install=false, --cmd_line=... is ignored. You would specify arguments for the installer manually.
            If the consolepi-image-creator.sh script is ran from a ConsolePi, the script will detect that it's a ConsolePi and offer to pre-stage it's existing settings. If a file has already been pre-staged (via consolepi-stage dir) it will skip it. It will give you the chance to edit ConsolePi.yaml if pre-staged, so you can deploy multiple ConsolePis and edit the specifics for each as you stage them.
            Entire home directory imports: If you place /root and/or /home/pi inside the consolepi-stage directory. Those contents/sub-dirs will be imported to the respective users directory on the image. You can even pre-stage a users home directory for a user that doesn't exist. When the installer runs, you are given the option to create new users. Once created if a folder is found in consolepi-stage for that user (i.e. home/pi/consolepi-stage/home/larry), the contents will be copied from the consolepi-stage dir to /home/larry.
            Refer to Power Control Setup.

            Support

            Read The Google Drive Setup for instructions on setting up Google Drive and authorizing ConsolePi to leverage the API. The Gdrive function uses the hostname as a unique identifier. If all of your ConsolePis have the same hostname only one of them will be synchronized. Make Hostnames unique for each ConsolePi In all of the above a local cloud cache which includes data for any remote ConsolePis pulled from ConsolePi.csv is updated for the sake of persistence and speed. The local cloud cache is what is referenced when the menu is initially launched. Note: that ConsolePi will automatically update the local cache file when it gets an IP address, or adapters are added/removed, so the refresh should only be necessary if other ConsolePis have come online since the the menu was launched. Additionally ConsolePis will automatically discover each other via mdns if on the same network, this will automatically update the local-cache if a new remote ConsolePi is discovered.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link