Fix database path issues and update deployment instructions

- Fix DatabaseService.ts to use correct relative paths (../../ instead of ../../../)
- Add npm run build step to deployment instructions
- Add database file creation step to deployment instructions
- Fix Caddyfile download to go directly to /etc/caddy/Caddyfile
- Update step numbering in deployment script

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code 2025-07-06 18:33:08 -04:00
parent 429a5d4afc
commit e2b3593c37
2 changed files with 11 additions and 7 deletions

View file

@ -146,11 +146,11 @@ if [ "$S3_BUCKET_NAME" != "none" ]; then
exit 1
fi
# Download Caddyfile template
# Download Caddyfile
echo "📥 Downloading Caddy configuration..."
curl -sSL "$S3_BASE_URL/Caddyfile" -o /tmp/Caddyfile
if [ $? -eq 0 ]; then
sudo mv /tmp/Caddyfile /etc/caddy/Caddyfile.template
sudo mv /tmp/Caddyfile /etc/caddy/Caddyfile
echo "✅ Downloaded Caddyfile from S3"
else
echo "❌ Failed to download Caddyfile from S3"
@ -180,6 +180,7 @@ fi
echo "3. Set up the application:"
echo " cd /opt/icewatch"
echo " npm install"
echo " npm run build # Compile TypeScript and build CSS"
echo " cp .env.example .env"
echo " nano .env # Add your MapBox token and admin password"
echo ""
@ -187,16 +188,19 @@ echo "4. Configure domain in Caddyfile (if needed):"
echo " sudo nano /etc/caddy/Caddyfile"
echo " # The default is configured for ice.puremichigan.lol"
echo ""
echo "5. Set permissions:"
echo "5. Create database files:"
echo " touch icewatch.db profanity.db"
echo ""
echo "6. Set permissions:"
echo " sudo chown -R icewatch:icewatch /opt/icewatch"
echo " sudo chmod 660 /opt/icewatch/.env"
echo ""
echo "6. Start services:"
echo "7. Start services:"
echo " sudo systemctl daemon-reload"
echo " sudo systemctl enable icewatch caddy"
echo " sudo systemctl start icewatch caddy"
echo ""
echo "7. Check status:"
echo "8. Check status:"
echo " sudo systemctl status icewatch"
echo " sudo systemctl status caddy"
echo ""

View file

@ -16,7 +16,7 @@ class DatabaseService {
async initializeMainDatabase(): Promise<void> {
return new Promise((resolve, reject) => {
const dbPath = path.join(__dirname, '../../../icewatch.db');
const dbPath = path.join(__dirname, '../../icewatch.db');
this.mainDb = new sqlite3.Database(dbPath, async (err: Error | null) => {
if (err) {
console.error('Could not connect to main database', err);
@ -41,7 +41,7 @@ class DatabaseService {
async initializeProfanityDatabase(): Promise<void> {
return new Promise((resolve, reject) => {
const dbPath = path.join(__dirname, '../../../profanity.db');
const dbPath = path.join(__dirname, '../../profanity.db');
this.profanityDb = new sqlite3.Database(dbPath, async (err: Error | null) => {
if (err) {
console.error('Could not connect to profanity database', err);