Skip to content

Commit

Permalink
churn
Browse files Browse the repository at this point in the history
  • Loading branch information
dubo-dubon-duponey committed Mar 18, 2024
1 parent 74d9aa9 commit 95426ab
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
sudo chown -R 2000:root "$GITHUB_WORKSPACE/cache/apt"
sudo chown -R 2000:root "$GITHUB_WORKSPACE/cache/certs"
sudo chown -R $(id -u) "$GITHUB_WORKSPACE/cache/bin"
sudo chmod g+w "$GITHUB_WORKSPACE/cache"
sudo chown $(id -u) "$GITHUB_WORKSPACE/cache"
- name: Start apt proxy
run: |
Expand Down
30 changes: 28 additions & 2 deletions context/runtime/boot/mdns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ mdns::records::resolve(){
printf "%s %s" "$server" "$port"
}

mdns::start::default(){
local host="${1:-}"
local name="${2:-}"
local with_http_proxy="${3:-}"
local with_http_proxy_https="${4:-}"
local with_tls_proxy="${5:-}"
local with_station="${6:-}"
local type="${7:-}"

local http_proxy_https_port="${7:-443}"
local http_proxy_http_port="${8:-80}"
local tls_proxy_port="${9:-443}"

local port="$tls_proxy_port"

[ "$with_http_proxy" != true ] || {
port="$([ "$with_http_proxy_https" == true ] && printf "%s" "$http_proxy_https_port" || printf "%s" "$http_proxy_http_port")"
type="${type:-_http._tcp}"
}
[ "$with_tls_proxy" != true ] || type="${type:-_tls._tcp}"

mdns::records::add "$type" "$host" "$name" "$port"
[ "$with_station" != true ] || mdns::records::add "_workstation._tcp" "$host" "$name" "$port"
mdns::start::broadcaster
}

mdns::start::broadcaster(){
[ ! -e "$_default_mod_mdns_configuration_path" ] || mdns::records::load "$_default_mod_mdns_configuration_path"
local IFS=","
Expand Down Expand Up @@ -83,10 +109,10 @@ mdns::start::dbus(){
# https://man7.org/linux/man-pages/man3/sd_bus_default.3.html
# https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html

# $XDG_STATE_HOME=/tmp/state
# $XDG_RUNTIME_DIR=/tmp/runtime
# Configuration file also has that ^ hardcoded, so, cannot use the variable...

local dbussocket=/tmp/state/dbus/system_bus_socket
local dbussocket=/tmp/runtime/dbus/system_bus_socket

# Ensure directory exists
helpers::dir::writable "$(dirname "$dbussocket")" create
Expand Down

0 comments on commit 95426ab

Please sign in to comment.