diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..f0902132 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,28 @@ +--- +name: "Bug report" +about: "Create a bug report to help us improve" +title: "" +labels: ["bug"] +assignees: "" +--- + +**Bug description** + + + +**To Reproduce** + + + +**Context info** + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..99cc36fa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +# Issues must have some content +blank_issues_enabled: false + +# Contact links +contact_links: + - name: "headscale usage documentation" + url: "https://github.com/juanfont/headscale/blob/main/docs" + about: "Find documentation about how to configure and run headscale." + - name: "headscale Discord community" + url: "https://discord.com/invite/XcQxk2VHjx" + about: "Please ask and answer questions about usage of headscale here." diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..f4cd6e71 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,15 @@ +--- +name: "Feature request" +about: "Suggest an idea for headscale" +title: "" +labels: ["enhancement"] +assignees: "" +--- + +**Feature request** + + + + diff --git a/.github/ISSUE_TEMPLATE/other_issue.md b/.github/ISSUE_TEMPLATE/other_issue.md new file mode 100644 index 00000000..76811e67 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other_issue.md @@ -0,0 +1,28 @@ +--- +name: "Other issue" +about: "Report a different issue" +title: "" +labels: ["bug"] +assignees: "" +--- + + + +**Issue description** + + + +**To Reproduce** + + + +**Context info** + + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..c7015806 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,10 @@ + + +- [] read the [CONTRIBUTING guidelines](README.md#user-content-contributing) +- [] raised a GitHub issue or discussed it on the projects chat beforehand +- [] added unit tests +- [] added integration tests +- [] updated documentation if needed +- [] updated CHANGELOG.md + + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06bd3ccf..d613e7a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Install dependencies run: | diff --git a/.gitignore b/.gitignore index 610550b9..d047cbfd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ /headscale config.json config.yaml +derp.yaml +*.hujson *.key /db.sqlite *.sqlite3 diff --git a/acls.go b/acls.go index 1550c340..4017e28e 100644 --- a/acls.go +++ b/acls.go @@ -34,6 +34,11 @@ const ( // LoadACLPolicy loads the ACL policy from the specify path, and generates the ACL rules. func (h *Headscale) LoadACLPolicy(path string) error { + log.Debug(). + Str("func", "LoadACLPolicy"). + Str("path", path). + Msg("Loading ACL policy from path") + policyFile, err := os.Open(path) if err != nil { return err @@ -67,6 +72,8 @@ func (h *Headscale) LoadACLPolicy(path string) error { } h.aclRules = rules + log.Trace().Interface("ACL", rules).Msg("ACL rules generated") + return nil } diff --git a/app.go b/app.go index db788908..b9d570c5 100644 --- a/app.go +++ b/app.go @@ -418,12 +418,12 @@ func (h *Headscale) Serve() error { err = h.ensureUnixSocketIsAbsent() if err != nil { - panic(err) + return fmt.Errorf("unable to remove old socket file: %w", err) } socketListener, err := net.Listen("unix", h.cfg.UnixSocket) if err != nil { - panic(err) + return fmt.Errorf("failed to set up gRPC socket: %w", err) } // Handle common process-killing signals so we can gracefully shut down: @@ -441,7 +441,7 @@ func (h *Headscale) Serve() error { networkListener, err := net.Listen("tcp", h.cfg.Addr) if err != nil { - panic(err) + return fmt.Errorf("failed to bind to TCP address: %w", err) } // Create the cmux object that will multiplex 2 protocols on the same port. diff --git a/config-example.yaml b/config-example.yaml index 692c605a..29b2f3ff 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -54,6 +54,8 @@ tls_letsencrypt_challenge_type: HTTP-01 tls_cert_path: "" tls_key_path: "" +log_level: info + # Path to a file containg ACL policies. acl_policy_path: "" diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..111b3bc8 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,7 @@ +# Official headscale documentation + +- [Configuration](Configuration.md) +- [Running](Running.md) +- [DNS](DNS.md) +- [TLS](TLS.md) +- [Glossary](Glossary.md)