Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/problem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ body:
- Mac with Apple Silicon
- Mac with Intel
- Linux
- Windows 11
- Something else
- type: textarea
id: output
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# install.ps1 on a real Windows, in Windows PowerShell 5.1, run the two ways people run it: piped into iex in their own
# window, and saved and run as a file. GitHub's Windows runners run Docker with Windows containers, so the starter must
# stop there and say how to switch, which is also how far a run can get here: the rest is tested where Squeryl's image runs.
name: windows

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
starter:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Windows PowerShell 5.1 reads it, and it is plain ASCII
shell: powershell
run: |
if ($PSVersionTable.PSEdition -ne 'Desktop') { throw 'not Windows PowerShell' }
$e = $null
[void][Management.Automation.Language.Parser]::ParseFile("$PWD\install.ps1", [ref]$null, [ref]$e)
if ($e) { $e | ForEach-Object { $_.ToString() }; exit 1 }
if ([IO.File]::ReadAllBytes("$PWD\install.ps1") | Where-Object { $_ -ge 0x80 }) { throw 'install.ps1 has a byte beyond ASCII' }
- name: Both starters name the same release
shell: powershell
run: |
$sh = [regex]::Match((Get-Content -Raw install.sh), '(?m)^RELEASE="([^"]*)"').Groups
$ps = [regex]::Match((Get-Content -Raw install.ps1), "(?m)^ \`$Release = '([^']*)'").Groups
if (-not $sh[0].Success -or -not $ps[0].Success) { throw 'a RELEASE line is missing' }
if ($sh[1].Value -ne $ps[1].Value) { throw "install.sh says '$($sh[1].Value)' and install.ps1 says '$($ps[1].Value)'" }
"both say '$($sh[1].Value)'"
- name: Piped into iex, with no release yet, it says so and leaves the window open
shell: powershell
run: |
$out = & { Invoke-Expression (Get-Content -Raw install.ps1) } 6>&1 | Out-String
$out
if ($LASTEXITCODE -ne 1) { throw "exited $LASTEXITCODE, not 1" }
if ($out -notmatch "isn't ready to install yet") { throw 'did not say it is not ready' }
'the window is still open'
$global:LASTEXITCODE = 0
- name: This runner's Docker is running, with its Windows containers
shell: powershell
# The runner's Docker service is not always up when a job starts, and a check that the installer stops at
# Windows containers needs it answering. Not part of what is tested: Squeryl's own scripts start Docker Desktop.
run: |
$ErrorActionPreference = 'Continue'
$service = Get-Service docker -ErrorAction SilentlyContinue
if (-not $service) { throw 'this runner has no docker service' }
if ($service.Status -ne 'Running') { Start-Service docker }
$tries = 0
while ($true) {
docker info 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) { break }
$tries++
if ($tries -gt 60) { throw 'the runner''s docker did not answer within two minutes' }
Start-Sleep -Seconds 2
}
"docker here runs $(docker version --format '{{.Server.Os}}') containers"
$global:LASTEXITCODE = 0
- name: Given a version, it stops at Docker, says how to switch to Linux containers, and makes no folder
shell: powershell
run: |
$env:SQUERYL_VERSION = 'sha-test'
$env:SQUERYL_DIR = "$env:RUNNER_TEMP\Squeryl"
Set-Content -Path "$env:RUNNER_TEMP\key" -Value 'ABCDEF-123456'
$env:SQUERYL_LICENSE_KEY_FILE = "$env:RUNNER_TEMP\key"
# In a PowerShell of its own, because the starter writes a problem to the error output itself, past this one's streams.
$ErrorActionPreference = 'Continue'
$out = powershell -NoProfile -Command "Invoke-Expression (Get-Content -Raw install.ps1); exit `$LASTEXITCODE" 2>&1 | Out-String
$code = $LASTEXITCODE
$out
if ($code -ne 1) { throw "exited $code, not 1" }
if ($out -notmatch 'Switch to Linux containers') { throw 'did not say how to switch' }
if (Test-Path $env:SQUERYL_DIR) { throw 'it made a folder' }
$global:LASTEXITCODE = 0
- name: Saved and run as a file, as an assistant runs it, its exit code says it stopped
shell: cmd
run: |
set SQUERYL_VERSION=
powershell -NoProfile -ExecutionPolicy Bypass -File install.ps1
if not errorlevel 1 (echo it exited 0 & exit /b 1)
echo exited %errorlevel%, as it should
exit /b 0
21 changes: 14 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ customer names or plans.
**Helping someone install Squeryl?** You don't need to change anything here. Follow [AI-INSTALL.md](AI-INSTALL.md).

## Changing this repository
It holds one small starter, kept short so that anyone can read it before running it. `install.sh` checks Docker, makes
the folder, downloads the image, copies the real installer out of that image and runs it. The real installer travels
inside each image, so it always matches the version it installs: fixes to the installer belong there, not here.
It holds one small starter, in two forms, kept short so that anyone can read it before running it: `install.sh` for a Mac
or Linux, and `install.ps1` for Windows. Each checks Docker, makes the folder, downloads the image, copies the real
installer out of that image and runs it. The real installer travels inside each image, so it always matches the version it
installs: fixes to the installer belong there, not here. A change to one starter belongs in the other too.

