Skip to content

Commit 2a56ce0

Browse files
authored
Merge pull request #145 from cryptomator/feature/improve-security
Feature: Improve developer security * use pnpm and its settings * add dependabot file * additional scripts
2 parents a1014b7 + 26caa17 commit 2a56ce0

11 files changed

Lines changed: 13082 additions & 21113 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Thank you for helping improve Cryptomator's documentation!
66

77
1. Fork the repository
88
2. Clone your fork: `git clone <your-fork-url>`
9-
3. Install dependencies: `npm install`
10-
4. Start development server: `npm start`
9+
3. Enable Corepack so the pinned pnpm version is used: `corepack enable`
10+
4. Install dependencies: `pnpm install`
11+
5. Start development server: `pnpm start`
1112

1213
## Making Changes
1314

@@ -34,6 +35,24 @@ We follow git flow for contributions:
3435
- Break up long sections with headings and lists
3536
- Link to related documentation when relevant
3637

38+
## Adding or upgrading dependencies
39+
40+
`pnpm-workspace.yaml` sets `minimumReleaseAge: 4320` (3 days). pnpm
41+
will refuse to resolve any package version younger than that — most
42+
malicious releases are detected and unpublished within hours, so the
43+
delay protects us at near-zero cost.
44+
45+
If you genuinely need a fresh release sooner (e.g. a security fix
46+
just published), add the specific package/version to
47+
`minimumReleaseAgeExclude` in `pnpm-workspace.yaml` and call it out
48+
in the PR description.
49+
50+
Routine upgrades land via Dependabot (configured in
51+
`.github/dependabot.yml`), which opens monthly grouped PRs for npm
52+
dependencies and GitHub Actions. Please don't run `pnpm up --latest`
53+
on the default branch — review the Dependabot PR instead, or open a
54+
PR with explicit version pins and a changelog link.
55+
3756
## Code of Conduct
3857

3958
Help us keep Cryptomator open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).

.github/dependabot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 2
2+
3+
# Reviewed dependency upgrades. Replaces ad-hoc `pnpm up --latest` with
4+
# Dependabot PRs that go through normal review.
5+
#
6+
# - npm ecosystem covers pnpm-lock.yaml (Dependabot understands pnpm).
7+
# - github-actions ecosystem covers third-party actions in workflows;
8+
# they are part of the same supply chain and need the same review.
9+
# - cooldown.default-days mirrors pnpm-workspace.yaml `minimumReleaseAge`
10+
# (3 days) so Dependabot does not propose a version pnpm would refuse
11+
# to install.
12+
13+
updates:
14+
- package-ecosystem: npm
15+
directory: /
16+
schedule:
17+
interval: monthly
18+
open-pull-requests-limit: 5
19+
cooldown:
20+
default-days: 3
21+
groups:
22+
minor-and-patch:
23+
update-types:
24+
- minor
25+
- patch
26+
27+
- package-ecosystem: github-actions
28+
directory: /
29+
schedule:
30+
interval: monthly
31+
open-pull-requests-limit: 5
32+
cooldown:
33+
default-days: 3
34+
groups:
35+
minor-and-patch:
36+
update-types:
37+
- minor
38+
- patch

.github/workflows/deploy.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,26 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Setup Pages
1717
uses: actions/configure-pages@v5
18+
- name: Verify lockfile has no non-registry sources
19+
run: scripts/check-lockfile.sh
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
1822
- name: Setup Node.js
1923
uses: actions/setup-node@v4
2024
with:
2125
node-version: '20'
22-
cache: 'npm'
26+
cache: 'pnpm'
2327
- name: Install dependencies
24-
run: npm ci
28+
run: pnpm install --frozen-lockfile
2529
- name: Build production
26-
run: npm run build
30+
run: pnpm run build
2731
- name: Upload Prod Pages artifact
2832
uses: actions/upload-pages-artifact@v3
2933
with:
3034
name: prod-site
3135
path: './build'
3236
- name: Build staging
33-
run: npm run build
37+
run: pnpm run build
3438
env:
3539
SITE_URL: https://docs.staging.cryptomator.org
3640
- name: Add robots.txt for staging

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Dependencies
22
/node_modules
3+
package-lock.json
34

45
# Production
56
/build

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ We welcome contributions! Please read our [contributing guidelines](.github/CONT
88

99
## Quick Start
1010

11+
This repo uses [pnpm](https://pnpm.io/) (pinned via `packageManager` in
12+
`package.json`). The easiest way to get a matching version is to enable
13+
[Corepack](https://nodejs.org/api/corepack.html): `corepack enable`.
14+
1115
```bash
12-
npm install
13-
npm start
16+
pnpm install
17+
pnpm start
1418
```
1519

16-
Opens dev server at `http://localhost:3000` with live reload.
20+
Opens dev server at `http://localhost:8000` with live reload.
1721

1822
## Structure
1923

@@ -27,8 +31,8 @@ Opens dev server at `http://localhost:3000` with live reload.
2731
## Scripts
2832

2933
```bash
30-
npm run build # Build static site
31-
npm run serve # Serve built site locally
34+
pnpm build # Build static site
35+
pnpm serve # Serve built site locally
3236
```
3337

3438
Other scripts can be found in `package.json`.

0 commit comments

Comments
 (0)