Commit f83b6c2a authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

Merge branch 'MLAB-677' into 'testing'

MLAB-677

See merge request !165
parents c2b73ce6 24e3ee4b
Pipeline #6893 passed with stage
in 8 seconds
......@@ -6,7 +6,7 @@ deploy-testing:
- cat $certidp > ./built/routes/cert/cert_idp.pem
- cat $key > ./built/routes/cert/key.pem
- "pm2 delete --silent account || :"
- pm2 start ./built/app.js --name=account
- pm2 start ./built/index.js --name=account
- pm2 save
tags:
- testing
......@@ -22,7 +22,7 @@ deploy-master:
- cat $key > ./routes/cert/key.pem
- npm install
- "pm2 delete --silent account || :"
- pm2 start ./app.js --name=account
- pm2 start ./index.js --name=account
- pm2 save
tags:
- production
......
......@@ -3,5 +3,6 @@
// NOTE: Works in Firefox and Opera. Does not work in Edge
// Handle 404
// Handle 500 - any server error
app.set("port",config.app.port),app.set("views",_path["default"].join(_path["default"].join(__dirname,"/views"))),app.set("view engine","pug"),app.use((0,_expressFileupload["default"])({createParentPath:!0,limits:{fileSize:1e6// 1 MB max. file size
}})),app.use((0,_methodOverride["default"])("_method")),app.use(_helmet["default"].contentSecurityPolicy({useDefaults:!0,directives:{"font-src":["'self'","https://use.fontawesome.com"],"img-src":["'self'","https://transfer.hft-stuttgart.de"],"script-src":["'self'","https://code.jquery.com/jquery-3.3.1.min.js","https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js","https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js","https://unpkg.com/bootstrap-show-password@1.2.1/dist/bootstrap-show-password.min.js"],"style-src":["'self'","https://use.fontawesome.com/releases/v5.8.2/css/all.css"],"frame-src":["'self'"]},reportOnly:!0})),app.use((0,_compression["default"])()),app.use((0,_morgan["default"])("combined")),app.use((0,_cookieParser["default"])(config.app.sessionSecret)),app.use(_bodyParser["default"].json()),app.use(_bodyParser["default"].urlencoded({extended:!1})),app.use(_express["default"]["static"](_path["default"].join(__dirname,"public"))),app.use(function(a,b,c){c()}),app.use((0,_expressSession["default"])({resave:!0,saveUninitialized:!0,secret:config.app.sessionSecret})),app.use((0,_expressFlash["default"])()),app.use(_passport["default"].initialize()),app.use(_passport["default"].session()),app.use(function(a,b,c){b.set("Cache-Control","no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0"),c()}),require("./routes/public")(app,config,lang),require("./routes/account")(app,config,_passport["default"],lang),app.use(function(a,b){b.status(404).render(lang+"/404")}),app.use(function(a,b,c){console.error(a.stack),c.status(500).render(lang+"/500",{error:a})}),app.listen(app.get("port"),function(){console.log("Express server listening on port "+app.get("port"))});
\ No newline at end of file
// export { app }
app.set("views",_path["default"].join(_path["default"].join(__dirname,"/views"))),app.set("view engine","pug"),app.use((0,_expressFileupload["default"])({createParentPath:!0,limits:{fileSize:1e6// 1 MB max. file size
}})),app.use((0,_methodOverride["default"])("_method")),app.use(_helmet["default"].contentSecurityPolicy({useDefaults:!0,directives:{"font-src":["'self'","https://use.fontawesome.com"],"img-src":["'self'","https://transfer.hft-stuttgart.de"],"script-src":["'self'","https://code.jquery.com/jquery-3.3.1.min.js","https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js","https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js","https://unpkg.com/bootstrap-show-password@1.2.1/dist/bootstrap-show-password.min.js"],"style-src":["'self'","https://use.fontawesome.com/releases/v5.8.2/css/all.css"],"frame-src":["'self'"]},reportOnly:!0})),app.use((0,_compression["default"])()),app.use((0,_morgan["default"])("combined")),app.use((0,_cookieParser["default"])(config.app.sessionSecret)),app.use(_bodyParser["default"].json()),app.use(_bodyParser["default"].urlencoded({extended:!1})),app.use(_express["default"]["static"](_path["default"].join(__dirname,"public"))),app.use(function(a,b,c){c()}),app.use((0,_expressSession["default"])({resave:!0,saveUninitialized:!0,secret:config.app.sessionSecret})),app.use((0,_expressFlash["default"])()),app.use(_passport["default"].initialize()),app.use(_passport["default"].session()),app.use(function(a,b,c){b.set("Cache-Control","no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0"),c()}),require("./routes/public")(app,config,lang),require("./routes/account")(app,config,_passport["default"],lang),app.use(function(a,b){b.status(404).render(lang+"/404")}),app.use(function(a,b,c){console.error(a.stack),c.status(500).render(lang+"/500",{error:a})}),module.exports=app;
\ No newline at end of file
#!/usr/bin/env node
/**
* Module dependencies.
*/ // import {app} from './app';
"use strict";var _process$env$NODE_ENV,_http=_interopRequireDefault(require("http"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var app=require("./app"),debug=require("debug")("MLAB-Account:server"),env=null!==(_process$env$NODE_ENV=process.env.NODE_ENV)&&void 0!==_process$env$NODE_ENV?_process$env$NODE_ENV:"testing",config=require("./config/config")[env],port=normalizePort(process.env.PORT||config.app.port);app.set("port",port);/**
* Create HTTP server.
*/var server=_http["default"].createServer(app);/**
* Listen on provided port, on all network interfaces.
*/server.listen(port),server.on("error",onError),server.on("listening",onListening);/**
* Normalize a port into a number, string, or false.
*/function normalizePort(a){var b=parseInt(a,10);return isNaN(b)?a:!!(0<=b)&&b}/**
* Event listener for HTTP server "error" event.
*/function onError(a){if("listen"!==a.syscall)throw a;var b="string"==typeof port?"Pipe "+port:"Port "+port;// handle specific listen errors with friendly messages
switch(a.code){case"EACCES":console.error(b+" requires elevated privileges"),process.exit(1);break;case"EADDRINUSE":console.error(b+" is already in use"),process.exit(1);break;default:throw a;}}/**
* Event listener for HTTP server "listening" event.
*/function onListening(){var a=server.address(),b="string"==typeof a?"pipe "+a:"port "+a.port;debug("Listening on "+b)}
\ No newline at end of file
This diff is collapsed.
......@@ -36,10 +36,6 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw")
span(class="d-none d-md-inline") Projekte und Dienste
li(class="nav-item")
a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
......
......@@ -8,8 +8,9 @@ html(lang="de")
link(rel="stylesheet", type="text/css", href="/css/m4lab.css")
link(rel="stylesheet", type="text/css", href="/css/m4lab-mobile.css")
link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
script(src="https://unpkg.com/vue@3")
body
div(class="container")
div(id="app" class="container")
div(class="row min-vh-100 flex-column flex-md-row")
aside(class="col-12 col-md-3 p-0 flex-shrink-1")
nav(class="navbar navbar-expand flex-md-column flex-row align-items-start py-2")
......@@ -27,10 +28,6 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw" style="color:black;")
span(class="d-none d-md-inline" style="color:black;") Projekte und Dienste
li(class="nav-item")
a(class="nav-link pl-0" href="/logout" style="color:red;")
i(class="fa fa-sign-out-alt fa-fw")
......@@ -67,8 +64,10 @@ html(lang="de")
div(class='form-group row')
label(for="name", class="col-sm-2") Name
div(class="col-sm-8")
input#name(name="name", type="text", class="form-control", placeholder="Name", maxlength="75" required)
p(id="nameInfo" class="font-italic font-weight-light") <small>Ihre Webseite wird unter folgender URL veröffentlicht: <strong>https://transfer.hft-stuttgart.de/pages/#{gitlabUsername}/<span id="websiteName"></span></strong></small>
input#name(name="name", type="text", :value="websiteName", @input="onInput", class="form-control", placeholder="Name", maxlength="75" required)
p(v-if="websiteName" class="font-italic font-weight-light")
<small>Ihre Webseite wird unter folgender URL veröffentlicht: <strong>https://transfer.hft-stuttgart.de/pages/#{gitlabUsername}/{{ websiteURL }}/home</strong></small>
p(v-else)
div(class="form-group row")
label(for="description", class="col-sm-2") Beschreibung
div(class="col-sm-8")
......@@ -102,22 +101,22 @@ html(lang="de")
script(src="/js/headfoot.js")
script(src="/js/mobile.js")
script.
// website URL
function showWebsiteURL() {
if ($("#name").val()) {
$("#nameInfo").show()
let webName = $("#name").val().toLowerCase().replace(/\s/g, '-')
document.getElementById("websiteName").innerText = webName+"/home/"
}
else {
$("#nameInfo").hide()
}
}
$('#name').on('input',function(e){
showWebsiteURL()
})
showWebsiteURL()
$("form").submit(function(){
$.LoadingOverlay("show")
});
\ No newline at end of file
});
script.
const { createApp } = Vue
createApp({
data() {
return {
websiteName: '',
websiteURL: ''
}
},
methods: {
onInput(e) {
this.websiteName = e.target.value
this.websiteURL = this.websiteName.toLowerCase().replace(/\s/g, '-')
}
}
}).mount('#app')
\ No newline at end of file
......@@ -27,10 +27,6 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw")
span(class="d-none d-md-inline") Projekte und Dienste
li(class="nav-item")
a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
......
......@@ -30,10 +30,6 @@ html(lang="de")
a(class="nav-link pl-0" href="#")
i(class="fa fa-lock fa-fw color_black")
span(class="d-none d-md-inline color_black") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw")
span(class="d-none d-md-inline") Projekte und Dienste
li(class="nav-item")
a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
......
......@@ -27,10 +27,6 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="#")
i(class="fa fa-tasks fa-fw color_black")
span(class="d-none d-md-inline color_black") Projekte und Dienste
li(class="nav-item")
a(class="nav-link pl-0 color_red" href="/logout")
i(class="fa fa-sign-out-alt fa-fw")
......
......@@ -27,10 +27,6 @@ html(lang="de")
a(class="nav-link pl-0" href="/account/security")
i(class="fa fa-lock fa-fw")
span(class="d-none d-md-inline") Sicherheitseinstellungen
li(class="nav-item")
a(class="nav-link pl-0" href="/account/services")
i(class="fa fa-tasks fa-fw" style="color:black;")
span(class="d-none d-md-inline" style="color:black;") Projekte und Dienste
li(class="nav-item")
a(class="nav-link pl-0" href="/logout" style="color:red;")
i(class="fa fa-sign-out-alt fa-fw")
......
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@"
else
exec node "$basedir/../eslint/bin/eslint.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\eslint\bin\eslint.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../eslint/bin/eslint.js" $args
} else {
& "$basedir/node$exe" "$basedir/../eslint/bin/eslint.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../eslint/bin/eslint.js" $args
} else {
& "node$exe" "$basedir/../eslint/bin/eslint.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@"
else
exec node "$basedir/../esprima/bin/esparse.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args
} else {
& "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args
} else {
& "node$exe" "$basedir/../esprima/bin/esparse.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@"
else
exec node "$basedir/../esprima/bin/esvalidate.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args
} else {
& "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args
} else {
& "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@"
else
exec node "$basedir/../js-yaml/bin/js-yaml.js" "$@"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment