Coder Social home page Coder Social logo

Comments (8)

securisec avatar securisec commented on May 14, 2024

@geekscrapy You can provide a custom location for the plugins already. Just specify your custom location in pluginpath in the chepy.conf file. By default, it will try to use its own plugins which are packed with the latest repos. You can see those here. If you place your own plugins in that folder, Chepy will load them. If not, and you specific your own directory, then it will load only what it finds in that directory.

As for the location of the conf file itself, because there are various ways of installing chepy, it is not a super good idea to have it look in the current location. If someone uses pip to install chepy, then the current location becomes the site-packets/chepy dir which becomes cumbersome for the user to update. As for use cases of a cwd location for the conf file, it does assume that the user will set a valid conf file, which the average user might fail too. So having a standard good known config file and location follows the pattern of most popular tools out there.

Thanks for the issues.

from chepy.

geekscrapy avatar geekscrapy commented on May 14, 2024

The issue I have with not having the cwd as a valid conf is this; chepy is part of my tool, I distribute my tool and I need to be able to set the plug-in directory to a directory in my tools "plugin" dir. This way I can distribute my own plugins with my own tool. Without this I have to get people to manually mod the chepy conf (which they shouldn't have to do, as chepy is only used in my tool internally, therefore people wont know to even change the plugin path!). If it's a library it needs to be portable, without the end user having to customise their setup for a lib, which is part of the bigger tool. I will say, there are also lots of other tools that will look in the following places to find the conf (usually in this order):
$cwd
$home
/etc
Hope that makes sense! 😅

from chepy.

securisec avatar securisec commented on May 14, 2024

Ah, i understand your use case. I will consider building that out. As an alternative, if you are distributing it as a tool, you can modify this line. Set home = Path().resolve().

Hope this solution helps in the meanwhile till next release!

from chepy.

geekscrapy avatar geekscrapy commented on May 14, 2024

So you know, I'm currently doing this to get round the limitation as I cannot distribute and modify the package as you suggest above (as chepy needs to be installed from pip -r requirements.txt):

from pathlib import Path
bin_path = os.path.dirname(os.path.realpath(__file__))
def custom_Chepy():
    import chepy
    conf = chepy.ChepyConfig()
    conf.plugin_path = Path(os.path.join(bin_path,'plugins'))
    _plugins = conf.load_plugins()
    class Chepy(
        chepy.AritmeticLogic,
        chepy.CodeTidy,
        chepy.Compression,
        chepy.DataFormat,
        chepy.DateTime,
        chepy.EncryptionEncoding,
        chepy.Extractors,
        chepy.Forensics,
        chepy.Hashing,
        chepy.Language,
        chepy.Multimedia,
        chepy.Networking,
        chepy.Other,
        chepy.Publickey,
        chepy.Search,
        chepy.Utils,
        *_plugins
    ):
        pass

    return Chepy

from chepy.

securisec avatar securisec commented on May 14, 2024

Ah glad you have it working. Not sure why my suggested method didn't work, but happy it is working for you now. I am still keeping it in mind your feature request for next version. Out of curiosity, what kind of plugins are you developing for chepy? I am always very open to ideas that can enhance chepy itself.

from chepy.

geekscrapy avatar geekscrapy commented on May 14, 2024

It would be file based plugins - renaming files, moving etc. Things that you can't normally do with a browser. So I'd be looking for more of those types of plugins in the future. FYI, the main reason I was looking at using chepy over the CyberChefAPI in node was because node takes a while to load it's imports, which is a killer for cli tool...

To be honest, I didn't try your method as it would mean I have to modify chepy code where-ever I want to run my tool, so it wasn't really an option.

from chepy.

securisec avatar securisec commented on May 14, 2024

@geekscrapy I just release version 2.1.3 which implements your requested feature. It will now look at $CWD for a .chepy folder where the configs are. You can refer to docs for more config objects. So if you distribute your package with a .chepy folder, then you can specify your own chepy.conf file with the proper keys to enable and set plugin paths. If you just supply an empty .chepy dir in cwd, then it will create the default conf files at first run.

from chepy.

geekscrapy avatar geekscrapy commented on May 14, 2024

Just an FYI, even though the .chepy dir is loaded from the CWD, the plugin_path is still required to be an absolute path which means the original issue exists.

from chepy.

Related Issues (20)

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.