Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spam plugin should implement check_configuration #600

Open
jayvdb opened this issue Aug 5, 2018 · 10 comments
Open

spam plugin should implement check_configuration #600

jayvdb opened this issue Aug 5, 2018 · 10 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Aug 5, 2018

MAX_LINES = 1 is invalid, as it will mean anyone writing one line is spamming, which is silly.

MAX_MSG_LEN <= length of BOT_PREFIX is invalid, as means invoking a command is spamming, which is silly.

@bistaastha
Copy link

@jayvdb Can I be assigned this issue?

@jayvdb
Copy link
Member Author

jayvdb commented Aug 6, 2018

Sure. i've sent you an invite to join @coala.

@bistaastha
Copy link

@jayvdb I am a college fresher right now and I am just getting familiar with python and git. I understand some of the issue but not all of it. Could you please explain it in more detail?

@jayvdb
Copy link
Member Author

jayvdb commented Aug 15, 2018

Ping @nvzard for help , here or on gitter room for coboro

@jayvdb
Copy link
Member Author

jayvdb commented Aug 16, 2018

Guide at http://errbot.io/en/latest/user_guide/plugin_development/configuration.html

The existing config (https://github.com/coala/corobo/blob/master/plugins/spam.py#L13)

is

    CONFIG_TEMPLATE = {
        'MAX_MSG_LEN': constants.MAX_MSG_LEN,
        'MAX_LINES': constants.MAX_LINES
    }

And those constants are at https://github.com/coala/corobo/blob/master/plugins/constants.py

so effectively the config default is

    CONFIG_TEMPLATE = {
        'MAX_MSG_LEN': 1000,
        'MAX_LINES': 20,
    }

The first config validation we need is to ensure that the user never sets MAX_LINES to 1 or 0 , as that causes the bot to go into meltdown.

Just try to validate that one to begin with. Then you can try validating MAX_MSG_LEN.

@bistaastha
Copy link

@jayvdb I am not sure where exactly am I supposed to write the validation.

@jayvdb
Copy link
Member Author

jayvdb commented Aug 19, 2018

You add it to spam.py's check_configuration.

First you need to install and run corobo.
If you cant do that, you may want to find another issue to work on.

@bistaastha
Copy link

Errbot isn't being detected on my system. And running corobo by the docker image shows something like this: https://pastebin.com/kLDFqJn3

@nvzard
Copy link
Member

nvzard commented Aug 19, 2018

@CodeSparkle
To setup corobo, just create a virtualenv and install all the deps in requirements.txt and test-requirements.txt. Then you'll be good to go.

@bistaastha
Copy link

While installing the dependencies, I encountered this error.
screenshot from 2018-09-03 08-09-41
I haven't been able to find my way around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants