diff --git a/.env b/.env index 9d5fc7b..3bf09f7 100644 --- a/.env +++ b/.env @@ -1,2 +1,8 @@ VITE_CG_API_KEY=CG-6tRLtAyJ9t5YdthDmRPhwKRD -VITE_CG_API_URL=https://pro-api.coingecko.com/api/v3 \ No newline at end of file +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" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 07e3184..f0e07e5 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +# Misc +.codegpt +.cache +.temp +.tmp \ No newline at end of file diff --git a/.parcel-cache/data.mdb b/.parcel-cache/data.mdb deleted file mode 100644 index 05f07e7..0000000 Binary files a/.parcel-cache/data.mdb and /dev/null differ diff --git a/.parcel-cache/lock.mdb b/.parcel-cache/lock.mdb deleted file mode 100644 index e829fc6..0000000 Binary files a/.parcel-cache/lock.mdb and /dev/null differ diff --git a/boilerhaus.org.conf.new b/boilerhaus.org.conf.new deleted file mode 100644 index 20e79e7..0000000 --- a/boilerhaus.org.conf.new +++ /dev/null @@ -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 -} diff --git a/cleanup.sh b/cleanup.sh new file mode 100755 index 0000000..848cf8d --- /dev/null +++ b/cleanup.sh @@ -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\"" \ No newline at end of file diff --git a/fix-nextcloud-occ.sh b/fix-nextcloud-occ.sh new file mode 100755 index 0000000..bd25eca --- /dev/null +++ b/fix-nextcloud-occ.sh @@ -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 \" /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." \ No newline at end of file