bigookie / skywire-wing-commander Goto Github PK
View Code? Open in Web Editor NEWWing Commander is a Telegram bot written in GO designed to help the Skyfleet community manage their Skyminers
License: MIT License
Wing Commander is a Telegram bot written in GO designed to help the Skyfleet community manage their Skyminers
License: MIT License
Is your feature request related to a problem? Please describe.
The Wing Commander Bot currently monitors the (local) Manager Node - and the Nodes that are connected to it. The status of the Nodes connectivity with the Manager is reported to the Bot via the Managers API.
There is an assumption that both the Bot and the Manager require an internet connection and without this neither will work. It also assumed that because the Node is connected to the Manager, that its also connected to the Skywire Discovery Node - which isn't always the case.
Describe the solution you'd like
It should be possible for the Bot to monitor the Skywire Discovery Node also to ensure that the local Nodes (connected to the Manager) are reporting as being connected to the Discovery Node.
When a Node is not detected as being connected to the Skywire Discovery Node the Bot should alert the owner - as this will be impacting the Nodes uptime stats.
This has recently been voted on by the community as the highest priority item.
Describe alternatives you've considered
If you want to confirm that your nodes are connected to the discovery node (there is no real reason why they shouldn't be assuming they are correctly configured) - then use the Skywire Node Checker
http://167.99.207.153:8001/
Describe the bug
Currently the app is not very resilient to incorrect data within the config.toml
configuration file.
To Reproduce
Steps to reproduce the behavior:
.wingocmmander/config.toml
file.string
type parameter (i.e. apikiey
, admin
) to not be enclosed in " " (double quotes)Wing Commander
(.wcbot
)Expected behavior
Fine for an error to still be reported, but preferably it will be one that allows the user to self-help. The error message should provide sufficient detail that the user knows what the problem is and has the ability to fix it without requiring assistance.
While this may not be possible in all cases - its what we should be targeting.
Screenshots
NA
Additional context
Low priority. Fix when we can
Idea: Enhance the Bit to monitor the connections of client nodes to the manager. It could then report to telegram if a Node has gone offline.
Enhancement to allow monitoring of the Nodes that are connected to and managed by the Manager node.
This will allow notifications when the connection status of the managed nodes changes ie a managed node has not been seen for a configured period of time - may indicate it has died and needs restarting, etc.
The code associated with the v0.0.1 (alpha) release is very crude and not well structured.
Work is needed to refactor the code (currently main.go) and seperate it out and improve its overall usability (re-usability) and structure.
Describe the bug
The /showconfig
command is not working on some systems.
To Reproduce
Steps to reproduce the behavior:
/showconfig
commandSorry,'/showconfig' is an unknown command.
...
Expected behavior
The Bot should reply with the current runtime configuration based on the content of the config.toml
file.
Describe the bug
Application instance control was accidentally disabled in v0.2.0-beta.9. This allows multiple instances of the Bot application wcbot
to run at the same time on the same machine.
To Reproduce
Steps to reproduce the behavior:
wcbot
twice.Expected behavior
Secondary instances of wcbot
will detect that there is a primary instance already running and will refuse to start.
Add a new command to the bot to display the current runtime configuration.
TravisCI builds are currently failing. Expect this is because of the current config file settings.
Describe the bug
A number of users have reported that the auto-restart script has not been working for them.
To Reproduce
Followed the steps included in the main Readme to enable auto-restart, however after reboot of the device, the bot is not automatically started.
Expected behavior
The bot should automatically start following a reboot or restart of the device.
The bots config file currently expects the admin user will contain a leading @ symbol and messages will be accepted or rejected by the bot based on an exact match of this config string against the telegram user sending the message.
The bot should be more accommodating and automatically add the @ if itβs not there (at runtime). Possibly warn the user by a message at start up hinting they should correct the config
Is your feature request related to a problem? Please describe.
Ability to request information about the currently connected Nodes from the bot.
Describe the solution you'd like
Would be good to have a /nodes command which would respond with a telegram custom keyboard allowing the user to select from a button, which node they want more info on. When a node is selected the NodeInfo structure could be returned, provide the following:
-Node Key
-Connection Type
-SentBytes
-RecvBytes
-LastSeen
-RunningSince
Describe alternatives you've considered
This could be achieved via text entry, but would be hard and unusable. User needs to select the node from a lot.
Additional context
Refer to here for detail on custom keyboards
https://core.telegram.org/bots/api/#replykeyboardmarkup
Is your feature request related to a problem? Please describe.
Automatic detection of new releases and ability to trigger an automatic update via Telegram.
This will help avoid the need for users to access the terminal on their nodes (ie via SSH) to perform an update. Will simplify the update process.
Describe the solution you'd like
Enhance the bot to perform periodic (configurable) update checks.
The bot should ping GitHub occasionally and see if there is a new version and report availability of a new version to its owner.
When a new version is detected the bot should accept a command that would trigger it to download the update in the background.
Is your feature request related to a problem? Please describe.
Better understanding of the deployed application and features that are used and errors that occur will assist in improving the application.
Describe the solution you'd like
integrate support for app analytics pushed to Google Analytics.
Describe alternatives you've considered
Lots... None are easy or free.
Additional context
All data collected must be anonymous. I'm not interested in who the users are, but more what and how they use the app to improve it over time.
Is your feature request related to a problem? Please describe.
NA
Describe the solution you'd like
Add a new button to the Wing Commander bot to provide a simple link to the offical whitelist site:
https://whitelist.skycoin.net/
The user will be required to login to the site manually - Wing Commander WILL NO manage the users credentials for the site (for security reasons)
Describe alternatives you've considered
NA
Additional context
Feature has been requested by a number of users in the Wing Commander telegram group
Documentation and image assets are starting to bloat the code repository. These assets need to be moved out of the repo and onto the Wiki to ensure download times of the code repo (i.e. for updates, etc) is not impacted.
Describe the bug
The regular Heartbeat message has a typo, as kindly pointed out by Telegram user @A D
To Reproduce
Heatbeat is incorrectly spelt as "Heatbeat"
Using Telegram-cli, it might be possible to initiate a conversation with the Botfather.
Create new Telegram bot
Get Telegram username
Get chat-id
Input information so all user will have to do is Enter phone number making setup even Simpiler then it already is.
Is your feature request related to a problem? Please describe.
Running the /status
command before running the /start
command will inform the user that 0 nodes are connected. This can be confusing.
Describe the solution you'd like
The /status
command should report the current status of monitoring (running or not). If it is running, then it should also report the number of connected nodes.
Is your feature request related to a problem? Please describe.
Simplify the process of setting up the Bot initially.
Describe the solution you'd like
Create a command line app that can guide the new user through the initial config setup - and create the required config.toml
file as output.
Something like wc-config
- which would then prompt for and do the following:
Provide your Bot API Key: <user input goes here>
Provide your Telegram User ID: <@myusername>
Attempting to retrieving ChatID. Please initiate a chat with the Bot in the Telegram app.
.......
Got ChatID: xxxxxxxxxx
config.toml created in ~/.wingcommander
complete
Describe alternatives you've considered
Current alternative is that users manually create the file. This can be confusing.
Describe the bug
I have just detected an issue where Wing Commander is not correctly handling errors when connecting to the Discovery Server API to validate Node connectivity.
If the connection fails the last know result is used (ie a cached result). This is not ideal, but under normal conditions should not impact the function.
I will be addressing this issue ASAP and expect to push an update tonight for it (all going well).
To Reproduce
Steps to reproduce the behavior:
/status
command again. An error should be logged to the command terminal (if your running in interactive mode, but no notification will be sent to Telegram session. The Bot will respond with the previous data - which makes everything look fine.Expected behavior
The user should be informed that the Discovery Server was unable to be contacted and that the Bot was unable to verify connectivity of the Nodes with the Discovery server at this point in time.
The Bot app, once started, will send telegram notifications when connections to other Nodes occur. This could be connections you make (outbound) to other nodes, or connections that are being made (inbound) to your nodes from others (which is really the driver for this project).
At the moment you get a verbose list of Node and App keys. This should be revised - to inform you that a connection had occurred (either inbound or outbound)
Describe the bug
A Telegram user who does not own the Wing Commander bot instance can initiate a private chat with the bot based on the bot name, and the bot will respond to commands issued from this user.
Thanks to GoldXT for assistance with identifying this issue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The bot MUST ignore all messages and commands from Telegram users who are not configured as the Admin (owner) of the bot instance within the config.toml
file.
Add new feature to allow the user to request periodic notifications from the Bot app to let them know it is still running and has not crashed.
Suggested periods - every:
1hr
2hr
12hr
24hr
Off by default and must be enabled.
Is your feature request related to a problem? Please describe.
Its currently possible for any number of instances of the Bot application (wcbot
) to be run on the same machine - however there is no point and this has caused confusion with some users.
Describe the solution you'd like
The Bot (wcbot
) should detect if another instance is already present and running on the same machine and inform the user with a helpful message. The second instance should not start.
Is your feature request related to a problem? Please describe.
While there is a lot of doco covering the steps needed to install Wing Commander for the first time, the process, especially for less technical users, can be difficult at times and because of the many commands that need to be entered on the command line - it can also be error prone.
Describe the solution you'd like
Create a simple, one-step, bootstrap installation script. The script can then be downloaded by a new user to the target system and run. The Script should then check for all dependencies (such as Go, etc) before trying to download and install Wing Commander from the current source on GitHub.
Is your feature request related to a problem? Please describe.
If the Bot app fails for any reason or if the Node needs to be restarted, users must manually restart it from a terminal session command line.
Describe the solution you'd like
An autostart script would avoid the need for users to access the Manager Node to restart the Wing Commander bot manually if the Pi was restarted.
The Skywire project has a similar script for bringing up the Manager and Nodes on boot. This same concept should be used to start Wing Commander.
Describe alternatives you've considered
Manual restart using the commands provided in the doco is the only alternative at this point.
Spelling Errors in the Configuration Readme
cd ~
mkdir .wincommander
cd .wingcommander
cp $GOPATH/src/github.com/BigOokie/skywire-wing-commander/src/wcbot/config.example.toml ~/.wingommander/config.toml
Expected behavior
It should read
cd ~
mkdir .wingcommander
cd .wingcommander
cp $GOPATH/src/github.com/BigOokie/skywire-wing-commander/src/wcbot/config.example.toml ~/.wingcommander/config.toml
There is a known issue in the v0.0.1 (alpha) release which results in the Bot app crashing in startup on an Official Skywire miner.
The issue relates the location of a file that is referenced by the Bot app - the location of which is different for an Official miner as opposed to a DIY.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.