Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
190f655
Minimal charm that installs the haproxy apt package
Thanhphan1147 Jul 30, 2024
e9e3d29
remove template test
Thanhphan1147 Jul 30, 2024
aa4bb43
render haproxy config and dhconfig files
Thanhphan1147 Aug 2, 2024
982d95d
add woke.yaml
Thanhphan1147 Aug 2, 2024
97ec85a
add lib/ to licenserc ignore list
Thanhphan1147 Aug 2, 2024
d4e808d
add .woke.yaml to licenserc
Thanhphan1147 Aug 2, 2024
f9f3ced
update test workflow, fix missing newline
Thanhphan1147 Aug 5, 2024
27e8c60
add j2 templates to .licenserc
Thanhphan1147 Aug 6, 2024
adb1fa0
enable and start the haproxy service
Thanhphan1147 Aug 9, 2024
fe0ddd9
add .gitignore
Thanhphan1147 Aug 9, 2024
b8e3a70
update tests
Thanhphan1147 Aug 9, 2024
0c260a5
remove duplicates install method
Thanhphan1147 Aug 12, 2024
e0d7133
move is_active check to service method
Thanhphan1147 Aug 9, 2024
7f939db
fix lint
Thanhphan1147 Aug 9, 2024
948fdf3
fix imports ordering
Thanhphan1147 Aug 12, 2024
55c3d8e
fix typo
Thanhphan1147 Aug 12, 2024
45a0102
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 19, 2024
5e33585
fix tests
Thanhphan1147 Aug 19, 2024
9ac5aad
add reconcile() method to restart haproxy with updated configuration
Thanhphan1147 Aug 19, 2024
6be75d9
render default haproxy page
Thanhphan1147 Aug 19, 2024
76a5140
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 19, 2024
6ae65db
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 26, 2024
0fbb442
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 30, 2024
ea5405d
add explicit docs for dh_params
Thanhphan1147 Sep 3, 2024
55a3dba
render haproxy config with global_max_conn charm config option
Thanhphan1147 Aug 2, 2024
66e644f
add exception handling, update logging config in global section
Thanhphan1147 Aug 5, 2024
65e8135
fix charmcraft.yaml indentation error
Thanhphan1147 Aug 6, 2024
110e37c
enable and start the haproxy service
Thanhphan1147 Aug 9, 2024
0ba7a37
fix lint
Thanhphan1147 Aug 12, 2024
61322d1
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 19, 2024
826d724
add missing docstring
Thanhphan1147 Sep 3, 2024
468d099
reset service failed count before restarting
Thanhphan1147 Sep 4, 2024
047f838
Merge branch 'main' into add_max_conn_config
Thanhphan1147 Sep 5, 2024
768917c
fix lint
Thanhphan1147 Sep 5, 2024
ba62571
move keep_trailling_nl to correct place
Thanhphan1147 Sep 5, 2024
9198cef
fix typo
Thanhphan1147 Sep 16, 2024
736bd1f
update validation to use sysctl fs.nr-open as upper limit. switch to …
Thanhphan1147 Sep 17, 2024
06f200e
remove sysctl lib
Thanhphan1147 Sep 17, 2024
cc89306
fix lint and static code analysis
Thanhphan1147 Sep 17, 2024
603cdf3
add config integration test
Thanhphan1147 Sep 17, 2024
1531f20
update config value
Thanhphan1147 Sep 17, 2024
dbab7bd
render haproxy config with global_max_conn charm config option
Thanhphan1147 Aug 2, 2024
94051e6
enable and start the haproxy service
Thanhphan1147 Aug 9, 2024
88575d2
fix lint
Thanhphan1147 Aug 12, 2024
2a28b7b
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 19, 2024
d9cd366
remove duplicate
Thanhphan1147 Aug 19, 2024
795be0c
validate config with decorator
Thanhphan1147 Aug 5, 2024
78a6b74
fix lint
Thanhphan1147 Sep 3, 2024
f9e195a
remove duplicated methods
Thanhphan1147 Sep 5, 2024
8de698f
enable and start the haproxy service
Thanhphan1147 Aug 9, 2024
15c55db
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 19, 2024
75b9a2c
remove duplicate
Thanhphan1147 Aug 19, 2024
d7e9c74
add tls_certficates lib
Thanhphan1147 Aug 6, 2024
ad5b494
add tls_relation service module
Thanhphan1147 Aug 6, 2024
be8e37c
add tls state component
Thanhphan1147 Aug 6, 2024
9165fe8
add cryptography as dependency
Thanhphan1147 Aug 6, 2024
31b9a47
update tls management
Thanhphan1147 Aug 9, 2024
0f89325
add missing deps
Thanhphan1147 Aug 12, 2024
f521f34
add rustup snap to pin rpds-py
Thanhphan1147 Aug 12, 2024
b8f319b
fix action not bound to hook, make param required
Thanhphan1147 Aug 12, 2024
8526cea
correctly place decorators
Thanhphan1147 Sep 17, 2024
7fc3c5e
remove extra import
Thanhphan1147 Sep 17, 2024
90efc1c
Merge remote-tracking branch 'origin/main' into certificates_integration
Thanhphan1147 Sep 19, 2024
7845159
fix naming + catch systemd error + update test
Thanhphan1147 Sep 19, 2024
5e14b7d
add reload error handling and update test
Thanhphan1147 Sep 20, 2024
288d00d
update cert management logic
Thanhphan1147 Sep 23, 2024
e00e12c
update cert management logic
Thanhphan1147 Sep 24, 2024
234127d
update cert management logic
Thanhphan1147 Sep 26, 2024
6a57aa6
fix bandit
Thanhphan1147 Sep 26, 2024
fc7cd8a
run on noble for python3.12
Thanhphan1147 Sep 26, 2024
2da3336
Merge remote-tracking branch 'origin/main' into certificates_integration
Thanhphan1147 Sep 26, 2024
f2344eb
Merge branch 'main' into render_haproxy_config
Thanhphan1147 Aug 19, 2024
df1ee08
remove duplicate
Thanhphan1147 Aug 19, 2024
66ace2b
add tests for tls_relation
Thanhphan1147 Aug 13, 2024
9867f9f
add unit tests for tls_relation
Thanhphan1147 Aug 13, 2024
2ca4ecb
add test_action integration test
Thanhphan1147 Aug 13, 2024
e3367de
fix naming
Thanhphan1147 Aug 13, 2024
a3f0d20
merge main and update decorator position
Thanhphan1147 Sep 10, 2024
98b884c
src-docs
Thanhphan1147 Sep 27, 2024
24fa707
update get_private_key docstring
Thanhphan1147 Sep 28, 2024
3186d0b
update test
Thanhphan1147 Sep 28, 2024
a3a14ef
Merge remote-tracking branch 'origin/main' into add_certificates_rela…
Thanhphan1147 Sep 28, 2024
58a0e38
fix docstring
Thanhphan1147 Sep 28, 2024
a542ab8
remove merge error
Thanhphan1147 Sep 28, 2024
e982905
update readme
Thanhphan1147 Sep 28, 2024
772cbc2
update tests
Thanhphan1147 Sep 30, 2024
64a78d1
Merge branch 'main' into add_certificates_relation_tests
Thanhphan1147 Sep 30, 2024
c362f29
Update docstring for integration tests
Thanhphan1147 Sep 30, 2024
d32edbe
update test_deploy
Thanhphan1147 Sep 30, 2024
422629e
Merge branch 'main' into add_certificates_relation_tests
Thanhphan1147 Oct 1, 2024
a1b3162
use the same method to get the unit IP as other charms. Update action…
Thanhphan1147 Oct 4, 2024
b5b418b
move back to old method of getting unit ip
Thanhphan1147 Oct 4, 2024
5a2facc
move unit address fixture to a helper method
Thanhphan1147 Oct 4, 2024
85b3c71
move error case to a separate test
Thanhphan1147 Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
juju-channel: 3.3/stable
self-hosted-runner: true
charmcraft-channel: latest/edge
modules: '["test_config.py", "test_charm.py"]'
modules: '["test_action.py", "test_config.py", "test_charm.py"]'
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ A Juju charm that deploys and manages haproxy on machine. HAProxy is a TCP/HTTP

