---
# System prepended metadata

title: 樹莓派筆記- 初見 Organizr
tags: [docker, Linux, 樹莓派]

---

---
title: 
description: 
date: 2023-04-20
lang: zh-tw
tags:
  - 樹莓派
  - Linux
  - docker
---
# 樹莓派筆記- 初見 Organizr


## docker compose
`docker compose`

```yml=
version: '3.3'
networks:
  default:
    name: ${DOCKER_MY_NETWORK}
    external: true
services:
    organizr:
        container_name: organizr
        hostname: organizr
        image: organizr/organizr:latest
        restart: unless-stopped
        expose:
            - 80
        volumes:
            - ${HOME_PATH}/organizr:/config
        env_file:
            - stack.env
```
## env
`stack.env`
```env=
DOCKER_MY_NETWORK=caddy_net
HOME_PATH=<your path>
TZ=Asia/Taipei
```

## Caddyfile
添加以下
`Caddyfile`
```Caddyfile=
home.{$MY_DOMAIN} {
	log {
		output file /var/log/caddy/access.log
	}
	forward_auth authelia:9091 {
		uri /api/verify?rd=https://auth.{$MY_DOMAIN}/
		copy_headers Remote-User Remote-Groups Remote-Name Remote-Email

		## This import needs to be included if you're relying on a trusted proxies configuration.
		import trusted_proxy_list
	}
	reverse_proxy organizr:80 {
		## This import needs to be included if you're relying on a trusted proxies configuration.
		import trusted_proxy_list
	}
}
```
## Authelia 登入 Organizr 
在先前有設置過Authelia登入
但Organizr自己也有一套簡易登入系統
這就需要連續登入兩次， 太麻煩了
好在有提供trusted header SSO功能
能將Authelia登入資訊傳遞給Organizr
依照下圖設定就好


:::info
Auth Proxy Whitelist: 改成使用docker子網。
例如:172.22.0.0/16
:::

![](https://www.authelia.com/integration/trusted-header-sso/organizr/organizr.png)

當然有個缺點目前資料庫都是各做各的
因此登入資料要一樣，才能正確登入
後續再弄個ldap當資料庫吧

## Ref
* https://docs.organizr.app/
* https://www.authelia.com/integration/trusted-header-sso/organizr/
