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

Configure default write location #114

Closed
refs opened this issue Feb 17, 2020 · 17 comments · Fixed by #2129
Closed

Configure default write location #114

refs opened this issue Feb 17, 2020 · 17 comments · Fixed by #2129
Labels

Comments

@refs
Copy link
Member

refs commented Feb 17, 2020

Currently konnectd's default writes a private key and a self signed certificate to the binary running location, leaving the programmer to either exclude this files from the git tree or in general adding some noise. If this is intended only for development we can use a tmp dir

image

@refs
Copy link
Member Author

refs commented Feb 17, 2020

cc @IljaN @butonic

@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

Yes the current implementation is not ideal. For the certs temp-dir would be okay 👍

But we are also creating default config-files. Need to do more concepting. A better approach would be to commit required default-configs to the configs dir. But this would break the current zero-configuration approach i.e just run the binary.

A counter-point would be that the binary will always be delivered in a tar anyways so we can also ship the config dir with it.

@IljaN IljaN transferred this issue from owncloud/ocis Feb 17, 2020
@IljaN IljaN transferred this issue from owncloud/ocis-konnectd Feb 17, 2020
@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

Currently ocis-konnectd is doing the writing. But lets leave the issue here, as this might concern other services as well in the future.

@refs
Copy link
Member Author

refs commented Feb 17, 2020

or delete generated artifacts on shutdown

@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

Okay I realize now that it polutes the config dir in the code-tree. Didn't think about this case because I always run the binary with ocis/bin as $PWD.

Would a .gitignore entry be okay for a start? But then we need to add files to ocis .gitignore which belong to other repos (ocis-konnectd) 🤔.

or delete generated artifacts on shutdown

This would work for developers but on a production system we probably won't have the permission to create anything in $PWD at all. Assuming configs are in /etc and the binary in /usr/bin or similar.

@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

IIRC other high-profile golang projects createe a directory in $XDG_CONFIG_HOME unless a flag overrides this behaviour. This would cover both use-cases i.e running in development or testing vs running as daemon.

See: https://wiki.archlinux.org/index.php/XDG_Base_Directory

@refs
Copy link
Member Author

refs commented Feb 17, 2020

or just add it to your global gitignore

@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

or just add it to your global .gitignore

Then every developer needs to remember to do it. Bad DX ;)

IMO using the XDG standard would be the right approach. What do you think?

@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

IMO using the XDG standard would be the right approach. What do you think?

Hmhh... but this would break windows and osx builds. So we would need to have an os-specific abstraction for it.
https://stackoverflow.com/questions/3373948/equivalents-of-xdg-config-home-and-xdg-data-home-on-mac-os-x

@refs
Copy link
Member Author

refs commented Feb 17, 2020

...I was in the process of typing this down :D

@refs
Copy link
Member Author

refs commented Feb 17, 2020

In theory the accounts / settings service should account for storing any configuration parameter, a private key and cert counts as that I guess.

@IljaN
Copy link
Member

IljaN commented Feb 17, 2020

refs pushed a commit that referenced this issue Sep 18, 2020
@refs refs changed the title Don't use the project structure as default writing location Configure default write location Jan 13, 2021
@settings settings bot removed the p3-medium label Apr 7, 2021
@stale
Copy link

stale bot commented Jun 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status:Stale label Jun 6, 2021
@refs
Copy link
Member Author

refs commented Jun 7, 2021

IMHO this is a super easy quick win @micbar

@stale stale bot removed the Status:Stale label Jun 7, 2021
@micbar micbar added the OCIS-Fastlane Planned outside of the sprint label Jun 7, 2021
@micbar
Copy link
Contributor

micbar commented Jun 7, 2021

Super easy quick fix for me would be more like effort 1 or 3 😄

@refs
Copy link
Member Author

refs commented Jun 7, 2021

@micbar #2129

@refs
Copy link
Member Author

refs commented Jun 7, 2021

@refs refs closed this as completed in #2129 Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants