Compare commits

...

10 Commits

Author SHA1 Message Date
Barunes Padhy
1e71fbea32
Update rangolio_installer.sh 2024-06-24 10:47:27 +03:00
Barunes Padhy
2db947763d
Update rangolio_installer.sh 2024-06-22 09:09:33 +03:00
Barunes Padhy
9171343e61
Update rangolio_installer.sh 2024-06-21 22:44:33 +03:00
Barunes Padhy
3e97a5c2e0
Update rangolio_installer.sh 2024-06-20 18:13:25 +03:00
Barunes Padhy
98a55629af
Update rangolio_installer.sh 2024-06-19 16:23:45 +03:00
Barunes Padhy
f4dcb6e7ec
Update rangolio_installer.sh 2024-06-19 16:17:41 +03:00
Barunes Padhy
8d4a15dbed
Update rangolio_installer.sh 2024-06-19 15:18:04 +03:00
Barunes Padhy
c3632b79db
Update rangolio_installer.bat 2024-06-19 14:56:30 +03:00
Barunes Padhy
837ddc8d8a
Update rangolio_installer.bat 2024-06-19 14:09:29 +03:00
d534fe3096 Create linux installer 2024-06-19 12:56:42 +03:00
2 changed files with 119 additions and 2 deletions

View File

@ -53,11 +53,11 @@ python manage.py migrate
REM Create a desktop shortcut for managing content
echo Creating desktop shortcut...
powershell -command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut($env:USERPROFILE + '\Desktop\Rangolio - Manage content.lnk'); $s.TargetPath = 'cmd.exe'; $s.Arguments = '/k cd /d %CD% & .env\Scripts\activate.bat & python manage.py runserver & start https://127.0.0.1:8000/'; $s.IconLocation = '%CD%\rangolio\backend\icons\128x128\icon.ico'; $s.Save()"
powershell -command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut($env:USERPROFILE + '\Desktop\Rangolio - Manage content.lnk'); $s.TargetPath = 'powershell.exe'; $s.Arguments = '-NoProfile -ExecutionPolicy Bypass -Command \"cd ''%CD%''; .env\\Scripts\\activate; python manage.py runserver; Start-Process http://127.0.0.1:8000/\"'; $s.IconLocation = '%CD%\icons\ico\rangolio.ico'; $s.Save()"
REM Create a start menu entry for managing content
echo Creating start menu entry...
powershell -command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut($env:APPDATA + '\Microsoft\Windows\Start Menu\Programs\Rangolio - Manage content.lnk'); $s.TargetPath = 'cmd.exe'; $s.Arguments = '/k cd /d %CD% & .env\Scripts\activate.bat & python manage.py runserver & start https://127.0.0.1:8000/'; $s.IconLocation = '%CD%\rangolio\backend\icons\256x256.png'; $s.Save()"
powershell -command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut($env:APPDATA + '\Microsoft\Windows\Start Menu\Programs\Rangolio - Manage content.lnk'); $s.TargetPath = 'powershell.exe'; $s.Arguments = '-NoProfile -ExecutionPolicy Bypass -Command \"cd ''%CD%''; .env\\Scripts\\activate; python manage.py runserver; Start-Process http://127.0.0.1:8000/\"'; $s.IconLocation = '%CD%\icons\ico\rangolio.ico'; $s.Save()"
echo Installation completed successfully.

117
rangolio_installer.sh Executable file
View File

@ -0,0 +1,117 @@
#!/bin/bash
# Function to check the existence of a command
command_exists() {
command -v "$1" &> /dev/null
}
# Detect the package manager and install necessary packages
detect_package_manager() {
if command_exists apt-get; then
echo "Detected package manager: APT (Debian, Ubuntu, etc.)"
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-venv git npm curl xterm libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xinerama0
elif command_exists dnf; then
echo "Detected package manager: DNF (Fedora)"
sudo dnf check-update
sudo dnf install -y python3 python3-pip git npm curl xterm
elif command_exists zypper; then
echo "Detected package manager: Zypper (openSUSE)"
sudo zypper refresh
sudo zypper install -y python3 python3-pip git npm curl xterm libgthread-2_0-0
elif command_exists pacman; then
echo "Detected package manager: Pacman (Arch)"
sudo pacman -Syu
sudo pacman -S --noconfirm python python-pip git npm curl xterm
else
echo "Package manager not detected. Unsupported OS or package manager."
exit 1
fi
}
# Install Node.js using NVM
install_nodejs() {
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install v18.20.3
}
# Set up the viewable UI
setup_viewable_ui() {
cd rangolio/frontend/viewable-ui/
npm install
npm run build:server
npm run build:ghpages
}
# Set up the editable UI
setup_editor_ui() {
cd ../editable-ui/
npm install
npm run build
}
# Set up the backend
setup_editor_backend() {
cd ../../backend
mkdir -p templates
python3 -m venv .env
source .env/bin/activate
pip install -r requirements.txt
python manage.py collectstatic --no-input
cp static/index.html templates/
python manage.py makemigrations
python manage.py migrate
}
create_run_script() {
RUN_SCRIPT="$PWD/start_editor.sh"
echo "#!/bin/bash" > $RUN_SCRIPT
echo "cd $PWD" >> $RUN_SCRIPT
echo "source .env/bin/activate" >> $RUN_SCRIPT
echo "xterm -e \"bash -c 'source .env/bin/activate; python manage.py runserver'\" &" >> $RUN_SCRIPT
echo "sleep 5" >> $RUN_SCRIPT
echo "xdg-open http://127.0.0.1:8000/" >> $RUN_SCRIPT
chmod +x $RUN_SCRIPT
}
# Create a desktop entry
create_desktop_entry() {
DESKTOP_ENTRY="[Desktop Entry]
Name=Rangolio Manage Content
Exec=$PWD/start_editor.sh
Icon=$PWD/icons/png/256x256.png
Type=Application
Terminal=false
Categories=Development;"
mkdir -p "$HOME/.local/share/applications"
echo "$DESKTOP_ENTRY" > "$HOME/.local/share/applications/rangolio-manage-content.desktop"
chmod +x "$HOME/.local/share/applications/rangolio-manage-content.desktop"
}
main() {
echo "Installing OS Dependencies"
detect_package_manager
install_nodejs
echo "Cloning Rangolio"
git clone https://github.com/barunespadhy/rangolio.git
echo "Setting up Rangolio UI"
setup_viewable_ui
setup_editor_ui
echo "Setting up Rangolio Editor Functions"
setup_editor_backend
echo "Create menu entry"
create_run_script
create_desktop_entry
}
main
exit 0