Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Self-Hosting Guide #84

Closed
cybormar opened this issue Nov 14, 2020 · 13 comments
Closed

Self-Hosting Guide #84

cybormar opened this issue Nov 14, 2020 · 13 comments
Labels
enhancement New feature or request good first issue Good for newcomers priority: high
Milestone

Comments

@cybormar
Copy link

sup, is there any guide or anything for self-hosting?

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Yo! I intend to do this later this week which I'm working on a big update, but the self-hosting process for now is very simple (I'm sorry if I miss something, it's my first time doing something open-source for real)

  • Clone the project (or fork and clone your fork to your computer)
  • Install all the dependencies using yarn or npm install
  • Copy the .env.exemple and rename the copy to .env
  • Fill in the .env data according to the comments you have in the file (You do not need to fill in the data for botlists like top.gg and Discord Bot List if you leave the version as canary, you can self-host Mio, which is Ritsu's API and is open-source, but if you don't want to, you can use the one Ritsu uses in production (ritsu.api.waiifu.tech) in API_URL, just don't abuse it.)
  • Start the bot using node . or node index.js, if all goes well, the title will appear in ASCII by Ritsu and she will be online!

Sorry for the last minute explanation, if you have any questions feel free to join in to the support server or send me a DM
Remember to follow the license.

https://discord.gg/XuDysZg
sazz#0002

@Sazzo Sazzo changed the title Guide Self-Hosting Guide Nov 15, 2020
@Sazzo Sazzo added enhancement New feature or request good first issue Good for newcomers priority: high labels Nov 15, 2020
@cybormar
Copy link
Author

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

It seems to be something related to the endpoint that Ritsu uses to see the statuses that we change, create a collection in your MongoDB with the id as "servers" and put the rest as described here

https://github.com/RitsuProject/Mio/blob/main/src/models/Servers.ts

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Also, i think that maybe I forgot to put in the example of .env, yes, put the token of your instance using the variable DISCORD_TOKEN in .env and the same MongoDB url plz

@cybormar
Copy link
Author

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

It seems to be something related to the endpoint that Ritsu uses to see the statuses that we change, create a collection in your MongoDB with the id as "servers" and put the rest as described here

https://github.com/RitsuProject/Mio/blob/main/src/models/Servers.ts
So, I have to keep the bot token and mongodb same for both Discord Bot and API i see.
What id I have to put in Servers collection? Guild ID or My own id or ?

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Aight, tysm I was confused about what should I put in API_URL but, seems like it's clear now. Tho before I hosted that API on my own PC but it didn't work. I was getting animethemes returning null and the location of the error is from ThemesController.ts line 226. I was also wondering what if I have to put the same MongoDB URL and bot token in that API too?

It seems to be something related to the endpoint that Ritsu uses to see the statuses that we change, create a collection in your MongoDB with the id as "servers" and put the rest as described here
https://github.com/RitsuProject/Mio/blob/main/src/models/Servers.ts
So, I have to keep the bot token and mongodb same for both Discord Bot and API i see.
What id I have to put in Servers collection? Guild ID or My own id or ?

Put the id as "servers".

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Added a little information about self-hosting and other stuff in README.md, i should do this soon in the other repositories like the in the API.

@cybormar
Copy link
Author

This should be fine right?
image

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

yup!

@cybormar
Copy link
Author

I'm getting this error now.

[GAME_SERVICE] GUILD -> 0000000000000000000 | SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at CentraResponse.json (node_modules\centra\model\CentraResponse.js:17:48)
    at phin (node_modules\phin\lib\phin.js:75:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async getProviderStatus (src\utils\getProviderStatus.js:14:21)
    at async GameService.choose (src\handlers\GameHandler.js:290:20)
    at async GameService.getTheme (src\handlers\GameHandler.js:276:19)
    at async GameService.startNewRound (src\handlers\GameHandler.js:95:19)

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

I'm getting this error now.

[GAME_SERVICE] GUILD -> 0000000000000000000 | SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at CentraResponse.json (node_modules\centra\model\CentraResponse.js:17:48)
    at phin (node_modules\phin\lib\phin.js:75:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async getProviderStatus (src\utils\getProviderStatus.js:14:21)
    at async GameService.choose (src\handlers\GameHandler.js:290:20)
    at async GameService.getTheme (src\handlers\GameHandler.js:276:19)
    at async GameService.startNewRound (src\handlers\GameHandler.js:95:19)

Can you access the API URL you put in API_URL and access the path /themes/status?

Like: http://localhost:3001/themes/status and see what appears.

Should be like this:
image

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Just a reminder, if you're running on localhost, the protocol that should generally be used is http, so it's supposed to be something like http://localhost instead of https://localhost

@Sazzo
Copy link
Member

Sazzo commented Nov 15, 2020

Closing this for now.

@Sazzo Sazzo closed this as completed Nov 15, 2020
@Sazzo Sazzo linked a pull request Nov 23, 2020 that will close this issue
@Sazzo Sazzo removed a link to a pull request Nov 25, 2020
@Sazzo Sazzo added this to the v2.5 milestone Nov 25, 2020
@Sazzo Sazzo mentioned this issue Jul 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers priority: high
Projects
None yet
Development

No branches or pull requests

2 participants