Merge branch 'main' into G114

This commit is contained in:
Felix Niederwanger 2023-09-23 08:59:09 +00:00
commit 9d6af6fced
3 changed files with 42 additions and 2 deletions

5
.gitignore vendored
View file

@ -17,7 +17,10 @@
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
vendor/
# Task files
.task
# Go workspace file
go.work

View file

@ -37,7 +37,12 @@ In it's current implementation, `weblug` requires to remain running as root with
make # Build weblug
make static # Make a static binary
Alternatively you there is also a [Taskfile](https://taskfile.dev)
task
task static # Build static binary
## Run as systemd unit
This repository provides an example [weblug.service](weblug.service), which can be used to start `weblug` as systemd service.
This file can be placed in `/etc/systemd/system/weblug.service` and in conjunction with an adequate `weblug.yml` file e.g. in `/etc/weblug.yml` this provides a way of running weblug as a native systemd service.
This file can be placed in `/etc/systemd/system/weblug.service` and in conjunction with an adequate `weblug.yml` file e.g. in `/etc/weblug.yml` this provides a way of running weblug as a native systemd service.

32
Taskfile.yml Normal file
View file

@ -0,0 +1,32 @@
# https://taskfile.dev
version: '3'
tasks:
default:
cmds:
- go build -o weblug cmd/weblug/*.go
silent: false
aliases: [weblug]
generates:
- weblug
sources:
- cmd/weblug/*.go
static:
cmds:
- go build -ldflags="-w -s" -o weblug cmd/weblug/*.go
env:
CGO_ENABLED: '0'
silent: false
aliases: [weblug-static]
generates:
- weblug
sources:
- cmd/weblug/*.go
test:
deps: [weblug]
# Ensure a weblug binary is present
preconditions:
- test -f weblug
cmds:
- sudo bash -c "cd test && ./blackbox.sh"