Skip to content

Commit ae9442b

Browse files
author
Alade Yessoufou
committed
Simplify installer workflow for Linux defaults
1 parent 8a998b1 commit ae9442b

7 files changed

Lines changed: 101 additions & 279 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7070
- **ENV_FILE support**: `load_config()` sources local `.env` before loading `shipnode.conf` — config values can reference env vars (e.g. `DB_PASSWORD=${DB_PASSWORD}`)
7171

7272
### Changed
73+
- **Installer workflow simplified**: Default install now uses `~/.shipnode` with PATH updates in `~/.bashrc` (and `~/.zshrc` if present), removing install location prompts
7374
- **Multi-app Caddy support**: Switched from monolithic `/etc/caddy/Caddyfile` to per-app configs in `/etc/caddy/conf.d/<app>.caddy` — supports multiple apps on one server
7475
- **Development dependencies included**: Dependencies now installed without `--production`/`--prod`/`--omit=dev` flags so build tools (TypeScript, Prisma CLI, etc.) are available during deployment
7576
- **Interactive init by default**: `shipnode init` now launches interactive wizard by default; use `--non-interactive` flag for legacy behavior

DISTRIBUTION.md

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,9 @@ Runs shipnode-installer.sh
4444
4545
Extracts to temp directory
4646
47-
User chooses install location
48-
• ~/.shipnode (default)
49-
• /opt/shipnode (system-wide)
50-
• Custom path
47+
Installs to ~/.shipnode
5148
52-
Copies files to location
53-
54-
User chooses PATH setup
55-
• Symlink to /usr/local/bin
56-
• Add to ~/.bashrc
57-
• Add to ~/.zshrc
58-
• Both shell configs
59-
• Manual setup
49+
Adds PATH entry to ~/.bashrc (and ~/.zshrc if present)
6050
6151
Verification & cleanup
6252
@@ -150,39 +140,14 @@ shipnode/
150140
└── shipnode-installer.sh # Self-extracting installer
151141
```
152142

153-
## Installation Locations
143+
## Installation Defaults
154144

155-
The installer supports three installation types:
145+
The installer always uses a Linux-safe default:
156146

157-
### 1. User Installation (~/.shipnode)
158-
- **Path**: `$HOME/.shipnode`
147+
- **Install path**: `$HOME/.shipnode`
159148
- **Permissions**: No sudo required
160-
- **Use case**: Single user, development
161-
- **Uninstall**: `rm -rf ~/.shipnode`
162-
163-
### 2. System Installation (/opt/shipnode)
164-
- **Path**: `/opt/shipnode`
165-
- **Permissions**: Requires sudo
166-
- **Use case**: Multi-user systems, production
167-
- **Uninstall**: `sudo rm -rf /opt/shipnode`
168-
169-
### 3. Custom Installation
170-
- **Path**: User-specified
171-
- **Permissions**: Depends on location
172-
- **Use case**: Special requirements
173-
- **Uninstall**: Remove the directory
174-
175-
## PATH Setup Options
176-
177-
### 1. Symlink (/usr/local/bin)
178-
- **Pros**: Works in all shells, clean, standard
179-
- **Cons**: Requires sudo
180-
- **Command**: `sudo ln -s <install-dir>/shipnode /usr/local/bin/shipnode`
181-
182-
### 2. Shell Config (bashrc/zshrc)
183-
- **Pros**: No sudo, easy to modify
184-
- **Cons**: Shell-specific, needs sourcing
185-
- **Command**: `export PATH="<install-dir>:$PATH"`
149+
- **PATH update**: Adds `export PATH="$HOME/.shipnode:$PATH"` to `~/.bashrc` (and `~/.zshrc` if present)
150+
- **Uninstall**: `rm -rf ~/.shipnode` and remove the PATH entry
186151

187152
## Testing the Installer
188153

@@ -199,7 +164,7 @@ bash shipnode-installer.sh
199164

200165
# Or test locally
201166
bash dist/shipnode-installer.sh
202-
# Choose option 1 and a test directory
167+
# Verify it installs to ~/.shipnode
203168
```
204169

205170
## Updating the Installer

INSTALL.md

