Initial CAcert web application build
- add webpack build, static resources and dependencies
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
/.idea/
|
||||
/node_modules/
|
||||
/static/
|
79
frontend_src/_custom.scss
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
Copyright 2020, 2021 Jan Dittberner
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
@import "~bootstrap/scss/bootstrap";
|
||||
|
||||
$dimmed_white: #f5f5f5;
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
background-color: $dimmed_white;
|
||||
}
|
||||
|
||||
body.idp {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.error-message, body.idp {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.form-signin {
|
||||
max-width: 330px;
|
||||
}
|
||||
|
||||
.form-consent {
|
||||
max-width: 550px;
|
||||
}
|
||||
|
||||
.form-signin, .form-consent {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
.checkbox {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.input[type="email"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
2
frontend_src/images/CAcert-favicon-src.svg
Normal file
After Width: | Height: | Size: 7.4 KiB |
2
frontend_src/images/CAcert-logo.svg
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
frontend_src/images/favicon-120.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
frontend_src/images/favicon-128.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
frontend_src/images/favicon-152.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
frontend_src/images/favicon-167.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
frontend_src/images/favicon-180.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
frontend_src/images/favicon-192.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
frontend_src/images/favicon-196.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
frontend_src/images/favicon-228.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
frontend_src/images/favicon-32.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
frontend_src/images/favicon-57.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
frontend_src/images/favicon-76.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
frontend_src/images/favicon-96.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
frontend_src/images/favicon.ico
Normal file
After Width: | Height: | Size: 4.2 KiB |
20
frontend_src/index.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2020, 2021 Jan Dittberner
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import 'jquery';
|
||||
import 'popper.js';
|
||||
import 'bootstrap';
|
36
package.json
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "cacert-webpack",
|
||||
"version": "0.1.0",
|
||||
"description": "webpack setup for CAcert static web resources",
|
||||
"scripts": {
|
||||
"build": "webpack",
|
||||
"watch": "webpack --watch"
|
||||
},
|
||||
"private": true,
|
||||
"author": "Jan Dittberner",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^9.8.6",
|
||||
"bootstrap": "^4.5.3",
|
||||
"browserslist": "^4.17.0",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"copy-webpack-plugin": "^7.0.0",
|
||||
"css-loader": "^5.0.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^1.3.2",
|
||||
"jquery": "^3.5.1",
|
||||
"mini-css-extract-plugin": "^1.3.3",
|
||||
"popper.js": "^1.16.1",
|
||||
"postcss-loader": "^4.1.0",
|
||||
"precss": "^4.0.0",
|
||||
"sass": "^1.32.0",
|
||||
"sass-loader": "^10.1.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"terser-webpack-plugin": "^5.0.3",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.11.1",
|
||||
"webpack-cli": "^4.3.1",
|
||||
"webpack-manifest-plugin": "^3.0.0"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
94
webpack.config.js
Normal file
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
Copyright 2020, 2021 Jan Dittberner
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const {WebpackManifestPlugin} = require("webpack-manifest-plugin");
|
||||
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
||||
entry: {
|
||||
cacert: [
|
||||
path.resolve(__dirname, 'frontend_src/index.js'),
|
||||
path.resolve(__dirname, 'frontend_src/_custom.scss'),
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin({cleanStaleWebpackAssets: false}),
|
||||
new WebpackManifestPlugin(),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "css/[name].bundle.css",
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: "images/**",
|
||||
context: path.resolve(__dirname, "frontend_src"),
|
||||
}
|
||||
],
|
||||
}),
|
||||
],
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'static'),
|
||||
filename: 'js/[name].bundle.js',
|
||||
},
|
||||
devtool: 'source-map',
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [new TerserPlugin()],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(svg|png|jpg|jpeg|gif)$/,
|
||||
type: "asset/resource",
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
use: [{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
publicPath: "/static/",
|
||||
}
|
||||
}, {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
importLoaders: 1,
|
||||
modules: {auto: true},
|
||||
}
|
||||
}, {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
postcssOptions: {
|
||||
plugins: [
|
||||
[
|
||||
'precss',
|
||||
'autoprefixer',
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
}, {
|
||||
loader: 'sass-loader',
|
||||
}]
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|