1093 Commits

Author SHA1 Message Date
Albert Copeland
fac78823a3 Merge pull request #103 from iFargle/iFargle-patch-1
Update Dockerfile
2023-05-08 14:30:56 +09:00
Albert Copeland
3cc188d5a3 Update Dockerfile 2023-05-08 14:30:46 +09:00
iFargle
7acc4b12fd Update build versions v0.6.2 2023-05-08 12:42:53 +09:00
Albert Copeland
a7c0c9b059 Merge pull request #102 from atb00ker/allow-changing-data-directory
Allow changing data directory
2023-05-08 12:40:28 +09:00
Ajay Tripathi
4eea529722 [deploy] Allow changing data directory in bare-metal setups 2023-05-06 03:31:03 +05:30
Ajay Tripathi
05db2f5282 [deploy] Add support for bare metal installation and document the same 2023-05-06 01:01:43 +05:30
Albert Copeland
0ff6de435a Merge pull request #98 from itbencn/add-machine-bug
fix add_machine reload bug
2023-05-02 14:28:38 +09:00
itbencn
d193ade192 fix add_machine reload bug 2023-05-02 13:25:46 +08:00
iFargle
0434d28b6e test 2023-05-02 14:17:29 +09:00
iFargle
3bf34d32c6 test 2023-05-02 13:43:53 +09:00
iFargle
4a081df965 test 2023-05-02 13:30:24 +09:00
iFargle
59586abd08 Test 2023-05-02 12:28:09 +09:00
iFargle
2033f80258 Reverting to 0.6.1 2023-05-02 12:25:07 +09:00
Albert Copeland
bff9e5b991 Merge pull request #96 from iFargle/revert-95-revert-92-iFargle-patch-1
Revert "Revert "Update README.md""
2023-04-27 16:14:53 +09:00
Albert Copeland
c62a117507 Revert "Revert "Update README.md"" 2023-04-27 16:14:44 +09:00
Albert Copeland
e436c59eb3 Merge pull request #95 from iFargle/revert-92-iFargle-patch-1
Revert "Update README.md"
2023-04-27 15:53:01 +09:00
Albert Copeland
dea647e7b6 Revert "Update README.md" 2023-04-27 15:52:10 +09:00
Albert Copeland
8fae2c325e Merge pull request #92 from iFargle/iFargle-patch-1
Update README.md
2023-04-23 10:45:25 +09:00
Albert Copeland
b1df872fa4 Update README.md 2023-04-23 10:44:54 +09:00
iFargle
3bae0ba05a test 2023-04-22 18:07:31 +09:00
Albert Copeland
cc67cf0e9c Merge pull request #90 from MarekPikula/fix_build_date_to_str
Fix build date to string
2023-04-22 15:18:08 +09:00
Marek Pikuła
e4a75280ef Make the BUILD_DATE a regular string again
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 06:15:53 +00:00
Marek Pikuła
26ab61dab6 Revert "Use ISO format for BUILD_DATE in Jenkins"
This reverts commit 3acfa64f11.

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 06:13:23 +00:00
iFargle
91802f6c3f Jenkins doesn't like the new BUILD_DATE for whatever reason. Outputs no logs at all 2023-04-22 15:03:11 +09:00
Albert Copeland
155ae7e84c Merge pull request #89 from MarekPikula/fix_env_validators
Fix environment validators
2023-04-22 14:46:58 +09:00
Marek Pikuła
0ae21b444c Set valid empty defaults for AUTH_TYPE and BUILD_DATE
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 05:36:46 +00:00
Marek Pikuła
3acfa64f11 Use ISO format for BUILD_DATE in Jenkins
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 05:36:03 +00:00
Marek Pikuła
3be00b83ac Make the BUILD_DATE validator more general
It should be more permissive and fall back to current time if format
error is detected,

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 05:34:05 +00:00
Marek Pikuła
a5bd6d2f7e Use Pydantic validation error message in logs
Should give better insight into the validation error.

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 05:31:40 +00:00
Marek Pikuła
7296c5d9e0 Make the AUTH_TYPE validator more general
- allow any casing style
- use Basic th by default if the string is left empty
- set some default values for user-password pair for BasicAuth

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-22 05:30:58 +00:00
iFargle
0aa0257b6e test 2023-04-22 13:02:53 +09:00
iFargle
0bffa71de2 test 2023-04-21 22:09:41 +09:00
Albert Copeland
9aeea628d2 Update pyproject.toml 2023-04-21 19:53:37 +09:00
iFargle
128c5d1d76 Update version v0.7.0 2023-04-21 19:31:16 +09:00
Albert Copeland
5097807385 Merge pull request #86 from MarekPikula/improve_code_style
Improve code style
2023-04-21 19:29:15 +09:00
Marek Pikuła
d4169f1af4 For now, disable pylint warnings in renderer
To be revisited in future.

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 06:31:51 +00:00
Marek Pikuła
fa86bbf00d Fix CI lint path
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 06:23:25 +00:00
Marek Pikuła
3cc8d4bc4f Disable fixme for pylint CI check
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 06:19:13 +00:00
Marek Pikuła
44f6f1526c Add VS Code launch targets
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 06:02:29 +00:00
Marek Pikuła
fe7a3667d4 Complete the major refactor
Major part of #73