Lines changed: 12 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ chmod +x shipnode-installer.sh
2525
./shipnode-installer.sh
2626
```
2727

28-
The interactive installer will:
29-
- Extract the bundled ShipNode to your chosen location
30-
- Set up PATH or create a symlink
28+
The installer will:
29+
- Extract the bundled ShipNode to `~/.shipnode`
30+
- Add ShipNode to your PATH via `~/.bashrc` (and `~/.zshrc` if present)
3131
- Verify the installation
3232

3333
---
@@ -94,55 +94,9 @@ validate_port "3000" && echo "Valid"
9494

9595
---
9696

97-
## Installation Options
97+
## Installation Defaults
9898

99-
## Installation Options
100-
101-
The installer offers several installation locations and PATH setup methods:
102-
103-
### Installation Locations
104-
105-
1. **~/.shipnode** (Default) - No sudo required, recommended for single users
106-
2. **/opt/shipnode** (System-wide) - Requires sudo, for multi-user systems
107-
3. **Custom path** - Specify your own location
108-
109-
### PATH Setup Methods
110-
111-
#### Option 1: Symlink to /usr/local/bin (Recommended)
112-
113-
Creates a system-wide symlink. Requires sudo. `shipnode` will be available globally from any directory.
114-
115-
**Pros:**
116-
- Works in all shells (bash, zsh, fish, etc.)
117-
- No shell config modifications needed
118-
- Clean and standard approach
119-
120-
**Cons:**
121-
- Requires sudo access
122-
123-
#### Option 2: Add to ~/.bashrc
124-
125-
Adds ShipNode to your PATH in bash configuration. After installation, run `source ~/.bashrc` or restart your terminal.
126-
127-
**Pros:**
128-
- No sudo required
129-
- Easy to modify or remove
130-
131-
**Cons:**
132-
- Only works in bash
133-
- Requires sourcing config after install
134-
135-
#### Option 3: Add to ~/.zshrc
136-
137-
Same as option 2, but for zsh users. After installation, run `source ~/.zshrc` or restart your terminal.
138-
139-
#### Option 4: Add to both bash and zsh
140-
141-
If you use both shells or are unsure which one you use.
142-
143-
#### Option 5: Manual Setup
144-
145-
Skip automatic installation and set up manually. The installer will show you the commands to run manually.
99+
ShipNode installs to `~/.shipnode` and updates your PATH in `~/.bashrc` (and `~/.zshrc` if present). No sudo is required.
146100

147101
## Verification
148102

@@ -158,22 +112,15 @@ You should see the ShipNode help menu.
158112

159113
### "command not found: shipnode"
160114

161-
**After symlink installation:**
162-
- Check if /usr/local/bin is in your PATH:
163-
```bash
164-
echo $PATH | grep /usr/local/bin
165-
```
166-
- If not, add it to your shell config:
167-
```bash
168-
export PATH="/usr/local/bin:$PATH"
169-
```
170-
171-
**After PATH installation:**
172115
- Make sure you sourced your shell config:
173116
```bash
174117
source ~/.bashrc # or ~/.zshrc
175118
```
176119
- Or restart your terminal
120+
- Check that `~/.shipnode` is on your PATH:
121+
```bash
122+
echo $PATH | grep "$HOME/.shipnode"
123+
```
177124

178125
### "Permission denied"
179126

@@ -204,15 +151,10 @@ To remove ShipNode:
204151

205152
1. **Remove installation directory:**
206153
```bash
207-
rm -rf ~/.shipnode # or /opt/shipnode, or your custom path
208-
```
209-
210-
2. **Remove symlink (if created):**
211-
```bash
212-
sudo rm /usr/local/bin/shipnode
154+
rm -rf ~/.shipnode
213155
```
214156

215-
3. **Remove from shell config (if added to PATH):**
157+
2. **Remove from shell config:**
216158
Edit `~/.bashrc` or `~/.zshrc` and remove the ShipNode export lines.
217159

218160
Or if installed from source:
@@ -227,7 +169,7 @@ cd /path/to/shipnode
227169

228170
1. **Read the documentation**
229171
```bash
230-
cat ~/.shipnode/README.md # or /opt/shipnode/README.md
172+
cat ~/.shipnode/README.md
231173
```
232174

233175
2. **Initialize a project**

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ chmod +x shipnode-installer.sh
3737
```
3838

3939
The installer will:
40-
- Extract ShipNode to your chosen location (~/.shipnode, /opt/shipnode, or custom)
41-
- Create a symlink to `/usr/local/bin` or add to your PATH
40+
- Extract ShipNode to `~/.shipnode`
41+
- Add ShipNode to your PATH via `~/.bashrc` (and `~/.zshrc` if present)
4242
- Verify the installation
4343

