# Recipes

Source: https://tiltas.openpanel.sh/docs/access/recipes

> Access set-ups for common situations, each as the exact rules to write.

Each recipe below is a few rules you can copy into **Access rules**, **Groups** and **Services**. Names such as `gitea`
or `ops` are examples.

## A contractor gets one Service

Someone outside your team needs your Gitea, and nothing else.

**Invite them as a Member.** In **Members**, choose **Invite a Member**, type their email and keep the role **Member**.
See [Invite people](/docs/people). They accept the invite and sign in their own laptop.

**Open the one Service to them.** In **Services**, open `gitea` → **Change who can open it**, and add the contractor.

That is all. Their laptop reaches `http://gitea` and nothing else: no rule names them, and the built-in rule only lets
them reach their own Devices. Check it on their Device's page under **What this Device can reach**. As a Member they can
still see the names of the Network's Devices and Services in the console; they cannot reach them.

When the work is done, remove them in **Members**: their Personal devices leave the Network with them. See
[Remove a Member](/docs/people/remove-and-leave).

**Everyone means everyone**

A Service or rule open to **Everyone in the Network** is open to every new Member too, the contractor included. Before
you invite, change those to a Group, such as `team`.

To see their laptop before it joins, turn on [Device approval](/docs/access/device-approval) first.

## Staging and production

Developers may use everything in staging. Only the ops team reaches production, and only for SSH and HTTPS.

**Groups**

| Group | Members | Servers |
|---|---|---|
| `developers` | the developers | |
| `ops` | the ops team | |
| `staging` | | the staging Servers |
| `production` | | the production Servers |

Make one [Join key](/docs/devices/join-keys) for each environment, with the Group `staging` or `production`, so every
new Server lands in the right Group by itself.

**Access rules**

| Who | May reach | Ports | Note |
|---|---|---|---|
| Group `developers` | Group `staging` | all | developers on staging |
| Group `ops` | Group `staging` | all | ops on staging |
| Group `ops` | Group `production` | `22, 443` | ops on production |

People who join or leave a team only change Groups; the rules stay as they are.

## A family NAS

Everyone in the family may open the NAS's photo page and its file shares. Only you may open its admin page.

The NAS is a Server in your Network ([Synology](/docs/devices/synology), [Unraid](/docs/devices/unraid),
[TrueNAS SCALE](/docs/devices/truenas) or [Docker](/docs/devices/docker)), called `nas`. Each family member is a Member
with their own phone and laptop.

**Group** `family`: every family Member.

**Service**: a Web Service `photos` on `nas`, target the photo app's HTTP port on the NAS, such as `localhost:8080`, with
**Who can open it**: Group `family`. They open `http://photos`.

**Access rules**

| Who | May reach | Ports | Note |
|---|---|---|---|
| Group `family` | Device `nas` | `445` | file shares (SMB) |
| you | Device `nas` | `5000` | NAS admin page |

On a laptop, the shares open at `smb://nas` (macOS) or `\\nas` (Windows), from anywhere.
