writefreely / documentation

WriteFreely documentation
https://writefreely.org/docs
Other
17 stars 12 forks source link

Document how to run writefreely under a separate user #54

Open glyn opened 1 month ago

glyn commented 1 month ago

Following the Getting Started page results in the writefreely server process running as root, which is far from ideal from a security perspective. It would be better to create a separate user and run the server process under that user.

See https://github.com/writefreely/writefreely/issues/85 for more context.

glyn commented 1 month ago

@thebaer I was going to take a crack at a PR for this issue, but I can't find the Getting Started page in the docs repo or in the main writefreely repo for that matter. Please could you tell me where it is?

thebaer commented 3 weeks ago

Thanks for taking a look at this @glyn! Sorry for the confusion -- we hadn't added it to this repo. You'll now find it at start.md.

glyn commented 3 weeks ago

Thanks. I'll take a look in due course.

glyn commented 1 week ago

I started to look at this, but since I don't use MySQL, I'm not going to be able to ensure correct instructions.

FWIW, on Debian, I followed the current installation instructions and then created a user (without a home directory):

# adduser --system writefreely

and changed the permissions of the writefreely installation directory:

# chown -R writefreely [writefreely installation directory]

Then I changed the systemd service definition to run writefreely under its own user:

...
[Service]
Type=simple
User=writefreely
...