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

improve systemd docs and simplify config file arithmetics #3480

Closed
wants to merge 17 commits into from

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Apr 7, 2022

Description

  • Improves the systemd docs
  • simplifies the configuration arithmetics (BREAKING), only loads .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 releases

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Apr 7, 2022

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.

@mmattel
Copy link
Contributor

mmattel commented Apr 7, 2022

Adding myself to get notified when merged as this is docs relevant 😄

@mmattel mmattel mentioned this pull request Apr 19, 2022
@sonarcloud
Copy link

sonarcloud bot commented Apr 26, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.7% 0.7% Coverage
57.6% 57.6% Duplication

@mmattel
Copy link
Contributor

mmattel commented Apr 27, 2022

@wkloucek I know that time is rare, do you have an update on this?

@micbar micbar mentioned this pull request Apr 29, 2022
45 tasks

#### 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.
Copy link
Contributor

@dragonchaser dragonchaser May 2, 2022

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`.
Copy link
Contributor

@dragonchaser dragonchaser May 2, 2022

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
Copy link
Contributor

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
Copy link
Collaborator

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.
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wkloucek wkloucek closed this May 30, 2022
@wkloucek wkloucek deleted the systemd-docs branch May 30, 2022 11:02
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 this pull request may close these issues.

4 participants