Skip to content

Commit

Permalink
putting this branch to bed (#5)
Browse files Browse the repository at this point in the history
* added some important stuff

* removed placeholder Caddyfile

* updated README

* working again 👍

* Add logging storage (#2) (#3)

* added some important stuff

* removed placeholder Caddyfile

* updated README

Co-authored-by: SamEureka <[email protected]>

Co-authored-by: SamEureka <[email protected]>

* git merge funk... 💣

Co-authored-by: SamEureka <[email protected]>
  • Loading branch information
SamEureka and SamEureka authored Sep 6, 2022
1 parent c45dc0b commit 29e5756
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.formatting.provider": "yapf"
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# <img src="caddy-dumb.png" alt="crappy caddy logo" width="60" /> balenaCaddyReverser
# <img src="caddy-dumb.png" alt="crappy caddy logo" width="60" /> caddy-reverso

__balenaCaddyReverser__ is a Caddy based reverse-proxy server running on your Raspberry Pi! It implements ACME DNS Challenge to obtain tls certificates from Let's Encrypt and is configured via balena device variables in the cloud dashboard. Tested on all Raspberry Pi from v1 to Pi-4-64!
__caddy-reverso__ is a Caddy based reverse-proxy server running on your Raspberry Pi! It implements ACME DNS Challenge to obtain tls certificates from Let's Encrypt and is configured via balena device variables in the cloud dashboard. Tested on all Raspberry Pi from v1 to Pi-4-64!

## Status
* ~~Works!!!~~ I broke some stuff... working on it.
* Works!!! ~~I broke some stuff... working on it.~~
* Needs to be documented properly
* Uses device variables to config the Caddyfile
* Wildcard certificates are working!!
Expand All @@ -14,6 +14,8 @@ __balenaCaddyReverser__ is a Caddy based reverse-proxy server running on your Ra
1. Document
2. Figure out how to publish as an app on [Balena Hub](https://hub.balena.io)
3. Test other DNS providers for the ACME provisioning
4. OAUTH authentication integration ([module](https://github.com/greenpau/caddy-security))
5. Basic authentication integration (should be easy :laughing:)

## Device Variables
|Name|Value|Notes|
Expand Down
10 changes: 3 additions & 7 deletions caddy/caddy-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,7 @@ def write_caddyfile():
## Start the caddy server passing in our new config file.
## If there aren't any HOSTs... don't start Caddy
if (create_env_list() != []):
subprocess.run(['caddy', 'run', '--config', '/etc/caddy/Caddyfile', '--adapter caddyfile'], capture_output=True)
os.system('caddy run --config /etc/caddy/Caddyfile --adapter caddyfile')


## ^^^^ trying `caddy run` instead of `caddy start`

## Idle... I couldn't find a better way to keep the service running.
## Please put in an issue if you know a better way to do this... or better yet, a PR!
#os.system('balena-idle')
## Idle... I like balena-idle as a fallback for troubleshooting. You can comment this out if you like.
os.system('balena-idle')

0 comments on commit 29e5756

Please sign in to comment.