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
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
gh release create "$GITHUB_REF_NAME" * --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" "$notes" $pre

# The default token cannot write to a different repository. Opt in after
# adding a fine-grained HOMEBREW_TAP_TOKEN for ponytojas/homebrew-tap.
# adding a fine-grained HOMEBREW_TAP_TOKEN for Use-Refract/homebrew-tap.
homebrew:
needs: release
if: vars.HOMEBREW_TAP_ENABLED == 'true' && !contains(github.ref_name, '-')
Expand All @@ -215,7 +215,7 @@ jobs:
path: metadata
- uses: actions/checkout@v7
with:
repository: ponytojas/homebrew-tap
repository: Use-Refract/homebrew-tap
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: tap
- name: Update tap
Expand Down Expand Up @@ -273,15 +273,15 @@ jobs:
- id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/ponytojas/refract
images: ghcr.io/use-refract/refract
- id: push
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=${{ github.ref_name }}
outputs: type=image,name=ghcr.io/ponytojas/refract,push-by-digest=true,name-canonical=true,push=true
outputs: type=image,name=ghcr.io/use-refract/refract,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=image-${{ matrix.arch }}
- id: digest
run: echo "${{ matrix.arch }}=${{ steps.push.outputs.digest }}" >> "$GITHUB_OUTPUT"
Expand All @@ -292,11 +292,11 @@ jobs:
# Blocks the release on Critical findings without a reviewed exception
# (security/image-scan-exceptions.json); the report is kept either way.
- name: Scan the pushed image
run: scripts/scan-image.sh "ghcr.io/ponytojas/refract@${{ steps.push.outputs.digest }}" "$RUNNER_TEMP/scan"
run: scripts/scan-image.sh "ghcr.io/use-refract/refract@${{ steps.push.outputs.digest }}" "$RUNNER_TEMP/scan"
- name: Keep the report with the build
if: ${{ !cancelled() && steps.push.outputs.digest != '' }}
run: |
printf '%s\n' "ghcr.io/ponytojas/refract@${{ steps.push.outputs.digest }}" > "$RUNNER_TEMP/scan/image.txt"
printf '%s\n' "ghcr.io/use-refract/refract@${{ steps.push.outputs.digest }}" > "$RUNNER_TEMP/scan/image.txt"
tar -czf "$RUNNER_TEMP/refract-image-${GITHUB_REF_NAME}-${{ matrix.arch }}-scan.tar.gz" -C "$RUNNER_TEMP/scan" .
- uses: actions/upload-artifact@v7
if: ${{ !cancelled() && steps.push.outputs.digest != '' }}
Expand All @@ -322,7 +322,7 @@ jobs:
- id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/ponytojas/refract
images: ghcr.io/use-refract/refract
# v1.2.3 → 1.2.3 and 1.2; "latest" only for releases, not pre-releases (v1.2.3-rc1).
tags: |
type=semver,pattern={{version}}
Expand All @@ -341,5 +341,5 @@ jobs:
done <<EOF
$TAGS
EOF
docker buildx imagetools create "$@" "ghcr.io/ponytojas/refract@$AMD64" "ghcr.io/ponytojas/refract@$ARM64"
docker buildx imagetools create "$@" "ghcr.io/use-refract/refract@$AMD64" "ghcr.io/use-refract/refract@$ARM64"
docker buildx imagetools inspect "$(printf '%s\n' "$TAGS" | head -1)"
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Needs [Docker](https://docs.docker.com/get-docker/). Check with `docker version`
openssl rand -base64 32 > refract.key && chmod 600 refract.key
docker run -d --name refract -p 127.0.0.1:8080:8080 -v refract-data:/data \
-e REFRACT_SECRET_KEY="$(cat refract.key)" -e REFRACT_AUTH=none -e REFRACT_ALLOWED_HOSTS=localhost \
ghcr.io/ponytojas/refract
ghcr.io/use-refract/refract
```

The image is published for amd64 and arm64. To build it from the source instead: `git clone https://github.com/ponytojas/Refract.git && cd Refract && docker build -t refract .`, then use `refract` as the image name.
The image is published for amd64 and arm64. To build it from the source instead: `git clone https://github.com/Use-Refract/Refract.git && cd Refract && docker build -t refract .`, then use `refract` as the image name.

Verify: `curl -s http://127.0.0.1:8080/healthz` prints `ok`. Then tell them to open <http://localhost:8080>, create a project and press ⌘↵ (Ctrl+Enter) to compile. The first compile downloads LaTeX packages and takes longer.

Expand All @@ -72,7 +72,7 @@ Check each tool and install what's missing. Versions are those the project build
### Run it

```sh
git clone https://github.com/ponytojas/Refract.git
git clone https://github.com/Use-Refract/Refract.git
cd Refract
make dev
```
Expand Down Expand Up @@ -118,7 +118,7 @@ Follow the README's [Deploy](README.md#deploy) section. Decide these with the pe
2. **The address and https**: a domain pointing at the server and a reverse proxy with TLS (the README has Caddy and nginx examples; the proxy must send `X-Forwarded-Proto` and must not buffer responses).
3. **Where the secret key lives**: somewhere it survives reinstalls and is backed up with the data volume.

Then start the container from the published image (`ghcr.io/ponytojas/refract:0.2`), create the first account (`docker exec refract refract users add <email>`), and verify `https://<domain>/healthz` prints `ok` and the sign-in page loads.
Then start the container from the published image (`ghcr.io/use-refract/refract:0.2`), create the first account (`docker exec refract refract users add <email>`), and verify `https://<domain>/healthz` prints `ok` and the sign-in page loads.

## When something goes wrong

Expand Down
13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Notable changes to Refract. The format follows [Keep a Changelog](https://keepac

### Changed

- Refract moved to the [Use-Refract](https://github.com/Use-Refract) organization: the repository is `Use-Refract/Refract`, and the Docker image is published as `ghcr.io/use-refract/refract` (images up to v0.2.0 stay at `ghcr.io/ponytojas/refract`). The macOS app looks for updates in the new repository; old links redirect. The Homebrew tap moved too: `brew install use-refract/tap/refract` (taps added as `ponytojas/tap` keep updating through GitHub's redirect).
- Sign in with ChatGPT is stricter: the sign-in address no longer carries a token, token responses and refreshed ID tokens are verified (a rotation cut short by a restart or a key-server outage resumes without a new login), the local callback ignores stray or malformed requests, a failed code exchange reuses the issued registration, sign-out retries revocation once, and ChatGPT requests don't follow redirects or retry a usage limit.
- A failed database upgrade now says that nothing was changed and where the copy from before the upgrade is (`refract.db.pre-upgrade`).
- `refract local` keeps its secret key in the system credential store (macOS Keychain, Secret Service on Linux, Windows Credential Manager), one item per data folder, and falls back to an owner-only `secret.key` in the data folder when no store can be reached, saying so in the log. An existing `secret.key` is kept. If the key is gone from the store for a data folder that was used before, Refract logs that stored credentials can't be read instead of failing.
Expand Down Expand Up @@ -117,7 +118,7 @@ The first release: a self-hosted LaTeX workspace with an AI assistant.

- LaTeX editor with tabs, autosave and syntax highlighting.
- Compilation with Tectonic, which fetches the packages a document needs; errors and warnings listed with file and line, each with **Fix with AI**.
- Named `fontspec` families (`\setmainfont{Open Sans}`) work without changing the document: Refract uses the project's own font files, the TeX bundle's Latin Modern and TeX Gyre, or downloads the family from Google Fonts (`REFRACT_FONT_DOWNLOADS=0` turns downloads off). By [Lorena Jimenez](https://github.com/Lorena-J) in [#1](https://github.com/ponytojas/Refract/pull/1).
- Named `fontspec` families (`\setmainfont{Open Sans}`) work without changing the document: Refract uses the project's own font files, the TeX bundle's Latin Modern and TeX Gyre, or downloads the family from Google Fonts (`REFRACT_FONT_DOWNLOADS=0` turns downloads off). By [Lorena Jimenez](https://github.com/Lorena-J) in [#1](https://github.com/Use-Refract/Refract/pull/1).
- PDF preview with SyncTeX in both directions (<kbd>⌘J</kbd>, and <kbd>⌘</kbd>-click in the PDF), and a right-click menu in the PDF.
- Command palette (<kbd>⌘K</kbd>) and a shortcut overlay.
- English and Spanish interface, light and dark themes, installable as an app from the browser.
Expand Down Expand Up @@ -158,8 +159,8 @@ The first release: a self-hosted LaTeX workspace with an AI assistant.
- `refract` binaries for macOS, Linux and Windows (amd64 and arm64).
- A Docker image for amd64 and arm64 on GitHub Container Registry, with Tectonic and SyncTeX included.

[Unreleased]: https://github.com/ponytojas/Refract/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/ponytojas/Refract/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/ponytojas/Refract/releases/tag/v0.1.2
[0.1.1]: https://github.com/ponytojas/Refract/releases/tag/v0.1.1
[0.1.0]: https://github.com/ponytojas/Refract/releases/tag/v0.1.0
[Unreleased]: https://github.com/Use-Refract/Refract/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/Use-Refract/Refract/compare/v0.1.2...v0.2.0
[0.1.2]: https://github.com/Use-Refract/Refract/releases/tag/v0.1.2
[0.1.1]: https://github.com/Use-Refract/Refract/releases/tag/v0.1.1
[0.1.0]: https://github.com/Use-Refract/Refract/releases/tag/v0.1.0
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ Edit, compile and read the PDF side by side, cite real papers, and keep every ve
</p>

<p align="center">
<a href="https://github.com/ponytojas/Refract/releases/latest"><img src="https://img.shields.io/github/v/release/ponytojas/Refract" alt="Latest release"></a>
<a href="https://github.com/ponytojas/Refract/pkgs/container/refract"><img src="https://img.shields.io/badge/docker-ghcr.io%2Fponytojas%2Frefract-2496ED?logo=docker&logoColor=white" alt="Docker image"></a>
<a href="https://github.com/ponytojas/Refract/actions/workflows/ci.yml"><img src="https://github.com/ponytojas/Refract/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/ponytojas/Refract/actions/workflows/security.yml"><img src="https://github.com/ponytojas/Refract/actions/workflows/security.yml/badge.svg" alt="Security"></a>
<a href="go.mod"><img src="https://img.shields.io/github/go-mod/go-version/ponytojas/Refract" alt="Go version"></a>
<a href="LICENSE"><img src="https://img.shields.io/github/license/ponytojas/Refract" alt="MIT License"></a>
<a href="https://github.com/Use-Refract/Refract/releases/latest"><img src="https://img.shields.io/github/v/release/Use-Refract/Refract" alt="Latest release"></a>
<a href="https://github.com/Use-Refract/Refract/pkgs/container/refract"><img src="https://img.shields.io/badge/docker-ghcr.io%2Fuse-refract%2Frefract-2496ED?logo=docker&logoColor=white" alt="Docker image"></a>
<a href="https://github.com/Use-Refract/Refract/actions/workflows/ci.yml"><img src="https://github.com/Use-Refract/Refract/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/Use-Refract/Refract/actions/workflows/security.yml"><img src="https://github.com/Use-Refract/Refract/actions/workflows/security.yml/badge.svg" alt="Security"></a>
<a href="go.mod"><img src="https://img.shields.io/github/go-mod/go-version/Use-Refract/Refract" alt="Go version"></a>
<a href="LICENSE"><img src="https://img.shields.io/github/license/Use-Refract/Refract" alt="MIT License"></a>
</p>

<p align="center">
Expand Down Expand Up @@ -204,14 +204,16 @@ The seed is used only by `refract local`; the server (`refract` without `local`)

You need [Docker](https://docs.docker.com/get-docker/).

The image is `ghcr.io/use-refract/refract` from the release after v0.2.0 on. Versions up to v0.2.0 were published as `ghcr.io/ponytojas/refract`, where they stay.

```sh
openssl rand -base64 32 > refract.key && chmod 600 refract.key # once: keep this file
docker run -d --name refract -p 127.0.0.1:8080:8080 -v refract-data:/data \
-e REFRACT_SECRET_KEY="$(cat refract.key)" \
-e REFRACT_AUTH=none \
-e REFRACT_SECRET_KEY="$(openssl rand -base64 32)" \
-e REFRACT_AUTH=none -e REFRACT_ALLOWED_HOSTS=localhost \
ghcr.io/ponytojas/refract
ghcr.io/use-refract/refract
```

The key encrypts the credentials you'll save (AI keys, git tokens), so use the same `refract.key` whenever you start the container again: with another key they can't be read back.
Expand All @@ -232,7 +234,7 @@ docker run -d --name refract --restart unless-stopped --stop-timeout 30 \
-e REFRACT_SECRET_KEY="$(cat refract.key)" \
-e REFRACT_AUTH=builtin \
-e REFRACT_PUBLIC_URL=https://refract.example.com \
ghcr.io/ponytojas/refract:0.2
ghcr.io/use-refract/refract:0.2
```

`refract.key` holds the secret key: create it once with `openssl rand -base64 32 > refract.key && chmod 600 refract.key`, and keep it with your backups.
Expand All @@ -253,7 +255,7 @@ The sandbox has no network, so Tectonic needs the whole TeX bundle on disk (abou
```sh
# 1. The offline TeX bundle, into its own volume (downloads 2.7 GB).
docker run --rm -v refract-tex:/opt/refract/tex --entrypoint refract-prepare-bundle \
ghcr.io/ponytojas/refract:0.2 /opt/refract/tex
ghcr.io/use-refract/refract:0.2 /opt/refract/tex

# 2. Refract, with the bundle read-only and the options bubblewrap needs.
docker run -d --name refract --restart unless-stopped --stop-timeout 30 \
Expand All @@ -262,7 +264,7 @@ docker run -d --name refract --restart unless-stopped --stop-timeout 30 \
-e REFRACT_SECRET_KEY="$(cat refract.key)" \
-e REFRACT_PROFILE=team -e REFRACT_AUTH=builtin \
-e REFRACT_TECTONIC_BUNDLE=/opt/refract/tex/bundle -e TECTONIC_CACHE_DIR=/opt/refract/tex/cache \
ghcr.io/ponytojas/refract:0.2
ghcr.io/use-refract/refract:0.2
```

Then create the accounts (`docker exec refract refract users add <email>`), put it [behind a reverse proxy](#behind-a-reverse-proxy) with https, and [back it up](#data-backups-and-upgrades) with the key. When you upgrade to an image with another Tectonic or bundle, prepare a new volume.
Expand Down Expand Up @@ -425,7 +427,7 @@ Everything lives in the `/data` volume:

To back up, stop the container, copy the volume, and keep `REFRACT_SECRET_KEY` with the copy.

To upgrade, pull the new image (`docker pull ghcr.io/ponytojas/refract:0.2`, or a newer version's tag) and start a new container on the same volume. Database changes are applied automatically at startup.
To upgrade, pull the new image (`docker pull ghcr.io/use-refract/refract:0.2`, or a newer version's tag) and start a new container on the same volume. Database changes are applied automatically at startup.

To go back to an older version after an upgrade:

Expand Down Expand Up @@ -475,13 +477,13 @@ The CLI lets you run `refract login` on your computer and upload the resulting c
**macOS (Apple Silicon or Intel):**

```sh
brew install ponytojas/tap/refract
brew install use-refract/tap/refract
refract login
```

Update with `brew update` followed by `brew upgrade ponytojas/tap/refract`.
Update with `brew update` followed by `brew upgrade use-refract/tap/refract`.

**Debian / Ubuntu:** download the `.deb` for your architecture (`amd64` or `arm64`) from [Releases](https://github.com/ponytojas/Refract/releases). Packages are available starting with v0.1.2. For example, from the download directory:
**Debian / Ubuntu:** download the `.deb` for your architecture (`amd64` or `arm64`) from [Releases](https://github.com/Use-Refract/Refract/releases). Packages are available starting with v0.1.2. For example, from the download directory:

```sh
sudo apt install ./refract_0.1.2_amd64.deb
Expand All @@ -490,7 +492,7 @@ refract login

Replace the version and architecture with those of your download. Install a newer `.deb` the same way to update; there is no Refract APT repository. On Linux, login opens a browser with `xdg-open` if available. Use `refract login --no-browser` to open the printed URL yourself on the same computer.

**Windows and other Linux distributions:** download the `.zip` or `.tar.gz` for your system from [Releases](https://github.com/ponytojas/Refract/releases), extract it and run `refract.exe login` (Windows) or `./refract login` (Linux) from the extracted directory. You can also place the executable in a directory on your `PATH`.
**Windows and other Linux distributions:** download the `.zip` or `.tar.gz` for your system from [Releases](https://github.com/Use-Refract/Refract/releases), extract it and run `refract.exe login` (Windows) or `./refract login` (Linux) from the extracted directory. You can also place the executable in a directory on your `PATH`.

Each new release includes WinGet manifests for the Windows zip archives. These are prepared for submission to Microsoft's community repository; `winget install --id ponytojas.Refract --exact` becomes available after Microsoft accepts a submission. See [packaging maintenance](packaging/README.md) for validation and publication.

Expand Down
2 changes: 1 addition & 1 deletion macos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ for the same answer instead of asking twice.
every Mach-O instead.
- **One feed per architecture, on GitHub Releases.** Sparkle doesn't choose by architecture and the apps
are per architecture (see "One app per architecture"), so each build is baked with its own feed,
`https://github.com/ponytojas/Refract/releases/latest/download/appcast-<arch>.xml` with `<arch>` as
`https://github.com/Use-Refract/Refract/releases/latest/download/appcast-<arch>.xml` with `<arch>` as
everywhere else in this repository (`arm64`, `amd64`). Releases rather than Pages: the feed is published
by the same job that publishes the archive it points to (nothing to keep in step, no second deployment
or token), `releases/latest/download/` is a stable URL, and the only cost is that a release flagged
Expand Down
2 changes: 1 addition & 1 deletion macos/Sources/Refract/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
self?.supervisor.restart()
},
showLogs: { NSWorkspace.shared.activateFileViewerSelecting([AppLog.store.file]) },
reinstall: { NSWorkspace.shared.open(URL(string: "https://github.com/ponytojas/Refract/releases/latest")!) })
reinstall: { NSWorkspace.shared.open(URL(string: "https://github.com/Use-Refract/Refract/releases/latest")!) })
window = NSWindow(contentViewController: root)
// No title bar of its own: the web app reaches the top edge, the traffic lights float
// over it. The title stays (Mission Control, the Window menu, VoiceOver) but isn't drawn.
Expand Down
2 changes: 1 addition & 1 deletion macos/Sources/Refract/Updater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final class UpdateController: NSObject, SPUUpdaterDelegate {
alert.addButton(withTitle: L("update.disabled.ok", "OK"))
alert.addButton(withTitle: L("update.disabled.releases", "Open Releases Page"))
if alert.runModal() == .alertSecondButtonReturn {
NSWorkspace.shared.open(URL(string: "https://github.com/ponytojas/Refract/releases/latest")!)
NSWorkspace.shared.open(URL(string: "https://github.com/Use-Refract/Refract/releases/latest")!)
}
}

Expand Down
2 changes: 1 addition & 1 deletion macos/Tests/RefractCoreTests/UpdateSettingsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import XCTest

final class UpdateSettingsTests: XCTestCase {
private let key = Data(repeating: 7, count: 32).base64EncodedString()
private let feed = "https://github.com/ponytojas/Refract/releases/latest/download/appcast-arm64.xml"
private let feed = "https://github.com/Use-Refract/Refract/releases/latest/download/appcast-arm64.xml"

private func info(key: String? = nil, feed: String? = nil, overridable: Bool = false) -> [String: Any] {
var d: [String: Any] = [:]
Expand Down
2 changes: 1 addition & 1 deletion macos/build-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ case "$ARCH" in
*) echo "error: arch must be arm64 or amd64" >&2; exit 2 ;;
esac
SPARKLE_KEY=${REFRACT_SPARKLE_PUBLIC_KEY:-}
FEED_BASE=${REFRACT_UPDATE_FEED_BASE:-https://github.com/ponytojas/Refract/releases/latest/download}
FEED_BASE=${REFRACT_UPDATE_FEED_BASE:-https://github.com/Use-Refract/Refract/releases/latest/download}
# A release without the key could never be updated (and an update could never be verified): refuse
# before spending ten minutes on the build. A release is `make mac-release` (REFRACT_RELEASE=1) or
# any Developer ID build; other builds (ad hoc, Apple Development, self-signed) without the key run
Expand Down
Loading
Loading