Skip to content

Commit f24b68d

Browse files
Update docs (#1695)
1 parent 6f2eb51 commit f24b68d

7 files changed

Lines changed: 42 additions & 25 deletions

File tree

.agents/setup

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@ if [ -z "$gh_version" ] || ! dpkg --compare-versions "$gh_version" ge "$gh_min_v
2727
sudo apt-get install -y gh
2828
fi
2929

30+
docker_packages=()
3031
if ! command -v docker >/dev/null 2>&1; then
31-
echo "==> Installing Docker and Docker Compose"
32+
docker_packages+=(docker-ce docker-ce-cli containerd.io)
33+
fi
34+
if ! sudo docker buildx version >/dev/null 2>&1; then
35+
docker_packages+=(docker-buildx-plugin)
36+
fi
37+
if ! sudo docker compose version >/dev/null 2>&1; then
38+
docker_packages+=(docker-compose-plugin)
39+
fi
40+
41+
if [ "${#docker_packages[@]}" -gt 0 ]; then
42+
echo "==> Installing missing Docker components: ${docker_packages[*]}"
3243
sudo install -m 0755 -d /etc/apt/keyrings
3344
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
3445
sudo chmod a+r /etc/apt/keyrings/docker.asc
3546
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |
3647
sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
3748
sudo apt-get update
38-
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
49+
sudo apt-get install -y "${docker_packages[@]}"
3950
fi
4051

4152
setup_user="$(id -un)"
@@ -65,7 +76,7 @@ if [ ! -f .env ]; then
6576
cp -- .env.example .env
6677
fi
6778

68-
container_fingerprint="$(fingerprint Dockerfile.dev docker-compose.yml entrypoint.dev.sh Gemfile Gemfile.lock package.json bun.lock)"
79+
container_fingerprint="$(fingerprint Dockerfile.dev docker-compose.yml entrypoint.dev.sh Gemfile Gemfile.lock package.json bun.lock bunfig.toml)"
6980
if cache_matches containers "$container_fingerprint"; then
7081
echo "==> Starting existing development containers"
7182
sudo docker compose up -d
@@ -82,7 +93,7 @@ sudo docker compose exec -T web sh -c '
8293
git config --global --add safe.directory "$repo_root"
8394
'
8495

85-
assets_fingerprint="$(fingerprint app/javascript app/assets/tailwind config/routes.rb config/vite.json config/initializers/js_from_routes.rb vite.config.ts svelte.config.js tsconfig.json tsconfig.svelte-check.json package.json bun.lock)"
96+
assets_fingerprint="$(fingerprint app/javascript app/assets/tailwind config/routes.rb config/vite.json config/initializers/js_from_routes.rb vite.config.ts svelte.config.js tsconfig.json tsconfig.svelte-check.json package.json bun.lock bunfig.toml)"
8697
if cache_matches assets "$assets_fingerprint" && [ -f public/vite-dev/.vite/manifest.json ]; then
8798
echo "==> Vite client assets are current"
8899
else

DEVELOPMENT.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Edit your `.env` file to include the following:
2121
```env
2222
# Database configurations - these work with the Docker setup
2323
DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development
24-
SAILORS_LOG_DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development
2524
2625
# Generate these with `rails secret` or use these for development
2726
SECRET_KEY_BASE=alallalalallalalallalalalladlalllalal
@@ -100,6 +99,14 @@ To run all CI checks locally, you can run:
10099
docker compose exec web bin/ci
101100
```
102101

102+
Bun uses the isolated linker configured in `bunfig.toml`, matching the production Docker build. The development image also copies this configuration when installing dependencies. If you have an existing hoisted install, clear the contents of the `node_modules` volume and Blume's generated cache, then reinstall before running CI:
103+
104+
```bash
105+
docker compose exec web sh -c 'find node_modules -mindepth 1 -delete && rm -rf .blume && bun install --frozen-lockfile'
106+
```
107+
108+
This avoids mixing Sharp's native libraries with the separate libvips version used by Ruby in the production image.
109+
103110
_Make sure these actually pass before making a PR!_
104111

105112
## Migrations

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN curl -fsSL https://bun.sh/install | bash && \
2626
WORKDIR /app
2727

2828
# Install npm dependencies for Vite.
29-
COPY package.json bun.lock ./
29+
COPY package.json bun.lock bunfig.toml ./
3030
RUN bun install && \
3131
bun x playwright install --with-deps --only-shell chromium && \
3232
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives

bunfig.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[install]
2+
# Match production: keep Sharp's native libraries separate from the libvips
3+
# version installed at the root for Ruby Vips in the Docker image.
4+
linker = "isolated"
5+
26
# Only install package versions published at least 1 day ago
37
# (cough cough axios RAT...)
48
minimumReleaseAge = 86400 # seconds

config/database.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ development:
99
encoding: unicode
1010
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
1111
url: <%= ENV['DATABASE_URL'] %>
12-
sailors_log:
13-
adapter: postgresql
14-
encoding: unicode
15-
url: <%= ENV['SAILORS_LOG_DATABASE_URL'] %>
16-
replica: true
1712

1813
# Warning: The database defined as "test" will be erased and
1914
# re-generated from your development database when you run "rake".
@@ -24,11 +19,6 @@ test:
2419
adapter: postgresql
2520
database: app_test
2621
url: <%= ENV['TEST_DATABASE_URL'] %>
27-
sailors_log:
28-
adapter: postgresql
29-
database: app_test
30-
url: <%= ENV['TEST_DATABASE_URL'] %>
31-
replica: true
3222

3323
# Store production database in the storage/ directory, which by default
3424
# is mounted as a persistent Docker volume in config/deploy.yml.
@@ -39,11 +29,6 @@ production:
3929
encoding: unicode
4030
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 16 }.to_i + 8 %> # Web threads + 8 GoodJob threads
4131
url: <%= ENV['POOL_DATABASE_URL'] %>
42-
sailors_log:
43-
adapter: postgresql
44-
encoding: unicode
45-
url: <%= ENV['SAILORS_LOG_DATABASE_URL'] %>
46-
replica: true
4732
cache:
4833
<<: *default
4934
adapter: postgresql

