···104104}
105105```
106106107107+### 4. Cron tasks
108108+109109+CLI commands can be scheduled to run at specific intervals using cron syntax. To enable it, create a `smallweb.json` file in the root of your app directory with the following structure:
110110+111111+```json
112112+{
113113+ "crons": [{
114114+ // The schedule in cron syntax
115115+ "schedule": "*/5 * * * *",
116116+ // args to pass to the run function
117117+ "args": []
118118+ }]
119119+}
120120+```
121121+107122## Common Tasks
108123109124Smallweb apps only have write access to the `data/` directory. You can use this directory to store state.
···142157}
143158144159db.close();
160160+```
161161+162162+## Private Apps
163163+164164+Apps can be protected behind authentication. To do this, you'll first need to make sure than an oidc provider is configured in the `.smallweb/config.json[c]` file.
165165+166166+```json
167167+{
168168+ "oidc": {
169169+ // use lastlogin.net as the oidc provider if none is specified
170170+ "issuer": "https://lastlogin.net"
171171+ },
172172+ "authorizedEmails": [
173173+ "pomdtr@example.com"
174174+ ]
175175+}
176176+```
177177+178178+Then, you can set the `private` property in the `smallweb.json` file to `true`:
179179+180180+```json
181181+{
182182+ "private": true
183183+}
184184+```
185185+186186+Or protect only specific routes:
187187+188188+```json
189189+{
190190+ "privateRoutes": [
191191+ "/admin/*"
192192+ ]
193193+}
194194+```
195195+196196+The user email can then be retrieved using the `Remote-Email` header:
197197+198198+```ts
199199+export default {
200200+ fetch(req: Request) {
201201+ const email = req.headers.get("Remote-Email");
202202+ if (!email) {
203203+ return new Response("Unauthorized", { status: 401 });
204204+ }
205205+206206+ return new Response(`Hello ${email}`);
207207+ },
208208+}
145209```
146210147211## Dependencies