Clean up repository by removing unnecessary files
This commit is contained in:
parent
43cb6dc6ac
commit
8ac7e422ee
8
.env
8
.env
|
|
@ -1,2 +1,8 @@
|
|||
VITE_CG_API_KEY=CG-6tRLtAyJ9t5YdthDmRPhwKRD
|
||||
VITE_CG_API_URL=https://pro-api.coingecko.com/api/v3
|
||||
VITE_CG_API_URL=https://pro-api.coingecko.com/api/v3
|
||||
|
||||
# VPS Configuration
|
||||
SERVER_IP="66.179.188.130"
|
||||
SERVER_USER="root"
|
||||
# Replace with your actual password
|
||||
SERVER_PASSWORD="4Kk7r8bi"
|
||||
|
|
@ -7,10 +7,19 @@ yarn-error.log*
|
|||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Dependencies and build artifacts
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
.parcel-cache
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
*.env.local
|
||||
*.env.development.local
|
||||
*.env.test.local
|
||||
*.env.production.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
|
|
@ -23,4 +32,8 @@ dist-ssr
|
|||
*.sln
|
||||
*.sw?
|
||||
|
||||
.codegpt
|
||||
# Misc
|
||||
.codegpt
|
||||
.cache
|
||||
.temp
|
||||
.tmp
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,34 +0,0 @@
|
|||
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
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script cleans up unnecessary files from the repository
|
||||
|
||||
echo "=== Cleaning up repository ==="
|
||||
|
||||
# Remove redundant Nextcloud fix scripts
|
||||
echo "Removing redundant Nextcloud fix scripts..."
|
||||
rm -f fix-nextcloud-trusted-domains.sh
|
||||
rm -f fix-nextcloud-domains.sh
|
||||
rm -f fix-nextcloud.sh
|
||||
|
||||
# Remove build cache
|
||||
echo "Removing build cache..."
|
||||
rm -rf .parcel-cache
|
||||
|
||||
# Remove unused configuration files
|
||||
echo "Removing unused configuration files..."
|
||||
rm -f boilerhaus.org.conf.new
|
||||
|
||||
# Clean up build artifacts
|
||||
echo "Cleaning up build artifacts..."
|
||||
rm -rf dist
|
||||
|
||||
# Add the changes to git
|
||||
echo "Adding changes to git..."
|
||||
git add -A
|
||||
|
||||
echo "=== Cleanup complete ==="
|
||||
echo "The following files have been removed:"
|
||||
echo "- fix-nextcloud-trusted-domains.sh"
|
||||
echo "- fix-nextcloud-domains.sh"
|
||||
echo "- fix-nextcloud.sh"
|
||||
echo "- .parcel-cache/ directory"
|
||||
echo "- boilerhaus.org.conf.new"
|
||||
echo "- dist/ directory"
|
||||
echo ""
|
||||
echo "To commit these changes, run:"
|
||||
echo "git commit -m \"Clean up repository by removing unnecessary files\""
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script adds cloud.boilerhaus.org to Nextcloud's trusted domains using the occ command
|
||||
|
||||
# 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 command with password
|
||||
SSH_CMD="sshpass -p $SERVER_PASSWORD ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP"
|
||||
|
||||
echo "Adding cloud.boilerhaus.org to Nextcloud's trusted domains using occ command..."
|
||||
|
||||
# Find the Nextcloud directory
|
||||
$SSH_CMD "sudo find /var/www -name occ 2>/dev/null" > nextcloud_occ_path.txt
|
||||
OCC_PATH=$(cat nextcloud_occ_path.txt)
|
||||
|
||||
if [ -z "$OCC_PATH" ]; then
|
||||
echo "Error: Could not find Nextcloud occ command."
|
||||
echo "Trying alternative approach..."
|
||||
|
||||
# Try to directly edit the config.php file
|
||||
$SSH_CMD "sudo bash -c 'echo \"<?php \\\$CONFIG['trusted_domains'][] = \\\"cloud.boilerhaus.org\\\"; \" > /var/www/nextcloud/config/config.php.additional'"
|
||||
$SSH_CMD "sudo bash -c 'cat /var/www/nextcloud/config/config.php.additional >> /var/www/nextcloud/config/config.php'"
|
||||
$SSH_CMD "sudo rm /var/www/nextcloud/config/config.php.additional"
|
||||
else
|
||||
echo "Found Nextcloud occ at: $OCC_PATH"
|
||||
|
||||
# Get the directory containing occ
|
||||
NEXTCLOUD_DIR=$(dirname "$OCC_PATH")
|
||||
|
||||
# Use the occ command to add the trusted domain
|
||||
$SSH_CMD "cd $NEXTCLOUD_DIR && sudo -u www-data php occ config:system:set trusted_domains 3 --value=cloud.boilerhaus.org"
|
||||
fi
|
||||
|
||||
# Restart Apache to apply changes
|
||||
$SSH_CMD "sudo systemctl restart apache2"
|
||||
|
||||
# Clean up
|
||||
rm -f nextcloud_occ_path.txt
|
||||
|
||||
echo "Trusted domains configuration updated. You should now be able to access your Nextcloud instance at https://cloud.boilerhaus.org"
|
||||
echo "If you still see the 'untrusted domain' error, try clearing your browser cache or using a private/incognito window."
|
||||
Loading…
Reference in New Issue