4444
### For Developers
@@ -66,9 +66,9 @@ The modular version sources all modules from `lib/` dynamically, making it easy
6666

6767
**If installed via installer:**
6868
```bash
69-
rm -rf ~/.shipnode # or /opt/shipnode
70-
sudo rm /usr/local/bin/shipnode
69+
rm -rf ~/.shipnode
7170
```
71+
Remove the ShipNode PATH entry from `~/.bashrc` or `~/.zshrc`.
7272

7373
**If cloned from source:**
7474
```bash

build-dist.sh

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ GREEN='\033[0;32m'
77
BLUE='\033[0;34m'
88
NC='\033[0m'
99

10-
VERSION="1.1.1"
10+
VERSION="1.1.2"
1111
DIST_DIR="dist"
1212
ARCHIVE_NAME="shipnode-payload.tar.gz"
1313
INSTALLER_NAME="shipnode-installer.sh"
@@ -90,7 +90,7 @@ YELLOW='\033[1;33m'
9090
BLUE='\033[0;34m'
9191
NC='\033[0m'
9292
93-
VERSION="1.1.1"
93+
VERSION="1.1.2"
9494
INSTALL_DIR="$HOME/.shipnode"
9595
9696
# Parse flags
@@ -149,67 +149,27 @@ fi
149149
150150
echo -e "${GREEN}✓${NC} Extracted successfully"
151151
152-
# Choose installation location
153-
# If not interactive (e.g., piped from curl or --non-interactive flag), default to recommended location
154-
if [ "$NON_INTERACTIVE" = true ] || [ ! -t 0 ]; then
155-
INSTALL_DIR="$HOME/.shipnode"
156-
USE_SUDO=""
157-
echo -e "${BLUE}→${NC} Non-interactive mode: installing to $INSTALL_DIR"
158-
else
159-
echo
160-
echo "Choose installation location:"
161-
echo " 1) $HOME/.shipnode (recommended)"
162-
echo " 2) /opt/shipnode (system-wide, requires sudo)"
163-
echo " 3) Custom path"
164-
echo
165-
166-
read -p "Enter choice [1-3]: " -n 1 -r
167-
echo
168-
169-
case $REPLY in
170-
1)
171-
INSTALL_DIR="$HOME/.shipnode"
172-
USE_SUDO=""
173-
;;
174-
2)
175-
INSTALL_DIR="/opt/shipnode"
176-
USE_SUDO="sudo"
177-
;;
178-
3)
179-
read -p "Enter installation path: " INSTALL_DIR
180-
INSTALL_DIR="${INSTALL_DIR/#\~/$HOME}"
181-
182-
# Check if we need sudo
183-
if [[ "$INSTALL_DIR" == /opt/* ]] || [[ "$INSTALL_DIR" == /usr/* ]]; then
184-
USE_SUDO="sudo"
185-
else
186-
USE_SUDO=""
187-
fi
188-
;;
189-
*)
190-
echo -e "${RED}Invalid choice${NC}"
191-
exit 1
192-
;;
193-
esac
194-
fi
152+
# Choose installation location (Linux-safe default)
153+
INSTALL_DIR="$HOME/.shipnode"
154+
echo -e "${BLUE}→${NC} Installing to $INSTALL_DIR"
195155
196156
# Install
197157
echo -e "${BLUE}→${NC} Installing to $INSTALL_DIR..."
198158
199159
# Remove old installation if exists
200160
if [ -d "$INSTALL_DIR" ]; then
201161
echo -e "${YELLOW}⚠${NC} Removing existing installation..."
202-
$USE_SUDO rm -rf "$INSTALL_DIR"
162+
rm -rf "$INSTALL_DIR"
203163
fi
204164
205165
# Create installation directory
206-
$USE_SUDO mkdir -p "$INSTALL_DIR"
166+
mkdir -p "$INSTALL_DIR"
207167
208168
# Copy files
209-
$USE_SUDO cp -r shipnode/* "$INSTALL_DIR/"
169+
cp -r shipnode/* "$INSTALL_DIR/"
210170
211171
# Make shipnode executable
212-
$USE_SUDO chmod +x "$INSTALL_DIR/shipnode"
172+
chmod +x "$INSTALL_DIR/shipnode"
213173
214174
echo -e "${GREEN}✓${NC} Files installed"
215175

0 commit comments

Comments
 (0)