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

Trouble changing IPFS_PATH in snap containers #8553

Closed
3 tasks done
ethever opened this issue Nov 16, 2021 · 3 comments
Closed
3 tasks done

Trouble changing IPFS_PATH in snap containers #8553

ethever opened this issue Nov 16, 2021 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@ethever
Copy link

ethever commented Nov 16, 2021

Checklist

Installation method

ipfs-update or dist.ipfs.io

Version

go-ipfs version: 0.10.0-64b532fbb
Repo version: 11
System version: arm64/linux
Golang version: go1.16.8

Config

{
  "API": {
    "HTTPHeaders": {}
  },
  "Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Announce": [],
    "Gateway": "/ip4/127.0.0.1/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic",
      "/ip6/::/udp/4001/quic"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "10GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": false,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "ShardingEnabled": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": null,
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "12D3KooWGeXigvpRQqLKZGW5fXNJ3c69w36SABv4bk136KGYBnQn"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": null
  },
  "Pinning": {
    "RemoteServices": {}
  },
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Routing": {
    "Type": "dht"
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 900,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "EnableAutoRelay": false,
    "EnableRelayHop": false,
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Description

yet, why i can not change the HOME dictionary for my IPFS NODE???? pls

@ethever ethever added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Nov 16, 2021
@ethever
Copy link
Author

ethever commented Nov 16, 2021

root@pi:/mnt/sda2/ipfs# export IPFS_PATH=/mnt/sda2/ipfs
root@pi:/mnt/sda2/ipfs# export IPFS_PATH=/mnt/sda2/ipfs/
root@pi:/mnt/sda2/ipfs# ipfs init
generating ED25519 keypair...done
peer identity: 12D3KooWPjrzDxX9qMAxwhDZPy5fbDchVKzerNN4VbMV9kUj8KrZ
initializing IPFS node at /root/snap/ipfs/common
Error: ipfs configuration file already exists!
Reinitializing would overwrite your keys.

root@pi:/mnt/sda2/ipfs# export IPFS_PATH=/mnt/sda2/ipfs/
root@pi:/mnt/sda2/ipfs# echo $IPFS_PATH
/mnt/sda2/ipfs/
root@pi:/mnt/sda2/ipfs# ipfs init
generating ED25519 keypair...done
peer identity: 12D3KooWGM8zVEqM6KLGK94zSEuNYFcgaCPd82eY4Cw4rSfQPWxh
initializing IPFS node at /root/snap/ipfs/common
Error: ipfs configuration file already exists!
Reinitializing would overwrite your keys.

root@pi:/mnt/sda2/ipfs# rm -rf /root/snap/ipfs
root@pi:/mnt/sda2/ipfs# echo $IPFS_PATH
/mnt/sda2/ipfs/
root@pi:/mnt/sda2/ipfs# ipfs init
generating ED25519 keypair...done
peer identity: 12D3KooWGeXigvpRQqLKZGW5fXNJ3c69w36SABv4bk136KGYBnQn
initializing IPFS node at /root/snap/ipfs/common
to get started, enter:

    ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme

root@pi:/mnt/sda2/ipfs# ipfs version --all
go-ipfs version: 0.10.0-64b532fbb
Repo version: 11
System version: arm64/linux
Golang version: go1.16.8
root@pi:/mnt/sda2/ipfs#
root@pi:/mnt/sda2/ipfs#
root@pi:/mnt/sda2/ipfs#
root@pi:/mnt/sda2/ipfs# ipfs config show

@gammazero
Copy link
Contributor

gammazero commented Nov 17, 2021

This is happening because IPFS is installed as a snap, and setting IPFS_PATH will not work. I recommend removing the IPFS snap:

sudo snap remove ipfs
hash -d ipfs

Then install IPFS per the instructions here:
https://docs.ipfs.io/install/command-line/#linux

@aschmahmann
Copy link
Contributor

aschmahmann commented Nov 17, 2021

First things first this issue is not inline with the IPFS Community Code of Conduct https://github.com/ipfs/community/blob/master/code-of-conduct. If you'd like to engage with the community please do so in a productive and respectful way or the moderators will remove your ability to engage.

Installation method
ipfs-update or dist.ipfs.io

You seem to have actually used snap here which is misleading.

This is a bug report, not a question. Ask questions on discuss.ipfs.io.

This is a question and not a bug report. Please follow the guidelines when filing issues, questions belong on the forums. If you'd like to engage further do so there.

Finally, @gammazero is correct and snap has issues with setting environment variables used by the container. There are resources online that detail this such as https://forum.snapcraft.io/t/set-environment-variables-after-install/4796.

@aschmahmann aschmahmann changed the title How the FUCKING issue: does THE IPFS_PATH not valid ???? Trouble changing IPFS_PATH in snap containers Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

3 participants