kytta / share2fedi

Cross-instance share page for the Fediverse
https://s2f.kytta.dev/
GNU Affero General Public License v3.0
28 stars 4 forks source link

Managing Share2Fedi via a systemd unit. #53

Open Zergy opened 1 year ago

Zergy commented 1 year ago

Hello,

I manage to install Share2fedi on my own instance this morning. For some reason it keep crashing and restarting when I tried to start it with PM2, but maybe it's my fault, but as it work fine with the "node" command directly, I keep it this way.

I created a little systemd unit to start and stop it, it could be nice to add it to the files of the project, so interacting with it will be easier than launching a command by hand. For your info, I made a copy of the "mastodon-web" unit as a base and modified, so, I guess it's not perfect. Before I forgot, in my example file I run Share2Fedi on port 3030 as the 3000 is already used.

I'm sorry if it's not the right place for that, as it's not a issue but more an addition proposal, I'm still a noob with github. :/

share2fedi.service.txt

kytta commented 1 year ago

I created a little systemd unit to start and stop it, it could be nice to add it to the files of the project, so interacting with it will be easier than launching a command by hand.

Good idea! I am not a fan of putting too many files into the source repository, but this addition is helpful. I need time to figure out where to put it...

For your info, I made a copy of the "mastodon-web" unit as a base and modified, so, I guess it's not perfect.

It does look quite good, actually! I have learned that systemd has sandboxing :D

I'm sorry if it's not the right place for that, as it's not a issue but more an addition proposal, I'm still a noob with github. :/

This certainly is a good place; otherwise, you could've also opened a pull request — all fine by me! Don't worry, there's plenty of time to learn it all :) Welcome to the world of open-source!