Files
ProxmoxVE/install/kubo-install.sh

53 lines
1.4 KiB
Bash
Raw Permalink Normal View History

2024-06-27 06:55:51 -04:00
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
2024-06-27 06:55:51 -04:00
# Author: tteck (tteckster)
# Co-Author: ulmentflam
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/ipfs/kubo
2024-06-27 06:55:51 -04:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2024-06-27 06:55:51 -04:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
2025-07-30 15:20:20 +02:00
fetch_and_deploy_gh_release "kubo" "ipfs/kubo" "prebuild" "latest" "/usr/local/kubo" "kubo*linux-amd64.tar.gz"
msg_info "Configuring IPFS"
2024-06-27 06:55:51 -04:00
$STD ln -s /usr/local/kubo/ipfs /usr/local/bin/ipfs
$STD ipfs init
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
LXCIP=$(hostname -I | awk '{print $1}')
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "[\"http://${LXCIP}:5001\", \"http://localhost:3000\", \"http://127.0.0.1:5001\", \"https://webui.ipfs.io\", \"http://0.0.0.0:5001\"]"
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
2025-07-30 15:20:20 +02:00
msg_ok "Configured IPFS"
2024-06-27 06:55:51 -04:00
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/ipfs.service
[Unit]
Description=IPFS Daemon
After=syslog.target network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/ipfs daemon
Restart=on-failure
2025-03-24 20:34:52 +01:00
Environment=HOME=/root
2024-06-27 06:55:51 -04:00
[Install]
WantedBy=multi-user.target
EOF
2025-07-30 15:20:20 +02:00
systemctl enable -q --now ipfs
2024-06-27 06:55:51 -04:00
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"