Skip to content
Versora

Manual

Administrators

Company policy

5 min read

On this page

The company policy is the set of settings IT locks on a computer: the proxy, the accepted servers, secret scanning, the Preferences pages that disappear or become read-only, a minimum for commit rules and the automatic update. It applies to every repository opened on that computer and sits above the team rules and each person's preferences.

The three levels

Versora combines three sources of rules. When there's more than one, the strongest wins:

  1. Machine: GPO, the Windows registry or a file in %ProgramData%. It's the strongest.
  2. Team: the repository's .versora.yml. See Team rules.
  3. User: each person's preferences.

Each level can tighten the rules of the level below, never loosen them. When combined:

RuleHow the sources combine
Maximum title lengththe smallest applies
Conventional Commits, Signed-off-byrequired if any source requires it
Allowed typesonly the ones every source accepts
AI trailerthe strictest mode applies; the machine's text, if it defines one, beats the team's
Protected branchesthe sum of the lists

Example: the machine policy defines commit_title_max: 72 and a repository's .versora.yml defines title_max: 60. In that repository, 60 applies. If .versora.yml says title_max: 100, 72 still applies.

The machine policy sources

Versora reads the machine policy in this order:

  1. HKLM\SOFTWARE\Policies\MCK2\Versora (computer GPO);
  2. HKCU\SOFTWARE\Policies\MCK2\Versora (user GPO);
  3. %ProgramData%\MCK2\Versora\policy.yml (for those who don't use GPO).

Each key comes from the first source that has a valid value. The sources don't add up within a key. If HKLM defines AllowedServers and policy.yml does too, only the HKLM list applies.

An invalid value doesn't lock anything. It appears under "Ignored values", with the reason, and the key moves on to the next source. A proxy misspelled in the registry, for example, lets the policy.yml proxy apply, if there is one.

policy.yml only applies if the file's owner is the Administrators group or SYSTEM. %ProgramData% lets any user create folders. Without this rule, another user of the same computer could plant a policy, for example a proxy that intercepts colleagues' traffic. Files created by GPO, by Intune or by an elevated process already come out with the right owner. %ProgramData% is also read from the Windows registry, not from the environment variable, which the user could change.

For IT

The policy is read when Versora opens. After changing the registry or the file, ask the person to close and reopen the app, or to click Reload the policy in Preferences › Policy and team.

What the person sees in the app

Preferences › Policy and team

It's the page that shows everything that's in effect and where each value came from. It can never be hidden or locked by the policy.

Where to find it

  • Menu: Preferences › Policy and team
  • Palette (Ctrl+P): "Company policy and team rules"
  • On any page with a policy notice: the See the policy in effect link

What appears

Company policy on this computer. The note says: "Set by the administrator (GPO or company file). It takes precedence over the team rules and your preferences." Then come:

  • the list of locked values, each with the source badge: Computer GPO, User GPO, Company file or Test source. With no policy, "No company policy on this computer." appears;
  • Ignored values: the keys with an invalid value, the source and the reason;
  • the sources, each with its path and state: "doesn't exist", "in effect", "has an error" or "ignored (file owner)". A key with an unknown name appears as "unknown keys: …", which is usually a typo;
  • Default settings: the path of settings.json and its state, when the folder exists;
  • the Reload the policy button;
  • the For the administrator block: the paths read and the ids of every Preferences page, to use in preferences_hidden and preferences_locked.

Team rules in ‹repository›. With a repository open, it shows the .versora.yml (state, warnings), the Rules in effect with the Company or Team badge, the push rules and the team commands. See Team rules.

First run. The Open the first-run wizard button.

Notices on the other Preferences pages

When the policy touches a page, its top shows a notice with the See the policy in effect link:

PageNotice
Any page in preferences_locked"This page is set by your company and is read-only." All the controls are disabled.
Network"The proxy is set by your company: …" and "Your company only allows these servers: …"
Checks"Secret scanning is set by your company: always on, on commit and on push." (or "Secret scanning was turned off by your company.") and "Protected branches (…): …"
Commit"In this repository, the commit title has at most … characters (…)."
Versions and commits"In this repository, Conventional Commits is required (…)."
Push rules"This repository also has team rules in .versora.yml."

In parentheses, the notice gives the source: "set by your company" or "team rule (.versora.yml)".

Two pages have their own notice:

  • Updates shows the Set by your company block, with what applies and the source (for example "Source: computer policy (HKLM)").
  • Accounts: in OAuth sign-in, the client id field comes already filled in and locked, with "Set by your organization's policy.", and the client id list marks the server as "set by your organization".

What happens to the person's choice

The policy doesn't erase anyone's preferences. While a key is in effect, the screen shows the locked value, and a change made in Preferences reverts right away. What the person had chosen stays saved and applies again if the key leaves the policy.

In the first-run wizard

The wizard's last step shows the policy in effect: "Your company set these settings on this computer. They take precedence over your preferences:", followed by the list. With no policy: "No company policy on this computer: every choice is yours." See First-run wizard.

What the policy doesn't cover

  • The integrated terminal is the user's shell. The allowed servers don't apply to it.
  • Jira is outside the list of allowed servers.
  • Versora's update site is also outside it. To block updates, use updates: off.
  • The person's git configuration (~/.gitconfig) isn't changed by the policy. The locked proxy, for example, applies to the git commands Versora opens, not to the git used in the terminal.

Test a policy without touching the registry

To try out a policy on a test machine, without writing to the registry or to %ProgramData%, start Versora with the VERSORA_POLICY_EXTRA environment variable pointing to a YAML file in the same format as policy.yml.

This test source comes last and only accepts values that add rules. Values that would loosen a rule (secrets_scan: off, team_commands: allow, commit_signoff: false and the like) are rejected with the warning "the test source can only add rules; this value would loosen a rule and was ignored". A key defined by a real source is never touched.

With the test source in use, the page warns: "The test source (VERSORA_POLICY_EXTRA) is in use: it only adds rules and never turns off a real policy." A wrong path appears as "the file set in VERSORA_POLICY_EXTRA doesn't exist".

See also