Skip to content

Commit d721beb

Browse files
committed
docs: prepare v4
1 parent ac5e3f6 commit d721beb

File tree

7 files changed

+29
-52
lines changed

7 files changed

+29
-52
lines changed

docs/docs/configuration/metadata.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ The `*.dbmeta.json` files are hidden from the user and cannot be viewed.
2727
If you are looking for the ".dbmeta.**md**" files, see [Readme Rendering](./readme.md).
2828
:::
2929

30+
:::info Backward Compatibility
31+
Individual file password protection using metadata files is no longer supported since v4. Use [Folder Passwords](./password.mdx) instead.
32+
:::
33+
3034
## Properties
3135

3236
#### Description

docs/docs/configuration/password.mdx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ Folders can be protected with a password using a `.access.json` file.
1010
Access control applies recursively to all children.
1111
It is also possible to protect the entire dir-browser instance with a global password.
1212

13-
Both file passwords and a global password can be used at the same time.
13+
Both folder passwords and a global password can be used at the same time.
14+
15+
:::info Backward Compatibility
16+
Before v4 individual files could be password protected using `.dbmeta.json`. This is no longer supported.
17+
:::
1418

1519
## Folder password
1620

@@ -40,7 +44,7 @@ php -r "echo password_hash('foobar', PASSWORD_DEFAULT);"
4044
![](password1.png)
4145

4246

43-
```json title="/examples/foo bar/.access.json"
47+
```json title="/examples/foobar/.access.json"
4448
{
4549
"password_hash": "$2y$10$kwS/gp3aGLQ.DqUNhiqiPe1HDBN4mYlyfd06DIC/157L9WAaWngIy",
4650
"hidden": false,
@@ -50,17 +54,14 @@ php -r "echo password_hash('foobar', PASSWORD_DEFAULT);"
5054

5155
#### Plaintext
5256

53-
```json title=".access.json"
57+
```json title="/examples/foobar/.access.json"
5458
{
5559
"password_raw": "foobar",
5660
"inherit": true
5761
}
5862
```
5963

60-
:::warning
61-
Prefer `password_hash` over `password_raw`.
62-
:::
63-
64+
Prefer `password_hash` over `password_raw` for better security.
6465

6566
### Access
6667

@@ -78,22 +79,22 @@ For programmatic access, send the key via the `X-Key` header:
7879

7980
`X-Key: foobar`
8081

81-
#### POST request
82-
83-
Or as part of a POST request
84-
8582
```
86-
curl -X POST https://dir-demo.adriansoftware.de/examples/foo%20%20%20bar/ -d "key=foobar"
83+
curl -H "X-Key: foobar" https://dir-demo.adriansoftware.de/examples/foo%20%20%20bar/
84+
```
8785

8886
:::info
8987
Legacy support: `?key=...` is still accepted, but dir-browser will redirect to a clean URL after setting the cookie.
88+
89+
```
90+
curl -X POST https://dir-demo.adriansoftware.de/examples/foo%20%20%20bar/ -d "key=foobar"
91+
```
9092
:::
9193

9294
### Inheritance
9395

9496
When evaluating access, dir-browser checks the current folder `.access.json` and all parent folders.
9597
Parent configs only apply to subfolders when `inherit: true`. Subfolder configs override parent configs.
96-
```
9798

9899
## Global password
99100

@@ -106,7 +107,7 @@ import EnvConfig from '@site/src/components/EnvConfig';
106107
<EnvConfig name="PASSWORD_USER|PASSWORD_RAW|PASSWORD_HASH" init="<empty>|<empty>|<empty>" values="<string>|<string>|<hash>" desc="Username|Plaintext password|Hash of a password. See definition above." versions="3.3|3.3|3.3"/>
107108

108109
:::warning
109-
`PASSWORD_USER` and either `PASSWORD_RAW` or `PASSWORD_HASH` is mandatory to specify.
110+
If `PASSWORD_USER` is set then either `PASSWORD_RAW` or `PASSWORD_HASH` is required.
110111
:::
111112

112113
{/* :::info

docs/docs/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
sidebar_position: 1
33
---
44

5-
# 👋 Welcome
5+
# dir-browser
66

7-
![](/img/p1.png)
7+
<!-- ![](/img/p1.png) -->
88
<!-- ![](/img/dir-browser.png) -->
99

1010
## Demo

docs/docs/v3.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const config = {
124124
announcementBar: {
125125
id: 'abar',
126126
content:
127-
'🔥 dir-browser <a href="/v3/intro">v3.0</a> released with tons of new features and fresh UI 🔥',
127+
'🔥 dir-browser <a href="/v4/intro">v4.0</a> released with support for password-protected folders 🔐',
128128
backgroundColor: '#fafbfc',
129129
textColor: '#091E42',
130130
isCloseable: true,

docs/src/pages/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function HomepageHeader() {
4747
</Link>
4848
<Link
4949
className="button button--secondary button--lg"
50-
to="/v3/intro">
50+
to="/v4/intro">
5151
Get started 🚀
5252
</Link>
5353
</div>

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)