Commit a890a6ed authored by Jelle van der Waa's avatar Jelle van der Waa 🚧

Initial commit

First version of the Arch Linux Reproducible Rebuilder status webpage,
build using webpack, JavaScript and bulma CSS framework.
parents
module.exports = {
env: {
browser: true,
es6: true
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
rules: {
}
}
/node_modules
/dist/main.js
/dist/css
localhost:8881 {
errors stderr
log stdout
gzip
root dist
proxy /repro https://reproducible.archlinux.org/ {
without /repro
transparent
}
}
The MIT License (MIT)
Copyright (c) 2020 Jelle van der Waa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Arch Linux Rebuilderd Status
A simple status display with the number of reproducible packages for Arch
Linux. Uses rebuilderd's API to fetch the current status of reproducibility.
## Dependencies
* npm (for building/development)
* caddy (for local development)
## Development
```
npm run watch
```
## Building
```
npm install
npm run build
```
The build files are located in the 'dist' directory.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Arch Linux Reproducible Status</title>
<script src="main.js" defer></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title">Arch Linux Reproducible [core] repository status</h1>
<h2 class="subtitle" id="status"></h2>
</div>
</div>
</section>
<section class="section">
<div id="bad" class="tile box has-background-danger">
<div class="content">
<p class='title is-5 has-text-white'>Unreproducible packages</p>
<ul id="packagesul">
</ul>
</div>
</div>
</section>
<footer class="footer">
<div class="content has-text-centered">
<p>
<strong>Arch Linux</strong> Reproducible Status by <a href="https://github.com/jelly">Jelle van der Waa</a>. The source code is licensed
<a href="http://opensource.org/licenses/mit-license.php">MIT</a>.
</p>
</div>
</footer>
</body>
</html>
This diff is collapsed.
{
"name": "arch-repro-website",
"version": "0.0.1",
"description": "Arch reproducible Status Website",
"author": "Jelle van der Waa",
"license": "MIT",
"private": true,
"scripts": {
"build": "NODE_ENV=production webpack --mode production",
"watch": "webpack --watch"
},
"dependencies": {
"eslint-loader": "^4.0.2",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
},
"devDependencies": {
"bulma": "^0.8.2",
"css-loader": "^3.5.3",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"sass-loader": "^8.0.2",
"style-loader": "^1.2.0",
"terser-webpack-plugin": "^2.3.6"
}
}
require('./style.scss');
const apiPrefix = require('Config').apiPrefix;
function displayBadPackages(data) {
const packagesList = document.getElementById("packagesul");
const fragment = document.createDocumentFragment();
for (pkg of data) {
if (pkg.status == 'GOOD') {
continue
}
const li = document.createElement('li');
const p = document.createElement('p');
p.className = 'subtitle is-6 has-text-white';
p.textContent = `${pkg.name}-${pkg.version}`;
li.appendChild(p);
fragment.appendChild(li);
}
packagesList.appendChild(fragment);
}
function displayStats(data) {
let bad = 0;
let good = 0;
let unknown = 0;
for (pkg of data) {
switch (pkg.status) {
case 'GOOD':
good++;
break
case 'BAD':
bad++;
break
case 'UNKWN':
unknown++;
break
}
}
reproPercentage = Math.round(good / data.length * 100);
const elem = document.getElementById("status");
elem.textContent = `The core repository is ${reproPercentage}% reproducible with ${bad} bad and ${unknown} unknown packages.`;
}
fetch(`${apiPrefix}/api/v0/pkgs/list`).then((response) => {
return response.json();
}).then((data) => {
displayStats(data);
displayBadPackages(data);
});
@charset "utf-8";
$primary: #08c;
@import "../node_modules/bulma/sass/utilities/_all.sass";
@import "../node_modules/bulma/sass/base/_all.sass";
@import "../node_modules/bulma/sass/elements/container.sass";
@import "../node_modules/bulma/sass/elements/box.sass";
@import "../node_modules/bulma/sass/elements/title.sass";
@import "../node_modules/bulma/sass/layout/footer.sass";
@import "../node_modules/bulma/sass/layout/hero.sass";
@import "../node_modules/bulma/sass/layout/section.sass";
@import "../node_modules/bulma/sass/grid/tiles.sass";
"use strict"
const path = require('path');
const TerserJSPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader'
},
{
loader: 'sass-loader',
options: {
sourceMap: true,
// options...
}
}
]
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
// eslint options (if necessary)
},
}],
},
externals: {
'Config': JSON.stringify(process.env.NODE_ENV === 'production' ? {
apiPrefix: ''
} : {
apiPrefix: '/repro'
}),
},
optimization: {
minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'css/style.css'
}),
]
};
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