ConsolePi | Raspberry Pi Based Serial Console Server, with PushBullet Notification of IP changes, Automatic VPN
kandi X-RAY | ConsolePi Summary
kandi X-RAY | ConsolePi Summary
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
Top functions reviewed by kandi - BETA
- 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
ConsolePi Key Features
ConsolePi Examples and Code Snippets
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
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
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
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:55The new object to get params in React Navigation 5 is:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ConsolePi
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
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page