1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00
This commit is contained in:
yalh76 2023-05-29 15:43:13 +02:00 committed by GitHub
commit 48e5982156
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 89 additions and 1 deletions

View file

@ -143,3 +143,17 @@ TRUST_PROXIES="*"
## Passport
#PASSPORT_PRIVATE_KEY=
#PASSPORT_PUBLIC_KEY=
## LDAP
LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_CONNECTIONS=default
LDAP_DEFAULT_HOSTS=127.0.0.1
LDAP_DEFAULT_USERNAME=null
LDAP_DEFAULT_PASSWORD=null
LDAP_DEFAULT_PORT=389
LDAP_DEFAULT_BASE_DN="ou=users,dc=yunohost,dc=org"
LDAP_DEFAULT_TIMEOUT=5
LDAP_DEFAULT_SSL=false
LDAP_DEFAULT_TLS=false

View file

@ -8,7 +8,7 @@ YNH_PHP_VERSION="8.2"
YNH_COMPOSER_VERSION="2.2.21"
pkg_dependencies="postgresql libgd3 jpegoptim optipng pngquant ffmpeg imagemagick supervisor php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-ctype php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-iconv php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-imagick"
pkg_dependencies="postgresql libgd3 jpegoptim optipng pngquant ffmpeg imagemagick supervisor php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-ctype php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-iconv php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-ldap"
#=================================================
# PERSONAL HELPERS

View file

@ -0,0 +1,45 @@
--- a/config/auth.php
+++ b/config/auth.php
@@ -67,25 +67,25 @@
'providers' => [
// Comment out or remove below for LDAP
- 'users' => [
- 'driver' => 'eloquent',
- 'model' => App\User::class,
- ],
-
- // Uncomment below for LDAP
// 'users' => [
- // 'driver' => 'ldap',
- // 'model' => LdapRecord\Models\ActiveDirectory\User::class,
- // 'rules' => [],
- // 'database' => [
- // 'model' => App\User::class,
- // 'sync_passwords' => false,
- // 'sync_attributes' => [
- // 'name' => 'cn',
- // 'email' => 'mail',
- // ],
- // ],
+ // 'driver' => 'eloquent',
+ // 'model' => App\User::class,
// ],
+
+ // Uncomment below for LDAP
+ 'users' => [
+ 'driver' => 'ldap',
+ 'model' => LdapRecord\Models\ActiveDirectory\User::class,
+ 'rules' => [],
+ 'database' => [
+ 'model' => App\User::class,
+ 'sync_passwords' => false,
+ 'sync_attributes' => [
+ 'name' => 'uid',
+ 'email' => 'mail',
+ ],
+ ],
+ ],
],
/*

View file

@ -0,0 +1,11 @@
--- a/composer.json
+++ b/composer.json
@@ -9,6 +9,8 @@
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-curl": "*",
+ "ext-ldap": "*",
+ "directorytree/ldaprecord-laravel": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",

View file

@ -0,0 +1,18 @@
--- a/app/User.php
+++ b/app/User.php
@@ -7,10 +7,13 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use App\Util\RateLimit\User as UserRateLimit;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use LdapRecord\Laravel\Auth\LdapAuthenticatable;
+use LdapRecord\Laravel\Auth\AuthenticatesWithLdap;
-class User extends Authenticatable
+class User extends Authenticatable implements LdapAuthenticatable
{
- use Notifiable, SoftDeletes, HasApiTokens, UserRateLimit;
+ use Notifiable, SoftDeletes, HasApiTokens, UserRateLimit, HasFactory, AuthenticatesWithLdap;
/**
* The attributes that should be mutated to dates.