diff --git a/install.sh b/install.sh index 8478c40..e04c3d4 100644 --- a/install.sh +++ b/install.sh @@ -9,6 +9,7 @@ MD_DIR="$WEBROOT/md" APACHE_CONF="/etc/apache2/sites-available/markdown.conf" SCRIPT_NAME="render.py" SCRIPT_PATH="$CGI_DIR/$SCRIPT_NAME" +UPLOAD_USER="anon" echo "==> Installing dependencies..." sudo apt update @@ -93,7 +94,7 @@ EOF sudo tee "$MD_DIR/docs/tutorial.md" > /dev/null << EOF # Tutorial Page -This is a **nested Markdown file** inside `docs/`. +This is a **nested Markdown file** inside \`docs/\`. EOF echo "==> Creating Apache virtual host config..." @@ -108,6 +109,11 @@ sudo tee "$APACHE_CONF" > /dev/null << EOF Require all granted + + Options +Indexes + Require all granted + + Alias /markdown/ $WEBROOT/ EOF @@ -116,8 +122,15 @@ echo "==> Enabling site and restarting Apache..." sudo a2ensite markdown sudo systemctl reload apache2 +echo "==> Granting FileZilla user 'anon' permission to upload to md/ folder..." +sudo usermod -aG www-data $UPLOAD_USER +sudo chown -R www-data:www-data "$MD_DIR" +sudo chmod -R 775 "$MD_DIR" + echo "" echo "✅ Setup Complete!" -echo "Open in your browser:" -echo " Root file: http://localhost/cgi-bin/render.py?file=index.md" -echo " Nested file: http://localhost/cgi-bin/render.py?file=docs/tutorial.md" +echo "📁 Upload Markdown files to: /var/www/html/markdown/md/" +echo "🖥️ View raw directory listing: http://localhost/markdown/md/" +echo "🖥️ View root file: http://localhost/cgi-bin/render.py?file=index.md" +echo "📄 View nested file: http://localhost/cgi-bin/render.py?file=docs/tutorial.md" +echo "🧑 Log out and back in as '$UPLOAD_USER' to apply group changes if needed."