Skip to content

Commit

Permalink
Merge pull request #69 from juanfont/change-default-port
Browse files Browse the repository at this point in the history
Use 8080 as default port in the example config
  • Loading branch information
juanfont authored Jul 31, 2021
2 parents 91bfb48 + 4fb55e1 commit c3aa9a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ Please bear in mind that all the commands from headscale support adding `-o json
Headscale's configuration file is named `config.json` or `config.yaml`. Headscale will look for it in `/etc/headscale`, `~/.headscale` and finally the directory from where the Headscale binary is executed.

```
"server_url": "http://192.168.1.12:8000",
"listen_addr": "0.0.0.0:8000",
"server_url": "http://192.168.1.12:8080",
"listen_addr": "0.0.0.0:8080",
```

`server_url` is the external URL via which Headscale is reachable. `listen_addr` is the IP address and port the Headscale program should listen on.
Expand Down
10 changes: 5 additions & 5 deletions cmd/headscale/headscale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func (*Suite) TestPostgresConfigLoading(c *check.C) {
c.Assert(err, check.IsNil)

// Test that config file was interpreted correctly
c.Assert(viper.GetString("server_url"), check.Equals, "http://127.0.0.1:8000")
c.Assert(viper.GetString("listen_addr"), check.Equals, "0.0.0.0:8000")
c.Assert(viper.GetString("server_url"), check.Equals, "http://127.0.0.1:8080")
c.Assert(viper.GetString("listen_addr"), check.Equals, "0.0.0.0:8080")
c.Assert(viper.GetString("derp_map_path"), check.Equals, "derp.yaml")
c.Assert(viper.GetString("db_type"), check.Equals, "postgres")
c.Assert(viper.GetString("db_port"), check.Equals, "5432")
Expand Down Expand Up @@ -84,8 +84,8 @@ func (*Suite) TestSqliteConfigLoading(c *check.C) {
c.Assert(err, check.IsNil)

// Test that config file was interpreted correctly
c.Assert(viper.GetString("server_url"), check.Equals, "http://127.0.0.1:8000")
c.Assert(viper.GetString("listen_addr"), check.Equals, "0.0.0.0:8000")
c.Assert(viper.GetString("server_url"), check.Equals, "http://127.0.0.1:8080")
c.Assert(viper.GetString("listen_addr"), check.Equals, "0.0.0.0:8080")
c.Assert(viper.GetString("derp_map_path"), check.Equals, "derp.yaml")
c.Assert(viper.GetString("db_type"), check.Equals, "sqlite3")
c.Assert(viper.GetString("db_path"), check.Equals, "db.sqlite")
Expand Down Expand Up @@ -125,7 +125,7 @@ func (*Suite) TestTLSConfigValidation(c *check.C) {
fmt.Println(tmp)

// Check configuration validation errors (2)
configYaml = []byte("---\nserver_url: \"http://127.0.0.1:8000\"\ntls_letsencrypt_hostname: \"example.com\"\ntls_letsencrypt_challenge_type: \"TLS-ALPN-01\"")
configYaml = []byte("---\nserver_url: \"http://127.0.0.1:8080\"\ntls_letsencrypt_hostname: \"example.com\"\ntls_letsencrypt_challenge_type: \"TLS-ALPN-01\"")
writeConfig(c, tmpDir, configYaml)
err = cli.LoadConfig(tmpDir)
c.Assert(err, check.IsNil)
Expand Down
4 changes: 2 additions & 2 deletions config.json.postgres.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"server_url": "http://127.0.0.1:8000",
"listen_addr": "0.0.0.0:8000",
"server_url": "http://127.0.0.1:8080",
"listen_addr": "0.0.0.0:8080",
"private_key_path": "private.key",
"derp_map_path": "derp.yaml",
"ephemeral_node_inactivity_timeout": "30m",
Expand Down
4 changes: 2 additions & 2 deletions config.json.sqlite.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"server_url": "http://127.0.0.1:8000",
"listen_addr": "0.0.0.0:8000",
"server_url": "http://127.0.0.1:8080",
"listen_addr": "0.0.0.0:8080",
"private_key_path": "private.key",
"derp_map_path": "derp.yaml",
"ephemeral_node_inactivity_timeout": "30m",
Expand Down

0 comments on commit c3aa9a5

Please sign in to comment.