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
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||||
|
|
||||||
VITE_APP_NAME="${APP_NAME}"
|
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');
|
return $this->hasRole('administrator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getLdapGuidColumn(): string
|
||||||
|
{
|
||||||
|
return 'ldap_guid';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLdapDomainColumn(): string
|
||||||
|
{
|
||||||
|
return 'ldap_domain';
|
||||||
|
}
|
||||||
|
|
||||||
public function emergencyContacts(): HasMany
|
public function emergencyContacts(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(EmergencyContact::class);
|
return $this->hasMany(EmergencyContact::class);
|
||||||
|
|||||||
19
compose.yaml
19
compose.yaml
@@ -84,6 +84,7 @@ services:
|
|||||||
- sail
|
- sail
|
||||||
openldap:
|
openldap:
|
||||||
image: 'osixia/openldap:1.5.0'
|
image: 'osixia/openldap:1.5.0'
|
||||||
|
command: '--copy-service'
|
||||||
ports:
|
ports:
|
||||||
- '${FORWARD_LDAP_PORT:-389}:389'
|
- '${FORWARD_LDAP_PORT:-389}:389'
|
||||||
- '${FORWARD_LDAPS_PORT:-636}:636'
|
- '${FORWARD_LDAPS_PORT:-636}:636'
|
||||||
@@ -96,8 +97,7 @@ services:
|
|||||||
LDAP_READONLY_USER_USERNAME: '${LDAP_READONLY_USERNAME:-readonly}'
|
LDAP_READONLY_USER_USERNAME: '${LDAP_READONLY_USERNAME:-readonly}'
|
||||||
LDAP_READONLY_USER_PASSWORD: '${LDAP_READONLY_PASSWORD:-readonly}'
|
LDAP_READONLY_USER_PASSWORD: '${LDAP_READONLY_PASSWORD:-readonly}'
|
||||||
volumes:
|
volumes:
|
||||||
- 'sail-ldap-data:/var/lib/ldap'
|
- './docker/openldap/bootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom/bootstrap.ldif'
|
||||||
- 'sail-ldap-config:/etc/ldap/slapd.d'
|
|
||||||
networks:
|
networks:
|
||||||
- sail
|
- sail
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -115,6 +115,17 @@ services:
|
|||||||
- '${LDAP_ADMIN_PASSWORD:-adminpassword}'
|
- '${LDAP_ADMIN_PASSWORD:-adminpassword}'
|
||||||
retries: 3
|
retries: 3
|
||||||
timeout: 5s
|
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:
|
networks:
|
||||||
sail:
|
sail:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
@@ -123,7 +134,3 @@ volumes:
|
|||||||
driver: local
|
driver: local
|
||||||
sail-redis:
|
sail-redis:
|
||||||
driver: local
|
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 * as bootstrap from 'bootstrap';
|
||||||
import './../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js';
|
|
||||||
|
|
||||||
window.bootstrap = bootstrap;
|
window.bootstrap = bootstrap;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" x-data x-init="
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"
|
||||||
const saved = localStorage.getItem('theme');
|
x-data="{ theme: localStorage.getItem('theme') || 'light' }"
|
||||||
if (saved) { document.documentElement.setAttribute('data-bs-theme', saved); }
|
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>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
@@ -43,16 +44,11 @@
|
|||||||
<li class="nav-item me-2">
|
<li class="nav-item me-2">
|
||||||
<button
|
<button
|
||||||
class="btn btn-sm btn-outline-light"
|
class="btn btn-sm btn-outline-light"
|
||||||
x-on:click="
|
x-on:click="theme = theme === 'dark' ? 'light' : 'dark'"
|
||||||
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);
|
|
||||||
"
|
|
||||||
title="Toggle dark/light mode"
|
title="Toggle dark/light mode"
|
||||||
>
|
>
|
||||||
<span x-show="document.documentElement.getAttribute('data-bs-theme') !== 'dark'">🌙</span>
|
<span x-show="theme !== 'dark'">🌙</span>
|
||||||
<span x-show="document.documentElement.getAttribute('data-bs-theme') === 'dark'">☀️</span>
|
<span x-show="theme === 'dark'">☀️</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
@auth
|
@auth
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<!doctype html>
|
<!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>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
@@ -8,7 +12,7 @@
|
|||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
@livewireStyles
|
@livewireStyles
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-light">
|
<body>
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
@livewireScripts
|
@livewireScripts
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ new #[Layout('components.layouts.guest')] class extends Component {
|
|||||||
{
|
{
|
||||||
$this->validate();
|
$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();
|
session()->regenerate();
|
||||||
$this->redirectIntended(route('dashboard'), navigate: true);
|
$this->redirectIntended(route('dashboard'), navigate: true);
|
||||||
return;
|
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 shadow-sm" style="width: 100%; max-width: 420px;">
|
||||||
<div class="card-body p-4">
|
<div class="card-body p-4">
|
||||||
<div class="text-center mb-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
|
@error('journeys') <div class="alert alert-danger">{{ $message }}</div> @enderror
|
||||||
|
|
||||||
@foreach ($journeys as $i => $journey)
|
@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">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<strong class="small">Journey {{ $i + 1 }}</strong>
|
<strong class="small">Journey {{ $i + 1 }}</strong>
|
||||||
@if (count($journeys) > 1)
|
@if (count($journeys) > 1)
|
||||||
@@ -413,7 +413,7 @@ new #[Layout('components.layouts.app')] class extends Component {
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@foreach ($costCodes as $i => $code)
|
@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">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<strong class="small">Cost Code {{ $i + 1 }}</strong>
|
<strong class="small">Cost Code {{ $i + 1 }}</strong>
|
||||||
@if (count($costCodes) > 1)
|
@if (count($costCodes) > 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user