Skip to content

enh: add harp config - #382

Open
kyteinsky wants to merge 7 commits into
nextcloud:masterfrom
kyteinsky:enh/harp-config
Open

enh: add harp config#382
kyteinsky wants to merge 7 commits into
nextcloud:masterfrom
kyteinsky:enh/harp-config

Conversation

@kyteinsky

Copy link
Copy Markdown
Contributor

No description provided.

@kyteinsky
kyteinsky marked this pull request as draft February 12, 2025 11:35
Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml Outdated
Comment thread data/nginx/vhost.d/nextcloud.local_location_override Outdated
Comment thread docker-compose.yml Outdated
@kyteinsky

Copy link
Copy Markdown
Contributor Author

container_name seems necessary for dns setting so the proxy _location addition can connect to it
these are the dns names when container does not have an explicit name:

                    "DNSNames": [
                        "master-appapi-harp-1",
                        "2b4545c5162e"
                    ]

@kyteinsky
kyteinsky marked this pull request as ready for review March 3, 2025 14:58
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
Comment thread docker-compose.yml
- "8782:8782"
environment:
- HP_SHARED_KEY=${HP_SHARED_KEY:-some_very_secure_password}
- HP_TRUSTED_PROXY_IPS={HP_TRUSTED_PROXY_IPS:-${DOCKER_SUBNET:-192.168.21.0/24}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does $ is missing here for HP_TRUSTED_PROXY_IPS?

proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 1800s;

set $harp_addr appapi-harp:8780;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my setup the proxy_pass with a variable and a URI part discards the request URI

I used this:

set $harp_upstream http://appapi-harp:8780;
proxy_pass $harp_upstream;

do not know what is more correct, my setup is a fresh one and is not fully tested...

Comment thread docker-compose.yml
network_mode: ${HP_NETWORK_MODE:-master_default}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${CERT_PATH:-./data/ssl/harp/}:/certs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 1329 uses it for appapi-dsp-https as ${CERT_PATH:-./data/ssl/app_api/app_api.pem}:/certs/cert.pem, and example.env:68 documents it as that .pem file. Anyone who uncomments it per example.env gets a single file bind-mounted at HaRP's /certs, where start.sh does mkdir -p /certs/frp on boot, so HaRP will not start. A separate HP_CERT_PATH avoids the clash

Comment thread docker-compose.yml
environment:
- HP_SHARED_KEY=${HP_SHARED_KEY:-some_very_secure_password}
- HP_TRUSTED_PROXY_IPS={HP_TRUSTED_PROXY_IPS:-${DOCKER_SUBNET:-192.168.21.0/24}}
- NC_INSTANCE_URL=${HP_NC_INSTANCE_URL:-http://nextcloud.local}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the stack parameterises host names with ${DOMAIN_SUFFIX} (example.env:38). With e.g. DOMAIN_SUFFIX=.test the vhost becomes nextcloud.test, nginx-proxy finds no matching <host>_location file

Comment thread docker-compose.yml
container_name: appapi-harp
network_mode: ${HP_NETWORK_MODE:-master_default}
volumes:
- /var/run/docker.sock:/var/run/docker.sock

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention here is ${DOCKER_SOCKET-/var/run/docker.sock} (lines 11, 1312, 1328), documented at example.env:62 for rootless Docker

@@ -0,0 +1,11 @@
location /exapps/ {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be good to add:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

here to allow ExApps to receive websocket connections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants