Merge branch 'master' of ssh.dev.azure.com:v3/HackKu/HackKu%202020/backend

This commit is contained in:
garrettmills 2020-02-08 02:39:40 -06:00
commit fe54a91243
10 changed files with 155 additions and 20 deletions

View File

@ -2,27 +2,40 @@
--input-padding-x: 1.5rem; --input-padding-x: 1.5rem;
--input-padding-y: 0.75rem; --input-padding-y: 0.75rem;
} }
body {
background-image: url('https://images.unsplash.com/photo-1501618669935-18b6ecb13d6d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1464&q=80');
background-position: 60% 20%;
}
@media all and (max-width: 768px) {
body {
background-image: none;
background-color: #F1EFE7;
}
}
.login, .login,
.image { .image {
min-height: 100vh; min-height: 100vh;
} }
.name-banner{
.bg-image { font-family: 'Merienda', cursive;
background-image: url('https://source.unsplash.com/4812YdII6W0/2592x1728');
background-size: cover;
background-position: center;
} }
.login-heading { .login-heading {
font-weight: 300; font-weight: 300;
} }
.btn-login { .btn-login {
font-size: 0.9rem; border: solid 7px #41403E;
letter-spacing: 0.05rem; align-self: center;
padding: 0.75rem 1rem; background: transparent;
border-radius: 2rem; padding: 1rem 1rem;
-webkit-transition: all .5s ease;
transition: all .5s ease;
color: #41403E;
font-size: 2rem;
letter-spacing: 1px;
outline: none;
box-shadow: 20px 38px 34px -26px rgba(0, 0, 0, 0.2);
border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
} }
.form-label-group { .form-label-group {
@ -92,7 +105,7 @@
} }
.form-submit-button { .form-submit-button {
margin-top: 50px; margin-top: 30px;
margin-bottom: 50px; margin-bottom: 50px;
} }

View File

@ -7,6 +7,9 @@ const Controller = require('libflitter/controller/Controller')
* are used as handlers for routes specified in the route files. * are used as handlers for routes specified in the route files.
*/ */
class Home extends Controller { class Home extends Controller {
static get services(){
return [...super.services, 'configs']
}
/* /*
* Serve the main welcome page. * Serve the main welcome page.
@ -20,6 +23,10 @@ class Home extends Controller {
*/ */
return res.page('welcome', {user: req.user}) return res.page('welcome', {user: req.user})
} }
async get_login(req, res){
const app_name = this.configs.get('app.name')
return res.page('login', {app_name})
}
} }
module.exports = Home module.exports = Home

View File

