MCPcopy
hub / github.com/Dokploy/dokploy / defaultCommand

Function defaultCommand

packages/server/src/setup/server-setup.ts:109–260  ·  view source on GitHub ↗
(isBuildServer = false)

Source from the content-addressed store, hash-verified

107};
108
109export const defaultCommand = (isBuildServer = false) => {
110 const bashCommand = `
111set -e;
112DOCKER_VERSION=28.5.0
113OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
114SYS_ARCH=$(uname -m)
115CURRENT_USER=$USER
116
117echo "Installing requirements for: OS: $OS_TYPE"
118
119# Auto-detect sudo requirement
120if [ "$EUID" -eq 0 ]; then
121 SUDO_CMD=""
122 echo "Running as root"
123else
124 if sudo -n true 2>/dev/null; then
125 SUDO_CMD="sudo"
126 echo "Running as $CURRENT_USER with sudo privileges"
127 else
128 echo "Error: Non-root user requires passwordless sudo access. ❌"
129 echo "Configure with: echo '$CURRENT_USER ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/$CURRENT_USER"
130 exit 1
131 fi
132fi
133
134# Check if the OS is manjaro, if so, change it to arch
135if [ "$OS_TYPE" = "manjaro" ] || [ "$OS_TYPE" = "manjaro-arm" ]; then
136 OS_TYPE="arch"
137fi
138
139# Check if the OS is Asahi Linux, if so, change it to fedora
140if [ "$OS_TYPE" = "fedora-asahi-remix" ]; then
141 OS_TYPE="fedora"
142fi
143
144# Check if the OS is popOS, if so, change it to ubuntu
145if [ "$OS_TYPE" = "pop" ]; then
146 OS_TYPE="ubuntu"
147fi
148
149# Check if the OS is linuxmint, if so, change it to ubuntu
150if [ "$OS_TYPE" = "linuxmint" ]; then
151 OS_TYPE="ubuntu"
152fi
153
154#Check if the OS is zorin, if so, change it to ubuntu
155if [ "$OS_TYPE" = "zorin" ]; then
156 OS_TYPE="ubuntu"
157fi
158
159if [ "$OS_TYPE" = "arch" ] || [ "$OS_TYPE" = "archarm" ]; then
160 OS_VERSION="rolling"
161else
162 OS_VERSION=$(grep -w "VERSION_ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
163fi
164
165if [ "$OS_TYPE" = 'amzn' ]; then
166 $SUDO_CMD dnf install -y findutils >/dev/null

Callers 2

server.tsFile · 0.90
installRequirementsFunction · 0.85

Calls 15

installUtilitiesFunction · 0.85
validatePortsFunction · 0.85
installRCloneFunction · 0.85
installDockerFunction · 0.85
setupSwarmFunction · 0.85
setupNetworkFunction · 0.85
setupMainDirectoryFunction · 0.85
createTraefikInstanceFunction · 0.85
installNixpacksFunction · 0.85
installBuildpacksFunction · 0.85
installRailpackFunction · 0.85
setupPermissionsFunction · 0.85

Tested by

no test coverage detected