source service goes through squid caching

This commit is contained in:
2026-02-06 19:09:42 +08:00
parent 215634aad8
commit 35b0f19626
4 changed files with 20 additions and 0 deletions

View File

@@ -50,6 +50,13 @@ if [ "${OBS_COMPONENT}" = "source" ]; then
chmod 777 /srv/obs/run
# scmbridge switch users but invokes git with HOME=/root
chmod 777 /root
# configure proxy for servicedispatch, if specified
if [ -n "${BS_SERVICE_PROXY}" ]; then
update-ca-certificates
sed -i "s#BS_SERVICEDISPATCH_ENV_REPLACE#environment=http_proxy=\"${BS_SERVICE_PROXY}\", https_proxy=\"${BS_SERVICE_PROXY}\"#" /obs/supervisord.conf.d/obs_source_server.conf
else
sed -i "s#BS_SERVICEDISPATCH_ENV_REPLACE##" /obs/supervisord.conf.d/obs_source_server.conf
fi
supervisord -c /obs/supervisord.conf.d/obs_source_server.conf
elif [ "${OBS_COMPONENT}" = "binary" ]; then
prepare_bs_schd

View File

@@ -4,6 +4,7 @@ files=supervisord.conf
[program:bs_service]
command=/usr/lib/obs/server/bs_service
redirect_stderr=1
BS_SERVICEDISPATCH_ENV_REPLACE
[program:bs_srcserver]
command=/usr/lib/obs/server/bs_srcserver

View File

@@ -35,6 +35,15 @@
dest: "{{ OBS_DEPLOY_LOCATION }}/source/volume/scmbridge-conf/critical-instances"
content: |
build.opensuse.org
- name: Populate Volume - CA cert
ansible.builtin.file:
path: "{{ OBS_DEPLOY_LOCATION }}/source/volume/cert"
state: directory
- name: Populate Volume - OBS Cache CA
ansible.builtin.copy:
dest: "{{ OBS_DEPLOY_LOCATION }}/source/volume/cert/obs-cache.pem"
content: "{{ lookup('ansible.builtin.file', (groups['obs_cache'][0] | extract(hostvars))['CACHE_SSL_CA_PEM']) | regex_search('-----BEGIN CERTIFICATE-----[\\s\\S]*-----END CERTIFICATE-----', multiline=True) }}"
notify: Restart Container
- name: Force Restart Containers
when: restart_container is defined
changed_when: true

View File

@@ -9,6 +9,8 @@ services:
OBS_SRC_SERVER: http://127.0.0.1:5352
OBS_REPO_SERVER: http://{{ (groups['obs_repo'][0] | extract(hostvars))['ansible_host'] }}:{{ (groups['obs_repo'][0] | extract(hostvars))['PORT'] }}
OBS_SERVICE_SERVER: http://127.0.0.1:5152
BS_SERVICE_PROXY: {{ BS_SERVICE_PROXY }}
ports:
- 0.0.0.0:{{ SRC_PORT }}:5352
- 0.0.0.0:{{ SRV_PORT }}:5152
@@ -18,4 +20,5 @@ services:
- ./volume/log:/var/log/supervisord
- ./volume/scmbridge-conf:/etc/obs/services/scm-bridge/
- ./volume/ssh:/srv/obs/service/.ssh
- ./volume/cert:/etc/pki/trust/anchors/
restart: unless-stopped