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

ipfs service: Fix dataDir being ignored #25531

Merged
merged 1 commit into from
May 10, 2017
Merged

ipfs service: Fix dataDir being ignored #25531

merged 1 commit into from
May 10, 2017

Conversation

infinisil
Copy link
Member

Motivation for this change

IPFS uses the environment variable IPFS_PATH to determine where to look for it's data, which wasn't set previously therefore ignoring the dataDir attribute.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

IPFS uses the environment variable IPFS_PATH to determine where to look for it's data, which wasn't set previously therefore ignoring the dataDir attribute
@mention-bot
Copy link

@infinisil, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mguentner to be a potential reviewer.

@mguentner
Copy link
Contributor

Ref: #21992

@Mic92
Copy link
Member

Mic92 commented May 9, 2017

What is your opinion on that? @mguentner

@infinisil
Copy link
Member Author

There should also be added some note that TCP port 4001 optimally should be opened.

@mguentner
Copy link
Contributor

That looks good to me, I am still not sure what to do with #21992. IMHO the IPFS_PATH should only be visible in the context of the daemon.

@infinisil
Copy link
Member Author

I tested this now and it works with as is with the folder permissions, I'm not sure why though. I tested pinning and adding.

I'm not sure how PR's are handled exactly, #21992 has the same intention as this one, but doesn't actually work. With this PR IPFS_PATH is indeed only visible to the daemon and the systemd services.

@Mic92 Mic92 merged commit 7b211da into NixOS:master May 10, 2017
@infinisil
Copy link
Member Author

I just noticed something that was wrong all along: In the ipfs-start service, the script checks for ${cfg.dataDir}/.ipfs to already exists. But that folder never even gets generated by ipfs init. The confusion probably came from the default value ~/.ipfs.

Instead we should check for ${cfg.dataDir}/config, as the main implementation does. I'm going to open a new PR for that when I get the time.

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.

None yet

4 participants