Compare commits

..
2 Commits
Author SHA1 Message Date
Gabriel20xx e3e32f239d Sync shared snapshot from 56e2f60
Docker / Docker Build & Push (push) Successful in 4m15s
2026-09-09 16:53:20 +02:00
Gabriel20xx 878ac92948 Retry Docker Hub login on handshake timeout
Wrap docker/login-action with nick-fields/retry (3 attempts, 15s backoff)
so transient DockerHub TLS handshake timeouts do not fail the build.
2026-09-08 22:36:06 +02:00
4 changed files with 89 additions and 77 deletions

No files matched your search

+75 -72
View File
@@ -1,72 +1,75 @@
name: Docker
on:
push:
branches:
- "**"
paths:
- 'shared/**'
- 'backend/**'
- 'frontend/**'
- 'docker/**'
- '.github/workflows/docker.yml'
pull_request:
branches:
- main
- master
paths:
- 'shared/**'
- 'backend/**'
- 'frontend/**'
- 'docker/**'
- '.github/workflows/docker.yml'
workflow_dispatch: {}
jobs:
build:
name: Docker Build & Push
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
submodules: false
- name: Set up QEMU (multi-arch builds)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/login-action@v4
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ vars.DOCKERHUB_USERNAME }}/collabtableserver
tags: |
type=ref,event=branch
type=sha,prefix=sha-,format=short
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: ./docker/Dockerfile
platforms: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ vars.DOCKERHUB_USERNAME }}/collabtableserver:buildcache
cache-to: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && format('type=registry,ref={0}/collabtableserver:buildcache,mode=max', vars.DOCKERHUB_USERNAME) || '' }}
provenance: false
name: Docker
on:
push:
branches:
- "**"
paths:
- 'shared/**'
- 'backend/**'
- 'frontend/**'
- 'docker/**'
- '.github/workflows/docker.yml'
pull_request:
branches:
- main
- master
paths:
- 'shared/**'
- 'backend/**'
- 'frontend/**'
- 'docker/**'
- '.github/workflows/docker.yml'
workflow_dispatch: {}
jobs:
build:
name: Docker Build & Push
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
submodules: false
- name: Set up QEMU (multi-arch builds)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
retry_wait_seconds: 15
command: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ vars.DOCKERHUB_USERNAME }}" --password-stdin
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ vars.DOCKERHUB_USERNAME }}/collabtableserver
tags: |
type=ref,event=branch
type=sha,prefix=sha-,format=short
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: ./docker/Dockerfile
platforms: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ vars.DOCKERHUB_USERNAME }}/collabtableserver:buildcache
cache-to: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && format('type=registry,ref={0}/collabtableserver:buildcache,mode=max', vars.DOCKERHUB_USERNAME) || '' }}
provenance: false
@@ -201,7 +201,6 @@
class="sc-input"
minlength="8"
name="password"
required
type="password"
bind:value={password}
/>
@@ -229,7 +228,6 @@
class="sc-input"
minlength="8"
name="confirmPassword"
required
type="password"
bind:value={confirmPassword}
/>
@@ -72,6 +72,10 @@
async function createUser(event: SubmitEvent): Promise<void> {
event.preventDefault();
if (!onCreate) return;
if (!newUser.username.trim() && !newUser.email.trim()) {
error = 'A username or email is required.';
return;
}
saving = true;
error = '';
notice = '';
@@ -152,9 +156,9 @@
<form class="sc-user-form" onsubmit={createUser}>
<strong>Add user</strong>
<div class="sc-user-grid">
<input aria-label="New username" class="sc-input" placeholder="Username" required type="text" bind:value={newUser.username} />
<input aria-label="New email" class="sc-input" placeholder="Email" required type="email" bind:value={newUser.email} />
<input aria-label="New password" class="sc-input" minlength="8" placeholder="Password" required type="password" bind:value={newUser.password} />
<input aria-label="New username" class="sc-input" placeholder="Username (optional if email is set)" type="text" bind:value={newUser.username} />
<input aria-label="New email" class="sc-input" placeholder="Email (optional if username is set)" type="email" bind:value={newUser.email} />
<input aria-label="New password" class="sc-input" minlength="8" placeholder="Password (optional)" type="password" bind:value={newUser.password} />
<select aria-label="New role" class="sc-input" disabled={!canAssignAdmin} bind:value={newUser.role}>
<option value="user">User</option>
{#if canAssignAdmin}<option value="admin">Admin</option>{/if}
+7
View File
@@ -60,6 +60,13 @@ export interface ManagedUser {
lastLoginAt?: string | null;
}
/**
* username/email are plain (never undefined) so <input> bindings stay simple
* -- an empty string, not an absent key, is how this form represents "not
* provided". At least one of username/email must be non-empty, and password
* may be left empty entirely; AuthGuard's POST /api/admin/users derives
* whichever of username/password is omitted (see its handleCreateUser).
*/
export interface UserCreateInput {
username: string;
email: string;