Skip to content

Commit

Permalink
feat: zero-knowledge install
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Apr 1, 2024
1 parent 476c6b2 commit 57965a7
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 8 deletions.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,20 @@ Open https://viasite.github.io/site-audit-seo-viewer/.

## Install

## Install with docker-compose
``` bash
git clone https://github.com/viasite/site-audit-seo
cd site-audit-seo
git clone https://github.com/viasite/site-audit-seo-viewer data/front
docker-compose pull # for skip build step
docker-compose up -d
## Zero-knowledge install
Requires Docker.

### Windows: download and run `install-run.bat`.
Script will clone repository to `%LocalAppData%\Programs\site-audit-seo` and run service on http://localhost:5302.


### Linux/MacOS:
```
curl https://raw.githubusercontent.com/viasite/site-audit-seo/master/install-run.sh | bash
```

Script will clone repository to `$HOME/.local/share/programs/site-audit-seo` and run service on http://localhost:5302.

Service will available on http://localhost:5302

##### Default ports:
Expand All @@ -125,7 +130,6 @@ Service will available on http://localhost:5302

You can change it in `.env` file or in `docker-compose.yml`.


## Install with NPM:
``` bash
npm install -g site-audit-seo
Expand All @@ -143,6 +147,15 @@ Run this (replace `$USER` to your username or run from your user, not from `root
sudo chown -R $USER:$USER "$(npm prefix -g)/lib/node_modules/site-audit-seo/node_modules/puppeteer/.local-chromium/"
```

## Install developer instanse with docker-compose
``` bash
git clone https://github.com/viasite/site-audit-seo
cd site-audit-seo
git clone https://github.com/viasite/site-audit-seo-viewer data/front
docker-compose pull # for skip build step
docker-compose up -d
```

Error details [Invalid file descriptor to ICU data received](https://github.com/puppeteer/puppeteer/issues/2519).

## Command line usage:
Expand Down
34 changes: 34 additions & 0 deletions install-run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@echo off
:: Use environment variable for INSTALL_DIR if it exists, else use default
IF NOT DEFINED INSTALL_DIR SET "INSTALL_DIR=%LocalAppData%\Programs\site-audit-seo"
echo INSTALL_DIR: %INSTALL_DIR%

:: Check if the install directory exists, create if it does not
IF NOT EXIST "%INSTALL_DIR%" (
mkdir "%INSTALL_DIR%"
)

:: Clone the repository (Ensure you have git command available)
pushd "%INSTALL_DIR%"
IF EXIST ".git" (
echo Repository already cloned, updating...
git pull
) ELSE (
git clone https://github.com/viasite/site-audit-seo.git "%INSTALL_DIR%"
)

:: Assuming docker-compose.yml is at the root of the cloned directory
:: Start Docker Compose
docker compose pull
docker compose up -d

:: Follow the logs
docker compose logs -tf

popd

echo.
echo site-audit-seo will remain running in the background.
echo To stop the service, run:
echo cd "%INSTALL_DIR%"
echo docker compose down
34 changes: 34 additions & 0 deletions install-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Use environment variable for INSTALL_DIR if it exists, else use default
INSTALL_DIR=${INSTALL_DIR:-"$HOME/.local/share/programs/site-audit-seo"}
echo "INSTALL_DIR: $INSTALL_DIR"

# Check if the install directory exists, create if it does not
if [ ! -d "$INSTALL_DIR" ]; then
mkdir -p "$INSTALL_DIR"
fi

# Clone the repository (Ensure you have git command available)
cd "$INSTALL_DIR"
if [ ! -d ".git" ]; then
git clone https://github.com/viasite/site-audit-seo.git "$INSTALL_DIR"
else
echo "Repository already cloned, updating..."
git pull
fi

# Assuming docker-compose.yml is at the root of the cloned directory
# Start Docker Compose
docker compose pull
docker compose up -d

# Follow the logs
docker compose logs -tf

echo ""
echo "site-audit-seo will remain running in the background."
echo "To stop the service, run:
cd \"$INSTALL_DIR\"
docker compose down
"

0 comments on commit 57965a7

Please sign in to comment.