Compare commits
6 Commits
6cde90042e
...
496b50ed12
| Author | SHA1 | Date | |
|---|---|---|---|
| 496b50ed12 | |||
| 50e3ff6ded | |||
| fdf8d65310 | |||
| c2140b4493 | |||
| 652cf8bd6a | |||
| 5fdc0d45e3 |
@@ -3,23 +3,12 @@ run-name: ${{ gitea.event.head_commit.message }}
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- dev
|
||||||
- master
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
|
||||||
runs-on: debian-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install Bats
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y bats
|
|
||||||
- name: Run Shell Tests
|
|
||||||
run: bats tests/shell/git_update.bats
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
if: gitea.ref_name == 'master'
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
needs: test
|
|
||||||
steps:
|
steps:
|
||||||
- name: Custom Checkout
|
- name: Custom Checkout
|
||||||
env:
|
env:
|
||||||
@@ -43,6 +32,7 @@ jobs:
|
|||||||
rm .vault_pass.txt
|
rm .vault_pass.txt
|
||||||
|
|
||||||
promote_stable:
|
promote_stable:
|
||||||
|
if: gitea.ref_name == 'master'
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
needs: deploy
|
needs: deploy
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ const StatusIcon = ({ status = 'bad', tooltip }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Acp({ isAdmin }) {
|
function Acp({ isAdmin }) {
|
||||||
const forcedMinPhpForTesting = '>=8.5'
|
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { roles: authRoles } = useAuth()
|
const { roles: authRoles } = useAuth()
|
||||||
const canManageFounder = authRoles.includes('ROLE_FOUNDER')
|
const canManageFounder = authRoles.includes('ROLE_FOUNDER')
|
||||||
@@ -470,11 +469,21 @@ function Acp({ isAdmin }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cliDefaultPhpIsSufficient = useMemo(() => {
|
const cliDefaultPhpIsSufficient = useMemo(() => {
|
||||||
|
const minimum = parseMinPhpConstraint(systemStatus?.min_versions?.php)
|
||||||
const current = normalizeSemver(systemStatus?.php_default_version)
|
const current = normalizeSemver(systemStatus?.php_default_version)
|
||||||
const minimum = parseMinPhpConstraint(forcedMinPhpForTesting || systemStatus?.min_versions?.php)
|
if (!minimum) return true
|
||||||
if (!current || !minimum) return false
|
if (!current) return false
|
||||||
return compareSemver(current, minimum) >= 0
|
return compareSemver(current, minimum) >= 0
|
||||||
}, [systemStatus, forcedMinPhpForTesting])
|
}, [systemStatus])
|
||||||
|
|
||||||
|
const phpSelectedIsSufficient = useMemo(() => {
|
||||||
|
if (!systemStatus?.php_selected_ok) return false
|
||||||
|
const minimum = parseMinPhpConstraint(systemStatus?.min_versions?.php)
|
||||||
|
const current = normalizeSemver(systemStatus?.php_selected_version)
|
||||||
|
if (!minimum) return true
|
||||||
|
if (!current) return false
|
||||||
|
return compareSemver(current, minimum) >= 0
|
||||||
|
}, [systemStatus])
|
||||||
|
|
||||||
const systemChecks = useMemo(() => {
|
const systemChecks = useMemo(() => {
|
||||||
if (!systemStatus) return []
|
if (!systemStatus) return []
|
||||||
@@ -483,9 +492,9 @@ function Acp({ isAdmin }) {
|
|||||||
id: 'php',
|
id: 'php',
|
||||||
label: 'PHP',
|
label: 'PHP',
|
||||||
path: systemStatus.php_selected_path || '—',
|
path: systemStatus.php_selected_path || '—',
|
||||||
min: forcedMinPhpForTesting || systemStatus.min_versions?.php || '—',
|
min: systemStatus.min_versions?.php || '—',
|
||||||
current: systemStatus.php_selected_version || '—',
|
current: systemStatus.php_selected_version || '—',
|
||||||
status: systemStatus.php_selected_ok ? 'ok' : 'bad',
|
status: phpSelectedIsSufficient ? 'ok' : 'bad',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'composer',
|
id: 'composer',
|
||||||
@@ -563,7 +572,7 @@ function Acp({ isAdmin }) {
|
|||||||
status: systemStatus.updates_writable ? 'ok' : 'bad',
|
status: systemStatus.updates_writable ? 'ok' : 'bad',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}, [systemStatus, t])
|
}, [phpSelectedIsSufficient, systemStatus, t])
|
||||||
|
|
||||||
const visibleSystemChecks = useMemo(() => {
|
const visibleSystemChecks = useMemo(() => {
|
||||||
const visibilityBySection = {
|
const visibilityBySection = {
|
||||||
@@ -3906,7 +3915,7 @@ function Acp({ isAdmin }) {
|
|||||||
)}
|
)}
|
||||||
<Form.Text className="bb-muted">
|
<Form.Text className="bb-muted">
|
||||||
Minimum required PHP (from composer.json):{' '}
|
Minimum required PHP (from composer.json):{' '}
|
||||||
{(forcedMinPhpForTesting || systemStatus?.min_versions?.php) || 'unknown'}. Use a custom binary
|
{systemStatus?.min_versions?.php || 'unknown'}. Use a custom binary
|
||||||
on like php84. On KeyHelp setups use e.g. `keyhelp-php84`.
|
on like php84. On KeyHelp setups use e.g. `keyhelp-php84`.
|
||||||
</Form.Text>
|
</Form.Text>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Button, Card, Container, Form } from 'react-bootstrap'
|
import { Button, Card, Container, Form } from 'react-bootstrap'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { Link, useNavigate } from 'react-router-dom'
|
||||||
import { useAuth } from '../context/AuthContext'
|
import { useAuth } from '../context/AuthContext'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
@@ -53,10 +53,18 @@ export default function Login() {
|
|||||||
onChange={(event) => setPassword(event.target.value)}
|
onChange={(event) => setPassword(event.target.value)}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
<div className="mt-2 text-end">
|
||||||
|
<Link to="/reset-password">{t('auth.forgot_password')}</Link>
|
||||||
|
</div>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
<div className="d-flex gap-2">
|
||||||
|
<Button as={Link} to="/" type="button" variant="outline-secondary" disabled={loading}>
|
||||||
|
{t('acp.cancel')}
|
||||||
|
</Button>
|
||||||
<Button type="submit" variant="dark" disabled={loading}>
|
<Button type="submit" variant="dark" disabled={loading}>
|
||||||
{loading ? t('form.signing_in') : t('form.sign_in')}
|
{loading ? t('form.signing_in') : t('form.sign_in')}
|
||||||
</Button>
|
</Button>
|
||||||
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</Card.Body>
|
</Card.Body>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
"auth.login_title": "Anmelden",
|
"auth.login_title": "Anmelden",
|
||||||
"auth.login_identifier": "E-Mail oder Benutzername",
|
"auth.login_identifier": "E-Mail oder Benutzername",
|
||||||
"auth.login_placeholder": "name@example.com oder benutzername",
|
"auth.login_placeholder": "name@example.com oder benutzername",
|
||||||
|
"auth.forgot_password": "Passwort vergessen?",
|
||||||
"auth.register_hint": "Registriere dich mit E-Mail und einem eindeutigen Benutzernamen.",
|
"auth.register_hint": "Registriere dich mit E-Mail und einem eindeutigen Benutzernamen.",
|
||||||
"auth.verify_notice": "Bitte bestätige deine E-Mail-Adresse, bevor du dich anmeldest.",
|
"auth.verify_notice": "Bitte bestätige deine E-Mail-Adresse, bevor du dich anmeldest.",
|
||||||
"auth.register_title": "Konto erstellen",
|
"auth.register_title": "Konto erstellen",
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
"auth.login_title": "Log in",
|
"auth.login_title": "Log in",
|
||||||
"auth.login_identifier": "Email or username",
|
"auth.login_identifier": "Email or username",
|
||||||
"auth.login_placeholder": "name@example.com or username",
|
"auth.login_placeholder": "name@example.com or username",
|
||||||
|
"auth.forgot_password": "Forgot password?",
|
||||||
"auth.register_hint": "Register with an email and a unique username.",
|
"auth.register_hint": "Register with an email and a unique username.",
|
||||||
"auth.verify_notice": "Check your email to verify your account before logging in.",
|
"auth.verify_notice": "Check your email to verify your account before logging in.",
|
||||||
"auth.register_title": "Create account",
|
"auth.register_title": "Create account",
|
||||||
|
|||||||
12
tests/run-shell-tests.sh
Normal file
12
tests/run-shell-tests.sh
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
cd "$ROOT_DIR"
|
||||||
|
|
||||||
|
if ! command -v bats >/dev/null 2>&1; then
|
||||||
|
echo "bats is not installed. Install with: brew install bats-core" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
bats tests/shell/git_update.bats
|
||||||
Reference in New Issue
Block a user