Commit 7784d2b2 authored by yPhil's avatar yPhil
Browse files

Merge branch 'dev'

parents e87e4204 0bd3233b
...@@ -7,5 +7,5 @@ job1: ...@@ -7,5 +7,5 @@ job1:
stage: build stage: build
script: script:
- npm install - npm install
- PTL_PORT_HTTP=8000 npm start - npm start
- PTL_PORT_HTTP=8000 npm run coverage - npm run coverage
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
"remotestorage": "rs#1.2.3", "remotestorage": "rs#1.2.3",
"rs-widget": "1.3.0", "rs-widget": "1.3.0",
"DOMPurify": "dompurify#^2.2.6", "DOMPurify": "dompurify#^2.2.6",
"responsively-lazy": "^2.0.2" "responsively-lazy": "^2.0.2",
"idb-keyval": "^5.0.5"
}, },
"resolutions": { "resolutions": {
"intro.js": "^3.3.1" "intro.js": "^3.3.1"
......
...@@ -9,16 +9,25 @@ const httpServer = http.createServer(petrolette); ...@@ -9,16 +9,25 @@ const httpServer = http.createServer(petrolette);
const portHttp = pjson.HTTP_PORT || 8000; const portHttp = pjson.HTTP_PORT || 8000;
const portHttps = pjson.HTTPS_PORT || 8001; const portHttps = pjson.HTTPS_PORT || 8001;
process.on('uncaughtException', function(err) {
console.error('### Pétrolette uncaughtException: %s', err.code);
});
httpServer.listen(portHttp, () => { httpServer.listen(portHttp, () => {
console.debug('HTTP Server running on port %s', portHttp); console.debug('HTTP Server running on port %s', portHttp);
}); });
const httpsServer = https.createServer({ try {
key: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/privkey.pem'), const httpsServer = https.createServer({
cert: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/cert.pem'), key: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/privkey.pem'),
ca: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/chain.pem'), cert: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/cert.pem'),
}, petrolette); ca: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/chain.pem'),
}, petrolette);
httpsServer.listen(portHttps, () => { httpsServer.listen(portHttps, () => {
console.debug('HTTPS Server running'); console.debug('HTTPS Server running');
}); });
} catch (error) {
console.error('error: no HTTPS here');
}
This diff is collapsed.
{ {
"name": "petrolette", "name": "petrolette",
"description": "The news reader that doesn't know you", "description": "The news reader that doesn't know you",
"version": "1.3.0A", "version": "1.3.0",
"private": true, "private": true,
"license": "GPL-3.0-only", "license": "GPL-3.0-only",
"HTTP_PORT": 8000, "HTTP_PORT": 8000,
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"feedrat": "git+https://framagit.org/yphil/feedrat.git", "feedrat": "git+https://framagit.org/yphil/feedrat.git",
"helmet": "^4.4.1", "helmet": "^4.4.1",
"iconv-lite": "^0.6.2", "iconv-lite": "^0.6.2",
"idb": "^6.0.0",
"morgan": "^1.10.0", "morgan": "^1.10.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"npm": "^7.10.0", "npm": "^7.10.0",
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
"devDependencies": { "devDependencies": {
"mocha": "^8.3.2", "mocha": "^8.3.2",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"rollup": "^2.47.0",
"should": "^13.2.3" "should": "^13.2.3"
} }
} }
...@@ -8,32 +8,16 @@ const express = require('express'), ...@@ -8,32 +8,16 @@ const express = require('express'),
helmet = require("helmet"), helmet = require("helmet"),
compression = require('compression'); compression = require('compression');
// if (!fs.existsSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR))){ fs.mkdir(path.join(__dirname, pjson.FAVICONS_CACHE_DIR), {
// fs.mkdirSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR)); recursive: true
// } }, (err) => {
fs.mkdir(path.join(__dirname, pjson.FAVICONS_CACHE_DIR), (err) => {
if (err) { if (err) {
return console.error(err); return console.error(err);
} }
console.log('Directory created successfully!'); console.log('Directory created successfully!');
return true;
}); });
fs.mkdir(path.join(__dirname, pjson.FAVICONS_CACHE_DIR),
{ recursive: true }, (err) => {
if (err) {
return console.error(err);
}
console.log('Directory created successfully!');
});
// app.use(function(req, res, next) {
// if (req.secure) {
// res.setHeader('Strict-Transport-Security', 'max-age=63072000; includeSubDomains'); // 2 years
// }
// next();
// });
app.set('views', path.join(__dirname, 'views')); app.set('views', path.join(__dirname, 'views'));
app.engine('html', require('ejs').renderFile); app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html'); app.set('view engine', 'html');
...@@ -45,10 +29,11 @@ app.use(helmet({contentSecurityPolicy: false})); ...@@ -45,10 +29,11 @@ app.use(helmet({contentSecurityPolicy: false}));
app.use(bodyParser.json()); app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false})); app.use(bodyParser.urlencoded({extended: false}));
// app.use(express.static(__dirname + '/renewal', { dotfiles: 'allow' }));
app.use('/favicons', express.static(path.join(__dirname, pjson.FAVICONS_CACHE_DIR))); app.use('/favicons', express.static(path.join(__dirname, pjson.FAVICONS_CACHE_DIR)));
app.use('/static', express.static(path.join(__dirname, 'public'))); app.use('/static', express.static(path.join(__dirname, 'public')));
app.use('/bower', express.static(path.join(__dirname, 'bower_components'))); app.use('/bower', express.static(path.join(__dirname, 'bower_components')));
app.use('/', router); app.use('/', router);
module.exports = app; module.exports = app;
@font-face { @font-face {
font-family: 'fontello'; font-family: 'fontello';
src: url('../font/fontello.eot?46778389'); src: url('../font/fontello.eot?78914911');
src: url('../font/fontello.eot?46778389#iefix') format('embedded-opentype'), src: url('../font/fontello.eot?78914911#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?46778389') format('woff2'), url('../font/fontello.woff2?78914911') format('woff2'),
url('../font/fontello.woff?46778389') format('woff'), url('../font/fontello.woff?78914911') format('woff'),
url('../font/fontello.ttf?46778389') format('truetype'), url('../font/fontello.ttf?78914911') format('truetype'),
url('../font/fontello.svg?46778389#fontello') format('svg'); url('../font/fontello.svg?78914911#fontello') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) { @media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face { @font-face {
font-family: 'fontello'; font-family: 'fontello';
src: url('../font/fontello.svg?46778389#fontello') format('svg'); src: url('../font/fontello.svg?78914911#fontello') format('svg');
} }
} }
*/ */
...@@ -56,16 +56,14 @@ ...@@ -56,16 +56,14 @@
} }
.icon-left:before { content: '\e801'; } /* '' */ .icon-left:before { content: '\e801'; } /* '' */
.icon-down-circle:before { content: '\e802'; } /* '' */ .icon-down:before { content: '\e802'; } /* '' */
.icon-upload:before { content: '\e803'; } /* '' */ .icon-upload:before { content: '\e803'; } /* '' */
.icon-up:before { content: '\e804'; } /* '' */ .icon-up:before { content: '\e804'; } /* '' */
.icon-down:before { content: '\e805'; } /* '' */
.icon-right:before { content: '\e806'; } /* '' */ .icon-right:before { content: '\e806'; } /* '' */
.icon-rss:before { content: '\e807'; } /* '' */ .icon-rss:before { content: '\e807'; } /* '' */
.icon-checked:before { content: '\e808'; } /* '' */
.icon-checkbox:before { content: '\e809'; } /* '' */
.icon-petrolette:before { content: '\e80a'; } /* '' */ .icon-petrolette:before { content: '\e80a'; } /* '' */
.icon-download:before { content: '\e80b'; } /* '' */ .icon-download:before { content: '\e80b'; } /* '' */
.icon-checked:before { content: '\e80f'; } /* '' */
.icon-trash-empty:before { content: '\e810'; } /* '' */ .icon-trash-empty:before { content: '\e810'; } /* '' */
.icon-plus:before { content: '\e811'; } /* '' */ .icon-plus:before { content: '\e811'; } /* '' */
.icon-minus:before { content: '\e812'; } /* '' */ .icon-minus:before { content: '\e812'; } /* '' */
...@@ -75,7 +73,8 @@ ...@@ -75,7 +73,8 @@
.icon-cancel:before { content: '\e816'; } /* '' */ .icon-cancel:before { content: '\e816'; } /* '' */
.icon-refresh:before { content: '\e817'; } /* '' */ .icon-refresh:before { content: '\e817'; } /* '' */
.icon-pencil:before { content: '\e818'; } /* '' */ .icon-pencil:before { content: '\e818'; } /* '' */
.icon-cog:before { content: '\e819'; } /* '' */ .icon-checkbox:before { content: '\e81a'; } /* '' */
.icon-cog:before { content: '\e81b'; } /* '' */
.icon-pin:before { content: '\e820'; } /* '' */ .icon-pin:before { content: '\e820'; } /* '' */
.icon-audio:before { content: '\e821'; } /* '' */ .icon-audio:before { content: '\e821'; } /* '' */
.icon-comments:before { content: '\e822'; } /* '' */ .icon-comments:before { content: '\e822'; } /* '' */
......
...@@ -92,17 +92,17 @@ ...@@ -92,17 +92,17 @@
body { body {
background-color: var(--color-background); background-color: var(--color-background);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
margin: 0; margin: 0;
} }
a:link { ul,
color: var(--color-text); li {
text-decoration: none; padding: 0;
} }
.fancybox-caption a, .fancybox-caption a:link, .fancybox-caption a:visited { a:link {
background-color: var(--color-button-bg); color: var(--color-text);
color: var(--color-button-text);
text-decoration: none; text-decoration: none;
} }
...@@ -110,15 +110,31 @@ a:visited { ...@@ -110,15 +110,31 @@ a:visited {
color: var(--color-link-visited); color: var(--color-link-visited);
} }
a:hover,
/* .ui-tab.ui-state-active a:link, .ui-tab.ui-state-active i, .ui-tab.ui-state-default a:link, */
a:active {
color: var(--color-link-hover);
}
/* .fancybox-caption a, */
/* .fancybox-caption a:link, */
/* .fancybox-caption a:visited { */
/* background-color: var(--color-button-bg); */
/* color: var(--color-button-text); */
/* text-decoration: none; */
/* } */
/* a.ui-tabs-anchor:link, */ /* a.ui-tabs-anchor:link, */
/* a.ui-tabs-anchor:visited { */ /* a.ui-tabs-anchor:visited { */
/* color: var(--color-link); */ /* color: var(--color-link); */
/* } */ /* } */
a:hover, .ui-state-default a,
/* .ui-tab.ui-state-active a:link, .ui-tab.ui-state-active i, .ui-tab.ui-state-default a:link, */ .ui-state-default a:link,
a:active { .ui-state-default a:visited,
color: var(--color-link-hover); .ui-state-default:not(.ui-slider-handle),
.ui-widget-content .ui-state-default:not(.ui-slider-handle) {
color: var(--color-link);
} }
li.feedItem:not(.error) a { li.feedItem:not(.error) a {
...@@ -126,6 +142,11 @@ li.feedItem:not(.error) a { ...@@ -126,6 +142,11 @@ li.feedItem:not(.error) a {
width: 100%; width: 100%;
} }
li.ui-state-active a:link,
li.ui-tabs-active > a:visited {
color: var(--color-link-hover);
}
.feedHeader > .feedTitle > a:link, .feedHeader > .feedTitle > a:link,
.feedHeader > .feedTitle > a:visited, .feedHeader > .feedTitle > a:visited,
.feedHeader > .feedTitle > a:focus, .feedHeader > .feedTitle > a:focus,
...@@ -151,11 +172,29 @@ table#jsLicenseTable td a:link { ...@@ -151,11 +172,29 @@ table#jsLicenseTable td a:link {
text-decoration: underline; text-decoration: underline;
} }
.feedHeader .feedControls div {
margin: 0 2px 0 0;
}
div#logoTitle { div#logoTitle {
display: flex; display: flex;
/* cursor: pointer; */ /* cursor: pointer; */
} }
.feedHeader > .feedToggle,
.feedHeader .feedControls div {
text-align: center;
}
#loadSpinner > div {
color: var(--color-text);
font-size: 12pt;
}
.ui-tab.ui-state-active > i {
color: var(--color-link);
}
div#logoTitle > div, div#logoTitle > div,
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.topNav > div.menuBarButton, .topNav > div.menuBarButton,
...@@ -165,18 +204,8 @@ i.tabIcon, ...@@ -165,18 +204,8 @@ i.tabIcon,
cursor: pointer; cursor: pointer;
} }
.feedHeader .feedControls div { .middleButton {
margin: 0 2px 0 0; margin: 0 5px;
}
.feedHeader > .feedToggle,
.feedHeader .feedControls div {
text-align: center;
}
#loadSpinner > div {
color: var(--color-text);
font-size: 12pt;
} }
p.dangerous { p.dangerous {
...@@ -199,19 +228,22 @@ button.dangerous:hover { ...@@ -199,19 +228,22 @@ button.dangerous:hover {
transform: rotate(90deg); transform: rotate(90deg);
} }
.ui-spinner input {
width: 32px;
}
.topNav { .topNav {
z-index: 20; z-index: 20;
background-color: var(--color-ui-qua);
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
height: 45px; height: 45px;
} }
.topNav > div.menuBarItem { /* .topNav > div.menuBarItem { */
color: var(--color-ui-pri); /* color: var(--color-ui-pri); */
text-align: center; /* text-align: center; */
} /* } */
.topNav .navLeft { .topNav .navLeft {
order: 1; order: 1;
...@@ -228,11 +260,15 @@ button.dangerous:hover { ...@@ -228,11 +260,15 @@ button.dangerous:hover {
.topNav > div.menuBarItem > i.topMenuIcon { .topNav > div.menuBarItem > i.topMenuIcon {
display: block; display: block;
color: var(--color-ui-sec); color: var(--color-text);
font-size: 16pt; font-size: 16pt;
margin: 8px 8px 8px 12px; margin: 8px 8px 8px 12px;
} }
.topNav > div.menuBarItem > i.topMenuIcon:hover {
color: var(--color-link-hover);
}
.topNav > div.menuBarItem > i.icon-reset { .topNav > div.menuBarItem > i.icon-reset {
margin: 11px 0 8px -28px; margin: 11px 0 8px -28px;
color: #333; color: #333;
...@@ -246,10 +282,6 @@ button.dangerous:hover { ...@@ -246,10 +282,6 @@ button.dangerous:hover {
margin: 4px 0 8px; margin: 4px 0 8px;
} }
.topNav > div.menuBarItem i.topMenuIcon:hover {
color: var(--color-text);
}
.icon-w3c { .icon-w3c {
color: var(--color-ui-success); color: var(--color-ui-success);
} }
...@@ -261,6 +293,17 @@ i.icon-petrolette { ...@@ -261,6 +293,17 @@ i.icon-petrolette {
color: var(--color-ui-sec); color: var(--color-ui-sec);
} }
.logoTitle {
color: var(--color-ui-sec);
display: var(--logo-display);
font-family: LobsterRegular, Helvetica, Arial, sans-serif;
font-size: 36pt;
}
#preload > .logoTitle {
font-family: LobsterRegular, Helvetica, sans-serif;
}
div#logoTitle > .logoTitle:hover, div#logoTitle > .logoTitle:hover,
i.icon-petrolette:hover, i.icon-petrolette:hover,
i.icon-petrolette.writing { i.icon-petrolette.writing {
...@@ -273,15 +316,17 @@ div#logoTitle > div { ...@@ -273,15 +316,17 @@ div#logoTitle > div {
flex: 1 0; flex: 1 0;
} }
.logoTitle { .ui-tab i.tabCloser {
color: var(--color-link-hover); top: 2px;
display: var(--logo-display); color: var(--color-tab-inactive-bg);
font-family: LobsterRegular, Helvetica, Arial, sans-serif; }
font-size: 36pt;
.ui-state-active i.tabCloser {
color: var(--color-text);
} }
i.tabCloser:hover { i.tabCloser:hover {
color: var(--color-link-hover); color: var(--color-danger);
} }
[class ^= "icon-"]::before, [class ^= "icon-"]::before,
...@@ -347,12 +392,8 @@ i.tabCloser:hover { ...@@ -347,12 +392,8 @@ i.tabCloser:hover {
width: 0; width: 0;
} }
#preload > .logoTitle {
font-family: LobsterRegular, Helvetica, sans-serif;
}
.feedHeader > .feedTitle { .feedHeader > .feedTitle {
margin-top: 2px; margin-top: 3px;
flex-basis: auto; flex-basis: auto;
flex-grow: 4; flex-grow: 4;
flex-shrink: 1; flex-shrink: 1;
...@@ -395,7 +436,7 @@ h1.rs-big-headline { ...@@ -395,7 +436,7 @@ h1.rs-big-headline {
} }
.rs-sub-headline { .rs-sub-headline {
word-break: normal; word-break: normal !important;
} }
h3 { h3 {
...@@ -427,7 +468,7 @@ ul { ...@@ -427,7 +468,7 @@ ul {
width: -moz-available; width: -moz-available;
width: -webkit-fill-available; width: -webkit-fill-available;
width: fill-available; width: fill-available;
align-items: center; /* align-items: center; */
} }
#questionDialog > .flexBox { #questionDialog > .flexBox {
...@@ -442,11 +483,6 @@ ul { ...@@ -442,11 +483,6 @@ ul {
flex-grow: 4; flex-grow: 4;
} }
/* legend, */
/* #dialogs p { */
/* color: var(--color-ui-pri); */
/* } */
ul.help li { ul.help li {
margin: 1em 0 0 1em; margin: 1em 0 0 1em;
} }
...@@ -522,10 +558,6 @@ li.feedItem.error > strong.value { ...@@ -522,10 +558,6 @@ li.feedItem.error > strong.value {
z-index: 10; z-index: 10;
} }
.hidden {
display: none;
}
#newTabTab.hidden { #newTabTab.hidden {
display: none; display: none;
} }
...@@ -544,14 +576,12 @@ li.feedItem.error > strong.value { ...@@ -544,14 +576,12 @@ li.feedItem.error > strong.value {
select { select {
width: 100%; width: 100%;
height: 30px; height: 30px;