@ -26,7 +26,6 @@ const index = {
* handler's exec() method. * handler's exec() method.
*/ */
middleware: [ middleware: [
['HomeLogger', {note: 'arguments can be specified as the second element in this array'}],
// 'MiddlewareName', // Or without arguments // 'MiddlewareName', // Or without arguments
], ],
@ -46,6 +45,7 @@ const index = {
// Placeholder for auth dashboard. You'd replace this with // Placeholder for auth dashboard. You'd replace this with
// your own route protected by 'middleware::auth:UserOnly' // your own route protected by 'middleware::auth:UserOnly'
'/dash': [ 'controller::Home.welcome' ], '/dash': [ 'controller::Home.welcome' ],
'/login': [ 'middleware::auth:GuestOnly', 'controller::Home.get_login' ],
}, },
/* /*

View File

@ -4,14 +4,16 @@ html
meta(name='viewport' content='width=device-width initial-scale=1') meta(name='viewport' content='width=device-width initial-scale=1')
link(rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css') link(rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css')
link(rel='stylesheet' href='/assets/auth/forms.css') link(rel='stylesheet' href='/assets/auth/forms.css')
link(href="https://fonts.googleapis.com/css?family=Merienda:700&display=swap" rel="stylesheet")
body body
.container-fluid .container-fluid
.row.no-gutter .row.no-gutter
.d-none.d-md-flex.col-md-6.col-lg-8.bg-image .d-none.d-md-flex.col-md-5
.col-md-6.col-lg-4 .col-md-5
.login.d-flex.align-items-center.py-5 .login.d-flex.align-items-center.py-5
.container .container
.row .row
.col-md-9.col-lg-8.mx-auto .col-md-9.col-lg-8.mx-auto
h2.name-banner #{_app.name}
block content block content
script(src='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css') script(src='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css')

87
app/views/login.pug Normal file
View File

@ -0,0 +1,87 @@
html
head
title Flitter
meta(name="viewport" content="width=device-width, initial-scale=1")
link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous")
script(src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous")
script(src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous")
script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous")
script(src="https://kit.fontawesome.com/5043ba9cc5.js" crossorigin="anonymous")
link(href="https://fonts.googleapis.com/css?family=Merienda:700&display=swap" rel="stylesheet")
style(type="text/css").
@import url('https://fonts.googleapis.com/css?family=Rajdhani');
html,
body {
background-color:#343a40;
}
#intro {
margin-top: 10px;
color: #cccccc;
text-align: center;
}
#name {
font-family: 'Merienda', cursive;
}
#login {
width: 50em;
}
.login-container {
display: grid;
color: #cccccc;
border: solid 7px #cccccc;
align-self: center;
background: transparent;
-webkit-transition: all .5s ease;
transition: all .5s ease;
outline: none;
box-shadow: 20px 38px 34px -26px rgba(0, 0, 0, 0.2);
border-radius: 82px 65px 185px 1085px/72px 225px 58px 15px;
}
.btn-login {
color: #cccccc;
border: solid 7px #cccccc;
align-self: center;
background: transparent;
-webkit-transition: all .5s ease;
transition: all .5s ease;
outline: none;
box-shadow: 20px 38px 34px -26px rgba(0, 0, 0, 0.2);
border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
}
.login-container div a {
width: 100%;
}
.icons {
font-size: 1.8em;
padding: 1em 1em 1em 1em;
}
body
.container#intro
h1 Hi, Welcome to
span#name #{app_name}.
h2 Choose your login method.
.container#login
.login-container
div
a.btn.btn-login.btn-light(href="/auth/flitter/login")
i.icons.fas.fa-sign-in-alt
span Local Login
div
a.btn.btn-login.btn-light(href="/auth/github_oauth/login")
i.icons.fab.fa-github
span Login with GitHub
div
a.btn.btn-login.btn-light.disabled(href="google.com")
i.icons.fab.fa-google
span Login with Google
div
a.btn.btn-login.btn-light.disabled(href="microsoft.com")
i.icons.fab.fa-microsoft
span Login with Microsoft
div
a.btn.btn-login.btn-light.disabled(href="apple.com")
i.icons.fab.fa-apple
span Login with Apple

View File

@ -34,7 +34,7 @@ html
font-size: 24pt; font-size: 24pt;
color: #00323d; color: #00323d;
} }
body body
.flitter-container .flitter-container
img.flitter-image(src="/assets/flitter.png") img.flitter-image(src="/assets/flitter.png")
a.flitter-name(href="https://flitter.garrettmills.dev/" target="_blank") powered by flitter a.flitter-name(href="https://flitter.garrettmills.dev/" target="_blank") powered by flitter

22
azure-pipelines.yml Normal file
View File

@ -0,0 +1,22 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: InstallSSHKey@0
inputs:
knownHostsEntry: 'hack20.glmdev.tech,34.70.10.162 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBA6VTjCHRkj4WMQG8yoSL/RfJDtQ0QtYvRVjIVpXPn2d2e0Z1NyLutenudSFxRauKz91x4CUhCpSj75569wbTIk='
sshPublicKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjtWm3P9STR4T04pYAd4scEQZs/4/6hRlt9TUttfieyAqycSbsI2c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Cd15VKzPwWIbPKB8hhOd22dI4t258ggRSQoRekEg/Z+a7uq1OJldJkYM 9fpNxnj8blrPKDNMLFoKZgO8M4Rk5o2yTkOxA78e3zyjSKc3OPnV+EY0wNmHt418 sM42XoNW3jdS9ivJBCE/57KuTYtQprz3dF7ydFB1tv09qVIialT7Y0gdlF3UCrhM 1XosTBJGKzpY4nHvPdGc9NPpiO8UVmX8rCH90yO/ZlleWNmLbGl2McPs0otVZ0Hk KD8e3/bCTUd/iamM35TSaFkpRfSf/1iIUH5RXBypQJmxsqWk6d7YbHHadTQSiXsl qTOzuGA5Rf0JLrsX1vQxmE83fdKvLPbBFkkzUqGsrpYpLyzSjIMa+7Pcr1jD8kID wC2eG04YNESlZ0mzBe3H1FeePPOtHDG3bUWL97gT2bwUx91FXFTvH/dZ2mcV+/A8 5fvw5U38R3ejw/uvRhX7sL2qqDn6uZAEI3aL/W0CfQNnhR9fm8swBhsNIrm9jmMA 9K9SezCOwKO9a2BZ5f9UOE00dZyoG4YC3bEsNFnjQ9EkO/ucOXqd4/BwC5prc6FF bKcS/2WVdDUFxoMIsPcuqqDb38bcufiFwvsW6DeRfJsZ9M63DIYkr/Qb1t30kQ4x dG8jx3Rcc9eIX9ddZATW8+xocHZL9yDk8Ly7Q0i29MgTbyDkzPkJqbd4VnRpT4/8 Kh/SRkd2XBDUA3wdO+P1VU5QwpBkja4IUfYSpZk3pCd3FHi+jP6EczRgaayc5zRW MKqhzhg+W+7yh8CFw9eHTJ1zl+E92LoUI90o7UQ1qacGQz2i8dG25o3JVDN9fLCc dp/AidqD+zbT5VU1SPdeFBpRJHmA6rWVD/UHJ/itOV9MQk0PAAsB5hRvNXmuin6m rTIjC8qM0Zw+rnqi1snKnnvnBhK/0DHbzwonEP16YmTwhMlGP7LnOBNqtcpEBWPn -----END RSA PRIVATE KEY-----'

View File

@ -4,7 +4,7 @@ const app_config = {
* The name of the application. * The name of the application.
* Used through-out the application as the proper display name. * Used through-out the application as the proper display name.
*/ */
name: env("APP_NAME", "Flitter"), name: env("APP_NAME", "unknown"),
/* /*
* URL of the application. * URL of the application.

View File

@ -97,7 +97,7 @@ const auth_config = {
}, },
}, },
example_oauth: { github_oauth: {
type: 'Oauth2Provider', type: 'Oauth2Provider',
enable: env('AUTH_OAUTH2_ENABLE', true), enable: env('AUTH_OAUTH2_ENABLE', true),

View File

@ -17,4 +17,8 @@ SSL_CERT_FILE=cert.pem
SSL_CERT_KEY=cert.key SSL_CERT_KEY=cert.key
#for development, AUTH_FLITTER_ENABLE should be true #for development, AUTH_FLITTER_ENABLE should be true
#AUTH_FLITTER_ENABLE=true AUTH_FLITTER_ENABLE=true
#insert client ID for oauth
AUTH_OAUTH2_CLIENT_ID=
AUTH_OAUTH2_CLIENT_SECRET=