@underpostnet/underpost 2.99.8 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.env.production +1 -0
  2. package/.github/workflows/gitlab.ci.yml +20 -0
  3. package/.github/workflows/publish.ci.yml +18 -34
  4. package/.vscode/extensions.json +8 -50
  5. package/.vscode/settings.json +0 -77
  6. package/CHANGELOG.md +116 -1
  7. package/{cli.md → CLI-HELP.md} +48 -41
  8. package/README.md +3 -3
  9. package/bin/build.js +1 -15
  10. package/bin/deploy.js +4 -133
  11. package/bin/file.js +10 -8
  12. package/bin/zed.js +63 -2
  13. package/jsdoc.json +1 -2
  14. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  15. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  16. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  17. package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
  18. package/manifests/deployment/fastapi/initial_data.sh +4 -52
  19. package/manifests/ipfs/configmap.yaml +57 -0
  20. package/manifests/ipfs/headless-service.yaml +35 -0
  21. package/manifests/ipfs/kustomization.yaml +8 -0
  22. package/manifests/ipfs/statefulset.yaml +149 -0
  23. package/manifests/ipfs/storage-class.yaml +9 -0
  24. package/package.json +9 -5
  25. package/scripts/k3s-node-setup.sh +89 -0
  26. package/scripts/lxd-vm-setup.sh +23 -0
  27. package/scripts/rocky-setup.sh +1 -13
  28. package/src/api/user/user.router.js +0 -47
  29. package/src/cli/baremetal.js +7 -9
  30. package/src/cli/cluster.js +72 -121
  31. package/src/cli/deploy.js +8 -5
  32. package/src/cli/index.js +31 -30
  33. package/src/cli/ipfs.js +184 -0
  34. package/src/cli/lxd.js +192 -237
  35. package/src/cli/repository.js +4 -1
  36. package/src/cli/run.js +3 -2
  37. package/src/client/components/core/Docs.js +92 -6
  38. package/src/client/components/core/VanillaJs.js +36 -25
  39. package/src/client/services/user/user.management.js +0 -5
  40. package/src/client/services/user/user.service.js +1 -1
  41. package/src/index.js +12 -1
  42. package/src/runtime/express/Express.js +3 -2
  43. package/src/server/client-build-docs.js +178 -41
  44. package/src/server/conf.js +1 -1
  45. package/src/server/logger.js +22 -10
  46. package/.vscode/zed.keymap.json +0 -39
  47. package/.vscode/zed.settings.json +0 -20
  48. package/manifests/lxd/underpost-setup.sh +0 -163