# Usage

Deploy the haproxy charm and integrate it with a certificate provider charm
```
juju deploy haproxy
juju deploy haproxy --channel=2.8/edge
juju deploy self-signed-certificates
juju integrate haproxy self-signed-certificates
```

# HAProxy Project Information
Expand Down
73 changes: 73 additions & 0 deletions src-docs/charm.py.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!-- markdownlint-disable -->

<a href="../src/charm.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

# <kbd>module</kbd> `charm.py`
haproxy-operator charm file.

**Global Variables**
---------------
- **TLS_CERT_RELATION**


---

## <kbd>class</kbd> `HAProxyCharm`
Charm haproxy.

<a href="../src/charm.py#L37"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

```python
__init__(*args: Any)
```

Initialize the charm and register event handlers.



**Args:**

- <b>`args`</b>: Arguments to initialize the charm base.


---

#### <kbd>property</kbd> app

Application that this unit is part of.

---

#### <kbd>property</kbd> charm_dir

Root directory of the charm as it is running.

---

#### <kbd>property</kbd> config

A mapping containing the charm's config and current values.

---

#### <kbd>property</kbd> meta

Metadata of this charm.

---

#### <kbd>property</kbd> model

Shortcut for more simple access the model.

---

#### <kbd>property</kbd> unit

Unit that this execution is responsible for.




107 changes: 107 additions & 0 deletions src-docs/haproxy.py.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!-- markdownlint-disable -->

<a href="../src/haproxy.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

# <kbd>module</kbd> `haproxy.py`
The haproxy service module.

**Global Variables**
---------------
- **APT_PACKAGE_VERSION**
- **APT_PACKAGE_NAME**
- **HAPROXY_USER**
- **HAPROXY_DH_PARAM**
- **HAPROXY_SERVICE**

---

<a href="../src/haproxy.py#L106"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `render_file`

```python
render_file(path: Path, content: str, mode: int) → None
```

Write a content rendered from a template to a file.



**Args:**

- <b>`path`</b>: Path object to the file.
- <b>`content`</b>: the data to be written to the file.
- <b>`mode`</b>: access permission mask applied to the file using chmod (e.g. 0o640).


---

## <kbd>class</kbd> `HAProxyService`
HAProxy service class.




---

<a href="../src/haproxy.py#L50"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `install`

```python
install() → None
```

Install the haproxy apt package.



**Raises:**

- <b>`RuntimeError`</b>: If the service is not running after installation.

---

<a href="../src/haproxy.py#L74"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `is_active`

```python
is_active() → bool
```

Indicate if the haproxy service is active.



**Returns:**
True if the haproxy is running.

---

<a href="../src/haproxy.py#L65"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `reconcile`

```python
reconcile(config: CharmConfig) → None
```

Render the haproxy config and reload the haproxy service.



**Args:**

- <b>`config`</b>: charm config


---

## <kbd>class</kbd> `HaproxyServiceReloadError`
Error when reloading the haproxy service.





Loading