mirror of
https://github.com/openziti/zrok.git
synced 2025-01-25 07:19:11 +01:00
document and announce Linux user shares
This commit is contained in:
parent
b44f690ab2
commit
af0367e36b
@ -120,9 +120,6 @@ nfpms:
|
||||
- dst: /usr/lib/systemd/user/
|
||||
src: ./nfpm/zrok-share@.service
|
||||
|
||||
- dst: /usr/lib/systemd/user/
|
||||
src: ./nfpm/zrok-share@.service
|
||||
|
||||
- dst: /etc/systemd/system/zrok-share.service.d/override.conf
|
||||
src: ./nfpm/zrok-share.service.override.conf
|
||||
|
||||
|
@ -4,9 +4,11 @@
|
||||
|
||||
FIX: Docker share examples had incorrect default path for zrok environment mountpoint
|
||||
|
||||
FIX: Clarify how to use DNS providers like Route53 with the zrok Docker instance sample.
|
||||
|
||||
CHANGE: Use port 80 for the default Ziti API endpoint in the zrok Docker instance sample (https://github.com/openziti/zrok/issues/793).
|
||||
|
||||
FIX: Clarify how to use DNS providers like Route53 with the zrok Docker instance sample.
|
||||
FEATURE: Linux service template for systemd user units (https://github.com/openziti/zrok/pull/818)
|
||||
|
||||
## v0.4.45
|
||||
|
||||
|
@ -1,42 +1,10 @@
|
||||
import LinuxShareInstall from './_linux-share-install.mdx'
|
||||
import AnsibleRepoSetup from './install/_ansible_repo_setup.yaml'
|
||||
import ConcatenateYamlSnippets from '@site/src/components/cat-yaml.jsx'
|
||||
|
||||
## Goal
|
||||
|
||||
Proxy a reserved public subdomain to a backend target with an always-on Linux system service.
|
||||
|
||||
## How it Works
|
||||
|
||||
The `zrok-share` package creates a `zrok-share.service` unit in systemd. The administrator edits the service's configuration file to specify the:
|
||||
|
||||
1. zrok environment enable token
|
||||
1. target URL or files to be shared and backend mode, e.g. `proxy`
|
||||
1. authentication options, if wanted
|
||||
|
||||
When the service starts it will:
|
||||
|
||||
1. enable the zrok environment unless `/var/lib/zrok-share/.zrok/environment.json` exists
|
||||
1. reserve a public subdomain for the service unless `/var/lib/zrok-share/.zrok/reserved.json` exists
|
||||
1. start sharing the target specified as `ZROK_TARGET` in the environment file
|
||||
|
||||
## Installation
|
||||
|
||||
1. Set up `zrok`'s Linux package repository by following [the Linux install guide](/guides/install/linux.mdx#install-zrok-from-the-repository), or run this one-liner to complete the repo setup and install packages.
|
||||
|
||||
```bash
|
||||
curl -sSLf https://get.openziti.io/install.bash \
|
||||
| sudo bash -s zrok-share
|
||||
```
|
||||
|
||||
1. If you set up the repository by following the guide, then also install the `zrok-share` package. This package provides the systemd service.
|
||||
|
||||
```bash title="Ubuntu, Debian"
|
||||
sudo apt install zrok-share
|
||||
```
|
||||
|
||||
```bash title="Fedora, Rocky"
|
||||
sudo dnf install zrok-share
|
||||
```
|
||||
<LinuxShareInstall />
|
||||
|
||||
<Details>
|
||||
<summary>Ansible Playbook</summary>
|
||||
|
17
docs/guides/_linux-share-install.mdx
Normal file
17
docs/guides/_linux-share-install.mdx
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
1. Set up `zrok`'s Linux package repository by following [the Linux install guide](/guides/install/linux.mdx#install-zrok-from-the-repository), or run this one-liner to complete the repo setup and install packages.
|
||||
|
||||
```bash
|
||||
curl -sSLf https://get.openziti.io/install.bash \
|
||||
| sudo bash -s zrok-share
|
||||
```
|
||||
|
||||
1. If you set up the repository by following the guide, then also install the `zrok-share` package. This package provides the systemd service.
|
||||
|
||||
```bash title="Ubuntu, Debian"
|
||||
sudo apt install zrok-share
|
||||
```
|
||||
|
||||
```bash title="Fedora, Rocky"
|
||||
sudo dnf install zrok-share
|
||||
```
|
8
docs/guides/linux-user-share/_category_.json
Normal file
8
docs/guides/linux-user-share/_category_.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "Linux User Share",
|
||||
"position": 40,
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "guides/linux-user-share/index"
|
||||
}
|
||||
}
|
44
docs/guides/linux-user-share/index.mdx
Normal file
44
docs/guides/linux-user-share/index.mdx
Normal file
@ -0,0 +1,44 @@
|
||||
---
|
||||
title: Linux User Share
|
||||
---
|
||||
|
||||
import LinuxShareInstall from '/../docs/guides/_linux-share-install.mdx'
|
||||
|
||||
## Overview
|
||||
|
||||
You can run any number of zrok share services as `systemd --user` units with your Linux user's zrok environment in `~/.zrok`. This is like [zrok frontdoor](/guides/frontdoor.mdx) except that frontdoor is a system service managed by root separately from your user's login. Linux user shares, Linux system services, and Docker shares all use the same configuration environment variables.
|
||||
|
||||
## Install the Linux Package
|
||||
|
||||
The package provides the `zrok` executable and service unit template.
|
||||
|
||||
<LinuxShareInstall />
|
||||
|
||||
## Create a User Share Configuration File
|
||||
|
||||
Substitute a name for your instance in place of `my-instance` in the following example. To avoid character escaping problems, use only letters, numbers, hyphens, and underscores in the instance name, not spaces or other special characters.
|
||||
|
||||
```bash
|
||||
ZROK_INSTANCE="my-instance"
|
||||
cp /opt/openziti/etc/zrok/zrok-share.env ~/.zrok/zrok-share@${ZROK_INSTANCE}.env
|
||||
```
|
||||
|
||||
## Edit the User Share Configuration File
|
||||
|
||||
Edit the configuration file in `~/.zrok/zrok-share@${ZROK_INSTANCE}.env` as you would for [zrok frontdoor](/guides/frontdoor.mdx), except ignore the first section "ZROK ENVIRONMENT" because user shares re-use `~/.zrok` and do not need a separate zrok environment.
|
||||
|
||||
## Start the User Share Service
|
||||
|
||||
```bash
|
||||
systemctl --user enable --now zrok-share@${ZROK_INSTANCE}.service
|
||||
```
|
||||
|
||||
## Check the User Share Journal
|
||||
|
||||
```bash
|
||||
journalctl --user -lfu zrok-share@${ZROK_INSTANCE}.service
|
||||
```
|
||||
|
||||
## Add Another User Share
|
||||
|
||||
To create another user share, choose another instance name, copy the `zrok-share.env` file, edit the configuration file, and start the service.
|
Loading…
Reference in New Issue
Block a user