Unfortunately, it wasn't possible to split it to multiple smaller
commits, since the changes touched the entire application substantially.
Here is a short list of major changes:

1. Create a separate library (headscale-api), which is used as a
   convenient abstraction layer providing Pythonic interface with
   Pydantic. Headscale API is fully asynchronous library, benefitting
   from improved concurrency for backend requests thus increasing page
   load speed, e.g., on "Machines" page.
2. Create a common common, validated with flask-pydantic API passthrough
   layer from GUI to the backend.
3. Move authentication to a separate (auth.py), consolidating the
   functionality in a single place (with better place for expansion in
   the future).
4. Move configuration management to a separate module (config.py). Use
   Pydantic's BaseSettings for reading values from environment, with
   extensive validation and error reporting.
5. Reduce the number of health checks.
    - Now, most are performed during server initialization. If any test
      fails, the server is started in tainted mode, with only the error
      page exposed (thus reducing the surface of attack in invalid
      state).
    - Key checks are implicit in the requests to the backend and
      guarded by `@headscale.key_check_guard` decorator.
    - Key renewal is moved to server-side scheduler.
6. Introduce type hints to the level satisfactory for mypy static
   analysis. Also, enable some other linters in CI and add optional
   pre-commit hooks.
7. Properly handle some error states. Instead of returning success and
   handling different responses, if something fails, there is HTTP error
   code and standard response for it.
8. General formatting, small rewrites for clarity and more idiomatic
   Python constructs.

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 06:02:29 +00:00
Marek Pikuła
20a4c9d3f6 Add some extensions and enable Python linting in devcontainer
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
5eaa796ba3 Add Github Workflow for linters
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
142a97d723 Add more pre-commit hooks
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
64bac3b440 Add Poetry local config 2023-04-21 05:50:28 +00:00
Marek Pikuła
358c0086af Apply black and isort auto formatting
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
4919147483 Add pre-commit hooks
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
19f27eb552 Add basic devcontainer configuration
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
74b53cad21 Add more development tools
- black
- isort
- ruff
- pre-comit
- mypy
- pydocstyle

Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Marek Pikuła
8158d7cf7d Import Python gitignore from toptal
Signed-off-by: Marek Pikuła <marek.pikula@embevity.com>
2023-04-21 05:50:28 +00:00
Albert Copeland
6ef80d061c Merge pull request #85 from itbencn/add-machine-bug
fix add_machine bug & foramt
2023-04-21 11:18:13 +09:00