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

[bug] federation allowList does not seem to work #10

Closed
thomasdouwes opened this issue Jun 12, 2023 · 9 comments
Closed

[bug] federation allowList does not seem to work #10

thomasdouwes opened this issue Jun 12, 2023 · 9 comments

Comments

@thomasdouwes
Copy link

The allowList property of the federation option does not seem to be followed, and the bot will reply to all comments/posts on any federated community.
example:

federation: {
  allowList: [
    {
      instance: 'lemmy.world',
      communities: ['vexillology']
    },
    {
      instance: 'lemmy.antemeridiem.xyz',
      communities: ['vexillologyjerk']
    }
  ]
},

I am using lemmy-bot 0.3.9 from npm

@SleeplessOne1917
Copy link
Owner

I'll take a look at this once the HTTP changes for Lemmy are merged., Thanks for letting me know.

@thomasdouwes
Copy link
Author

I made a new user and it seems to be working with that one with the same script. I made a patch by checking the community ID with getCommunityId, but the next day, without rebooting my PC, getCommunityId now returns undefined on the same script. I'm thinking this might be an issue with the lemmy instance not this library. I'll try to look into this further and see if I can find the source.

@thomasdouwes
Copy link
Author

thomasdouwes commented Jun 16, 2023

This might have been fixed by upgrading my lemmy instance from 0.17.2 to 0.17.4. it still replies to any local community but it seems to follow allowList for federated communities

@thomasdouwes
Copy link
Author

I have had no more issues since the lemmy update and some constant crashing has also been resolved. I think this was a problem with lemmy 0.17.2 and not this library. it still replies in all local communities however, is that intended?

@SleeplessOne1917
Copy link
Owner

It should not reply to all local communities. I will have to fix that.

@SleeplessOne1917
Copy link
Owner

Try using bot version 0.4.1 and see if it works now.

@thomasdouwes
Copy link
Author

Sadly I can't upgrade my instance to 0.18.0, can I still test this version or would I need 0.18.0?

@SleeplessOne1917
Copy link
Owner

@thomasdouwes I think it should still work even if your instance is still one 0.17.x. The major difference between 0.17.x and 0.18.x is that the websocket API was removed. The bot uses the HTTP API now, but the HTTP API shouldn't have had any breaking changes between version.

@thomasdouwes
Copy link
Author

I can't get the new version working on 0.17.4, I get UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of null when starting the bot. However, I have quickly set up a new 0.18.1 test instance on my PC and the bot is no longer replying to all local communities. I can't get my test instance federating for some reason but I assume that is also working.
Even though I can't use the fix on my instance I'm going to close this issue because the bug is fixed. thanks for the fix.

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

No branches or pull requests

2 participants