Add deployment scripts and update README with new deployment information

This commit is contained in:
boilerrat 2025-03-16 14:47:23 -04:00
parent ece54771b7
commit 7b8ab4ec4f
8 changed files with 208 additions and 36 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
SERVER_USER=your_server_username
SERVER_PASSWORD=your_server_password
SERVER_IP=your_server_ip

BIN
.parcel-cache/data.mdb Normal file

Binary file not shown.

BIN
.parcel-cache/lock.mdb Normal file

Binary file not shown.

View File

@ -27,8 +27,8 @@ A modern, responsive personal website built with React, TypeScript, and Vite. Th
**Clone the repository:**
```bash
git clone https://github.com/boilerrat/personal-website
cd personal-website
git clone https://git.boilerhaus.org/boiler/Web3CV.git
cd Web3CV
```
**Install dependencies:**
@ -49,46 +49,67 @@ npm run dev
npm run build
```
## 🌐 Domain Transfer to Vercel
## 🚀 Deployment
This website is now deployed on a VPS at [boilerhaus.org](https://boilerhaus.org) using a custom deployment script.
### Deployment Setup
1. **Environment Configuration**
- Create a `.env` file based on `.env.example`
- Add your server credentials:
```
SERVER_USER=your_server_username
SERVER_PASSWORD=your_server_password
SERVER_IP=your_server_ip
```
2. **Deploy to VPS**
- Run the deployment script:
```bash
./deploy-website.sh
```
- This script will:
- Build the project
- Create a tarball of the built files
- Upload to the server
- Extract files to the web directory
- Set proper permissions
3. **Check Website Status**
- Run the status check script:
```bash
./check-website.sh
```
- This will check the status of all services:
- Portfolio website (boilerhaus.org)
- Gitea (git.boilerhaus.org)
- Vaultwarden (bw.boilerhaus.org)
- Nextcloud (cloud.boilerhaus.org)
### Server Configuration
The website is served by Nginx with SSL certificates from Let's Encrypt. The configuration files are located on the server at `/etc/nginx/sites-available/`.
## 🌐 Domain Information
### Current Setup
- Domain: [boilerhaus.org](https://boilerhaus.org)
- Subdomains:
- [git.boilerhaus.org](https://git.boilerhaus.org) - Gitea instance
- [bw.boilerhaus.org](https://bw.boilerhaus.org) - Vaultwarden instance
- [cloud.boilerhaus.org](https://cloud.boilerhaus.org) - Nextcloud dashboard
### Previous Setup (Archived)
- Domains: [www.chriswylde.xyz](https://www.chriswylde.xyz) and [www.boilerrat.xyz](https://www.boilerra.xyz)
- Registrar: Namecheap
- Current Host: Netlify
- Target Host: Vercel
### Steps to Transfer Domain to Vercel
1. **Add Domain to Vercel Project**
- Go to your Vercel project dashboard
- Navigate to "Settings" > "Domains"
- Add your domains: `chriswylde.xyz` and `boilerrat.xyz`
- Vercel will provide nameserver information
2. **Update Namecheap DNS Settings**
- Log in to Namecheap
- Go to "Domain List" and select your domain
- Click "Manage"
- Select "Custom DNS" under "Nameservers"
- Add Vercel's nameservers:
```bash
ns1.vercel-dns.com
ns2.vercel-dns.com
```
3. **Wait for Propagation**
- DNS changes can take up to 48 hours to propagate
- You can check propagation status in Vercel's dashboard
4. **SSL/HTTPS Setup**
- Vercel automatically provisions SSL certificates
- No additional configuration needed
- Previous Host: Netlify/Vercel
## 🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/boilerrat/personal-website/issues).
Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://git.boilerhaus.org/boiler/Web3CV/issues).
## 📝 License
@ -96,7 +117,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## 👤 Contact
- Website: [chriswylde.xyz](https://www.chriswylde.xyz)
- Website: [boilerhaus.org](https://boilerhaus.org)
- Twitter: [@boilerrat](https://twitter.com/boilerrat)
- Farcaster: [@boiler](https://warpcast.com/boiler)
- Email: mailto [128boilerrat@gmail.com](mailto:128boilerrat@gmail.com)
- Email: [128boilerrat@gmail.com](mailto:128boilerrat@gmail.com)

34
boilerhaus.org.conf.new Normal file
View File

@ -0,0 +1,34 @@
server {
listen 80;
listen [::]:80;
server_name boilerhaus.org;
root /var/www/boilerhaus.org;
index index.html;
location / {
try_files $uri $uri/ =404;
}
# Managed by Certbot
# This section will be updated by Certbot automatically
}
# Nextcloud configuration
server {
listen 80;
listen [::]:80;
server_name cloud.boilerhaus.org;
# Proxy to Nextcloud
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Managed by Certbot
# This section will be updated by Certbot automatically
}

17
check-website.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# This script checks the status of the portfolio website
echo "Checking website status..."
curl -I https://boilerhaus.org
echo -e "\nChecking Gitea status..."
curl -I https://git.boilerhaus.org
echo -e "\nChecking Vaultwarden status..."
curl -I https://bw.boilerhaus.org
echo -e "\nChecking Nextcloud status..."
curl -I https://cloud.boilerhaus.org
echo -e "\nAll checks completed."

68
deploy-website.sh Executable file
View File

@ -0,0 +1,68 @@
#!/bin/bash
# This script deploys the portfolio website from Gitea to the VPS
# Load environment variables
if [ -f .env ]; then
source .env
else
echo "Error: .env file not found. Please create it based on .env.example."
exit 1
fi
# Check if sshpass is installed
if ! command -v sshpass &> /dev/null; then
echo "Error: sshpass is not installed. Please run 'sudo apt-get install sshpass' first."
exit 1
fi
# Set SSH and SCP commands with password
SSH_CMD="sshpass -p $SERVER_PASSWORD ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP"
SCP_CMD="sshpass -p $SERVER_PASSWORD scp -o StrictHostKeyChecking=no"
# Set variables
REMOTE_DIR="/var/www/boilerhaus.org"
TEMP_DIR="./portfolio-temp"
# Create a temporary directory for the website files
echo "Creating temporary directory..."
mkdir -p $TEMP_DIR
# Check if TypeScript is installed
if ! command -v tsc &> /dev/null; then
echo "Installing TypeScript globally..."
npm install -g typescript
fi
# Build the project
echo "Building the project..."
npm run build
# Check if dist directory exists
if [ ! -d "dist" ]; then
echo "Error: Build failed. The dist directory does not exist."
exit 1
fi
# Create a tarball of the built files
echo "Creating tarball of the built files..."
cd dist
tar -czf ../portfolio-dist.tar.gz .
cd ..
# Upload the tarball to the server
echo "Uploading to server..."
$SCP_CMD portfolio-dist.tar.gz $SERVER_USER@$SERVER_IP:/tmp/
# Extract the tarball on the server
echo "Extracting files on server..."
$SSH_CMD "mkdir -p $REMOTE_DIR && \
tar -xzf /tmp/portfolio-dist.tar.gz -C $REMOTE_DIR && \
chown -R www-data:www-data $REMOTE_DIR && \
rm /tmp/portfolio-dist.tar.gz"
# Clean up local files
echo "Cleaning up..."
rm -rf $TEMP_DIR portfolio-dist.tar.gz
echo "Portfolio website deployed successfully!"

29
update-from-gitea.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# This script updates the local repository from Gitea
echo "Updating local repository from Gitea..."
# Fetch the latest changes from Gitea
git fetch origin
# Check if there are any changes
if git diff --quiet HEAD origin/main; then
echo "Local repository is already up to date."
else
echo "New changes detected. Updating local repository..."
# Stash any local changes
git stash
# Pull the latest changes
git pull origin main
# Apply stashed changes if any
if git stash list | grep -q "stash@{0}"; then
echo "Applying stashed changes..."
git stash pop
fi
echo "Local repository updated successfully!"
fi