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

Can't bulk import #33

Open
KodeIn opened this issue Feb 14, 2025 · 3 comments
Open

Can't bulk import #33

KodeIn opened this issue Feb 14, 2025 · 3 comments

Comments

@KodeIn
Copy link

KodeIn commented Feb 14, 2025

Hello.
While trying sharkey on my server I stumbled on a slight problem. When bulk import emotes, I get this king of message in journalctl logs :

ERR  1        [queue db]        failed(RequestError: Blocked address: 127.0.0.1) id=9699 {
   job: {
     info: 'id=9699 attempts=1/0 age=19ms',
     data: { user: [Object], fileId: 'a485c4g470' },
     name: 'importCustomEmojis',
     failedReason: 'Blocked address: 127.0.0.1'
   },
   e: {
     stack: 'RequestError: Blocked address: 127.0.0.1\n' +
       '    at ClientRequest.<anonymous> (file:///var/www/sharkey/node_modules/.pnpm/[email protected]/node_modules/got/dist/source/core/index.js:673:107)\n' +
       '    at Object.onceWrapper (node:events:633:26)\n' +
       '    at ClientRequest.emit (node:events:530:35)\n' +
       '    at emitErrorEvent (node:_http_client:104:11)\n' +
       '    at TLSSocket.socketErrorListener (node:_http_client:518:5)\n' +
       '    at TLSSocket.emit (node:events:518:28)\n' +
       '    at emitErrorNT (node:internal/streams/destroy:170:8)\n' +
       '    at emitErrorCloseNT (node:internal/streams/destroy:129:3)\n' +
       '    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n' +
       '    at TLSSocket.<anonymous> (file:///var/www/sharkey/packages/backend/built/core/HttpRequestService.js:88:40)\n' +
       '    at TLSSocket.emit (node:events:530:35)\n' +
       '    at afterConnect (node:net:1619:10)\n' +
       '    at afterConnectMultiple (node:net:1726:3)',
     message: 'Blocked address: 127.0.0.1',
     name: 'RequestError'
   }
 }

I also tried to import .CSV file exported from my vanilla mastodon instance containing accounts that I'm following without success. I don't know if it's the same problem but since it may I mention it here.

I have no troubles adding manually a single new emote nor following manually accounts.

As I'm quite inexperienced at managing servers I don't know if it's a problem specific to my system or a more generic problem but I'd be glad getting some help to fix it.

@looowizz
Copy link
Contributor

Hi! I've also had this problem but havent gotten round to making a PR. Also not sure about the security implications of the solution.

What i did was add the following to /var/www/sharkey/.config/default.yml:

allowedPrivateNetworks: [
  '127.0.0.1/8'
]

and add the following to /etc/nginx/your.sharkey.domain.d/sharkey.conf:

location / {
  allow 127.0.0.1;
  ...
}

Then restart nginx and sharkey with

sudo yunohost service restart nginx
sudo yunohost service restart sharkey

It still seems to be very heavily rate limited (only like 1 import per hour or so) but it seems to work for me. Lmk how it goes for you!

@KodeIn
Copy link
Author

KodeIn commented Feb 14, 2025

Thanks, everything works perfectly now. No more excuses to not migrate my account.

@looowizz
Copy link
Contributor

Awesome! Will open a PR to close this issue soon :)

looowizz added a commit to looowizz/sharkey_ynh that referenced this issue Feb 15, 2025
This fixes the ability to bulk import followers, custom emotes, etc.

Might have some security implications though, as mentioned in the example config: https://github.com/misskey-dev/misskey/blob/1e88aa9d816ec216c04a3e444a3af95496cc5142/.config/example.yml#L330-L332

Closes issue YunoHost-Apps#33

Signed-off-by: loowiz <[email protected]>
@looowizz looowizz mentioned this issue Feb 15, 2025
2 tasks
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