@@ -1,39 +0,0 @@
1
- [
2
- {
3
- "context": "Editor",
4
- "bindings": {
5
- "ctrl-c": "editor::Copy",
6
- "ctrl-x": "editor::Cut",
7
- "ctrl-v": "editor::Paste",
8
- "ctrl-shift-c": "editor::CopyAndTrim",
9
- "ctrl-shift-v": "editor::Paste",
10
- "cmd-c": "editor::Copy",
11
- "cmd-x": "editor::Cut",
12
- "cmd-v": "editor::Paste"
13
- }
14
- },
15
- {
16
- "context": "Terminal",
17
- "bindings": {
18
- "ctrl-shift-c": "terminal::Copy",
19
- "ctrl-shift-v": "terminal::Paste",
20
- "cmd-shift-c": "terminal::Copy",
21
- "cmd-shift-v": "terminal::Paste"
22
- }
23
- },
24
- {
25
- "context": "Editor && edit_prediction",
26
- "bindings": {
27
- "tab": "editor::AcceptEditPrediction",
28
- "alt-tab": "editor::AcceptEditPrediction",
29
- "alt-l": null
30
- }
31
- },
32
- {
33
- "context": "Editor && edit_prediction_conflict",
34
- "bindings": {
35
- "alt-l": "editor::AcceptEditPrediction",
36
- "tab": "editor::ComposeCompletion"
37
- }
38
- }
39
- ]
@@ -1,20 +0,0 @@
1
- {
2
- "ui_font_size": 16,
3
- "buffer_font_size": 15,
4
- "theme": {
5
- "mode": "system",
6
- "light": "One Dark",
7
- "dark": "One Dark"
8
- },
9
-
10
- "features": {
11
- "edit_prediction_provider": "copilot",
12
- "copilot": true // https://github.com/login/device
13
- },
14
-
15
- "show_edit_predictions": true,
16
-
17
- "edit_predictions": {
18
- "mode": "eager"
19
- }
20
- }
@@ -1,163 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Exit immediately if a command exits with a non-zero status.
4
- set -e
5
-
6
- echo "Starting Underpost Kubernetes Node Setup for Production (Kubeadm/K3s Use Case)..."
7
-
8
- # --- Disk Partition Resizing (Keep as is, seems functional) ---
9
- echo "Expanding /dev/sda2 partition and resizing filesystem..."
10
-
11
- # Check if parted is installed
12
- if ! command -v parted &>/dev/null; then
13
- echo "parted not found, installing..."
14
- sudo dnf install -y parted
15
- fi
16
-
17
- # Get start sector of /dev/sda2
18
- START_SECTOR=$(sudo parted /dev/sda -ms unit s print | awk -F: '/^2:/{print $2}' | sed 's/s//')
19
-
20
- # Resize the partition
21
- # Using 'sudo' for parted commands
22
- sudo parted /dev/sda ---pretend-input-tty <<EOF
23
- unit s
24
- resizepart 2 100%
25
- Yes
26
- quit
27
- EOF
28
-
29
- # Resize the filesystem
30
- sudo resize2fs /dev/sda2
31
-
32
- echo "Disk and filesystem resized successfully."
33
-
34
- # --- Essential System Package Installation ---
35
- echo "Installing essential system packages..."
36
- sudo dnf install -y tar bzip2 git epel-release
37
-
38
- # Perform a system update to ensure all packages are up-to-date
39
- sudo dnf -y update
40
-
41
- # --- NVM and Node.js Installation ---
42
- echo "Installing NVM and Node.js v24.10.0..."
43
- curl -o- https://cdn.jsdelivr.net/gh/nvm-sh/nvm@v0.40.1/install.sh | bash
44
-
45
- # Load nvm for the current session
46
- export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
47
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
48
-
49
- nvm install 24.10.0
50
- nvm use 24.10.0
51
-
52
- echo "
53
- ██╗░░░██╗███╗░░██╗██████╗░███████╗██████╗░██████╗░░█████╗░░██████╗████████╗
54
- ██║░░░██║████╗░██║██╔══██╗██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
55
- ██║░░░██║██╔██╗██║██║░░██║█████╗░░██████╔╝██████╔╝██║░░██║╚█████╗░░░░██║░░░
56
- ██║░░░██║██║╚████║██║░░██║██╔══╝░░██╔══██╗██╔═══╝░██║░░██║░╚═══██╗░░░██║░░░
57
- ╚██████╔╝██║░╚███║██████╔╝███████╗██║░░██║██║░░░░░╚█████╔╝██████╔╝░░░██║░░░
58
- ░╚═════╝░╚═╝░░╚══╝╚═════╝░╚══════╝╚═╝░░╚═╝╚═╝░░░░░░╚════╝░╚═════╝░░░░╚═╝░░░
59
-
60
- Installing underpost k8s node...
61
- "
62
-
63
- # Install underpost globally
64
- npm install -g underpost
65
-
66
- # Ensure underpost executable is in PATH and has execute permissions
67
- # Adjusting this for global npm install which usually handles permissions
68
- # If you still face issues, ensure /root/.nvm/versions/node/v24.10.0/bin is in your PATH
69
- # For global installs, it's usually handled automatically.
70
- # chmod +x /root/.nvm/versions/node/v24.10.0/bin/underpost # This might not be necessary for global npm installs
71
-
72
- # --- Kernel Module for Bridge Filtering ---
73
- # This is crucial for Kubernetes networking (CNI)
74
- echo "Loading br_netfilter kernel module..."
75
- sudo modprobe br_netfilter
76
-
77
- # --- Initial Host Setup for Kubernetes Prerequisites ---
78
- # This calls the initHost method in cluster.js to install Docker, Podman, Kind, Kubeadm, Helm.
79
- echo "Running initial host setup for Kubernetes prerequisites..."
80
- # Ensure the current directory is where 'underpost' expects its root, or use absolute paths.
81
- # Assuming 'underpost root' correctly points to the base directory of your project.
82
- cd "$(underpost root)/underpost"
83
- underpost cluster --init-host
84
-
85
- # --- Argument Parsing for Kubeadm/Kind/K3s/Worker ---
86
- USE_KUBEADM=false
87
- USE_KIND=false # Not the primary focus for this request, but keeping the logic
88
- USE_K3S=false # New K3s option
89
- USE_WORKER=false
90
-
91
- for arg in "$@"; do
92
- case "$arg" in
93
- --kubeadm)
94
- USE_KUBEADM=true
95
- ;;
96
- --kind)
97
- USE_KIND=true
98
- ;;
99
- --k3s) # New K3s argument
100
- USE_K3S=true
101
- ;;
102
- --worker)
103
- USE_WORKER=true
104
- ;;
105
- esac
106
- done
107
-
108
- echo "USE_KUBEADM = $USE_KUBEADM"
109
- echo "USE_KIND = $USE_KIND"
110
- echo "USE_K3S = $USE_K3S" # Display K3s flag status
111
- echo "USE_WORKER = $USE_WORKER"
112
-
113
- # --- Kubernetes Cluster Initialization Logic ---
114
-
115
- # Apply host configuration (SELinux, Containerd, Sysctl, and now firewalld disabling)
116
- echo "Applying Kubernetes host configuration (SELinux, Containerd, Sysctl, Firewalld)..."
117
- underpost cluster --config
118
-
119
- if $USE_KUBEADM; then
120
- if $USE_WORKER; then
121
- echo "Running worker node setup for kubeadm..."
122
- # For worker nodes, the 'underpost cluster --worker' command will handle joining
123
- # the cluster. The join command itself needs to be provided from the control plane.
124
- # This script assumes the join command will be executed separately or passed in.
125
- # Example: underpost cluster --worker --join-command "kubeadm join ..."
126
- # For now, this just runs the worker-specific config.
127
- underpost cluster --worker
128
- underpost cluster --chown
129
- echo "Worker node setup initiated. You will need to manually join this worker to your control plane."
130
- echo "On your control plane, run 'kubeadm token create --print-join-command' and execute the output here."
131
- else
132
- echo "Running control plane setup with kubeadm..."
133
- # This will initialize the kubeadm control plane and install Calico
134
- underpost cluster --kubeadm
135
- echo "Kubeadm control plane initialized. Check cluster status with 'kubectl get nodes'."
136
- fi
137
- elif $USE_K3S; then # New K3s initialization block
138
- if $USE_WORKER; then
139
- echo "Running worker node setup for K3s..."
140
- # For K3s worker nodes, the 'underpost cluster --worker' command will handle joining
141
- # the cluster. The K3s join command (k3s agent --server ...) needs to be provided.
142
- underpost cluster --worker --k3s
143
- underpost cluster --chown
144
- echo "K3s Worker node setup initiated. You will need to manually join this worker to your control plane."
145
- echo "On your K3s control plane, get the K3S_TOKEN from /var/lib/rancher/k3s/server/node-token"
146
- echo "and the K3S_URL (e.g., https://<control-plane-ip>:6443)."
147
- echo "Then execute: K3S_URL=${K3S_URL} K3S_TOKEN=${K3S_TOKEN} curl -sfL https://get.k3s.io | sh -"
148
- else
149
- echo "Running control plane setup with K3s..."
150
- underpost cluster --k3s
151
- echo "K3s control plane initialized. Check cluster status with 'kubectl get nodes'."
152
- fi
153
- elif $USE_KIND; then
154
- echo "Running control node with kind..."
155
- underpost cluster
156
- echo "Kind cluster initialized. Check cluster status with 'kubectl get nodes'."
157
- else
158
- echo "No specific cluster role (--kubeadm, --kind, --k3s, --worker) specified. Please provide one."
159
- exit 1
160
- fi
161
-
162
- echo "Underpost Kubernetes Node Setup completed."
163
- echo "Remember to verify cluster health with 'kubectl get nodes' and 'kubectl get pods --all-namespaces'."