-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAS-120628 / 23.10 / Add IPFS app to community train (#1023)
* Add ipfs to community train * run chown before config and only once * fix selector * update readme(s) * add update strategy
- Loading branch information
Showing
17 changed files
with
593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: file://../../../common | ||
version: 1.0.0 | ||
digest: sha256:f90dc95623b075f1d9ec4c4ba12464e2e789176ce7282a3aede37222201763b6 | ||
generated: "2023-03-09T22:30:24.240799718+02:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: ipfs | ||
description: Interplanetary Filesystem - the Web3 standard for content-addressing, interoperable with HTTP | ||
annotations: | ||
title: IPFS | ||
type: application | ||
version: 1.0.0 | ||
apiVersion: v2 | ||
appVersion: '0.18.1' | ||
kubeVersion: '>=1.16.0-0' | ||
maintainers: | ||
- name: truenas | ||
url: https://www.truenas.com/ | ||
dependencies: | ||
- name: common | ||
repository: file://../../../common | ||
version: 1.0.0 | ||
home: https://ipfs.tech/ | ||
icon: https://avatars.githubusercontent.com/u/10536621 | ||
sources: | ||
- https://github.com/ipfs/kubo | ||
- https://github.com/truenas/charts/tree/master/community/ipfs | ||
- https://ipfs.tech/ | ||
keywords: | ||
- storage | ||
- ipfs | ||
- kubo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# IPFS | ||
|
||
[Interplanetary Filesystem](https://ipfs.tech) - the Web3 standard for content-addressing, interoperable with HTTP | ||
|
||
> When application is installed, a container will be launched with **root** privileges. | ||
> This is required in order to apply the correct permissions to the ipfs directories. | ||
> Afterward, the `ipfs` container will run as a **non**-root user (Default: `568`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# IPFS | ||
|
||
[Interplanetary Filesystem](https://ipfs.tech) - the Web3 standard for content-addressing, interoperable with HTTP | ||
|
||
> When application is installed, a container will be launched with **root** privileges. | ||
> This is required in order to apply the correct permissions to the ipfs directories. | ||
> Afterward, the `ipfs` container will run as a **non**-root user (Default: `568`). |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ipfsStorage: | ||
data: | ||
type: hostPath | ||
hostPath: /mnt/{{ .Release.Namespace }}/data | ||
datasetName: data | ||
staging: | ||
type: hostPath | ||
hostPath: /mnt/{{ .Release.Namespace }}/staging | ||
datasetName: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ipfsConfig: | ||
additionalEnvs: | ||
- name: GOLOG_LOG_LEVEL | ||
value: debug | ||
- name: GOLOG_LOG_FMT | ||
value: json | ||
|
||
ipfsStorage: | ||
data: | ||
type: hostPath | ||
hostPath: /mnt/{{ .Release.Namespace }}/data | ||
datasetName: data | ||
staging: | ||
type: hostPath | ||
hostPath: /mnt/{{ .Release.Namespace }}/staging | ||
datasetName: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ipfsStorage: | ||
data: | ||
type: hostPath | ||
hostPath: /mnt/{{ .Release.Namespace }}/data | ||
datasetName: data | ||
staging: | ||
type: hostPath | ||
hostPath: /mnt/{{ .Release.Namespace }}/staging | ||
datasetName: staging | ||
ipfsNetwork: | ||
hostNetwork: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
icon_url: https://avatars.githubusercontent.com/u/10536621 | ||
categories: | ||
- storage | ||
- ipfs | ||
- kubo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
groups: | ||
- name: IPFS Configuration | ||
description: Configure IPFS | ||
- name: User and Group Configuration | ||
description: Configure User and Group for IPFS | ||
- name: Network Configuration | ||
description: Configure Network for IPFS | ||
- name: Storage Configuration | ||
description: Configure Storage for IPFS | ||
- name: Resources Configuration | ||
description: Configure Resources for IPFS | ||
|
||
portals: | ||
web_portal: | ||
protocols: | ||
- "$kubernetes-resource_configmap_portal_protocol" | ||
host: | ||
- "$kubernetes-resource_configmap_portal_host" | ||
ports: | ||
- "$kubernetes-resource_configmap_portal_port" | ||
path: "$kubernetes-resource_configmap_portal_path" | ||
|
||
questions: | ||
|
||
- variable: ipfsConfig | ||
label: "" | ||
group: IPFS Configuration | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: additionalEnvs | ||
label: Additional Environment Variables | ||
description: Configure additional environment variables for IPFS. | ||
schema: | ||
type: list | ||
default: [] | ||
items: | ||
- variable: env | ||
label: Environment Variable | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: name | ||
label: Name | ||
schema: | ||
type: string | ||
required: true | ||
- variable: value | ||
label: Value | ||
schema: | ||
type: string | ||
required: true | ||
|
||
- variable: ipfsRunAs | ||
label: "" | ||
group: User and Group Configuration | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: user | ||
label: User ID | ||
description: The user id that IPFS will run as. | ||
schema: | ||
type: int | ||
min: 1 | ||
default: 568 | ||
required: true | ||
- variable: group | ||
label: Group ID | ||
description: The group id that IPFS will run as. | ||
schema: | ||
type: int | ||
min: 1 | ||
default: 568 | ||
required: true | ||
|
||
- variable: ipfsNetwork | ||
label: "" | ||
group: Network Configuration | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: apiPort | ||
label: API Port | ||
description: The port for the IPFS API (And WebUI). | ||
schema: | ||
type: int | ||
default: 30000 | ||
min: 9000 | ||
max: 65535 | ||
required: true | ||
- variable: swarmPort | ||
label: Swarm Port | ||
description: The port for the IPFS Swarm. Both TCP and UDP | ||
schema: | ||
type: int | ||
default: 30001 | ||
min: 9000 | ||
max: 65535 | ||
required: true | ||
- variable: gatewayPort | ||
label: Gateway Port | ||
description: The port for the IPFS Gateway. | ||
schema: | ||
type: int | ||
default: 30002 | ||
min: 9000 | ||
max: 65535 | ||
required: true | ||
- variable: hostNetwork | ||
label: Host Network | ||
description: | | ||
Bind to the host network. It's recommended to keep this disabled. | ||
schema: | ||
type: boolean | ||
default: false | ||
|
||
- variable: ipfsStorage | ||
label: "" | ||
group: Storage Configuration | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: data | ||
label: IPFS Data Storage | ||
description: The path to store IPFS data. | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: type | ||
label: Type | ||
schema: | ||
type: string | ||
required: true | ||
default: ixVolume | ||
enum: | ||
- value: hostPath | ||
description: Host Path | ||
- value: ixVolume | ||
description: ixVolume | ||
- variable: datasetName | ||
label: Dataset Name | ||
schema: | ||
type: string | ||
show_if: [["type", "=", "ixVolume"]] | ||
required: true | ||
hidden: true | ||
immutable: true | ||
default: data | ||
$ref: | ||
- "normalize/ixVolume" | ||
- variable: hostPath | ||
label: Host Path | ||
schema: | ||
type: hostpath | ||
show_if: [["type", "=", "hostPath"]] | ||
immutable: true | ||
required: true | ||
- variable: staging | ||
label: IPFS Staging Storage | ||
description: The path to store IPFS staging storage. | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: type | ||
label: Type | ||
schema: | ||
type: string | ||
required: true | ||
default: ixVolume | ||
enum: | ||
- value: hostPath | ||
description: Host Path | ||
- value: ixVolume | ||
description: ixVolume | ||
- variable: datasetName | ||
label: Dataset Name | ||
schema: | ||
type: string | ||
show_if: [["type", "=", "ixVolume"]] | ||
required: true | ||
hidden: true | ||
immutable: true | ||
default: staging | ||
$ref: | ||
- "normalize/ixVolume" | ||
- variable: hostPath | ||
label: Host Path | ||
schema: | ||
type: hostpath | ||
show_if: [["type", "=", "hostPath"]] | ||
immutable: true | ||
required: true | ||
|
||
- variable: resources | ||
label: "" | ||
group: Resources Configuration | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: limits | ||
label: Limits | ||
schema: | ||
type: dict | ||
attrs: | ||
- variable: cpu | ||
label: CPU | ||
description: CPU limit for qBittorrent. | ||
schema: | ||
type: string | ||
default: 4000m | ||
required: true | ||
- variable: memory | ||
label: Memory | ||
description: Memory limit for qBittorrent. | ||
schema: | ||
type: string | ||
default: 8Gi | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ include "ix.v1.common.lib.chart.notes" $ }} |
60 changes: 60 additions & 0 deletions
60
library/ix-dev/community/ipfs/templates/_configuration.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{- define "ipfs.configuration" -}} | ||
{{/* Default Swarm Addresses https://github.com/ipfs/kubo/blob/master/docs/config.md#addressesswarm */}} | ||
{{ $swarmAddressesList := (list | ||
(printf "/ip4/0.0.0.0/tcp/%v" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip6/::/tcp/%v" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip4/0.0.0.0/udp/%v/quic" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip4/0.0.0.0/udp/%v/quic-v1" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip4/0.0.0.0/udp/%v/quic-v1/webtransport" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip6/::/udp/%v/quic" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip6/::/udp/%v/quic-v1" .Values.ipfsNetwork.swarmPort) | ||
(printf "/ip6/::/udp/%v/quic-v1/webtransport" .Values.ipfsNetwork.swarmPort) | ||
) }} | ||
|
||
{{ $swarmAddresses := printf "[ \"%s\" ]" (join "\", \"" $swarmAddressesList) }} | ||
|
||
{{/* Default API Address https://github.com/ipfs/kubo/blob/master/docs/config.md#addressesapi */}} | ||
{{ $apiAddresses := printf "/ip4/0.0.0.0/tcp/%v" .Values.ipfsNetwork.apiPort }} | ||
{{/* Default Gateway Address https://github.com/ipfs/kubo/blob/master/docs/config.md#addressesgateway */}} | ||
{{ $gatewayAddresses := printf "/ip4/0.0.0.0/tcp/%v" .Values.ipfsNetwork.gatewayPort }} | ||
{{ $allowOrigins := "[ \"*\" ]" }} | ||
{{ $allowMethods := "[ \"PUT\", \"POST\" ]" }} | ||
|
||
|
||
{{/* Configmaps */}} | ||
configmap: | ||
config-script: | ||
enabled: true | ||
data: | ||
init-config.sh: | | ||
#!/bin/sh | ||
set -e | ||
|
||
if [ ! -f /data/ipfs/config ]; then | ||
# Create the IPFS config file | ||
echo "Initializing IPFS" | ||
ipfs init | ||
fi | ||
|
||
# Configure the Addresses.API | ||
echo "Configuring the Addresses.API to {{ $apiAddresses }}" | ||
ipfs config Addresses.API {{ $apiAddresses }} | ||
|
||
# Configure the Addresses.Gateway | ||
echo "Configuring the Addresses.Gateway to {{ $gatewayAddresses }}" | ||
ipfs config Addresses.Gateway {{ $gatewayAddresses }} | ||
|
||
# Configure the Addresses.Swarm | ||
echo "Configuring the Addresses.Swarm to {{ $swarmAddresses | squote }}" | ||
ipfs config Addresses.Swarm --json {{ $swarmAddresses | squote }} | ||
|
||
# Configure the API.HTTPHeaders.Access-Control-Allow-Origin | ||
echo "Configuring the API.HTTPHeaders.Access-Control-Allow-Origin to {{ $allowOrigins | squote }}" | ||
ipfs config API.HTTPHeaders.Access-Control-Allow-Origin --json {{ $allowOrigins | squote }} | ||
|
||
# Configure the API.HTTPHeaders.Access-Control-Allow-Methods | ||
echo "Configuring the API.HTTPHeaders.Access-Control-Allow-Methods to {{ $allowMethods | squote }}" | ||
ipfs config API.HTTPHeaders.Access-Control-Allow-Methods --json {{ $allowMethods | squote }} | ||
|
||
echo "Finished configuring IPFS" | ||
{{- end -}} |
Oops, something went wrong.