Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Wolfgang Knopki
Spacedeck-open-SAML
Commits
d19d0222
Commit
d19d0222
authored
May 19, 2019
by
mntmn
Browse files
fix phantomjs ssl error and space screenshots
parent
69037685
Changes
2
Hide whitespace changes
Inline
Side-by-side
routes/api/space_exports.js
View file @
d19d0222
...
...
@@ -51,8 +51,7 @@ router.get('/png', function(req, res, next) {
if
(
!
req
.
space
.
thumbnail_updated_at
||
req
.
space
.
thumbnail_updated_at
<
req
.
space
.
updated_at
||
!
req
.
space
.
thumbnail_url
)
{
db
.
Space
.
update
({
thumbnail_updated_at
:
triggered
},
{
where
:
{
"
_id
"
:
req
.
space
.
_id
}});
phantom
.
takeScreenshot
(
req
.
space
,
"
png
"
,
function
(
local_path
)
{
phantom
.
takeScreenshot
(
req
.
space
,
"
png
"
,
function
(
local_path
)
{
var
localResizedFilePath
=
local_path
+
"
.thumb.jpg
"
;
gm
(
local_path
).
resize
(
640
,
480
).
quality
(
70.0
).
autoOrient
().
write
(
localResizedFilePath
,
function
(
err
)
{
...
...
@@ -95,7 +94,7 @@ router.get('/png', function(req, res, next) {
},
function
()
{
// on_error
console
.
error
(
"
phantom
could not create screenshot for space
"
+
req
.
space_id
);
console
.
error
(
"
[space screenshot]
could not create screenshot for space
"
+
req
.
space_id
);
res
.
status
(
404
).
send
(
"
Not found
"
);
});
}
else
{
...
...
spacedeck.js
View file @
d19d0222
...
...
@@ -26,6 +26,9 @@ const serveStatic = require('serve-static');
const
isProduction
=
app
.
get
(
'
env
'
)
===
'
production
'
;
// workaround for libssl_conf.so error triggered by phantomjs
process
.
env
[
'
OPENSSL_CONF
'
]
=
'
/dev/null
'
;
console
.
log
(
"
Booting Spacedeck Open… (environment:
"
+
app
.
get
(
'
env
'
)
+
"
)
"
);
app
.
use
(
logger
(
isProduction
?
'
combined
'
:
'
dev
'
));
...
...
@@ -72,7 +75,7 @@ app.use(helmet.frameguard())
app
.
use
(
helmet
.
xssFilter
())
app
.
use
(
helmet
.
hsts
({
maxAge
:
7776000000
,
includeSub
d
omains
:
true
includeSub
D
omains
:
true
}))
app
.
disable
(
'
x-powered-by
'
);
app
.
use
(
helmet
.
noSniff
())
...
...
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