docs/getting-started/quick-start.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Get up and running with Hackatime in under 5 minutes! Start tracking your coding
1212

1313
Visit [hackatime.hackclub.com](https://hackatime.hackclub.com) and sign up using:
1414

15-
- Your Hack Club Slack account (recommended)
15+
- **Sign in with Hack Club** using your Hack Club Account
16+
- Your Hack Club Slack account
1617
- Email address
1718

1819
## Step 2: Run automated setup
@@ -96,7 +97,7 @@ Just run the automated setup script on the [Hackatime Setup Page](https://hackat
9697
Hackatime is free, open source, privacy-focused, and includes unique features like leaderboards for Hack Club members.
9798
</AccordionItem>
9899
<AccordionItem title="Can I import my existing WakaTime data?">
99-
Currently, data import is not supported, but you can start fresh with Hackatime while keeping your WakaTime account.
100+
Yes! Open [Settings → Imports & Exports](https://hackatime.hackclub.com/my/settings/imports_exports), choose **WakaTime** under **Imports**, and enter your WakaTime API key to request a one-time heartbeat dump. You can follow the import's progress on that page.
100101
</AccordionItem>
101102
<AccordionItem title="Is my code data secure?">
102103
Hackatime only tracks metadata (file names, languages, project names) - never your actual code content. All data is encrypted in transit.

docs/oauth/oauth-apps.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Scopes control what data your app can access. It's a good idea to only request t
2626
|-------|-------------|-------------------|
2727
| `profile` | Access basic profile information (user ID, email addresses, Slack ID, GitHub username, trust factor) | Yes |
2828
| `read` | View basic info about the user's Hackatime account | No |
29-
| `admin` | Access the [Admin API](#admin-api-access) on the authorizing admin's behalf. | No |
29+
| `admin` | Access the [Admin API](#admin-api-access) on the authorizing user's behalf, subject to their role permissions. | No |
3030

3131
If you don't specify any scopes, only the `profile` scope is granted.
3232

@@ -39,6 +39,7 @@ scope=profile+read
3939
### Admin scope restrictions
4040

4141
- Only **admin+** users (`admin`, `superadmin`, `ultraadmin`) can attach the `admin` scope to an OAuth application.
42+
- **Viewers and admin+ users** (`viewer`, `admin`, `superadmin`, `ultraadmin`) can authorize an approved application requesting the `admin` scope. The token does not grant permissions beyond the authorizing user's role.
4243
- Apps with the `admin` scope must be **confidential** (server-side clients that can keep a secret).
4344
- **This scope requires approval from Hack Club HQ to use.** It won't work if you try to use it without permission!
4445

@@ -107,7 +108,7 @@ POST https://hackatime.hackclub.com/oauth/token
107108
{
108109
"access_token": "abc123...",
109110
"token_type": "Bearer",
110-
"expires_in": 504576000,
111+
"expires_in": 504911232,
111112
"scope": "profile read",
112113
"created_at": 1700000000
113114
}
@@ -236,6 +237,14 @@ Returns the user's most recent heartbeat.
236237
}
237238
```
238239

240+
If the user has no heartbeats (excluding setup test entries), the endpoint returns **200 OK** with:
241+
242+
```json
243+
{
244+
"heartbeat": null
245+
}
246+
```
247+
239248
### GET /api/v1/authenticated/api_keys
240249

241250
Returns the user's Hackatime API key (creates one if none exists).

0 commit comments

Comments
 (0)