First public release. - docs: document the audit log, user offboarding, CSV export and the "require a reason for destructive actions" setting across README, docs/ and CLAUDE/AGENTS.md; note retention for panel_audit - docs: fill the publishing placeholders (repo URL, security contact, issue-template links) and add a semantic-versioning policy - move agent/contributor context into CLAUDE/ (AGENTS.md + a README); root CLAUDE.md is now a thin @-import pointer - add a favicon (shield-lock, matching the login screen) to the login page and the app layout - CHANGELOG: promote [Unreleased] to [1.0.0]; keep the earlier internal build as [0.1.0] Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UfuvfwexztdS7LDpGuKsuK
3.2 KiB
Development
Local setup
git clone https://gitea.kzbikowski.pl/kzbkowski/ADconsle.git adconsole && cd adconsole
composer install
cp .env.example .env
php artisan key:generate
Edit .env for a dev box:
APP_ENV=local
APP_DEBUG=true
LOG_LEVEL=debug
DB_CONNECTION=sqlite # simplest; then: touch database/database.sqlite
php artisan migrate
php artisan serve
You still need a reachable domain controller for the AD-backed screens. Without one, the auth and list pages will error — the test suite does not need a DC (it fakes the guard and mocks LdapRecord).
Tests
php artisan test # everything (~40, SQLite :memory:)
php artisan test --filter=Dashboard # one file / group
composer test # config:clear + test
tests/Unit— pure logic (LdapAttributeHelper,AttributeCipher,MemberOfLoginGroup,OuTreeService).tests/Feature— HTTP: auth, localisation, the About page, attribute config, the audit log and the user CSV export (RefreshDatabase), and the dashboard (seeds thefilecache, no LDAP).tests/TestCase::actingAsPanelAdmin()logs in a fakeApp\Ldap\Useron theldapguard so you can hit protected routes.
PHPUnit tags every test DEPR because PHP 8.5 deprecates a PDO constant PHPUnit
touches. It is not a failure — look at the Tests: summary line.
Code style
vendor/bin/pint # fix
vendor/bin/pint --test # check only (CI)
composer lint / composer format
Match the surrounding code: constructor property promotion, typed properties,
short closures, App\Services for cross-cutting logic. Comments in the codebase
are Polish — keep new ones consistent with the file you're editing.
Adding a translation string
- Add the key to both
lang/pl/<ns>.phpandlang/en/<ns>.php. - Use
__('<ns>.<key>')in Blade/PHP — never inline copy. - Some existing
lang/pl/*values are asserted verbatim bytests/Feature/AttributeConfigTestandAboutPageTest; run the suite after touching PL strings.
Adding an AD attribute to the UI
No code change needed for a plain attribute: /settings → Attributes →
add key / label / ldap name / category / type / column. Computed or
specially-encoded attributes (bit flags, FileTime) need a helper in
App\Services\LdapAttributeHelper and wiring in the relevant controller.
Front-end
public/css/style.css and public/js/main.js are edited directly and served
as-is — no build step. Keep the light/dark (data-bs-theme) treatment working
for anything new: define colours as tokens on :root and override under
[data-bs-theme="dark"].
Database changes
New migrations go in database/migrations. Remember the project rule: no AD
data in SQL — migrations are for app infrastructure and panel_settings-style
config only. PanelSettingsService is the access point for panel config; don't
read the table directly from controllers.
Handy commands
php artisan route:list --path=users
php artisan tinker
php artisan optimize:clear # after .env / config edits
php artisan migrate:fresh # dev DB reset (infra tables only)