Compare commits
10 Commits
95d953cf13
...
fix/ldap-b
| Author | SHA1 | Date | |
|---|---|---|---|
| d59ec55999 | |||
| 9f47e6e2c8 | |||
| fd53a28f03 | |||
| bbcffe64b7 | |||
| 98abc637c8 | |||
| 236ba9558c | |||
| 5f0b4218ae | |||
| 38b1dd0f4d | |||
| 2b9b2fd32d | |||
| 35f3af9efe |
@@ -63,3 +63,10 @@ AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
|
||||
LDAP_HOST=openldap
|
||||
LDAP_USERNAME="cn=admin,dc=travel,dc=local"
|
||||
LDAP_PASSWORD=adminpassword
|
||||
LDAP_PORT=389
|
||||
LDAP_BASE_DN="dc=travel,dc=local"
|
||||
LDAP_LOGGING=true
|
||||
|
||||
@@ -64,6 +64,16 @@ class User extends Authenticatable implements FilamentUser, LdapAuthenticatable
|
||||
return $this->hasRole('administrator');
|
||||
}
|
||||
|
||||
public function getLdapGuidColumn(): string
|
||||
{
|
||||
return 'ldap_guid';
|
||||
}
|
||||
|
||||
public function getLdapDomainColumn(): string
|
||||
{
|
||||
return 'ldap_domain';
|
||||
}
|
||||
|
||||
public function emergencyContacts(): HasMany
|
||||
{
|
||||
return $this->hasMany(EmergencyContact::class);
|
||||
|
||||
19
compose.yaml
19
compose.yaml
@@ -84,6 +84,7 @@ services:
|
||||
- sail
|
||||
openldap:
|
||||
image: 'osixia/openldap:1.5.0'
|
||||
command: '--copy-service'
|
||||
ports:
|
||||
- '${FORWARD_LDAP_PORT:-389}:389'
|
||||
- '${FORWARD_LDAPS_PORT:-636}:636'
|
||||
@@ -96,8 +97,7 @@ services:
|
||||
LDAP_READONLY_USER_USERNAME: '${LDAP_READONLY_USERNAME:-readonly}'
|
||||
LDAP_READONLY_USER_PASSWORD: '${LDAP_READONLY_PASSWORD:-readonly}'
|
||||
volumes:
|
||||
- 'sail-ldap-data:/var/lib/ldap'
|
||||
- 'sail-ldap-config:/etc/ldap/slapd.d'
|
||||
- './docker/openldap/bootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/bootstrap.ldif'
|
||||
networks:
|
||||
- sail
|
||||
healthcheck:
|
||||
@@ -115,6 +115,17 @@ services:
|
||||
- '${LDAP_ADMIN_PASSWORD:-adminpassword}'
|
||||
retries: 3
|
||||
timeout: 5s
|
||||
phpldapadmin:
|
||||
image: 'osixia/phpldapadmin:latest'
|
||||
ports:
|
||||
- '${FORWARD_PHPLDAPADMIN_PORT:-8085}:80'
|
||||
environment:
|
||||
PHPLDAPADMIN_LDAP_HOSTS: openldap
|
||||
PHPLDAPADMIN_HTTPS: 'false'
|
||||
networks:
|
||||
- sail
|
||||
depends_on:
|
||||
- openldap
|
||||
networks:
|
||||
sail:
|
||||
driver: bridge
|
||||
@@ -123,7 +134,3 @@ volumes:
|
||||
driver: local
|
||||
sail-redis:
|
||||
driver: local
|
||||
sail-ldap-data:
|
||||
driver: local
|
||||
sail-ldap-config:
|
||||
driver: local
|
||||
|
||||
46
docker/openldap/bootstrap.ldif
Normal file
46
docker/openldap/bootstrap.ldif
Normal file
@@ -0,0 +1,46 @@
|
||||
# People OU
|
||||
dn: ou=people,dc=travel,dc=local
|
||||
objectClass: organizationalUnit
|
||||
ou: people
|
||||
|
||||
# Administrator
|
||||
dn: uid=admin,ou=people,dc=travel,dc=local
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: posixAccount
|
||||
objectClass: shadowAccount
|
||||
cn: Administrator
|
||||
sn: Administrator
|
||||
uid: admin
|
||||
mail: admin@travel.local
|
||||
uidNumber: 1000
|
||||
gidNumber: 1000
|
||||
homeDirectory: /home/admin
|
||||
userPassword: password
|
||||
|
||||
# Travel Approver
|
||||
dn: uid=approver,ou=people,dc=travel,dc=local
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: posixAccount
|
||||
objectClass: shadowAccount
|
||||
cn: Travel Approver
|
||||
sn: Approver
|
||||
uid: approver
|
||||
mail: approver@travel.local
|
||||
uidNumber: 1001
|
||||
gidNumber: 1000
|
||||
homeDirectory: /home/approver
|
||||
userPassword: password
|
||||
|
||||
# Staff Member
|
||||
dn: uid=staff,ou=people,dc=travel,dc=local
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: posixAccount
|
||||
objectClass: shadowAccount
|
||||
cn: Staff Member
|
||||
sn: Member
|
||||
uid: staff
|
||||
mail: staff@travel.local
|
||||
uidNumber: 1002
|
||||
gidNumber: 1000
|
||||
homeDirectory: /home/staff
|
||||
userPassword: password
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as bootstrap from 'bootstrap';
|
||||
import './../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js';
|
||||
|
||||
window.bootstrap = bootstrap;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" x-data x-init="
|
||||
const saved = localStorage.getItem('theme');
|
||||
if (saved) { document.documentElement.setAttribute('data-bs-theme', saved); }
|
||||
">
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
|
||||
x-data="{ theme: localStorage.getItem('theme') || 'light' }"
|
||||
x-init="$watch('theme', val => { document.documentElement.setAttribute('data-bs-theme', val); localStorage.setItem('theme', val); }); document.documentElement.setAttribute('data-bs-theme', theme);"
|
||||
:data-bs-theme="theme"
|
||||
>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -43,16 +44,11 @@
|
||||
<li class="nav-item me-2">
|
||||
<button
|
||||
class="btn btn-sm btn-outline-light"
|
||||
x-on:click="
|
||||
const current = document.documentElement.getAttribute('data-bs-theme');
|
||||
const next = current === 'dark' ? 'light' : 'dark';
|
||||
document.documentElement.setAttribute('data-bs-theme', next);
|
||||
localStorage.setItem('theme', next);
|
||||
"
|
||||
x-on:click="theme = theme === 'dark' ? 'light' : 'dark'"
|
||||
title="Toggle dark/light mode"
|
||||
>
|
||||
<span x-show="document.documentElement.getAttribute('data-bs-theme') !== 'dark'">🌙</span>
|
||||
<span x-show="document.documentElement.getAttribute('data-bs-theme') === 'dark'">☀️</span>
|
||||
<span x-show="theme !== 'dark'">🌙</span>
|
||||
<span x-show="theme === 'dark'">☀️</span>
|
||||
</button>
|
||||
</li>
|
||||
@auth
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
|
||||
x-data="{ theme: localStorage.getItem('theme') || 'light' }"
|
||||
x-init="document.documentElement.setAttribute('data-bs-theme', theme);"
|
||||
:data-bs-theme="theme"
|
||||
>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -8,7 +12,7 @@
|
||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||
@livewireStyles
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<body>
|
||||
{{ $slot }}
|
||||
@livewireScripts
|
||||
</body>
|
||||
|
||||
@@ -18,7 +18,7 @@ new #[Layout('components.layouts.guest')] class extends Component {
|
||||
{
|
||||
$this->validate();
|
||||
|
||||
if (Auth::attempt(['username' => $this->username, 'password' => $this->password], $this->rememberMe)) {
|
||||
if (Auth::attempt(['uid' => $this->username, 'password' => $this->password], $this->rememberMe)) {
|
||||
session()->regenerate();
|
||||
$this->redirectIntended(route('dashboard'), navigate: true);
|
||||
return;
|
||||
@@ -29,7 +29,7 @@ new #[Layout('components.layouts.guest')] class extends Component {
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="min-vh-100 d-flex align-items-center justify-content-center bg-light">
|
||||
<div class="min-vh-100 d-flex align-items-center justify-content-center">
|
||||
<div class="card shadow-sm" style="width: 100%; max-width: 420px;">
|
||||
<div class="card-body p-4">
|
||||
<div class="text-center mb-4">
|
||||
|
||||
@@ -318,7 +318,7 @@ new #[Layout('components.layouts.app')] class extends Component {
|
||||
@error('journeys') <div class="alert alert-danger">{{ $message }}</div> @enderror
|
||||
|
||||
@foreach ($journeys as $i => $journey)
|
||||
<div class="border rounded p-3 mb-3 bg-light" wire:key="journey-{{ $i }}">
|
||||
<div class="border rounded p-3 mb-3" wire:key="journey-{{ $i }}">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<strong class="small">Journey {{ $i + 1 }}</strong>
|
||||
@if (count($journeys) > 1)
|
||||
@@ -413,7 +413,7 @@ new #[Layout('components.layouts.app')] class extends Component {
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@foreach ($costCodes as $i => $code)
|
||||
<div class="border rounded p-3 mb-3 bg-light" wire:key="code-{{ $i }}">
|
||||
<div class="border rounded p-3 mb-3" wire:key="code-{{ $i }}">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<strong class="small">Cost Code {{ $i + 1 }}</strong>
|
||||
@if (count($costCodes) > 1)
|
||||
|
||||
Reference in New Issue
Block a user