Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webDav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ali Arshad
webDav
Commits
326a67d0
Commit
326a67d0
authored
Mar 01, 2018
by
aliarshad9691
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal improvements
parent
72db8390
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
calendarserver.php
WWW/calendarserver.php
+9
-13
TokenAuth.php
WWW/classes/TokenAuth.php
+2
-3
docker-compose.yml
docker-compose.yml
+1
-0
start.sh
start.sh
+1
-0
No files found.
WWW/calendarserver.php
View file @
326a67d0
<?php
namespace
api
;
use
Sabre
;
use
PT
;
use
Sabre
;
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'OPTIONS'
)
{
@
header
(
'Access-Control-Allow-Origin: *'
);
...
...
@@ -18,18 +17,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
}
@
header
(
'Access-Control-Allow-Origin: *'
);
/*
CalendarServer example
This server features CalDAV support
*/
// settings
date_default_timezone_set
(
'
Canada/Easter
n'
);
// If you want to run the SabreDAV server in a custom location (using mod_rewrite for instance)
// You can override the baseUri here.
// $baseUri = '/'
;
/* Database */
//$pdo = new PDO('sqlite:data/db.sqlite');
$pdo
=
new
\PDO
(
'mysql:host=
db;dbname=ksa'
,
'aliarshad'
,
'aliarshad'
);
date_default_timezone_set
(
'
Europe/Londo
n'
);
$host
=
getenv
(
"MYSQL_HOST"
);
$user
=
getenv
(
"MYSQL_USER"
);
$password
=
getenv
(
"MYSQL_PASSWORD"
)
;
$db
=
getenv
(
"MYSQL_DATABASE"
);
$pdo
=
new
\PDO
(
'mysql:host=
'
.
$host
.
';dbname='
.
$db
,
$user
,
$password
);
$pdo
->
setAttribute
(
\PDO
::
ATTR_ERRMODE
,
\PDO
::
ERRMODE_EXCEPTION
);
// Files we need
require_once
'vendor/autoload.php'
;
...
...
WWW/classes/TokenAuth.php
View file @
326a67d0
...
...
@@ -8,13 +8,12 @@ class TokenAuth extends AbstractBearer
{
public
$tableName
=
"users"
;
private
$pdo
;
private
$apiURL
=
"https://da-api.drywallaptitude.co.uk/auth/verify"
;
private
$apiURL
=
''
;
function
__construct
(
\PDO
$pdo
)
{
$this
->
pdo
=
$pdo
;
$this
->
apiURL
=
getenv
(
'VERIFY_URL'
);
}
function
validateBearerToken
(
$token
)
...
...
docker-compose.yml
View file @
326a67d0
...
...
@@ -14,6 +14,7 @@ services:
-
./WWW:/var/www/html
environment
:
-
MYSQL_HOST=db
-
VERIFY_URL=https://da-api.drywallaptitude.co.uk/auth/verify
env_file
:
-
database.env
restart
:
unless-stopped
...
...
start.sh
View file @
326a67d0
...
...
@@ -6,6 +6,7 @@ echo "env[MYSQL_DATABASE]= $MYSQL_DATABASE">> /etc/php/7.0/fpm/pool.d/www.conf
echo
"env[MYSQL_USER]=
$MYSQL_USER
"
>>
/etc/php/7.0/fpm/pool.d/www.conf
echo
"env[MYSQL_PASSWORD]=
$MYSQL_PASSWORD
"
>>
/etc/php/7.0/fpm/pool.d/www.conf
echo
"env[MYSQL_HOST]=
$MYSQL_HOST
"
>>
/etc/php/7.0/fpm/pool.d/www.conf
echo
"env[VERIFY_URL]=
$VERIFY_URL
"
>>
/etc/php/7.0/fpm/pool.d/www.conf
cd
/var/www/html
composer
-n
install
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment