Skip to content

Commit 4bb82d4

Browse files
Merge branch 'main' into has/secrethub/oidc-short-sub
2 parents 26708cf + 71d9773 commit 4bb82d4

File tree

15 files changed

+227
-66
lines changed

15 files changed

+227
-66
lines changed

docs/docs/getting-started/changelog.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@ Thank you for using Semaphore!
88
We continuously deploy changes that improve our product for our customers.
99
This page is updated on a weekly basis.
1010

11+
### Week of Sept 29 2025
12+
13+
**(New)** New macOS Image will be released
14+
15+
- Name: macos-xcode26
16+
- Availability: a2-standard-4 agent type
17+
18+
**(New)** New packages:
19+
20+
- Xcode 26
21+
- iOS simulator 26
22+
- iOS simulator 18.6
23+
24+
**(Updated)** Updated packages:
25+
- macOS 16 -> 26
26+
- (System) Ruby 3.4.4 -> 3.4.6
27+
- Flutter 3.32.1 -> 3.35.4
28+
- Homebrew 4.5.3 -> 4.6.11
29+
- Fastlane 2.227.2 -> 2.228.0
30+
- Postgres 14.18 -> 14.19
31+
32+
**(Removed)** Removed packages:
33+
- iOS simulator versions below 18.6
34+
35+
36+
1137
### Week of Jun 9 2025
1238

1339
**(Improved) macos-xcode16 (apple silicon) image update**

encryptor/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ENV APP_NAME=${APP_NAME}
1111
RUN echo "Build of $APP_NAME started"
1212

1313
RUN apt-get update -y && apt-get install --no-install-recommends -y ca-certificates unzip curl libc-bin libc6 \
14-
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
14+
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
1515

1616
WORKDIR /app
1717
COPY pkg pkg
@@ -32,7 +32,7 @@ RUN curl -sL https://github.com/google/protobuf/releases/download/v3.3.0/protoc-
3232
WORKDIR /app
3333
RUN go install github.com/mgechev/[email protected]
3434
RUN go install gotest.tools/[email protected]
35-
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
35+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.7
3636

3737
CMD [ "/bin/bash", "-c \"while sleep 1000; do :; done\"" ]
3838

@@ -48,7 +48,7 @@ LABEL org.opencontainers.image.source https://github.com/semaphoreio/semaphore
4848
# postgresql-client needs to be installed here too,
4949
# otherwise the createdb command won't work.
5050
RUN apt-get update -y && apt-get install --no-install-recommends -y ca-certificates \
51-
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
51+
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
5252

5353
# We don't need Docker health checks, since these containers
5454
# are intended to run in Kubernetes pods, which have probes.

guard/config/config.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,7 @@ config :guard, Guard.OrganizationCleaner,
126126

127127
config :guard, :hard_destroy_grace_period_days, 30
128128

129+
config :guard, :posthog_api_key, ""
130+
config :guard, :posthog_host, "https://app.posthog.com"
131+
129132
import_config "#{config_env()}.exs"

guard/config/runtime.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ config :guard,
166166
:hide_gitlab_login_page,
167167
System.get_env("HIDE_GITLAB_LOGIN_PAGE") == "true"
168168

