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

Document how to run at startup / restart #4

Closed
eine opened this issue Jul 27, 2018 · 7 comments · May be fixed by #41
Closed

Document how to run at startup / restart #4

eine opened this issue Jul 27, 2018 · 7 comments · May be fixed by #41

Comments

@eine
Copy link
Contributor

eine commented Jul 27, 2018

Close filebrowser/filebrowser#411, filebrowser/filebrowser#418 and filebrowser/filebrowser#453.

In the issues referred above, and in the references in them, multiple alternatives are given:

It'd be interesting to have a short section in the web page (or maybe some hints spread in existing ones) to summarize the suggested alternatives. I think that the most relevant for this use case are systemd, screen/tmux and docker.

@yurividal, @xcvista would you like to contribute?

@xcvista
Copy link

xcvista commented Jul 28, 2018

For my contribution, it would be easier to ship the systemd unit file with the program, and add instructions on how to install the unit file, configuration files and how to use them.

@eine
Copy link
Contributor Author

eine commented Jul 28, 2018

The possible problem if it is shipped with the program is that each user can extract/install it in a different path, use a different user/group, and/or put config file(s) in different paths. Therefore, it is difficult to provide a solution that fits all the use cases without requiring manual intervention.

That's why I think that it is desirable to add the content in filebrowser/filebrowser#411 to the web page (probably in Installation -> systemd), and provide some additional references for users to tailor it to their needs.

Alternatively, a default setup can be added to the one-step script (get.sh) that interactively asks the user about the params. However, this implementation requires some more work.

@xcvista
Copy link

xcvista commented Jul 28, 2018

The file in filebrowser/filebrowser#411 is concrete. It is supposed to be copied to the systemd unit directory (e.g. /lib/systemd/system) as-is using the file name filebrowser@.service. This is why I am suggesting shipping this file with the code.

@eine
Copy link
Contributor Author

eine commented Jul 28, 2018

These three params in that file are concrete, but not portable:

User=www-data
Group=www-data
ExecStart=/usr/local/sbin/filebrowser -c /etc/filebrowser/%I

More precisely, the default install path with the one-step script is /usr/local/bin, not /usr/local/sbin. Also, user/group www-data are not ensured to exists in the system. They do exist in Ubuntu-based distros with apache, but not in many other distros.

Nevertheless, copying the file to /lib/systemd/system is ok. I also like the suggestion about putting the configuration(s) in /etc/filebrowser.

@xcvista
Copy link

xcvista commented Jul 31, 2018

The www-data user and group are from the default Debian installation of multiple Web servers - Apache, nginx, etc. The file I used is intended for Debian and Ubuntu.

This file can be generated in the installation step by filling in the actual installation location and guessed Web server user and group using this template. The /lib/systemd/system location is default for systemd. The /etc/filebrowser path is my own creation but since you like it...

@navossoc
Copy link

navossoc commented Dec 3, 2018

I also suggest to change to:

ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser/%I -d /etc/filebrowser/%I.db

This way you don't need to specify database on your default.json or default.yaml

@hacdias hacdias transferred this issue from filebrowser/get Jan 8, 2019
@mckaygerhard
Copy link

  1. any init file unit must not be included with filebrowser, cos must keep simple
  2. any init file unit must be documented i will provide sysvinit and openrc for devuan/alpine only
  3. after that is complete this issue must be closed, due the reason 1. and the reason 2.

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

Successfully merging a pull request may close this issue.

4 participants