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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ``` --- # [ `SUMMARY` ] ``` this project is a hybrid of hybrids - ( m4pl1mp - https://git.tcp.direct/decoded/m4pl1mp ) - this version spans across different networks and not limited to irc, it connects matrix, telegram, discord and offers up a newer way of unifying those services in one core process. to summarize it's g1mp from security @ blackhats.ru, maple from tcpdirect @ ircd.chat and a parallel process across many networks with those same services in hydradized modular ai. ``` --- # [ `SCREENSHOTS` ] --- ![screenshots](screenshots/ss1.png) --- # [ `API KEYS` ] - **get these or some before you start** - some of maple's services require api developer keys for certain sites, it is recommended you get them all - at minimal you should have a youtube, cryptocompare, possibly twitter key. all of these api keys are free - to setup and the only one that would really ever cost anything is openai using gpt3 backend and that isn't - even required, maple gpt2 runs offline and doesn't require openai services for language models like davici. --- ### [ **Relevant urls pertaining to the developer api keys and server credentials** ] --- - **cryptocompare** - https://min-api.cryptocompare.com/ - https://min-api.cryptocompare.com/pricing - **openai** - https://beta.openai.com/signup - **nickserv** - https://wiki.anope.org/index.php/2.0/Modules#NickServ - `/msg nickserv help register` - **matrix** - https://app.element.io/ - **discord** - https://discord.com/developers/applications - **telegram** - https://tinyurl.com/bdececee - https://docs.python-telegram-bot.org/en/v20.0a2/examples.html - **twitter** - https://developer.twitter.com/en/portal/petition/essential/basic-info - **youtube** - https://console.cloud.google.com/apis/credentials --- # [ `PREREQUISITES` ] #### - [ substitute apt for the package manager of your choice ] #### - [ virtualenv could be substituted for pyenv/pipenv or no virtualenv et al ] #### - [ environmental credentials in env/bin/activate could alternatively be hardcoded ] - 1 `apt install python3` - `*note: python3.9 is ideal` - 2 `apt install python3-pip` - 3 `python3 -m pip install virtualenv` --- # [ `MAPLE` ] ## - **Setup** - `git clone https://git.tcp.direct/decoded/maple.git && cd maple && bash maple` ## - **Usage** - `./maple` - this will ideally setup/start/stop maple services --- # [ `NOTES` ] #### [ Append your credentials for **developer/service** `api keys` into `~/maple/env/bin/activate` ] ``` cat ~/maple/env/bin/activate .. export CRYPTOCOMPARE_KEY=your_cryptocompare_developer_key # <- CRYPTOCOMPARE_KEY export NICKSERV_USERNAME=your_nickserv_username # <- IRCD NICKSERV USER export NICKSERV_PASSWORD=your_nickserv_password # <- IRCD NICKSERV PASS export BOT_SASL_USERNAME=$NICKSERV_USERNAME # <- IRCD NICKSERV USER export BOT_SASL_PASSWORD=$NICKSERV_PASSWORD # <- IRCD NICKSERV PASS export MATRIX_HOMESERVER=https://matrix.org # <- MATRIX HOMESERVER export MATRIX___USERNAME=your_matrix_username # <- MATRIX USERNAME export MATRIX___PASSWORD=your_matrix_password # <- MATRIX PASSWORD export DEVELOPER_KEY=1394823190182390182382383215382158321 # <- YOUTUBE API KEY export CONSUMER_KEY=2151235132512351235123512351325231 # <- TWITTER API KEY export CONSUMER_SECRET=514512521345234523452345234523452345234523452 # <- TWITTER API KEY export ACCESS_TOKEN_KEY=24513429875209348502934850294898348034850293485203948592 # <- TWITTER API KEY export ACCESS_TOKEN_SECRET=523490582034985203948520394804884820934850923485 # <- TWITTER API KEY export OPENAPI_KEY=AeJWbyak16wjHZ8L4TAbGIlVk31YwwAyz-GsezWCJ7Wkh7BIFTO # <- OPENAI API KEY export DISCORD__MAPLE=295326962352954038 # <- DISCORD API KEY export DISCORD__SCHAN=295326962352954038 # <- DISCORD API KEY export DISCORD__TOKEN=AT2Sh4g.G1M9vNTOXmIaQzdvn5b6QzQMTyTBX6COJONUIRjLWi5UX0j294 # <- DISCORD API KEY export TELEGRAM_TOKEN=AHh4DA9FgE3vs1SfAnx8975t85J30mU925GhJWcoUBBo7 # <- TELEGRAM API KEY export HYDRA_DESIGNATION=dupe # <- DEBUG CORE OR DUPE export HYDRA_HOME=#b0tsh0p # <- DEBUG HOME CHANNEL ``` --- ### THE API KEYS / THEIR VARIABLES / THEIR USAGE AND FUNCTIONALITY IN MAPLE ENVIRONMENT - 1 `env/bin/activate` - the actual credentials to be exported into the local environment - 2 `relevant plugin` - reads these particular environmental variable exports - 3 `the source code` - where the credentials are read back to as runtime only variables ### [ this method can be hardened with a cipher, but at some point a key is required ] --- 1 export CRYPTOCOMPARE_KEY=your_cryptocompare_developer_key 2 plugins.crypto_plugin 3 CRYPTOCOMPARE_KEY=os.environ['CRYPTOCOMPARE_KEY'] --- 1 export NICKSERV_USERNAME=your_nickserv_username 1 export NICKSERV_PASSWORD=your_nickserv_password 2 plugins.auth_custom_plugin 3 NICKSERV_USERNAME=os.environ['NICKSERV_USERNAME'] 3 NICKSERV_PASSWORD=os.environ['NICKSERV_PASSWORD'] --- 1 export BOT_SASL_USERNAME=also_your_nickserv_username 1 export BOT_SASL_PASSWORD=also_your_nickserv_password 2 plugins.sasl_custom_plugin 3 BOT_SASL_USERNAME=os.environ['BOT_SASL_USERNAME'] 3 BOT_SASL_PASSWORD=os.environ['BOT_SASL_PASSWORD'] --- 1 export MATRIX_HOMESERVER=https://matrix.org 1 export MATRIX___USERNAME=your_matrix_username 1 export MATRIX___PASSWORD=your_matrix_password 2 plugins.net_matrix_plugin 3 MATRIX_HOMESERVER=os.environ['MATRIX_HOMESERVER'] 3 MATRIX___USERNAME=os.environ['MATRIX___USERNAME'] 3 MATRIX___PASSWORD=os.environ['MATRIX___PASSWORD'] --- 1 export OPENAPI_KEY=AeJWbyak16wjHZ8L4TAbGIlVk31YwwAyz-GsezWCJ7Wkh7BIFTO 2 plugins.openai_plugin 3 OPENAPI_KEY = os.environ['OPENAPI_KEY'] --- 1 export DISCORD__MAPLE=295326962352954038 1 export DISCORD__SCHAN=295326962352954038 1 export DISCORD__TOKEN=AT2Sh4g.G1M9vNTOXmIaQzdvn5b6QzQMTyTBX6COJONUIRjLWi5UX0j294 2 plugins.net_discord_plugin 3 DISCORD__SCHAN=int(os.environ['DISCORD__SCHAN']) 3 DISCORD__MAPLE=int(os.environ['DISCORD__MAPLE']) 3 DISCORD__TOKEN=str(os.environ['DISCORD__TOKEN']) --- 1 export TELEGRAM_TOKEN=AHh4DA9FgE3vs1SfAnx8975t85J30mU925GhJWcoUBBo7 2 plugins.net_telegram_plugin 3 TELEGRAM_TOKEN=os.environ['TELEGRAM_TOKEN'] --- 1 export DEVELOPER_KEY=1394823190182390182382383215382158321 2 plugins.youtube_plugin 3 DEVELOPER_KEY = os.environ['DEVELOPER_KEY'] --- 1 export CONSUMER_KEY=2151235132512351235123512351325231 1 export CONSUMER_SECRET=514512521345234523452345234523452345234523452 1 export ACCESS_TOKEN_KEY=24513429875209348502934850294898348034850293485203948592 1 export ACCESS_TOKEN_SECRET=523490582034985203948520394804884820934850923485 2 plugins.twitter_plugin 3 CONSUMER_KEY = os.environ['CONSUMER_KEY'] 3 CONSUMER_SECRET = os.environ['CONSUMER_SECRET'] 3 ACCESS_TOKEN_KEY = os.environ['ACCESS_TOKEN_KEY'] 3 ACCESS_TOKEN_SECRET = os.environ['ACCESS_TOKEN_SECRET'] --- --- # [ `TODOING` ] - SERVICES_DISCORD - - tool_dims_plugin - - net_discord_plugin - - cmd_irc_plugin - - tool_bus_plugin - SERVICES_MATRIX - - tool_dims_plugin - - net_irc_plugin - - cmd_irc_plugin - - tool_bus_plugin - SERVICES_TELEGRAM - - tool_dims_plugin - - cmd_irc_plugin - - tool_bus_plugin - SERVICES_TWITTER - - url_grabber_plugin - SERVICES_YOUTUBE - - url_grabber_plugin - - twitter_plugin - SERVICES_OPENAI - - NONE ? TODO # [ `TODOING`/`NOTES` ] ## maple - default - DISCORD__SERVICING=-1 - TELEGRAM_SERVICING=-1 - MATRIX___SERVICING=-1 - OPENAI___SERVICING=-1 - YOUTUBE__SERVICING=-1 - TWITTER__SERVICING=-1 ## maple - true - DISCORD__SERVICING=1 - TELEGRAM_SERVICING=1 - MATRIX___SERVICING=1 - OPENAI___SERVICING=1 - YOUTUBE__SERVICING=1 - TWITTER__SERVICING=1 ## maple - false - DISCORD__SERVICING=0 - TELEGRAM_SERVICING=0 - MATRIX___SERVICING=0 - OPENAI___SERVICING=0 - YOUTUBE__SERVICING=0 - TWITTER__SERVICING=0 --- # [ `TODO` ] - the initial maple setup build will be affected by user selective services - e.g. maybe no discord or telegram, and maybe not matrix either, not every user will require 100% of the services in full fledge operation. - crypto_plugin also has it's own developer key, cryptocompare needs to be added to the rest of the devkeys - tool_colors_plugin, colorform - this plugin has a formatting glitch and is still offline in a few modules due to chaos variable formatting randomness - it requires better sanitization and exception handling alternatives. - - it should be in every plugin replacing the print function when fully sanitized by formatting schemes and center piece to the main admin heads up display pane. - cleanup tools_bus_plugin, there was input/output bridge messaging - this code will be re merged - cleanup tools_dim_plugin, there is lingering code that is either offline or antiquated but interwoven in #s - openai plugin is written and functions, the setup automation has omitted it's incorporation until baselined - convert escaped irc color codes back to terminal codes for ansi_plugin.py # [ `CHANGELOG`/`VERSION HISTORY` ] # **v2.7** - user tailorization - automated setup # **v2.666-3** - changed the directory structure for ease of use with the hydra system during development - ive got the hydra system split down at minimal 3.. 1 that stays up no matter what, another that runs - all of services developed up to this point, and the last one is kind of like the core, it's stripped - of services because there is already a bot running services but this one can develop new services and - stop,start,restart,crash etc.. as much as the developer would like with out sacraficing being online - or known services going offline.. # **v2.666-2** - plugins/ansi_plugin.py is an ansi recapture utility.. basically if someone is pumping ansi art into a - channel this will copy it 1:1 but for the intent of using 'ansipants', converting the graphic to an image - and then re-uploading the image rather than the ansi/utf8 to discord/matrix/telegram due to the fact they - easily or properly display ansi graphics but they show images. # **v2.666-1** - plugins/net_hydra_plugin.py is a multiband wrapper that i use as a headless hydra code/debug logic. - meaning a core, that stripped of services will always be online, so no matter what a presensce is online. - anything non core is a dupe, aka hydra.. one may run the ai one machine, and another may just be that im - coding something and dont want service to go offline and yet i myself require them to code. so that is - why and how this hydra logic is used, and it because of features of sasl authentication that it's done. # **v2.666** - fixed bridge responses double echoing - simplified the calling of some plugins - incorporated a multihead wrapper to keep services running # **v2.5** - telegram/discord/matrix/irc now netspanned ( always more to do ) - the routerio logic mostly finished in plugins/tool_bus_plugin.py - the way inter-process threads are handled are now speakable/observable - maple ai is now online, it's very fast now, almost immediate response --- # **v2.4** - telegram netspanned - experimenting with color coding --- # **v2.3** - discord netspanned --- # **v2.2** - matrix netspanned --- # **v2.1** - tried pyenv+pipenv, ended up up reverting back to pure virtualenv for consistency. --- # [ `BACKSTORY` ] ### [ `CURRENT NETSPANNED PROTOCOLS` ] - [online] - irc - https://www.rfc-editor.org/rfc/rfc2812.html - [online] - matrix - https://spec.matrix.org/latest - [online] - discord - https://discord.com/developers/docs/reference - [online] - telegram - https://core.telegram.org/bots/api ### [ `THE BASE HYBRID` ] - m4plmp - https://git.tcp.direct/decoded/m4pl1mp ### [ `BOT BASE CODES` ] - Maple - https://git.tcp.direct/decoded/Maple_old - maple renamed herself in tcpdirect - g1mp - https://git.tcp.direct/decoded/g1mp - g1mp was the first service bot ---