169+
config :guard, :posthog_api_key, System.get_env("POSTHOG_API_KEY")
170+
config :guard, :posthog_host, System.get_env("POSTHOG_HOST") || "https://app.posthog.com"
171+
169172
if System.get_env("AMQP_URL") != nil do
170173
config :amqp,
171174
connections: [

guard/lib/guard/id/api.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ defmodule Guard.Id.Api do
188188
end
189189

190190
defp render_signup_page(conn, assigns) do
191+
assigns =
192+
Keyword.merge(assigns,
193+
posthog_api_key: Application.get_env(:guard, :posthog_api_key, ""),
194+
posthog_host: Application.get_env(:guard, :posthog_host, "https://app.posthog.com")
195+
)
196+
191197
html_content = Guard.TemplateRenderer.render_template([assigns: assigns], "signup.html")
192198

193199
conn
@@ -326,6 +332,12 @@ defmodule Guard.Id.Api do
326332
end
327333

328334
defp render_login_page(conn, assigns) do
335+
assigns =
336+
Keyword.merge(assigns,
337+
posthog_api_key: Application.get_env(:guard, :posthog_api_key, ""),
338+
posthog_host: Application.get_env(:guard, :posthog_host, "https://app.posthog.com")
339+
)
340+
329341
html_content = Guard.TemplateRenderer.render_template([assigns: assigns], "login.html")
330342

331343
conn

guard/templates/login.html.eex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@
4141
<meta name="twitter:data1" content="1 minute" />
4242
<meta name="twitter:label2" content="Written by" />
4343
<meta name="twitter:data2" content="Semaphore Team" />
44+
<%= if assigns[:posthog_api_key] && assigns[:posthog_api_key] != "" do %>
45+
<script>
46+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init Ce js Ls Te Fs Ds capture Ye calculateEventProperties Us register register_once register_for_session unregister unregister_for_session Ws getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSurveysLoaded onSessionId getSurveys getActiveMatchingSurveys renderSurvey displaySurvey canRenderSurvey canRenderSurveyAsync identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty Bs zs createPersonProfile Hs Ms Gs opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing get_explicit_consent_status is_capturing clear_opt_in_out_capturing Ns debug L qs getPageViewId captureTraceFeedback captureTraceMetric".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
47+
48+
posthog.init('<%= assigns[:posthog_api_key] %>', {
49+
api_host: '<%= assigns[:posthog_host] %>',
50+
defaults: '2025-05-24',
51+
person_profiles: 'identified_only'
52+
});
53+
</script>
54+
<% end %>
4455
</head>
4556
<body class="page-template-default page page-id-19406 wp-embed-responsive no-sidebar">
4657
<div id="page" class="site no-header-no-footer green v8theme ">

guard/templates/signup.html.eex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@
4444
<meta name="twitter:data1" content="1 minute">
4545
<meta name="twitter:label2" content="Written by">
4646
<meta name="twitter:data2" content="Semaphore Team">
47+
<%= if assigns[:posthog_api_key] && assigns[:posthog_api_key] != "" do %>
48+
<script>
49+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init Ce js Ls Te Fs Ds capture Ye calculateEventProperties Us register register_once register_for_session unregister unregister_for_session Ws getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSurveysLoaded onSessionId getSurveys getActiveMatchingSurveys renderSurvey displaySurvey canRenderSurvey canRenderSurveyAsync identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty Bs zs createPersonProfile Hs Ms Gs opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing get_explicit_consent_status is_capturing clear_opt_in_out_capturing Ns debug L qs getPageViewId captureTraceFeedback captureTraceMetric".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
50+
51+
posthog.init('<%= assigns[:posthog_api_key] %>', {
52+
api_host: '<%= assigns[:posthog_host] %>',
53+
defaults: '2025-05-24',
54+
person_profiles: 'identified_only'
55+
});
56+
</script>
57+
<% end %>
4758
</head>
4859
<body class="page-template-default page page-id-19406 wp-embed-responsive no-sidebar">
4960
<header>

public-api-gateway/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ENV APP_NAME=${APP_NAME}
1111
RUN echo "Build of $APP_NAME started"
1212

1313
RUN apt-get update -y && apt-get install --no-install-recommends -y ca-certificates unzip curl libc-bin libc6 \
14-
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
14+
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
1515

1616
WORKDIR /tmp
1717
RUN curl -sL https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip -o protoc && \
@@ -22,8 +22,8 @@ WORKDIR /app
2222

2323
RUN go install github.com/mgechev/[email protected]
2424
RUN go install gotest.tools/[email protected]
25-
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
26-
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
25+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.7
26+
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
2727

2828
FROM base AS dev
2929

repohub/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ RUN curl -sL https://github.com/golang-migrate/migrate/releases/download/v4.18.1
6161

6262
WORKDIR /app
6363
RUN go install github.com/mgechev/[email protected]
64-
RUN go install gotest.tools/gotestsum@latest
65-
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
66-
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
64+
RUN go install gotest.tools/gotestsum@v1.12.1
65+
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
66+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.8
6767

6868
CMD [ "/bin/bash", "-c \"while sleep 1000; do :; done\"" ]
6969

repository_hub/lib/repository_hub/clients/github_client.ex

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ defmodule RepositoryHub.GithubClient do
3232
@err_not_found "Repository not found. If this is a private repository, it looks like you haven't authorized Semaphore with GitHub, please visit https://docs.semaphoreci.com/using-semaphore/connect-github#troubleshooting-guide to read more."
3333
@err_not_authorized "It looks like you haven't authorized Semaphore with GitHub, please visit https://docs.semaphoreci.com/using-semaphore/connect-github#troubleshooting-guide to read more."
3434

35+
@api_url "https://api.github.com"
36+
3537
def repository_permissions(params, opts \\ []) do
3638
owner = params.repo_owner
3739
repo = params.repo_name
@@ -641,33 +643,28 @@ defmodule RepositoryHub.GithubClient do
641643
end
642644

643645
@impl true
646+
# https://docs.github.com/en/rest/repos/webhooks?apiVersion=2022-11-28#delete-a-repository-webhook
644647
def remove_webhook(params, opts \\ []) do
645-
with_client(opts[:token], params.repo_owner, :remove_webhook, fn client ->
646-
client
647-
|> Tentacat.Hooks.remove(
648-
params.repo_owner,
649-
params.repo_name,
650-
params.webhook_id
651-
)
652-
|> case do
653-
{204, _, _} ->
654-
wrap(:ok)
648+
"#{@api_url}/repos/#{params.repo_owner}/#{params.repo_name}/hooks/#{params.webhook_id}"
649+
|> http_delete(opts[:token])
650+
|> unwrap(fn response ->
651+
{response.status_code, response.body, response.headers, response.request_url}
652+
end)
653+
|> unwrap(fn
654+
{204, _, _, _} ->
655+
wrap(:ok)
655656

656-
{307, _, response} ->
657-
fail_with(:precondition, "Removing webhook failed. #{fetch_status_message(response)}")
657+
{404, _, _, _} ->
658+
wrap(:ok)
658659

659-
{404, _, _} ->
660-
wrap(:ok)
661-
662-
{status, _, resp} ->
663-
log_error([
664-
"removing webhook #{params.repo_owner}/#{params.repo_name}",
665-
"status: #{status}",
666-
"response: #{inspect_response(resp)}"
667-
])
660+
{status, encoded_body, _, _} ->
661+
log_error([
662+
"removing webhook #{params.repo_owner}/#{params.repo_name}",
663+
"status: #{status}",
664+
"response: #{inspect(encoded_body)}"
665+
])
668666

669-
fail_with(:precondition, "Removing webhook failed.")
670-
end
667+
fail_with(:precondition, "Removing webhook failed.")
671668
end)
672669
end
673670

@@ -941,6 +938,25 @@ defmodule RepositoryHub.GithubClient do
941938
inspect(%{response | request: %{response.request | headers: request_headers}})
942939
end
943940

941+
defp http_delete(resource, token) do
942+
resource
943+
|> HTTPoison.delete(request_headers(token), options())
944+
end
945+
946+
defp options(opts \\ []) do
947+
[recv_timeout: 25_000]
948+
|> Keyword.merge(opts)
949+
end
950+
951+
defp request_headers(token) do
952+
[
953+
{"Content-Type", "application/json"},
954+
{"Accept", "application/vnd.github+json"},
955+
{"X-GitHub-Api-Version", "2022-11-28"},
956+
{"Authorization", "Bearer #{token}"}
957+
]
958+
end
959+
944960
defmodule Webhook do
945961
def url(project_id) do
946962
host = Application.fetch_env!(:repository_hub, :webhook_host)

0 commit comments

Comments
 (0)