Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi committed Mar 20, 2024
1 parent 0cc3391 commit 55e5b04
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ [email protected]
# Make sure that these directories exist, with write permissions for your server.
# USE ABSOLUTE PATHS for better predictability
WEBDAV_TMP_DIR='/tmp'
WEBDAV_PUBLIC_DIR='/webdav'
WEBDAV_PUBLIC_DIR='/webdav/public'
WEBDAV_HOMES_DIR='/webdav/homes'

# Logging path
# By default, it will log in the standard Symfony directory: var/log/prod.log (for production)
Expand Down
1 change: 1 addition & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ services:
$authMethod: "%env(AUTH_METHOD)%"
$authRealm: "%env(AUTH_REALM)%"
$webdavPublicDir: "%env(resolve:WEBDAV_PUBLIC_DIR)%"
$webdavHomesDir: "%env(resolve:WEBDAV_HOMES_DIR)%"
$webdavTmpDir: "%env(resolve:WEBDAV_TMP_DIR)%"

App\Security\LoginFormAuthenticator:
Expand Down
12 changes: 10 additions & 2 deletions src/Controller/DAVController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ class DAVController extends AbstractController
*/
protected $webdavPublicDir;

/**
* WebDAV User Homes directory.
*
* @var string
*/
protected $webdavHomesDir;

/**
* WebDAV Temporary directory.
*
Expand Down Expand Up @@ -128,7 +135,7 @@ class DAVController extends AbstractController
*/
protected $server;

public function __construct(MailerInterface $mailer, BasicAuth $basicAuthBackend, IMAPAuth $IMAPAuthBackend, LDAPAuth $LDAPAuthBackend, UrlGeneratorInterface $router, EntityManagerInterface $entityManager, LoggerInterface $logger, string $publicDir, bool $calDAVEnabled = true, bool $cardDAVEnabled = true, bool $webDAVEnabled = false, string $inviteAddress = null, string $authMethod = null, string $authRealm = null, string $webdavPublicDir = null, string $webdavTmpDir = null)
public function __construct(MailerInterface $mailer, BasicAuth $basicAuthBackend, IMAPAuth $IMAPAuthBackend, LDAPAuth $LDAPAuthBackend, UrlGeneratorInterface $router, EntityManagerInterface $entityManager, LoggerInterface $logger, string $publicDir, bool $calDAVEnabled = true, bool $cardDAVEnabled = true, bool $webDAVEnabled = false, string $inviteAddress = null, string $authMethod = null, string $authRealm = null, string $webdavPublicDir = null, string $webdavHomesDir = null, string $webdavTmpDir = null)
{
$this->publicDir = $publicDir;

Expand All @@ -138,6 +145,7 @@ public function __construct(MailerInterface $mailer, BasicAuth $basicAuthBackend
$this->inviteAddress = $inviteAddress ?? null;

$this->webdavPublicDir = $webdavPublicDir;
$this->webdavHomesDir = $webdavHomesDir;
$this->webdavTmpDir = $webdavTmpDir;

$this->em = $entityManager;
Expand Down Expand Up @@ -207,7 +215,7 @@ private function initServer(string $authMethod, string $authRealm = User::DEFAUL
$nodes = [
// /principals
new \Sabre\CalDAV\Principal\Collection($principalBackend),
new \Sabre\DAVACL\FS\HomeCollection($principalBackend, $this->webdavPublicDir),
new \Sabre\DAVACL\FS\HomeCollection($principalBackend, $this->webdavHomesDir),
];

if ($this->calDAVEnabled) {
Expand Down

0 comments on commit 55e5b04

Please sign in to comment.