mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-22 14:47:31 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
536e8b71bf | ||
![]() |
acc43c39af | ||
![]() |
eae1b6a3de | ||
![]() |
31cc61478f | ||
![]() |
3095c1e150 | ||
![]() |
e1d5da5bd9 | ||
![]() |
5f818b7349 | ||
![]() |
1e93347a26 | ||
![]() |
18867a4c84 | ||
![]() |
3b97c7bdec | ||
![]() |
203e6bc6b2 | ||
![]() |
a613501ff2 | ||
![]() |
75afdc6306 | ||
![]() |
f02beaf075 | ||
![]() |
8bcc7e88f0 | ||
![]() |
0adbd720bf |
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
# golangci-lint manually in the `Run lint` step.
|
||||
- uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
args: --timeout 4m
|
||||
args: --timeout 5m
|
||||
|
||||
# Setup Go
|
||||
- name: Setup Go
|
||||
@@ -36,6 +36,4 @@ jobs:
|
||||
sudo apt install -y make
|
||||
|
||||
- name: Run lint
|
||||
with:
|
||||
args: --timeout 4m
|
||||
run: make lint
|
||||
|
52
.github/workflows/release.yml
vendored
52
.github/workflows/release.yml
vendored
@@ -1,9 +1,11 @@
|
||||
name: goreleaser
|
||||
---
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*" # triggers only if push new tag version
|
||||
- "*" # triggers only if push new tag version
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
@@ -27,4 +29,48 @@ jobs:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
docker-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
# list of Docker images to use as base name for tags
|
||||
images: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/headscale
|
||||
ghcr.io/${{ github.repository_owner }}/headscale
|
||||
tags: |
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Login to GHCR
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -20,4 +20,7 @@ config.json
|
||||
/db.sqlite
|
||||
*.sqlite3
|
||||
|
||||
# Exclude Jetbrains Editors
|
||||
.idea
|
||||
|
||||
test_output/
|
||||
|
2
Makefile
2
Makefile
@@ -20,7 +20,7 @@ coverprofile_html:
|
||||
|
||||
lint:
|
||||
golint
|
||||
golangci-lint run
|
||||
golangci-lint run --timeout 5m
|
||||
|
||||
compress: build
|
||||
upx --brute headscale
|
||||
|
28
README.md
28
README.md
@@ -38,8 +38,16 @@ Suggestions/PRs welcomed!
|
||||
|
||||
## Running it
|
||||
|
||||
1. Download the Headscale binary https://github.com/juanfont/headscale/releases, and place it somewhere in your PATH
|
||||
|
||||
1. Download the Headscale binary https://github.com/juanfont/headscale/releases, and place it somewhere in your PATH or use the docker container
|
||||
|
||||
```shell
|
||||
docker pull headscale/headscale:x.x.x
|
||||
```
|
||||
|
||||
or
|
||||
```shell
|
||||
docker pull ghrc.io/juanfont/headscale:x.x.x
|
||||
```
|
||||
|
||||
2. (Optional, you can also use SQLite) Get yourself a PostgreSQL DB running
|
||||
|
||||
@@ -64,11 +72,19 @@ Suggestions/PRs welcomed!
|
||||
```shell
|
||||
headscale namespaces create myfirstnamespace
|
||||
```
|
||||
or docker:
|
||||
```shell
|
||||
docker run -v ./private.key:/private.key -v ./config.json:/config.json headscale/headscale:x.x.x headscale namespace create myfirstnamespace
|
||||
```
|
||||
|
||||
5. Run the server
|
||||
```shell
|
||||
headscale serve
|
||||
```
|
||||
or docker:
|
||||
```shell
|
||||
docker run -v $(pwd)/private.key:/private.key -v $(pwd)/config.json:/config.json -v $(pwd)/derb.yaml:/derb.yaml -p 127.0.0.1:8080:8080 headscale/headscale:x.x.x headscale serve
|
||||
```
|
||||
|
||||
6. If you used tailscale.com before in your nodes, make sure you clear the tailscaled data folder
|
||||
```shell
|
||||
@@ -88,6 +104,10 @@ Suggestions/PRs welcomed!
|
||||
```shell
|
||||
headscale -n myfirstnamespace node register YOURMACHINEKEY
|
||||
```
|
||||
or docker:
|
||||
```shell
|
||||
docker run -v ./private.key:/private.key -v ./config.json:/config.json headscale/headscale:x.x.x headscale -n myfirstnamespace node register YOURMACHINEKEY
|
||||
```
|
||||
|
||||
Alternatively, you can use Auth Keys to register your machines:
|
||||
|
||||
@@ -95,6 +115,10 @@ Alternatively, you can use Auth Keys to register your machines:
|
||||
```shell
|
||||
headscale -n myfirstnamespace preauthkeys create --reusable --expiration 24h
|
||||
```
|
||||
or docker:
|
||||
```shell
|
||||
docker run -v ./private.key:/private.key -v ./config.json:/config.json headscale/headscale:x.x.x headscale -n myfirstnamespace preauthkeys create --reusable --expiration 24h
|
||||
```
|
||||
|
||||
2. Use the authkey from your machine to register it
|
||||
```shell
|
||||
|
@@ -22,14 +22,12 @@ func main() {
|
||||
colors = true
|
||||
default:
|
||||
// no color, return text as is.
|
||||
log.Trace().Msg("Colors are not supported, disabling")
|
||||
colors = false
|
||||
}
|
||||
|
||||
// Adhere to no-color.org manifesto of allowing users to
|
||||
// turn off color in cli/services
|
||||
if _, noColorIsSet := os.LookupEnv("NO_COLOR"); noColorIsSet {
|
||||
log.Trace().Msg("NO_COLOR is set, disabling colors")
|
||||
colors = false
|
||||
}
|
||||
|
||||
|
@@ -89,7 +89,6 @@ Use "headscale [command] --help" for more information about a command.
|
||||
|
||||
# TODO / Ideas
|
||||
|
||||
- Github action to publish the docker image
|
||||
- Interpolate `email:` option to the ClusterIssuer from site configuration.
|
||||
This probably needs to be done with a transformer, kustomize vars don't seem to work.
|
||||
- Add kustomize examples for cloud-native ingress, load balancer
|
||||
|
Reference in New Issue
Block a user