Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.82k stars 2.3k forks source link

[Rewrite] Launcher #850

Closed palmtree5 closed 6 years ago

palmtree5 commented 7 years ago

Any suggestions for the rewrite when it comes to the launcher?

boswelja commented 7 years ago

Not sure if this was already a thing or not, but what about checking for updates on launcher start?

tekulvw commented 7 years ago

It's been a thing for about a year now, it's harder than it sounds to get right.

tekulvw commented 7 years ago

If #853 goes through we'll need to have users select a "cog install" path where downloader will put installed cogs. This should default to ~/.config/something on mac/*nix and %appdata%/somewhere on windows.

boswelja commented 7 years ago

What about a way to install / uninstall cogs from the launcher as well?

tekulvw commented 7 years ago

Right now that's only possible if cogs are loaded prior to launcher start

Kowlin commented 7 years ago

Actually I was thinking of a method of adding autostarting systems (like pm2 and supervisord) into the launcher. This seems like a good thing to pick up for it, check what is installed. And provide options accordingly

Jan200101 commented 7 years ago

pm2 requires root permissions to add a task to autostart that could be a problem

Kowlin commented 7 years ago

Yet another reason to use Supervisor 😏

palmtree5 commented 7 years ago

Could be a good thing though one would need to generate files for that. I've actually looked into this myself to some extent

On Mon, Jul 17, 2017, 1:37 PM Kowlin notifications@github.com wrote:

Actually I was thinking of a method of adding autostarting systems (like pm2 and supervisord) into the launcher. This seems like a good thing to pick up for it, check what is installed. And provide options accordingly

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Twentysix26/Red-DiscordBot/issues/850#issuecomment-315892562, or mute the thread https://github.com/notifications/unsubscribe-auth/ADaVp2Opzl_0hXWxW1b2yk8uIFl5b70Dks5sO9QWgaJpZM4ORZMI .

Twentysix26 commented 7 years ago

Considering the variety of process managers, the need for root, the amount of stuff that can go wrong with automating this, I think it's better to leave this to the user. They installed a bot on a Linux vps, I'm sure they can spend 2 additional minutes looking at a 5 steps tutorial

palmtree5 commented 7 years ago

I'm sure they can spend 2 additional minutes looking at a 5 steps tutorial

That I've seen multiple people manage to screw up in various methods. Automating at least the creation of such a file could potentially reduce issues caused by people making incorrect changes or failing to change certain things in the files (for example, username/group or python path). Even if we manage to clarify our docs to reduce these issues, someone will probably still manage to screw it up despite that.

That being said, my thought would be to have them as options in the launcher that only appear for linux users (maybe even reducing it to things actually supported by the version and distro they're running (example: don't show Upstart as an option for users on Ubuntu 16.04+) so as to help deter selecting an incorrect option). Then once they've chosen an option, we proceed to generate the needed file and tell them exactly where to move it to (or move it there for them using something that would look like subprocess.call(["sudo", "-k", "mv", os.path.join(os.getcwd(), "red.service"), os.path.join(os.path.sep, "etc", "systemd", "system", "red.service")])) and tell them what command to use to enable autorestart

Kowlin commented 7 years ago

A info debugger for the launcher. A formatted list to be copied to another GitHub issue or the support that. Including stuff like the Python version running, the current Git SHA1 hash, FFmpeg/PyNaCl status, OS information (OS and 32/64bit), User.

As always, feel free to throw more stuff down below ;)

tekulvw commented 7 years ago

Can you add support for asking users for a cog install directory (where should downloader put installed cogs?) because this will be supported with #853. It would also be useful to ask where people want to put their data because that's next on my list after I finish 853.

tekulvw commented 6 years ago

@palmtree5 has implemented this, please post new issues for future suggestions