Skip to content

Commit 1541086

Browse files
authored
Merge pull request #17372 from github/repo-sync
repo sync
2 parents cbca3b3 + aa7a155 commit 1541086

12 files changed

+115
-41
lines changed
Loading
Loading
Loading
Loading
Loading

content/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ shortTitle: Set the timeout
1212

1313
A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.
1414

15+
Some organizations may have a maximum idle timeout policy. If an organization policy sets a maximum timeout which is less than the default timeout you have set, the organization's timeout will be used instead of your setting, and you will be notified of this after the codespace is created. For more information, see "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
16+
1517
{% warning %}
1618

1719
**Warning**: Codespaces are billed per minute. If you are not actively using a codespace but the codespace has not yet timed out, you are still billed for the time that the codespace is running. For more information, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."

content/codespaces/managing-codespaces-for-your-organization/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ children:
1515
- /reviewing-your-organizations-audit-logs-for-codespaces
1616
- /restricting-access-to-machine-types
1717
- /restricting-the-visibility-of-forwarded-ports
18+
- /restricting-the-idle-timeout-period
1819
shortTitle: Managing your organization
1920
---
2021

content/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Restricting access to machine types
3-
shortTitle: Machine type access
3+
shortTitle: Restrict machine types
44
intro: You can set constraints on the types of machines users can choose when they create codespaces in your organization.
55
product: '{% data reusables.gated-features.codespaces %}'
6-
permissions: 'To manage access to machine types for the repositories in an organization, you must be an organization owner.'
6+
permissions: 'To manage access to machine types for the repositories in an organization, you must be an owner of the organization.'
77
versions:
88
fpt: '*'
99
ghec: '*'
@@ -47,33 +47,22 @@ If you add an organization-wide policy, you should set it to the largest choice
4747

4848
{% data reusables.profile.access_org %}
4949
{% data reusables.profile.org_settings %}
50-
1. In the "Code, planning, and automation" section of the sidebar, select **{% octicon "codespaces" aria-label="The codespaces icon" %} {% data variables.product.prodname_codespaces %}** then click **Policy**.
51-
2. On the "Codespace policies" page, click **Create Policy**.
52-
3. Enter a name for your new policy.
53-
4. Click **Add constraint** and choose **Machine types**.
50+
{% data reusables.codespaces.codespaces-org-policies %}
51+
1. Click **Add constraint** and choose **Machine types**.
5452

5553
![Add a constraint for machine types](/assets/images/help/codespaces/add-constraint-dropdown.png)
5654

57-
5. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint, then clear the selection of any machine types that you don't want to be available.
55+
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint, then clear the selection of any machine types that you don't want to be available.
5856

5957
![Edit the machine type constraint](/assets/images/help/codespaces/edit-machine-constraint.png)
6058

61-
6. In the "Change policy target" area, click the dropdown button.
62-
7. Choose either **All repositories** or **Selected repositories** to determine which repositories this policy will apply to.
63-
8. If you chose **Selected repositories**:
64-
1. Click {% octicon "gear" aria-label="The settings icon" %}.
65-
66-
![Edit the settings for the policy](/assets/images/help/codespaces/policy-edit.png)
67-
68-
2. Select the repositories you want this policy to apply to.
69-
3. At the bottom of the repository list, click **Select repositories**.
70-
71-
![Select repositories for this policy](/assets/images/help/codespaces/policy-select-repos.png)
72-
73-
9. Click **Save**.
74-
59+
{% data reusables.codespaces.codespaces-policy-targets %}
60+
1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)" and "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
61+
1. After you have finished adding constraints to your policy, click **Save**.
7562
## Editing a policy
7663

