Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: shellcheck -s sh install.sh selfhostit scripts/pin-apps.sh scripts/release-apps.sh
- run: sh -n install.sh && sh -n selfhostit && sh -n scripts/pin-apps.sh && sh -n scripts/release-apps.sh
- run: shellcheck -s sh install.sh selfhostit scripts/pin-apps.sh scripts/release-apps.sh scripts/test-selfhostit.sh
- run: sh -n install.sh && sh -n selfhostit && sh -n scripts/pin-apps.sh && sh -n scripts/release-apps.sh && sh -n scripts/test-selfhostit.sh
# selfhostit info, list and remove against a made-up apps folder and a stub docker
- run: scripts/test-selfhostit.sh

# Every file install.sh downloads must still have the SHA-256 it pins.
pins:
Expand Down
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs.selfhostit.org
69 changes: 45 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
# Install selfhostit apps

selfhostit apps are small apps you run on your own hardware: a Raspberry Pi, a NAS or a
selfhostit apps are small apps you run on your own hardware: a [Raspberry Pi](words.md#raspberry-pi), a [NAS](words.md#nas) or a
cheap server. Each one is a single container with its data in one folder, and they all
install the same way, with Docker.

| App | What it does | Port |
|---|---|---|
| [Splitwiz](https://github.com/selfhostit/splitwiz) | Split shared costs with your partner or roommate | 8090 |
| [should-we](https://github.com/selfhostit/should-we) | Pick one option together, as a group | 8091 |
| [Flowy](https://github.com/selfhostit/flowy) | A private period and cycle tracker | 8092 |
| [Troye](https://github.com/selfhostit/troye) | A private calorie and weight tracker | 8093 |
| [Shoppa](https://github.com/selfhostit/shoppa) | A shared shopping list for your household | 8094 |
| [Calio](https://github.com/selfhostit/calio) | One calendar for your household: plans, pet sitting and trips | 8095 |

The port is where the installer puts each app, so they can all run on one machine. If
another program already has it, the app gets the next free port, and keeps that one.
install the same way, with [Docker](words.md#docker).

| App | What it does |
|---|---|
| [Splitwiz](https://github.com/selfhostit/splitwiz) | Split shared costs with your partner or roommate |
| [should-we](https://github.com/selfhostit/should-we) | Pick one option together, as a group |
| [Flowy](https://github.com/selfhostit/flowy) | A private period and cycle tracker |
| [Troye](https://github.com/selfhostit/troye) | A private calorie and weight tracker |
| [Shoppa](https://github.com/selfhostit/shoppa) | A shared shopping list for your household |
| [Calio](https://github.com/selfhostit/calio) | One calendar for your household: plans, pet sitting and trips |

## Before you start

- **About 30 minutes.**
- **A machine that stays on,** such as a Raspberry Pi, a mini PC, an old laptop or a NAS.
Not sure which? See [which machine?](machine.md)
- **A computer with a [terminal](words.md#terminal)** to type the install line, on that machine or connected to
it: [open a terminal and connect](terminal.md).
- **An account to sign in to [Tailscale](words.md#tailscale) with** (Google, Microsoft, Apple or GitHub), if you
want the apps on your phones.
- **The phones of everyone who will use the apps.** Each one gets the free Tailscale app:
[what that means for a phone](phones.md#tailscale-is-a-vpn-but-not-that-kind).

You can stop at any step and nothing breaks: the apps keep working on the machine, and
running the installer again picks up where you left off. You can also
[remove everything](updates-and-backups.md#remove-an-app) later.

## Quick start

**1. Install the apps you want.** You need a little computer that runs Linux, such as an old
**1. Install the apps you want.** You need a little computer that runs [Linux](words.md#linux), such as an old
laptop, a mini PC, a Raspberry Pi or a NAS (see [what you need](#what-you-need)), and a
terminal on it, or SSH. Then:
terminal on it, or [SSH](words.md#ssh) ([how to open one and connect](terminal.md)). Then:

```sh
curl -fsSL https://github.com/selfhostit/docs/releases/latest/download/install.sh | sh
Expand All @@ -42,22 +55,24 @@ settings and data are kept. Step by step: [a Pi or Linux](linux.md), a
[Synology](synology.md) or [another NAS](other-nas.md).

**2. Open an app and make your account.** At the end the installer lists each app's address
and a one-time setup code. Open the address, type the code and create your account: you
become the app's owner. [After you install](first-steps.md) says how to add the rest of your
and a one-time [setup code](words.md#setup-code). Open the address, type the code and create your account: you
become the app's [owner](words.md#owner-and-member). [After you install](first-steps.md) says how to add the rest of your
household, and what to do when something doesn't open.

**3. Open them from your phones and other computers.** The apps only answer on the machine
they run on, so nothing else on your network or the internet can reach them by accident. To
use them from your phone or laptop, at home and away, they need an `https://` address, which
phones also need to install a web app and show its notifications. The installer can give all
use them from your phone or laptop, at home and away, they need an [`https://`](words.md#https) address, which
phones also need to install a [web app](words.md#web-app) and show its notifications. The installer can give all
your apps one with [Tailscale](phones.md#tailscale-recommended), a free private network that
only your own devices can reach: say yes when it asks. There is nothing to install on the
server, because the installer runs Tailscale for you; you sign in once, and each phone gets
the Tailscale app. Then [put the apps on your phones](phones.md#install-the-app-on-the-phone).
Tailscale is a [VPN](words.md#vpn), but not the kind that changes how your phone browses:
[here is what it does on a phone](phones.md#tailscale-is-a-vpn-but-not-that-kind).

<img src="img/phones.svg" width="100%" alt="Three panels: say yes to Tailscale in the installer and open its sign-in link, install the Tailscale app on each phone with the same account, then open each app's https address and add it to the home screen.">

Already have a domain? Use [a reverse proxy](phones.md#your-own-domain-with-a-reverse-proxy)
Already have a [domain](words.md#domain)? Use [a reverse proxy](phones.md#your-own-domain-with-a-reverse-proxy)
instead of Tailscale.

Prefer to read and check a script before you run it? Download it, verify it, read it, then
Expand All @@ -80,7 +95,7 @@ and what you are trusting.

The apps keep their data on your machine, in one folder each, with no selfhostit cloud and no
analytics. They listen on `127.0.0.1` only and are reached through Tailscale or your own
reverse proxy, never a forwarded port. Containers run as a normal user with no Linux
reverse proxy, never a [forwarded port](words.md#port-forwarding). Containers run as a normal user with no Linux
capabilities and a read-only filesystem, a new install asks for a one-time setup code,
passwords are stored as bcrypt hashes, sign-ins are rate limited and the web apps send a
Content Security Policy. Every change, and every week, is scanned with CodeQL, govulncheck,
Expand All @@ -93,10 +108,14 @@ privately through the app's Security tab on GitHub or to kalfasyan@pm.me

## Guides

- [Raspberry Pi and Linux](linux.md): a Pi, a mini PC, an old laptop or a VPS.
- [Which machine?](machine.md): a NAS, a spare computer, a Raspberry Pi or mini PC, or a
rented server.
- [Open a terminal and connect](terminal.md): on Windows, Mac, Linux or a Chromebook.
- [Words you'll meet](words.md): SSH, Docker, Tailscale and the other words in these guides.
- [Raspberry Pi and Linux](linux.md): a Pi, a mini PC, an old laptop or a [VPS](words.md#vps).
- [Synology NAS](synology.md): with Container Manager, from the DSM web interface.
- [Other NAS and home servers](other-nas.md): QNAP, Unraid, TrueNAS SCALE, Portainer,
CasaOS and anything else that takes a Compose file.
CasaOS and anything else that takes a [Compose file](words.md#compose-file).
- [Use them on your phones](phones.md): Tailscale, or a reverse proxy with your own domain.
- [After you install](first-steps.md): your first account, adding your household, and what to
do when an app doesn't open.
Expand All @@ -105,6 +124,8 @@ privately through the app's Security tab on GitHub or to kalfasyan@pm.me

## What you need

Not sure what to run them on? [Which machine?](machine.md) compares the choices.

Anything that runs Docker containers for `linux/amd64`, `linux/arm64` or `linux/arm/v7`:
x86 and ARM servers, a Raspberry Pi 3 or newer (64-bit Raspberry Pi OS is best), and NAS
models with a Docker app. Each app needs about 128 to 512 MB of memory. NAS models without
Expand Down
52 changes: 52 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Site settings for https://docs.selfhostit.org, built by GitHub Pages' own Jekyll.
# The .md files stay plain GitHub markdown: the plugins below give them titles, turn
# README.md into the home page and `x.md` links into pages, so no front matter is needed.
title: selfhostit docs
description: Install selfhostit apps on your own Raspberry Pi, NAS or server, step by step.
url: https://docs.selfhostit.org
lang: en

markdown: kramdown
kramdown:
input: GFM
auto_ids: true

plugins:
- jekyll-optional-front-matter
- jekyll-readme-index
- jekyll-titles-from-headings
- jekyll-relative-links

relative_links:
enabled: true
collections: false

readme_index:
enabled: true

titles_from_headings:
enabled: true
strip_title: false

defaults:
- scope:
path: ""
values:
layout: default

exclude:
- install.sh
- selfhostit
- scripts/
- security/
- "*.sh"
- .github/
- Makefile
- LICENSE
- Gemfile
- Gemfile.lock
- vendor/

# Don't also publish the raw .md files next to the pages.
optional_front_matter:
remove_originals: true
198 changes: 198 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<!doctype html>
<html lang="{{ site.lang | default: 'en' }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- if page.url == "/" %}
<title>{{ site.title }}: install apps on your own machine</title>
{%- else %}
<title>{{ page.title | default: site.title }} · {{ site.title }}</title>
{%- endif %}
<meta name="description" content="{{ page.description | default: site.description }}">
<link rel="canonical" href="{{ page.url | absolute_url }}">
<meta property="og:title" content="{{ page.title | default: site.title }}">
<meta property="og:url" content="{{ page.url | absolute_url }}">
<meta property="og:description" content="{{ site.description }}">
<link rel="stylesheet" href="{{ '/assets/docs.css' | relative_url }}">
</head>
<body>

<a class="skip" href="#content">Skip to the page</a>

<header class="top">
<div class="wrap top-row">
<a class="logo" href="https://selfhostit.org">selfhostit</a>
<a class="docs-home" href="{{ '/' | relative_url }}">Install guide</a>
<button class="menu-btn" type="button" aria-expanded="false" aria-controls="pages" hidden>Pages</button>
</div>
</header>

{%- assign pages_nav = "/|Start,/machine.html|Which machine,/terminal.html|Terminal,/phones.html|Phones,/first-steps.html|After you install,/updates-and-backups.html|Updates and backups,/words.html|Words" | split: "," %}
<div class="wrap layout">
<nav id="pages" class="pages" aria-label="Guide pages">
<ul>
{%- for item in pages_nav %}
{%- assign parts = item | split: "|" %}
<li><a href="{{ parts[0] | relative_url }}"{% if page.url == parts[0] %} aria-current="page"{% endif %}>{{ parts[1] }}</a></li>
{%- endfor %}
</ul>
</nav>

<main id="content" class="content">
{{ content }}
</main>
</div>

<footer class="wrap foot">
<span>selfhostit by Yannis Kalfas · open source, MIT licensed</span>
<span><a href="https://selfhostit.org/contact.html">Contact</a> · <a href="https://github.com/selfhostit/docs">Edit these docs on GitHub</a></span>
</footer>

<script>
(() => {
// Small screens: the page list folds behind a "Pages" button. Without JS it stays open.
const btn = document.querySelector('.menu-btn')
const nav = document.getElementById('pages')
btn.hidden = false
document.documentElement.classList.add('js')
btn.addEventListener('click', () => {
const open = btn.getAttribute('aria-expanded') !== 'true'
btn.setAttribute('aria-expanded', String(open))
nav.classList.toggle('open', open)
})

// A Copy button on every code block, because newcomers paste these commands.
for (const pre of document.querySelectorAll('.content pre')) {
const box = pre.closest('div.highlighter-rouge') || pre
const b = document.createElement('button')
b.type = 'button'
b.className = 'copy'
b.textContent = 'Copy'
b.addEventListener('click', async () => {
try {
await navigator.clipboard.writeText(pre.innerText.replace(/\n$/, ''))
b.textContent = 'Copied'
} catch {
b.textContent = 'Select and copy'
}
setTimeout(() => (b.textContent = 'Copy'), 1500)
})
box.classList.add('has-copy')
box.appendChild(b)
}

// Glossary hints: a link to words.html#term shows that term's first paragraph.
if (/\/words(\.html)?$/.test(location.pathname)) return
const isWord = (a) => {
const u = new URL(a.href, location.href)
return u.origin === location.origin && u.hash.length > 1 && /\/words(\.html|\.md)?$/.test(u.pathname)
}
const links = [...document.querySelectorAll('.content a[href*="words"]')].filter(isWord)
if (!links.length) return

let words = null
const load = (url) => (words ||= fetch(url).then((r) => (r.ok ? r.text() : Promise.reject())).then(
(html) => new DOMParser().parseFromString(html, 'text/html')
).catch(() => { words = null; return null }))

const hint = (doc, id) => {
let el = doc && doc.getElementById(id)
if (!el) return null
if (!/^H[1-6]$/.test(el.tagName)) el = el.closest('h1,h2,h3,h4,h5,h6') || el
const title = el.textContent.trim()
for (let n = el.nextElementSibling; n && !/^H[1-6]$/.test(n.tagName); n = n.nextElementSibling) {
if (n.tagName === 'P') return { title, text: n.textContent.trim() }
}
return null
}

const pop = document.createElement('div')
pop.className = 'hint'
pop.id = 'word-hint'
pop.setAttribute('role', 'tooltip')
pop.hidden = true
document.body.appendChild(pop)
let current = null
let hideTimer = 0

const place = (a) => {
const r = a.getBoundingClientRect()
const w = Math.min(320, document.documentElement.clientWidth - 32)
pop.style.width = w + 'px'
let left = r.left + window.scrollX
left = Math.max(16, Math.min(left, window.scrollX + document.documentElement.clientWidth - w - 16))
pop.style.left = left + 'px'
const below = r.bottom + window.scrollY + 8
pop.style.top = below + 'px'
const h = pop.offsetHeight
if (r.bottom + h + 16 > window.innerHeight && r.top > h + 16) {
pop.style.top = (r.top + window.scrollY - h - 8) + 'px'
}
}

const show = async (a) => {
clearTimeout(hideTimer)
if (current === a && !pop.hidden) return
current = a
const u = new URL(a.href, location.href)
const doc = await load(u.href.split('#')[0])
if (current !== a) return
const h = hint(doc, decodeURIComponent(u.hash.slice(1)))
if (!h) return
pop.replaceChildren()
const t = document.createElement('strong')
t.textContent = h.title
const p = document.createElement('p')
p.textContent = h.text
const more = document.createElement('a')
more.href = a.href
more.textContent = 'More in Words you\'ll meet'
pop.append(t, p, more)
pop.hidden = false
a.setAttribute('aria-describedby', pop.id)
place(a)
}

const hide = () => {
armed = null
pop.hidden = true
if (current) current.removeAttribute('aria-describedby')
current = null
}
const hideSoon = () => { clearTimeout(hideTimer); hideTimer = setTimeout(hide, 200) }

const touch = () => matchMedia('(hover: none)').matches
let armed = null
let quiet = false
for (const a of links) {
a.classList.add('word')
a.addEventListener('mouseenter', () => { if (!touch()) show(a) })
a.addEventListener('mouseleave', () => { if (!touch()) hideSoon() })
a.addEventListener('focus', () => { if (!quiet && !touch()) show(a) })
a.addEventListener('blur', () => setTimeout(() => { if (!pop.contains(document.activeElement)) hideSoon() }, 0))
// On touch screens the first tap shows the hint; a second tap follows the link.
a.addEventListener('click', (e) => {
if (touch() && armed !== a) {
e.preventDefault()
armed = a
show(a)
}
})
}
pop.addEventListener('mouseenter', () => clearTimeout(hideTimer))
pop.addEventListener('mouseleave', hideSoon)
pop.addEventListener('focusout', (e) => { if (!pop.contains(e.relatedTarget) && e.relatedTarget !== current) hideSoon() })
document.addEventListener('keydown', (e) => {
if (e.key !== 'Escape' || pop.hidden) return
const a = current
hide()
if (a && pop.contains(document.activeElement)) { quiet = true; a.focus({ preventScroll: true }); quiet = false }
})
document.addEventListener('pointerdown', (e) => {
if (!pop.hidden && !pop.contains(e.target) && !(current && current.contains(e.target))) hide()
})
window.addEventListener('resize', () => { if (current && !pop.hidden) place(current) })
})()
</script>
</body>
</html>
Loading
Loading