Embed default `--web-dir`
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 371
- Avg merge
- 26d 1h
- Merged PRs (30d)
- 1
Description
#### Is your feature request related to a problem? Please describe
I'm always frustrated when ... 😄
I cannot put `waved` binary somewhere in my `$PATH` and use it from working directory.
```
/MY/PWD $ waved --flags
panic: failed reading default index.html page: open /MY/PWD/www/index.html: no such file or directory
goroutine 1 [running]:
github.com/h2oai/wave.Run(0x8c7518, 0x6, 0x8c7e80, 0xe, 0x84fd2c, 0x6, 0x84f448, 0x1, 0xc000156120, 0x28, ...)
/home/runner/work/wave/wave/server.go:124 +0x2145
main.main()
/home/runner/work/wave/wave/cmd/wave/main.go:221 +0x139
```
Sure, I can specify `--web-dir` on each call or create an alias. But in that case I'd need to update the www data with new versions of `waved`.
`0.20.0+` wave includes `waved` with the Python package but more advanced flags are not exposed (e.g. all `--oidc-` flags) so running `waved` separately is necessary for particular cases.
#### Describe the solution you'd like
Embed www data into the binary and load them when the `--www-dir` is not explicitly specified.
Contributor guide
Research direction
Start by reading wave/server.go around the default web-directory handling and cmd/wave/main.go where command-line flags are configured. Trace how an explicitly supplied --web-dir is distinguished from the default, then verify that the binary can use embedded www data when no directory is supplied while preserving the explicit override.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, python
- Domain
- backend, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100