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

Server: Config defaults to root and Datadir #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a-mpch
Copy link
Contributor

@a-mpch a-mpch commented Nov 8, 2024

Should close #183

In this PR

Similar to bitcoin ~/.bitcoin/bitcoin.conf and ~/.lnd/lnd.conf, we add ~./lndk as default path to store conf file.
Added some prevalence root project conf.file wouldn't be overriden by lndk dir conf file.

We move the datadir to defaults to ~/.lndk/data. If ~/.lndk does not exists, it tries to create it.

We don't store it inside networks yet as LNDK does not have a concept of network in server, but it does using cli

How can i test it?

Add some files with different configurations:

  • lndk.conf in root project
  • ~/.lndk/lndk.conf

Test which configurations are used. Easy way to do it is to point to different lnd servers and point address in each file to each of them.

Why this?

Standardness and ease when deploying

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (bce9388) to head (a2b42b5).

Files with missing lines Patch % Lines
src/main.rs 0.00% 20 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #193   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           1       1           
  Lines         135     149   +14     
======================================
- Misses        135     149   +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@a-mpch a-mpch marked this pull request as draft November 8, 2024 20:18
@dunxen
Copy link
Collaborator

dunxen commented Nov 8, 2024

Thanks. I'll have a closer look this weekend. Catching up.

@dunxen
Copy link
Collaborator

dunxen commented Nov 9, 2024

I'm happy to have this PR be the "follow-up" to #192 as discussed in #192 (comment) 😄. Would you be okay to broaden the scope a bit as I imagine there's a dependency there anyway?

@a-mpch
Copy link
Contributor Author

a-mpch commented Nov 9, 2024

@dunxen sure, i'll take it!

@dunxen
Copy link
Collaborator

dunxen commented Nov 28, 2024

#192 has been merged now if that helps!

@a-mpch
Copy link
Contributor Author

a-mpch commented Nov 28, 2024

@dunxen ty! I'll take over it

@a-mpch a-mpch force-pushed the lndk_conf_from_different_sources branch 2 times, most recently from 16eaaac to 46959fa Compare December 13, 2024 20:26
@a-mpch a-mpch marked this pull request as ready for review December 13, 2024 21:54
@a-mpch
Copy link
Contributor Author

a-mpch commented Dec 13, 2024

I guess code coverage is broken?

@dunxen
Copy link
Collaborator

dunxen commented Dec 14, 2024

I guess code coverage is broken?

Yeah I'll sort that out. No worries.

LNDK is already using a datadir to store TLS certificates.
In this PR we default LNDK config and data to ~/.lndk.
Datadir is moved inside the default dir ~/.lndk/data. Then,
we expect lndk.conf file to be iether in root of the project,
or the default LNDK config folder or --config flag.
Precedence is flag > root > default dir.
@a-mpch a-mpch force-pushed the lndk_conf_from_different_sources branch from 46959fa to a2b42b5 Compare December 14, 2024 19:56
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.

Feature: make the default value for --conf as ~/.lndk/lndk.conf.
2 participants