YetAnotherToDoList/INSTALL.md

117 lines
2.8 KiB
Markdown
Raw Normal View History

---
gitea: none
include_toc: true
---
# Install YetAnotherToDoList
It is recommended to use this behind a proxy (e.g.
[Apache/httpd](https://httpd.apache.org/) or [NGINX](https://nginx.org/)) to add
TLS and [Gzip](https://www.gnu.org/software/gzip/)/[brotli](https://brotli.org/)
compression.
## Requirements:
- go 1.21.1 (not tested, but _should_ also work in all versions since 1.16)
- gcc 4.6+ (according to the
[golang wiki](https://github.com/golang/go/wiki/MinimumRequirements#cgo))
## Install via `go install`
When installing via this method, no commit & version information is provided and
there will be no frontend.
```bash
go install somepi.ddns.net/gitea/gilex-dev/YetAnotherToDoList@latest
```
You can specify the installation location by adding
`GOBIN=<installation directory>`
## Install from git repository (Recommended)
2023-10-24 16:51:58 +02:00
In addition to the [requirements](#requirements), you will need `git`,
`GNU make`, and `pnpm`.
```bash
git clone https://somepi.ddns.net/gitea/gilex-dev/YetAnotherToDoList.git
cd YetAnotherToDoList
go mod tidy # only if you want to edit the GraphQL backend
make frontend # omit if you want to run headless
make build
```
To customize your build, you can run `make` with these environment variables:
```
INSTALL_DIR=<installation directory>
BUILD_FLAGS=<go build flags>
RUN_FLAGS=<cli arguments for YetAnotherToDoList>
```
You also pass `build tags` to `BUILD_FLAGS`, e.g.
`BUILD_FLAGS="-tags headless,dev"` to disable the frontend and enable
`GraphiQL`.
While there is a `tools` build constraint/tag, building with it has no effect.
The `tools` package only exists to install the dependencies for the
`gqlgen generate` command when you run `go mod tidy`.
## Install from pre-build binary
There are currently no pre-build binaries available
## Troubleshooting
If you get an error like
`Unable to connect: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub`,
make sure `gcc` is installed and in your `PATH`.
If this still does not work, try
```bash
CGO_ENABLED=1 go install github.com/mattn/go-sqlite3
```
## Post install
### Add shell completion
YetAnotherToDoList must be in your `PATH` for this to work.
#### Bash
```bash
source <(YetAnotherToDoList completion bash)
```
For other shells or more info, see
```bash
YetAnotherToDoList help completion <bash|zsh|fish|powershell>
```
### Configuration
Edit the file [.YetAnotherToDoList.yaml](./.YetAnotherToDoList.yaml) and run
`YetAnotherToDoList help` for options.
## Uninstall
Run `make uninstall` or
```bash
rm $HOME/.local/bin/YetAnotherToDoList # replace with your installation path
```
Don't forget to delete the `.log`, `.yaml` and `.sqlite3` files if you don't
need them any more.
### Remove shell completion
#### Bash
```bash
complete -r YetAnotherToDoList
```