fix(native): correct setup paths to /opt/picpeak/app, update repo URL, add sqlite prod support; docs path fixes
Mirror to GitHub / mirror (push) Successful in 1m27s
Test and Lint / backend-test (push) Successful in 1m49s
Test and Lint / frontend-test (push) Successful in 2m9s
Version and Release / version-bump (push) Successful in 1m8s
Version and Release / trigger-drone (push) Successful in 3s
Mirror to GitHub / mirror (push) Successful in 1m27s
Test and Lint / backend-test (push) Successful in 1m49s
Test and Lint / frontend-test (push) Successful in 2m9s
Version and Release / version-bump (push) Successful in 1m8s
Version and Release / trigger-drone (push) Successful in 3s
This commit is contained in:
+9
-9
@@ -8,7 +8,7 @@ This guide provides easy installation instructions for PicPeak on Linux servers
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Download and run the unified setup script
|
# Download and run the unified setup script
|
||||||
curl -fsSL https://raw.githubusercontent.com/yourusername/wedding-photo-sharing/main/scripts/setup.sh -o setup.sh && \
|
curl -fsSL https://raw.githubusercontent.com/the-luap/picpeak/main/scripts/setup.sh -o setup.sh && \
|
||||||
chmod +x setup.sh && \
|
chmod +x setup.sh && \
|
||||||
sudo ./setup.sh
|
sudo ./setup.sh
|
||||||
```
|
```
|
||||||
@@ -305,9 +305,9 @@ docker compose restart
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Native Configuration
|
### Native Configuration
|
||||||
Edit `/opt/picpeak/backend/.env`:
|
Edit `/opt/picpeak/app/backend/.env`:
|
||||||
```bash
|
```bash
|
||||||
sudo nano /opt/picpeak/backend/.env
|
sudo nano /opt/picpeak/app/backend/.env
|
||||||
sudo systemctl restart picpeak-backend
|
sudo systemctl restart picpeak-backend
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ tar -czf photos-backup.tar.gz storage/events/
|
|||||||
#### Native:
|
#### Native:
|
||||||
```bash
|
```bash
|
||||||
# Database backup
|
# Database backup
|
||||||
sudo cp /opt/picpeak/backend/database.sqlite /backup/database-$(date +%Y%m%d).sqlite
|
sudo cp /opt/picpeak/app/backend/data/photo_sharing.db /backup/database-$(date +%Y%m%d).sqlite
|
||||||
|
|
||||||
# Photos backup
|
# Photos backup
|
||||||
sudo tar -czf /backup/photos-$(date +%Y%m%d).tar.gz /opt/picpeak/events/
|
sudo tar -czf /backup/photos-$(date +%Y%m%d).tar.gz /opt/picpeak/events/
|
||||||
@@ -446,7 +446,7 @@ ls -la ~/picpeak/storage/events/
|
|||||||
docker exec picpeak-backend node scripts/reset-admin-password.js
|
docker exec picpeak-backend node scripts/reset-admin-password.js
|
||||||
|
|
||||||
# Native
|
# Native
|
||||||
cd /opt/picpeak/backend
|
cd /opt/picpeak/app/backend
|
||||||
sudo -u picpeak node scripts/reset-admin-password.js
|
sudo -u picpeak node scripts/reset-admin-password.js
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -458,11 +458,11 @@ sudo -u picpeak node scripts/reset-admin-password.js
|
|||||||
- Installation: `/tmp/picpeak-setup-*.log`
|
- Installation: `/tmp/picpeak-setup-*.log`
|
||||||
|
|
||||||
2. **Documentation:**
|
2. **Documentation:**
|
||||||
- [Full Documentation](https://github.com/yourusername/wedding-photo-sharing)
|
- [Full Documentation](https://github.com/the-luap/picpeak)
|
||||||
- [Deployment Guide](./DEPLOYMENT_GUIDE.md)
|
- [Deployment Guide](./DEPLOYMENT_GUIDE.md)
|
||||||
|
|
||||||
3. **Support:**
|
3. **Support:**
|
||||||
- [GitHub Issues](https://github.com/yourusername/wedding-photo-sharing/issues)
|
- [GitHub Issues](https://github.com/the-luap/picpeak/issues)
|
||||||
- Include: Error messages, system info (`uname -a`), installation method
|
- Include: Error messages, system info (`uname -a`), installation method
|
||||||
|
|
||||||
## 🔒 Security Best Practices
|
## 🔒 Security Best Practices
|
||||||
@@ -498,7 +498,7 @@ services:
|
|||||||
### Native Optimization
|
### Native Optimization
|
||||||
```bash
|
```bash
|
||||||
# Increase Node.js memory
|
# Increase Node.js memory
|
||||||
echo "NODE_OPTIONS=--max-old-space-size=2048" >> /opt/picpeak/backend/.env
|
echo "NODE_OPTIONS=--max-old-space-size=2048" >> /opt/picpeak/app/backend/.env
|
||||||
sudo systemctl restart picpeak-backend
|
sudo systemctl restart picpeak-backend
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -540,4 +540,4 @@ sudo ./setup.sh --native \
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**PicPeak Setup v1.0** | [Documentation](https://github.com/yourusername/wedding-photo-sharing) | [Support](https://github.com/yourusername/wedding-photo-sharing/issues)
|
**PicPeak Setup v1.0** | [Documentation](https://github.com/the-luap/picpeak) | [Support](https://github.com/the-luap/picpeak/issues)
|
||||||
|
|||||||
+19
-16
@@ -551,22 +551,22 @@ setup_native_installation() {
|
|||||||
|
|
||||||
# Create application directory
|
# Create application directory
|
||||||
log_step "Creating application directory..."
|
log_step "Creating application directory..."
|
||||||
mkdir -p "$NATIVE_APP_DIR"/{backend,events/{active,archived},logs,config}
|
mkdir -p "$NATIVE_APP_DIR"/{app,events/{active,archived},logs,config}
|
||||||
|
|
||||||
# Clone repository
|
# Clone repository
|
||||||
log_step "Downloading PicPeak..."
|
log_step "Downloading PicPeak..."
|
||||||
if [[ -d "$NATIVE_APP_DIR/backend/.git" ]]; then
|
if [[ -d "$NATIVE_APP_DIR/app/.git" ]]; then
|
||||||
cd "$NATIVE_APP_DIR/backend"
|
cd "$NATIVE_APP_DIR/app"
|
||||||
git pull
|
git pull
|
||||||
else
|
else
|
||||||
git clone "$REPO_URL" "$NATIVE_APP_DIR/backend"
|
git clone "$REPO_URL" "$NATIVE_APP_DIR/app"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
log_step "Installing dependencies..."
|
log_step "Installing dependencies..."
|
||||||
# The repository root contains both backend/ and frontend/
|
# The repository root contains both backend/ and frontend/
|
||||||
# Install backend production dependencies
|
# Install backend production dependencies
|
||||||
cd "$NATIVE_APP_DIR/backend/backend"
|
cd "$NATIVE_APP_DIR/app/backend"
|
||||||
npm install --production
|
npm install --production
|
||||||
|
|
||||||
# Generate secrets
|
# Generate secrets
|
||||||
@@ -575,7 +575,7 @@ setup_native_installation() {
|
|||||||
|
|
||||||
# Create .env file
|
# Create .env file
|
||||||
log_step "Creating configuration..."
|
log_step "Creating configuration..."
|
||||||
cat > "$NATIVE_APP_DIR/backend/backend/.env" <<EOF
|
cat > "$NATIVE_APP_DIR/app/backend/.env" <<EOF
|
||||||
# PicPeak Native Configuration
|
# PicPeak Native Configuration
|
||||||
# Generated: $(date)
|
# Generated: $(date)
|
||||||
|
|
||||||
@@ -589,11 +589,11 @@ ADMIN_USERNAME=admin
|
|||||||
ADMIN_PASSWORD=$ADMIN_PASSWORD
|
ADMIN_PASSWORD=$ADMIN_PASSWORD
|
||||||
ADMIN_EMAIL=$ADMIN_EMAIL
|
ADMIN_EMAIL=$ADMIN_EMAIL
|
||||||
|
|
||||||
# Database
|
# Database (native uses SQLite by default)
|
||||||
DATABASE_CLIENT=sqlite3
|
DATABASE_CLIENT=sqlite3
|
||||||
DATABASE_PATH=$NATIVE_APP_DIR/backend/backend/data/photo_sharing.db
|
DATABASE_PATH=$NATIVE_APP_DIR/app/backend/data/photo_sharing.db
|
||||||
|
|
||||||
# Storage
|
# Storage root (thumbnails/uploads live under this path)
|
||||||
STORAGE_PATH=$NATIVE_APP_DIR
|
STORAGE_PATH=$NATIVE_APP_DIR
|
||||||
|
|
||||||
# Email
|
# Email
|
||||||
@@ -621,11 +621,11 @@ EOF
|
|||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
chown -R $NATIVE_APP_USER:$NATIVE_APP_USER "$NATIVE_APP_DIR"
|
chown -R $NATIVE_APP_USER:$NATIVE_APP_USER "$NATIVE_APP_DIR"
|
||||||
chmod 600 "$NATIVE_APP_DIR/backend/backend/.env"
|
chmod 600 "$NATIVE_APP_DIR/app/backend/.env"
|
||||||
|
|
||||||
# Run database migrations
|
# Run database migrations
|
||||||
log_step "Initializing database..."
|
log_step "Initializing database..."
|
||||||
cd "$NATIVE_APP_DIR/backend/backend"
|
cd "$NATIVE_APP_DIR/app/backend"
|
||||||
sudo -u $NATIVE_APP_USER npm run migrate
|
sudo -u $NATIVE_APP_USER npm run migrate
|
||||||
|
|
||||||
# Create systemd services
|
# Create systemd services
|
||||||
@@ -657,7 +657,7 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=$NATIVE_APP_USER
|
User=$NATIVE_APP_USER
|
||||||
WorkingDirectory=$NATIVE_APP_DIR/backend/backend
|
WorkingDirectory=$NATIVE_APP_DIR/app/backend
|
||||||
Environment="NODE_ENV=production"
|
Environment="NODE_ENV=production"
|
||||||
ExecStart=/usr/bin/node server.js
|
ExecStart=/usr/bin/node server.js
|
||||||
Restart=always
|
Restart=always
|
||||||
@@ -678,7 +678,7 @@ After=network.target picpeak-backend.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=$NATIVE_APP_USER
|
User=$NATIVE_APP_USER
|
||||||
WorkingDirectory=$NATIVE_APP_DIR/backend/backend
|
WorkingDirectory=$NATIVE_APP_DIR/app/backend
|
||||||
Environment="NODE_ENV=production"
|
Environment="NODE_ENV=production"
|
||||||
ExecStart=/usr/bin/node src/services/workerManager.js
|
ExecStart=/usr/bin/node src/services/workerManager.js
|
||||||
Restart=always
|
Restart=always
|
||||||
@@ -938,13 +938,16 @@ update_native_installation() {
|
|||||||
systemctl stop picpeak-backend picpeak-workers
|
systemctl stop picpeak-backend picpeak-workers
|
||||||
|
|
||||||
# Backup current configuration
|
# Backup current configuration
|
||||||
cp "$NATIVE_APP_DIR/backend/.env" "$NATIVE_APP_DIR/backend/.env.backup-$(date +%Y%m%d-%H%M%S)"
|
if [[ -f "$NATIVE_APP_DIR/app/backend/.env" ]]; then
|
||||||
|
cp "$NATIVE_APP_DIR/app/backend/.env" "$NATIVE_APP_DIR/app/backend/.env.backup-$(date +%Y%m%d-%H%M%S)"
|
||||||
|
fi
|
||||||
|
|
||||||
# Pull latest code
|
# Pull latest code
|
||||||
cd "$NATIVE_APP_DIR/backend"
|
cd "$NATIVE_APP_DIR/app"
|
||||||
sudo -u $NATIVE_APP_USER git pull
|
sudo -u $NATIVE_APP_USER git pull
|
||||||
|
|
||||||
# Update dependencies
|
# Update backend dependencies
|
||||||
|
cd "$NATIVE_APP_DIR/app/backend"
|
||||||
sudo -u $NATIVE_APP_USER npm install --production
|
sudo -u $NATIVE_APP_USER npm install --production
|
||||||
|
|
||||||
# Run migrations
|
# Run migrations
|
||||||
|
|||||||
Reference in New Issue
Block a user