-
Notifications
You must be signed in to change notification settings - Fork 187
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
improve systemd docs and simplify config file arithmetics #3480
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Adding myself to get notified when merged as this is docs relevant 😄 |
This reverts commit 45f49ae.
SonarCloud Quality Gate failed. |
@wkloucek I know that time is rare, do you have an update on this? |
|
||
#### Only config files | ||
You can set another directory as config path in the environment variable `OCIS_CONFIG_DIR`. It will then pick the same file names, but from the folder you configured. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer:
"You can override the config path using the environment variable OCIS_CONFIG_DIR
.
The same config filenames will be used, but the configs will be red from the changed config path."
@@ -10,17 +10,18 @@ geekdocFilePath: systemd.md | |||
{{< toc >}} | |||
|
|||
## Install the oCIS binary | |||
|
|||
Download the oCIS binary of your preferred version and for your CPU architecture and operating system from [download.owncloud.com](https://download.owncloud.com/ocis/ocis). | |||
|
|||
Rename the downloaded binary to `ocis` and move it to `/usr/bin/`. As a next step, you need to mark it as executable with `chmod +x /usr/bin/ocis`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/local/bin
should be the valid path here. The systems package manager should not interfere with that folder.
## Systemd service definition | ||
|
||
Create the Systemd service definition for oCIS in the file `/etc/systemd/system/ocis.service` with following content: | ||
``` | ||
|
||
```systemd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExecStart
should have a full path to the binary, do not expect that $PATH
is set up properly :D
|
||
func BaseConfigPath() string { | ||
|
||
// It is not nice to have hidden / secrete configuration options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo ...secret....
For reasons of simplicity we are using the root user and group to run oCIS which is not recommended. Please use a non-root user in production environments and modify the oCIS service definition accordingly. | ||
|
||
{{< hint danger >}} | ||
For reasons of simplicity we are using the root user and group to run oCIS, which is not recommended. Please use only privileged users in production environments and modify the oCIS service definition accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely adapt our sample service file instead of this comment in the future.
|
||
var ( | ||
// switch between modes | ||
BaseConfigPathType = "homedir" // or "path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider using build constraints to switch those: see https://stackoverflow.com/questions/36703867/golang-preprocessor-like-c-style-compile-switch and https://pkg.go.dev/go/build#hdr-Build_Constraints
Description
.yaml
files and only from one location (can be set at compile time, like the default storage path). Defaults to~/.ocis/config/
for binary releases (and if you compile it without an options set). Defaults to `/etc/ocis/´ for docker image releasesRelated Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: