Skip to content

Kiremode/ChaitAi_Linux_Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ChatAI Linux Setup Guide

πŸ”§ Installation Steps

1. Install Wine

Debian/Ubuntu:

sudo apt update
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo mv winehq.key /usr/share/keyrings/winehq-archive.key
wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
sudo mv winehq-$(lsb_release -cs).sources /etc/apt/sources.list.d/
sudo apt update
sudo apt install -y winehq-stable

Fedora/RHEL:

sudo dnf install -y wine

Arch Linux:

sudo pacman -S wine wine-gecko wine-mono

openSUSE:

sudo zypper install -y wine

2. Install Node.js

Debian/Ubuntu:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

Fedora/RHEL:

curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
sudo dnf install -y nodejs

Arch Linux:

sudo pacman -S nodejs npm

openSUSE:

sudo zypper install -y nodejs18 npm18

3. Install and Configure Chromium Browser

Debian/Ubuntu:

sudo apt install -y chromium-browser

Fedora/RHEL:

sudo dnf install -y chromium

Arch Linux:

sudo pacman -S chromium

openSUSE:

sudo zypper install -y chromium

Configure Chromium for Web Development

# Create Chromium configuration directory
mkdir -p ~/.config/chromium/Default

# Create a desktop shortcut for easy access (optional)
cat > ~/.local/share/applications/chromium-dev.desktop << 'EOF'
[Desktop Entry]
Version=1.0
Name=Chromium (Dev Mode)
Comment=Web Browser with Dev Tools
Exec=chromium --disable-web-security --user-data-dir=/tmp/chromium-dev --allow-running-insecure-content
Icon=chromium
Terminal=false
Type=Application
Categories=Network;WebBrowser;
EOF

# Make it executable
chmod +x ~/.local/share/applications/chromium-dev.desktop

Test Chromium Installation

# Test if Chromium runs properly
chromium --version

# Test opening a URL
chromium https://google.com &

Alternative Browsers (if Chromium doesn't work)

Install Google Chrome:

# Debian/Ubuntu
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt update
sudo apt install -y google-chrome-stable

# Fedora/RHEL
sudo dnf install -y google-chrome-stable

# Arch (from AUR)
yay -S google-chrome

Install Firefox (fallback):

# Debian/Ubuntu
sudo apt install -y firefox

# Fedora/RHEL
sudo dnf install -y firefox

# Arch
sudo pacman -S firefox

# openSUSE
sudo zypper install -y firefox

4. Configure Wine

# Set Wine environment
export WINEPREFIX="$HOME/.wine"
export WINEARCH="win64"

# Initialize Wine (opens GUI - select Windows 10)
winecfg

5. Install Python in Wine

# Download Python for Windows
cd /tmp
wget https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe

# Install in Wine
wine python-3.10.11-amd64.exe

# Verify installation
wine python --version

πŸš€ Using the Script

1. Setup Project

mkdir -p ~/Desktop/chatai
cd ~/Desktop/chatai

# Place your files:
# - app.exe (your ChatAI executable)
# - start.sh (the startup script)
# - native_proxy.js (the proxy server)
# - public/ folder with your web files

chmod +x start.sh

2. Run ChatAI

./start.sh

3. Access Application

4. Stop Services

Press Ctrl+C in the terminal to stop all services.

🌐 Browser Configuration Tips

For CORS and Local Development

If you have issues with CORS or local file access, launch Chromium with development flags:

chromium --disable-web-security --user-data-dir=/tmp/chromium-dev --allow-running-insecure-content http://localhost:3000

Set Default Browser

# Check current default browser
xdg-settings get default-web-browser

# Set Chromium as default
xdg-settings set default-web-browser chromium-browser.desktop

# Or for Google Chrome
xdg-settings set default-web-browser google-chrome.desktop

Browser Detection Order

The script will try browsers in this order:

  1. google-chrome (Google Chrome)
  2. chromium-browser or chromium (Chromium)
  3. firefox (Firefox)
  4. xdg-open (System default)

πŸ”§ What the Script Does

  1. Auto-installs Ollama if missing
  2. Creates directories (models, ollama, public)
  3. Moves UI files from html/browser to public if needed
  4. Starts services in order:
    • Ollama service
    • ChatAI backend (Wine app)
    • Node.js proxy server
  5. Opens browser automatically (tries Chromium first)
  6. Handles cleanup when stopped

πŸ› Quick Troubleshooting

Wine issues:

winecfg  # Check configuration

Python missing in Wine:

wine python --version  # Should show Python 3.10.x

Browser not opening:

# Check if Chromium is installed
chromium --version

# Manually open the URL
chromium http://localhost:3000

# Or try other browsers
google-chrome http://localhost:3000
firefox http://localhost:3000

Port conflicts:

sudo netstat -tulpn | grep -E ':(3000|5001|11434)'

Check logs:

tail -f server.log

That's it! Install Wine + Node.js + Chromium, configure Wine, install Python in Wine, then run the script. Chromium will automatically open the ChatAI interface.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published