diff --git a/README.md b/README.md index afed29f..d3dcf33 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ another program already has it, the app gets the next free port, and keeps that ## Quick start -**Install: one line, every app.** 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, 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: @@ -28,15 +28,30 @@ curl -fsSL https://github.com/selfhostit/docs/releases/latest/download/install.s Three panels: find an old laptop or a Raspberry Pi, paste one line in a terminal and pick your apps, then open every app in a browser at home. -The installer sets up Docker if it is missing (on Linux), asks which apps you want and where -to keep them, and starts them. Run the same line again to update; your settings and data are -kept. Step by step: [a Pi or Linux](linux.md), a [Synology](synology.md) or -[another NAS](other-nas.md). +The installer sets up Docker if it is missing (on Linux), shows the apps and asks which ones +you want: one, a few or all of them. Each app runs on its own and needs none of the others, +so start with the one you came for and add more later the same way. To skip the menu, put +the app names at the end: -**Optional: on your phones, at home and away.** Phones only install a web app and show its -notifications over `https://`, and that's the same for every app. The installer can give all -your apps `https://` addresses with [Tailscale](phones.md#tailscale-recommended), a free -private network that only your own devices can reach. There is nothing to install on the +```sh +curl -fsSL https://github.com/selfhostit/docs/releases/latest/download/install.sh | sh -s -- flowy +``` + +It then asks where to keep them and starts them. Run the same line again to update; your +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 +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 +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). @@ -83,6 +98,8 @@ privately through the app's Security tab on GitHub or to kalfasyan@pm.me - [Other NAS and home servers](other-nas.md): QNAP, Unraid, TrueNAS SCALE, Portainer, CasaOS and anything else that takes a 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. - [Updates and backups](updates-and-backups.md) - [Security and privacy](security.md): how your data is protected, and how to report a problem. diff --git a/first-steps.md b/first-steps.md new file mode 100644 index 0000000..b3e5671 --- /dev/null +++ b/first-steps.md @@ -0,0 +1,86 @@ +# After you install + +The installer ends with a list like this: + +``` +Done. + flowy https://selfhostit.your-tailnet.ts.net:8092 + setup code: K7QM-4XRP +``` + +Here is what to do next, and what to try when something doesn't open. + +## 1. Make your account + +Open the app's address and type its setup code. The code is there so nobody else who finds a +fresh install can claim it, and it is only needed once. Then create your account: you become +the app's **owner**, who can add people and open the admin page (`/_/`) with the same email +and password. + +Lost the code? It is in the app's folder until the first account exists: + +```sh +sudo cat ~/selfhostit/flowy/pb_data/setup_code # your folder and app +``` + +## 2. Add your household + +Nobody can sign themselves up, so the owner adds everyone else: + +| App | How | +|---|---| +| Splitwiz | The setup screen asks for both people at once. That's all. | +| should-we | No accounts. Start a decision, tap **Share** and send the link. | +| Flowy, Troye, Shoppa, Calio | Open the admin page, the app's address with `/_/` at the end, and sign in as the owner. Then **users** > **New record**: their email, a password and the role `member`. Send them the address and the password. | + +Each person only sees their own data in Flowy and Troye. In Shoppa and Calio the household +shares one list and one calendar. + +## 3. Put it on your phones + +On each phone, install the Tailscale app and sign in with your Tailscale account (for someone +else's phone, [share the machine](phones.md#tailscale-recommended) with their account). Then open the app's `https://` address, sign in and add it +to the home screen: [how, on Android and iPhone](phones.md#install-the-app-on-the-phone). +Turn on notifications in the app's settings if it has them. + +## 4. Keep it safe and current + +- **Update:** run the installer again, or `selfhostit update all` with the + [selfhostit command](updates-and-backups.md#one-command-selfhostit-update). +- **Backups:** each app keeps a backup of its database every night. Copy them somewhere + else too: [updates and backups](updates-and-backups.md). +- **Check:** `selfhostit check` looks for common mistakes, such as an app open to your network. + +Want another app later? Run the installer again and pick it, or name it: +`curl -fsSL https://github.com/selfhostit/docs/releases/latest/download/install.sh | sh -s -- calio`. +The apps you already have keep their settings and data. + +## When something doesn't open + +**`http://localhost:8092` doesn't open from my laptop or phone.** That address only works on +the machine the apps run on: the apps answer nowhere else, on purpose. Run the installer +again and say yes to Tailscale, or follow [phones](phones.md) for a reverse proxy. To look +once from your laptop without either, forward the port over SSH: +`ssh -L 8092:127.0.0.1:8092 you@homeserver.local`, then open `http://localhost:8092` on the laptop. + +**The Tailscale address says "connection refused" or doesn't load.** Check that: + +- it starts with `https://`, not `http://`; +- the phone or laptop has the Tailscale app on and is signed in to the same account, or the + `selfhostit` machine is shared with its account; +- the installer finished its Tailscale step. If it stopped at "HTTPS is not on for your + tailnet yet", allow HTTPS with the link it showed and run it again. + +**"Port is already allocated" or another app opens instead.** Run the installer again: it moves +an app to the next free port and lists the new address. To pick a port yourself, change it in +the app's `.env` and run the installer again. + +**"permission denied" talking to Docker.** Run the installer with `sudo` in front of `sh` +(`... | sudo sh`), or sign out and in again after Docker was installed, so your account is in +the `docker` group. + +**An app stopped or keeps restarting.** See what it says: `cd ~/selfhostit/flowy && docker compose logs --tail 50` +(your folder and app). On a Synology, Container Manager > Project > the app > Log shows the same. + +**Still stuck?** Open an issue in the app's repository with what you ran and what it printed, +or write to kalfasyan@pm.me. diff --git a/install.sh b/install.sh index d3151ad..0fbf01a 100644 --- a/install.sh +++ b/install.sh @@ -191,12 +191,17 @@ if [ -z "$chosen" ]; then printf ' %d) %-10s %s\n' "$i" "$app" "$(info "$app" | cut -d'|' -f2)" done echo + echo "Each app runs on its own, so pick only the ones you want; you can add more later." answer=$(ask "Which apps? Numbers or names, separated by spaces, or all" all) [ "$answer" = all ] && answer=$apps for a in $answer; do case $a in *[!0-9]*) chosen="$chosen $a" ;; - *) chosen="$chosen $(echo "$apps" | cut -d' ' -f"$a")" ;; + *) + app=$(echo "$apps" | tr ' ' '\n' | sed -n "${a}p" 2>/dev/null) + [ -n "$app" ] || die "there is no app number $a; choose from 1 to $(echo "$apps" | wc -w)" + chosen="$chosen $app" + ;; esac done fi @@ -222,8 +227,9 @@ if [ -d "$base/tailscale" ] || [ -n "${TS_AUTHKEY:-}" ]; then tailscale=y elif interactive; then echo - echo "Phones only install the apps and show notifications over https://. Tailscale" - echo "(free) gives each app an https:// address that only your own devices can reach." + echo "The apps only answer on this machine. To open them from your phones and other" + echo "computers, at home and away, Tailscale (free) gives each app an https:// address" + echo "that only your own devices can reach. Phones need https:// to install the apps." tailscale=$(ask "Set up Tailscale for the apps? (y/n)" y) else tailscale=n @@ -398,13 +404,18 @@ for app in $chosen; do [ -z "$code" ] || printf ' %-10s setup code: %s\n' "" "$code" done echo +say "Next:" +echo " 1. Open an address. A new app asks for its setup code once, then you make your" +echo " account and become its owner." if [ -n "$ts_name" ]; then - echo "On each phone, install the Tailscale app and sign in with the same account," - echo "then open these addresses and add each app to the home screen:" - echo " https://github.com/selfhostit/docs/blob/main/phones.md#install-the-app-on-the-phone" - echo "The apps and their data are in $base." + echo " 2. On each phone, install the Tailscale app and sign in with the same account," + echo " then open the addresses and add each app to the home screen." else - echo "Next, reach them from your phones over HTTPS:" - echo " https://github.com/selfhostit/docs/blob/main/phones.md" + echo " 2. These addresses only open on this machine. To open the apps from your phones" + echo " and other computers, run this installer again and say yes to Tailscale, or" + echo " set up a reverse proxy: https://github.com/selfhostit/docs/blob/main/phones.md" fi -echo "To update, run this installer again with the same apps." +echo +echo "Adding your household, and what to do when an app doesn't open:" +echo " https://github.com/selfhostit/docs/blob/main/first-steps.md" +echo "The apps and their data are in $base. To update, run this installer again." diff --git a/linux.md b/linux.md index 8e9e615..f62b61d 100644 --- a/linux.md +++ b/linux.md @@ -27,7 +27,8 @@ The installer: 1. Installs Docker with the official script from get.docker.com if it is missing (it asks first, and may ask for your password). -2. Shows the apps and asks which ones you want. Type numbers or names, such as `1 3`. +2. Shows the apps and asks which ones you want. Type numbers or names, such as `1 3`. Each + app runs on its own, so pick only the ones you want and add more later. 3. Asks for a folder, `~/selfhostit` by default, and puts each app in its own folder there with its database. 4. Asks whether to set up Tailscale, which gives every app an `https://` address that only @@ -42,7 +43,8 @@ with Tailscale, or `http://localhost:8090` on the machine itself without it. A n gets a one-time setup code, listed under its address: its setup screen asks for it when you create the first account, so nobody else can set it up. Each app only listens on the machine and on your Tailscale network, so nothing is open to the rest of your -network or the internet. Then [install the apps on your phones](phones.md). +network or the internet. Then [make your account and add your household](first-steps.md), +and [install the apps on your phones](phones.md). ## Without the menu diff --git a/phones.md b/phones.md index b36e6f4..7b8dcac 100644 --- a/phones.md +++ b/phones.md @@ -49,7 +49,10 @@ To sign in without the link, for example on a machine without a browser nearby, Flowy, Troye, Shoppa and Calio can also join Tailscale on their own, each with its own name such as `https://flowy.your-tailnet.ts.net`, when you install them with their own installer: see -their `docs/deploy.md`. +their `docs/deploy.md`. Then each app is a separate Tailscale machine, with no port in its +address, and you share each one on its own: someone you share Flowy with can't open Calio +until you share Calio too. This page's installer instead puts every app on the one +`selfhostit` machine, so one share covers them all. Either works; pick one way per app. Everyone who uses the apps needs to be on your tailnet. That suits a household; to share a should-we decision with friends, use a public address instead.