Skip to content

Commit

Permalink
Merge pull request #268 from mekanix/feature/apply-proxy
Browse files Browse the repository at this point in the history
Add command to apply PKG_PROXY setting
  • Loading branch information
mekanix committed Jan 10, 2023
2 parents 26d4c79 + d602b50 commit 2f711fa
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ MAKEFILES = ansible.mk \
use.mk
FRAMEWORKS_MAKEFILES = frameworks/freenit.project.mk \
frameworks/freenit.service.mk
SCRIPTS = bhyve-init.sh \
SCRIPTS = apply-proxy.sh \
bhyve-init.sh \
cbsd-init.sh \
chef-provision.sh \
expect-run.sh \
Expand Down
2 changes: 1 addition & 1 deletion cbsd-profile/system/master_poststop.d/deregister.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
LOCK_DIR="${CBSD_WORKDIR}/tmp"
LOCK_FILE="${LOCK_DIR}/cbsd.zone.lock"

Expand Down
2 changes: 1 addition & 1 deletion cbsd-profile/system/master_prestart.d/register.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
LOCK_DIR="${CBSD_WORKDIR}/tmp"
LOCK_FILE="${LOCK_DIR}/cbsd.zone.lock"

Expand Down
2 changes: 1 addition & 1 deletion mk/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUNNING_GID != id -g
UID ?= ${RUNNING_UID}
GID ?= ${RUNNING_GID}
DOMAIN != reggae get-config DOMAIN
CBSD_WORKDIR != sysrc -n cbsd_workdir
CBSD_WORKDIR != sysrc -s cbsdd -n cbsd_workdir
EXTRA_PACKAGES =

.for provisioner in ${PROVISIONERS}
Expand Down
13 changes: 13 additions & 0 deletions scripts/apply-proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh


CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
PKG_PROXY=`reggae get-config PKG_PROXY`

for jname in $(env NOCOLOR=1 cbsd jls header=0 display=jname); do
pkg_file="${CBSD_WORKDIR}/jails-data/${jname}-data/usr/local/etc/pkg.conf"
sed -i "" -r "/^pkg_env.*/d" "${pkg_file}"
if [ "${PKG_PROXY}" != "no" ]; then
echo "pkg_env : { http_proxy: \"http://${PKG_PROXY}/\" }" >>"${pkg_file}"
fi
done
2 changes: 1 addition & 1 deletion scripts/chef-provision.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
SERVICE="${1}"
TYPE="${2}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/import.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
IMAGE_PATH="${1}"
HYPERVISOR="${2:-jail}"
DOMAIN=`reggae get-config DOMAIN`
Expand Down
6 changes: 3 additions & 3 deletions scripts/network-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ setup_pf() {
-e "s;MASTER_IP;${MASTER_IP};g" \
"${SCRIPT_DIR}/../templates/pf.conf" >/etc/pf.conf
fi
sysrc pflog_enable="YES"
sysrc pf_enable="YES"
sysrc blacklistd_enable="YES"
service pflog enable
service pf enable
service blacklistd enable
sysrc sshd_flags+="\-oUseBlacklist=yes"
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/puppet-provision.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
SERVICE="${1}"
TYPE="${2}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/register.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ "${vnet}" != "1" ]; then
fi
. "${PROJECT_ROOT}/scripts/default.conf"

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
NAME=${jname}
IP=${ipv4_first}
ACTION="${1}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/salt-provision.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
SERVICE="${1}"
TYPE="${2}"
PY_VERSION_MAJOR="3"
Expand Down
2 changes: 1 addition & 1 deletion scripts/shell-provision.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

CBSD_WORKDIR=`sysrc -n cbsd_workdir`
CBSD_WORKDIR=`sysrc -s cbsdd -n cbsd_workdir`
SERVICE="${1}"
TYPE="${2}"

Expand Down

0 comments on commit 2f711fa

Please sign in to comment.