- **Plain `sh` only.** It runs on customers' machines, usually piped from `curl`.
- **`install.sh` is plain `sh` only.** It runs on customers' machines, usually piped from `curl`.
- **Nothing it runs may read from stdin**, because when piped, stdin is the script itself. That is why each command that
could read has `</dev/null`.
- **Each release changes one line:** `RELEASE` in `install.sh`. While it is empty, the starter says Squeryl isn't ready yet
and stops before asking for anything; `SQUERYL_VERSION` overrides it for testing.
- **`install.ps1` is for Windows PowerShell 5.1, which every Windows 11 has, and is plain ASCII**, because 5.1 reads a
script with no byte-order mark in the local code page. It runs as `irm … | iex` inside the person's own window, so it
never calls `exit`, which would close that window before they could read why: a problem throws, is reported, and the
script stops. GitHub's Windows runner checks it on every pull request (`.github/workflows/windows.yml`).
- **Each release changes one line in each starter:** `RELEASE` in `install.sh` and `$Release` in `install.ps1`, the same
value; the Windows check fails when they differ. While it is empty, the starter says Squeryl isn't ready yet and stops
before asking for anything; `SQUERYL_VERSION` overrides it for testing.
- **No token or secret, ever, even disguised.** GitHub revokes a token pushed to a public repository. The image's read token
comes from the license service, for whoever holds a license key.
- **`AI-INSTALL.md` is followed by other people's assistants.** Keep it to installing, and list an assistant under "Tested with" only
Expand All @@ -26,5 +32,6 @@ inside each image, so it always matches the version it installs: fixes to the in
ending the line before it with `\` or `|`. Then only an address can ever be cut short, which a reader can see.
- **Prove a change** by piping the script into `sh`, using a folder of your own (`SQUERYL_DIR`), an image already on the machine
(`SQUERYL_VERSION`), a key in a file (`SQUERYL_LICENSE_KEY_FILE`) and a stand-in service (`SQUERYL_LICENSE_SERVICE`), then read what it
printed as a customer would.
printed as a customer would. `install.ps1` takes the same settings; on a Mac or Linux, in PowerShell 7, it runs only with
`SQUERYL_PS_ON_UNIX=1`, which is how the tracker's rehearsal runs it (`sh install/rehearse.sh --powershell`).
- **Changes go through a pull request.** People run this script straight from `main`, so a person reviews each change.
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,37 @@ in your own browser. Squeryl keeps collecting while the server and Docker run; i
Already run a reverse proxy and want Squeryl at an address of your own? Once it is installed, the `README.md` in your
`Squeryl` folder says what to set, under "Reaching it from other computers".

## On Windows, or for a whole team on a server
## On Windows 11
**New, and still being tested.** If anything goes wrong, write to support@localseoguide.com.

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) and open it once.
2. Open **PowerShell** (press the Windows key, type PowerShell and press Enter), as yourself rather than as an
administrator, then run:

```powershell
irm https://raw.githubusercontent.com/LocalSEOGuide/squeryl-install/main/install.ps1 |
iex
```

If you were given a private version of Squeryl to install, run this instead, with the version you were given in place
of `<private-image-tag>`:

```powershell
$env:SQUERYL_VERSION = '<private-image-tag>'
irm https://raw.githubusercontent.com/LocalSEOGuide/squeryl-install/main/install.ps1 |
iex
```

3. Paste your license key when it asks, and open the link it prints.

This puts everything in a `Squeryl` folder in your user folder, with the guide in it as `README.md`. Prefer to read the
script first? [install.ps1](install.ps1) is short.

## For a whole team on a server
Not ready yet. A server install with its own web address and HTTPS, for everyone in a team, is coming.

## Uninstall
Open **Terminal** (or, on Linux, a terminal) and run:
Open **Terminal** (on Windows, **PowerShell**; on Linux, a terminal) and run:

```sh
cd ~/Squeryl
Expand All @@ -78,10 +104,10 @@ Your license key keeps working: installing again sends a new code to your email.

To remove every last trace, after `--delete-data`:

1. Move the `Squeryl` folder in your home folder to the Trash, or on Linux run `rm -rf ~/Squeryl`. This deletes your
backups too, so copy any you want to keep somewhere else first.
1. Move the `Squeryl` folder in your home folder to the Trash (on Windows, delete it in File Explorer), or on Linux run
`rm -rf ~/Squeryl`. This deletes your backups too, so copy any you want to keep somewhere else first.
2. Delete Squeryl's image: in Docker Desktop, open **Images** and delete `ghcr.io/localseoguide/squeryl-tracker`. Or,
on any computer, run:
on a Mac or Linux, run:

```sh
docker images --format '{{.Repository}}:{{.Tag}}' \
Expand Down
Loading