Skip to content

Commit a84e7a9

Browse files
chore(web): Improved security settings (#1303)
1 parent 90a5afe commit a84e7a9

63 files changed

Lines changed: 1362 additions & 1043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.development

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CTAGS_COMMAND=ctags
1313
# @see: https://authjs.dev/getting-started/deployment#auth_secret
1414
AUTH_SECRET="00000000000000000000000000000000000000000000"
1515
AUTH_URL="http://localhost:3000"
16-
# AUTH_CREDENTIALS_LOGIN_ENABLED=true
1716

1817
DATA_CACHE_DIR=${PWD}/.sourcebot # Path to the sourcebot cache dir (ex. ~/sourcebot/.sourcebot)
1918
SOURCEBOT_PUBLIC_KEY_PATH=${PWD}/public.pem

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
- Changed the workspace "Access" page to a "Security" page. [#1303](https://github.com/sourcebot-dev/sourcebot/pull/1303)
12+
13+
### Added
14+
- Added the ability to configure email code and credentials login from the security settings. [#1303](https://github.com/sourcebot-dev/sourcebot/pull/1303)
15+
- Added a list of configured SSO providers from the security settings. [#1303](https://github.com/sourcebot-dev/sourcebot/pull/1303)
16+
1017
## [5.0.2] - 2026-06-11
1118

1219
### Changed

docs/docs/configuration/auth/access-settings.mdx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ By default, Sourcebot requires new members to be approved by an owner of the dep
1111
to configure this behavior.
1212

1313
### Configuration
14-
Member approval can be configured by an owner of the deployment by navigating to **Settings -> Access**, or by setting the `REQUIRE_APPROVAL_NEW_MEMBERS` environment variable. When the environment variable is set, the UI toggle is disabled and the setting is controlled by the environment variable.
14+
Member approval can be configured by an owner of the deployment by navigating to **Settings -> Security**.
1515

16-
![Member Approval Toggle](/images/member_approval_toggle.png)
16+
<Frame>
17+
<img src="/images/member_approval_toggle.png" alt="Require approval for new members toggle in Settings → Access" />
18+
</Frame>
1719

1820
### Managing Requests
1921

@@ -27,7 +29,9 @@ Owners can see and manage all pending join requests by navigating to **Settings
2729
If member approval is required, an owner of the deployment can enable an invite link. When enabled, users
2830
can use this invite link to register and be automatically added to the organization without approval:
2931

30-
![Invite Link Toggle](/images/invite_link_toggle.png)
32+
<Frame>
33+
<img src="/images/invite_link_toggle.png" alt="Enable invite links toggle in Settings → Access" />
34+
</Frame>
3135

3236

3337
# Anonymous access
@@ -36,6 +40,10 @@ can use this invite link to register and be automatically added to the organizat
3640

3741
By default, your Sourcebot deployment is gated with a login page. If you'd like users to access the deployment anonymously, you can enable anonymous access.
3842

39-
This can be enabled by navigating to **Settings -> Access** or by setting the `FORCE_ENABLE_ANONYMOUS_ACCESS` environment variable.
43+
This can be enabled by navigating to **Settings -> Access**.
44+
45+
<Frame>
46+
<img src="/images/anonymous_access_toggle.png" alt="Enable anonymous access toggle in Settings → Access" />
47+
</Frame>
4048

4149
When accessing Sourcebot anonymously, a user's permissions are limited to that of the [Guest](/docs/configuration/auth/roles-and-permissions) role.

docs/docs/configuration/auth/providers.mdx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ If there's an authentication provider you'd like us to support, please [reach ou
1010
# Core Authentication Providers
1111

1212
### Email / Password
13-
---
14-
Email / password authentication is enabled by default. It can be **disabled** by setting `AUTH_CREDENTIALS_LOGIN_ENABLED` to `false`.
13+
Email / password authentication is enabled by default. You can toggle it from **Settings → Security** using the **Email login** setting.
1514

16-
### Email codes
17-
---
18-
Email codes are 6 digit codes sent to a provided email. Email codes are enabled when transactional emails are configured using the following environment variables:
19-
20-
- `AUTH_EMAIL_CODE_LOGIN_ENABLED`
21-
- `SMTP_CONNECTION_URL`
22-
- `EMAIL_FROM_ADDRESS`
15+
<Frame>
16+
<img src="/images/email_password_login_setting.png" alt="Email & password login setting toggle in Settings → Security" />
17+
</Frame>
2318

19+
### Email codes
20+
Email codes are 6 digit codes sent to a provided email. Email codes are enabled when [transactional emails](/docs/configuration/transactional-emails) and the **Email code** setting is toggled from **Settings → Security**:
2421

25-
See [transactional emails](/docs/configuration/transactional-emails) for more details.
22+
<Frame>
23+
<img src="/images/email_code_login_setting.png" alt="Email code login setting toggle in Settings → Security" />
24+
</Frame>
2625

2726
# Enterprise Authentication Providers
2827

docs/docs/configuration/config-file.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ The following are settings that can be provided in your config file to modify So
4949
| `maxRepoGarbageCollectionJobConcurrency` | number | 8 | 1 | Concurrent repo‑garbage‑collection jobs. |
5050
| `repoGarbageCollectionGracePeriodMs` | number | 10 seconds | 1 | Grace period to avoid deleting shards while loading. |
5151
| `repoIndexTimeoutMs` | number | 2 hours | 1 | Timeout for a single repo‑indexing run. |
52-
| `enablePublicAccess` **(deprecated)** | boolean | false || Use the `FORCE_ENABLE_ANONYMOUS_ACCESS` environment variable instead. |
5352
| `repoDrivenPermissionSyncIntervalMs` | number | 24 hours | 1 | Interval at which the repo permission syncer should run. |
5453
| `userDrivenPermissionSyncIntervalMs` | number | 24 hours | 1 | Interval at which the user permission syncer should run. |
5554
| `experiment_repoDrivenPermissionSyncIntervalMs` **(deprecated)** | number | 24 hours | 1 | Use `repoDrivenPermissionSyncIntervalMs` instead. |

docs/docs/configuration/environment-variables.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ The following environment variables allow you to configure your Sourcebot deploy
1010

1111
| Variable | Default | Description |
1212
| :------- | :------ | :---------- |
13-
| `AUTH_CREDENTIALS_LOGIN_ENABLED` | `true` | <p>Enables/disables authentication with basic credentials. Username and passwords are stored encrypted at rest within the postgres database. Checkout the [auth docs](/docs/configuration/auth/authentication) for more info</p> |
14-
| `AUTH_EMAIL_CODE_LOGIN_ENABLED` | `false` | <p>Enables/disables authentication with a login code that's sent to a users email. `SMTP_CONNECTION_URL` and `EMAIL_FROM_ADDRESS` must also be set. Checkout the [auth docs](/docs/configuration/auth/authentication) for more info </p> |
1513
| `AUTH_SECRET` **(required)** | - | <p>Used to validate login session cookies. Genearte one with `openssl rand -base64 33`.</p> |
1614
| `AUTH_SESSION_MAX_AGE_SECONDS` | `2592000` (30 days) | <p>Relative time from now in seconds when to expire the session.</p> |
1715
| `AUTH_SESSION_UPDATE_AGE_SECONDS` | `86400` (1 day) | <p>How often the session should be updated in seconds. If set to `0`, session is updated every time.</p> |
@@ -24,8 +22,6 @@ The following environment variables allow you to configure your Sourcebot deploy
2422
| `DATA_DIR` | `/data` | <p>The directory within the container to store all persistent data. Typically, this directory will be volume mapped such that data is persisted across container restarts (e.g., `docker run -v $(pwd):/data`)</p> |
2523
| `DATABASE_URL` **(required)** | - | <p>Connection string of your Postgres database, e.g. `postgresql://user:password@host:5432/sourcebot`.</p><p>If you'd like to use a non-default schema, you can provide it as a parameter in the database url.</p><p>You can also use `DATABASE_HOST`, `DATABASE_USERNAME`, `DATABASE_PASSWORD`, `DATABASE_NAME`, and `DATABASE_ARGS` to construct the database url.</p> |
2624
| `EMAIL_FROM_ADDRESS` | `-` | <p>The email address that transactional emails will be sent from. See [this doc](/docs/configuration/transactional-emails) for more info.</p> |
27-
| `FORCE_ENABLE_ANONYMOUS_ACCESS` | `false` | <p>When enabled, [anonymous access](/docs/configuration/auth/access-settings#anonymous-access) to the organization will always be enabled</p>
28-
| `REQUIRE_APPROVAL_NEW_MEMBERS` | - | <p>When set, controls whether new users require approval before accessing your deployment. If not set, the setting can be configured via the UI. See [member approval](/docs/configuration/auth/access-settings#member-approval) for more info.</p>
2925
| `REDIS_URL` **(required)** | - | <p>Connection string of your Redis instance, e.g. `redis://host:6379`.</p><p>To enable TLS, see [this doc](/docs/deployment/infrastructure/redis#tls).</p> |
3026
| `REDIS_REMOVE_ON_COMPLETE` | `0` | <p>Controls how many completed jobs are allowed to remain in Redis queues</p> |
3127
| `REDIS_REMOVE_ON_FAIL` | `100` | <p>Controls how many failed jobs are allowed to remain in Redis queues</p> |
@@ -54,10 +50,8 @@ The following environment variables allow you to configure your Sourcebot deploy
5450
| `AUTH_EE_GCP_IAP_AUDIENCE` | - | <p>The GCP IAP audience to use when verifying JWT tokens. Must be set to enable GCP IAP JIT provisioning</p> |
5551
| `PERMISSION_SYNC_ENABLED` | `false` | <p>Enables [permission syncing](/docs/features/permission-syncing).</p> |
5652
| `PERMISSION_SYNC_REPO_DRIVEN_ENABLED` | `true` | <p>Enables/disables [repo-driven permission syncing](/docs/features/permission-syncing#how-it-works). Only applies when `PERMISSION_SYNC_ENABLED` is `true`.</p> |
57-
| `EXPERIMENT_EE_PERMISSION_SYNC_ENABLED` **(deprecated)** | `false` | <p>Deprecated. Use `PERMISSION_SYNC_ENABLED` instead.</p> |
5853
| `AUTH_EE_ALLOW_EMAIL_ACCOUNT_LINKING` | `true` | <p>When enabled, different SSO accounts with the same email address will automatically be linked.</p> |
5954
| `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` | `false` | <p>When enabled, only organization owners can create API keys. Non-owner members will receive a `403` error if they attempt to create one.</p> |
60-
| `EXPERIMENT_DISABLE_API_KEY_CREATION_FOR_NON_ADMIN_USERS` **(deprecated)** | `false` | <p>Deprecated. Use `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` instead.</p> |
6155
| `DISABLE_API_KEY_USAGE_FOR_NON_OWNER_USERS` | `false` | <p>When enabled, only organization owners can create or use API keys. Non-owner members will receive a `403` error if they attempt to create or authenticate with an API key. If you only want to restrict creation (not usage), use `DISABLE_API_KEY_CREATION_FOR_NON_OWNER_USERS` instead.</p> |
6256

6357

32.3 KB
Loading

docs/images/demote_to_member.png

-9.85 KB
Loading
28.4 KB
Loading
29.7 KB
Loading

0 commit comments

Comments
 (0)