Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mailinabox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
mailinabox
Commits
8566b782
Commit
8566b782
authored
Oct 07, 2014
by
Joshua Tauberer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop webfinger, see #95
parent
06a8ce1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
64 deletions
+1
-64
nginx.conf
conf/nginx.conf
+0
-7
web.sh
setup/web.sh
+1
-11
webfinger.php
tools/webfinger.php
+0
-46
No files found.
conf/nginx.conf
View file @
8566b782
...
...
@@ -55,13 +55,6 @@ server {
client_max_body_size
20M
;
}
# Webfinger configuration.
location
=
/.well-known/webfinger
{
include
fastcgi_params
;
fastcgi_param
SCRIPT_FILENAME
/usr/local/bin/mailinabox-webfinger.php
;
fastcgi_pass
php-fpm
;
}
# Z-Push (Microsoft Exchange ActiveSync)
location
/Microsoft-Server-ActiveSync
{
include
/etc/nginx/fastcgi_params
;
...
...
setup/web.sh
View file @
8566b782
...
...
@@ -57,22 +57,12 @@ if [ -L /etc/init.d/php-fastcgi ]; then
apt-get
-y
purge php5-cgi
#NODOC
fi
# Put our webfinger script into a well-known location.
for
f
in
webfinger
;
do
cp
tools/
$f
.php /usr/local/bin/mailinabox-
$f
.php
chown
www-data.www-data /usr/local/bin/mailinabox-
$f
.php
done
# Remove obsoleted scripts. #NODOC
# exchange-autodiscover is now handled by Z-Push. #NODOC
for
f
in
exchange-autodiscover
;
do
#NODOC
for
f
in
webfinger
exchange-autodiscover
;
do
#NODOC
rm
-f
/usr/local/bin/mailinabox-
$f
.php
#NODOC
done
#NODOC
# Make some space for users to customize their webfinger responses.
mkdir
-p
$STORAGE_ROOT
/webfinger/acct
;
chown
-R
$STORAGE_USER
$STORAGE_ROOT
/webfinger
# Start services.
restart_service nginx
restart_service php5-fpm
...
...
tools/webfinger.php
deleted
100755 → 0
View file @
06a8ce1c
<?php
$resource
=
''
;
if
(
isset
(
$_GET
[
'resource'
])){
$resource
=
$_GET
[
'resource'
];
}
// Parse our configuration file to get the STORAGE_ROOT.
$STORAGE_ROOT
=
NULL
;
foreach
(
file
(
"/etc/mailinabox.conf"
)
as
$line
)
{
$line
=
explode
(
"="
,
rtrim
(
$line
),
2
);
if
(
$line
[
0
]
==
"STORAGE_ROOT"
)
{
$STORAGE_ROOT
=
$line
[
1
];
}
}
if
(
$STORAGE_ROOT
==
NULL
)
exit
(
"no STORAGE_ROOT"
);
// Turn the resource into a file path. First URL-encode the resource
// so that it is filepath-safe.
$fn
=
urlencode
(
$resource
);
// Replace the first colon (it's URL-encoded) with a slash since we'll
// break off the files into scheme subdirectories.
$fn
=
preg_replace
(
"/%3A/"
,
"/"
,
$fn
,
1
);
// Since this is often for email addresses, un-escape @-signs so they
// are not odd-looking. It's filename-safe anyway.
$fn
=
preg_replace
(
"/%40/"
,
"@"
,
$fn
);
// Combine with root path.
$fn
=
$STORAGE_ROOT
.
"/webfinger/"
.
$fn
.
".json"
;
// See if the file exists.
if
(
!
file_exists
(
$fn
))
{
header
(
"HTTP/1.0 404 Not Found"
);
exit
;
}
header
(
"Content-type: application/json"
);
echo
file_get_contents
(
$fn
);
//json_encode(array(
// subject => $resource,
//), JSON_PRETTY_PRINT);
?>
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