64+
You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.
65+
7766
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the available machine types](#adding-a-policy-to-limit-the-available-machine-types)."
7867
1. Click the name of the policy you want to edit.
7968
1. Make the required changes then click **Save**.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Restricting the idle timeout period
3+
shortTitle: Restrict timeout periods
4+
intro: 'You can set a maximum timeout period for any codespaces owned by your organization.'
5+
product: '{% data reusables.gated-features.codespaces %}'
6+
permissions: 'To manage timeout constraints for an organization''s codespaces, you must be an owner of the organization.'
7+
versions:
8+
fpt: '*'
9+
ghec: '*'
10+
type: how_to
11+
topics:
12+
- Codespaces
13+
---
14+
15+
## Overview
16+
17+
By default, codespaces time out after 30 minutes of inactivity. When a codespace times out it is stopped and will no longer incur charges for compute usage.
18+
19+
The personal settings of a {% data variables.product.prodname_dotcom %} user allow them to define their own timeout period for codespaces they create. This may be longer than the default 30-minute period. For more information, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)."
20+
21+
As an organization owner, you may want to configure constraints on the maximum idle timeout period for codespaces owned by your organization. This can help you limit costs associated with codespaces that are left to timeout after long periods of inactivity. You can set a maximum timeout for all codespaces owned by your organization, or for the codespaces of specific repositories.
22+
23+
{% note %}
24+
25+
**Note**: Maximum idle timeout constraints only apply to codespaces that are owned by your organization.
26+
27+
{% endnote %}
28+
29+
For more information about pricing for {% data variables.product.prodname_codespaces %} compute usage, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
30+
31+
### Behavior when you set a maximum idle timeout constraint
32+
33+
If someone sets the default idle timeout to 90 minutes in their personal settings and they then start a codespace for a repository with a maximum idle timeout constraint of 60 minutes, the codespace will time out after 60 minutes of inactivity. When codespace creation completes, a message explaining this will be displayed:
34+
35+
> Idle timeout for this codespace is set to 60 minutes in compliance with your organization’s policy.
36+
37+
### Setting organization-wide and repository-specific policies
38+
39+
When you create a policy, you choose whether it applies to all repositories in your organization, or only to specified repositories. If you create an organization-wide policy with a timeout constraint, then the timeout constraints in any policies that are targeted at specific repositories must fall within the restriction configured for the entire organization. The shortest timeout period - in an organization-wide policy, a policy targeted at specified repositories, or in someone's personal settings - is applied.
40+
41+
If you add an organization-wide policy with a timeout constraint, you should set the timeout to the longest acceptable period. You can then add separate policies that set the maximum timeout to a shorter period for specific repositories in your organization.
42+
43+
## Adding a policy to set a maximum idle timeout period
44+
45+
{% data reusables.profile.access_org %}
46+
{% data reusables.profile.org_settings %}
47+
{% data reusables.codespaces.codespaces-org-policies %}
48+
1. Click **Add constraint** and choose **Maximum idle timeout**.
49+
50+
![Add a constraint for idle timeout](/assets/images/help/codespaces/add-constraint-dropdown-timeout.png)
51+
52+
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint.
53+
54+
![Edit the timeout constraint](/assets/images/help/codespaces/edit-timeout-constraint.png)
55+
56+
1. Enter the maximum number of minutes codespaces can remain inactive before they time out, then click **Save**.
57+
58+
![Choose the port visibility options](/assets/images/help/codespaces/maximum-minutes-timeout.png)
59+
60+
{% data reusables.codespaces.codespaces-policy-targets %}
61+
1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" and "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)."
62+
1. After you have finished adding constraints to your policy, click **Save**.
63+
64+
The policy will be applied to all new codespaces that are created, and to existing codespaces the next time they are started.
65+
66+
## Editing a policy
67+
68+
You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.
69+
70+
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum idle timeout period](#adding-a-policy-to-set-a-maximum-idle-timeout-period)."
71+
1. Click the name of the policy you want to edit.
72+
1. Make the required changes then click **Save**.
73+
74+
## Deleting a policy
75+
76+
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to set a maximum idle timeout period](#adding-a-policy-to-set-a-maximum-idle-timeout-period)."
77+
1. Click the delete button to the right of the policy you want to delete.
78+
79+
![The delete button for a policy](/assets/images/help/codespaces/policy-delete.png)

content/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Restricting the visibility of forwarded ports
3-
shortTitle: Restricting port visibility
3+
shortTitle: Restrict port visibility
44
intro: 'You can set constraints on the visibility options users can choose when they forward ports from codespaces in your organization.'
55
product: '{% data reusables.gated-features.codespaces %}'
6-
permissions: 'To manage access to port visibility constraints for the repositories in an organization, you must be an organization owner.'
6+
permissions: 'To manage access to port visibility constraints for the repositories in an organization, you must be an owner of the organization.'
77
versions:
88
fpt: '*'
99
ghec: '*'
@@ -40,37 +40,26 @@ If you add an organization-wide policy, you should set it to the most lenient vi
4040

4141
{% data reusables.profile.access_org %}
4242
{% data reusables.profile.org_settings %}
43-
1. In the "Code, planning, and automation" section of the sidebar, select **{% octicon "codespaces" aria-label="The codespaces icon" %} {% data variables.product.prodname_codespaces %}** then click **Policies**.
44-
1. On the "Codespace policies" page, click **Create Policy**.
45-
1. Enter a name for your new policy.
43+
{% data reusables.codespaces.codespaces-org-policies %}
4644
1. Click **Add constraint** and choose **Port visibility**.
4745

4846
![Add a constraint for port visibility](/assets/images/help/codespaces/add-constraint-dropdown-ports.png)
4947

50-
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint
48+
1. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint.
5149

5250
![Edit the port visibility constraint](/assets/images/help/codespaces/edit-port-visibility-constraint.png)
5351

5452
1. Clear the selection of the port visibility options (**Org** or **Public**) that you don't want to be available.
5553

5654
![Choose the port visibility options](/assets/images/help/codespaces/choose-port-visibility-options.png)
5755

58-
1. In the "Change policy target" area, click the dropdown button.
59-
1. Choose either **All repositories** or **Selected repositories** to determine which repositories this policy will apply to.
60-
1. If you chose **Selected repositories**:
61-
1. Click {% octicon "gear" aria-label="The settings icon" %}.
62-
63-
![Edit the settings for the policy](/assets/images/help/codespaces/policy-edit.png)
64-
65-
2. Select the repositories you want this policy to apply to.
66-
3. At the bottom of the repository list, click **Select repositories**.
67-
68-
![Select repositories for this policy](/assets/images/help/codespaces/policy-select-repos.png)
69-
70-
1. Click **Save**.
71-
56+
{% data reusables.codespaces.codespaces-policy-targets %}
57+
1. If you want to add another constraint to the policy, click **Add constraint** and choose another constraint. For information about other constraints, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)" and "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
58+
1. After you have finished adding constraints to your policy, click **Save**.
7259
## Editing a policy
7360

61+
You can edit an existing policy. For example, you may want to add or remove constraints to or from a policy.
62+
7463
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the port visibility options](#adding-a-policy-to-limit-the-port-visibility-options)."
7564
1. Click the name of the policy you want to edit.
7665
1. Make the required changes then click **Save**.

0 commit comments

Comments
 (0)