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

Merge branch 'dev'

parents e87e4204 0bd3233b
......@@ -7,5 +7,5 @@ job1:
stage: build
script:
- npm install
- PTL_PORT_HTTP=8000 npm start
- PTL_PORT_HTTP=8000 npm run coverage
- npm start
- npm run coverage
......@@ -25,7 +25,8 @@
"remotestorage": "rs#1.2.3",
"rs-widget": "1.3.0",
"DOMPurify": "dompurify#^2.2.6",
"responsively-lazy": "^2.0.2"
"responsively-lazy": "^2.0.2",
"idb-keyval": "^5.0.5"
},
"resolutions": {
"intro.js": "^3.3.1"
......
......@@ -9,16 +9,25 @@ const httpServer = http.createServer(petrolette);
const portHttp = pjson.HTTP_PORT || 8000;
const portHttps = pjson.HTTPS_PORT || 8001;
process.on('uncaughtException', function(err) {
console.error('### Pétrolette uncaughtException: %s', err.code);
});
httpServer.listen(portHttp, () => {
console.debug('HTTP Server running on port %s', portHttp);
});
const httpsServer = https.createServer({
try {
const httpsServer = https.createServer({
key: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/privkey.pem'),
cert: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/cert.pem'),
ca: fs.readFileSync('/etc/letsencrypt/live/petrolette.space/chain.pem'),
}, petrolette);
}, petrolette);
httpsServer.listen(portHttps, () => {
httpsServer.listen(portHttps, () => {
console.debug('HTTPS Server running');
});
});
} catch (error) {
console.error('error: no HTTPS here');
}
This diff is collapsed.
{
"name": "petrolette",
"description": "The news reader that doesn't know you",
"version": "1.3.0A",
"version": "1.3.0",
"private": true,
"license": "GPL-3.0-only",
"HTTP_PORT": 8000,
......@@ -37,6 +37,7 @@
"feedrat": "git+https://framagit.org/yphil/feedrat.git",
"helmet": "^4.4.1",
"iconv-lite": "^0.6.2",
"idb": "^6.0.0",
"morgan": "^1.10.0",
"node-fetch": "^2.6.1",
"npm": "^7.10.0",
......@@ -46,6 +47,7 @@
"devDependencies": {
"mocha": "^8.3.2",
"nyc": "^15.1.0",
"rollup": "^2.47.0",
"should": "^13.2.3"
}
}
......@@ -8,32 +8,16 @@ const express = require('express'),
helmet = require("helmet"),
compression = require('compression');
// if (!fs.existsSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR))){
// fs.mkdirSync(path.join(__dirname, pjson.FAVICONS_CACHE_DIR));
// }
fs.mkdir(path.join(__dirname, pjson.FAVICONS_CACHE_DIR), (err) => {
fs.mkdir(path.join(__dirname, pjson.FAVICONS_CACHE_DIR), {
recursive: true
}, (err) => {
if (err) {
return console.error(err);
}
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.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
......@@ -45,10 +29,11 @@ app.use(helmet({contentSecurityPolicy: false}));
app.use(bodyParser.json());
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('/static', express.static(path.join(__dirname, 'public')));
app.use('/bower', express.static(path.join(__dirname, 'bower_components')));
app.use('/', router);
module.exports = app;
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?46778389');
src: url('../font/fontello.eot?46778389#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?46778389') format('woff2'),
url('../font/fontello.woff?46778389') format('woff'),
url('../font/fontello.ttf?46778389') format('truetype'),
url('../font/fontello.svg?46778389#fontello') format('svg');
src: url('../font/fontello.eot?78914911');
src: url('../font/fontello.eot?78914911#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?78914911') format('woff2'),
url('../font/fontello.woff?78914911') format('woff'),
url('../font/fontello.ttf?78914911') format('truetype'),
url('../font/fontello.svg?78914911#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
......@@ -15,7 +15,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
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 @@
}
.icon-left:before { content: '\e801'; } /* '' */
.icon-down-circle:before { content: '\e802'; } /* '' */
.icon-down:before { content: '\e802'; } /* '' */
.icon-upload:before { content: '\e803'; } /* '' */
.icon-up:before { content: '\e804'; } /* '' */
.icon-down:before { content: '\e805'; } /* '' */
.icon-right:before { content: '\e806'; } /* '' */
.icon-rss:before { content: '\e807'; } /* '' */
.icon-checked:before { content: '\e808'; } /* '' */
.icon-checkbox:before { content: '\e809'; } /* '' */
.icon-petrolette:before { content: '\e80a'; } /* '' */
.icon-download:before { content: '\e80b'; } /* '' */
.icon-checked:before { content: '\e80f'; } /* '' */
.icon-trash-empty:before { content: '\e810'; } /* '' */
.icon-plus:before { content: '\e811'; } /* '' */
.icon-minus:before { content: '\e812'; } /* '' */
......@@ -75,7 +73,8 @@
.icon-cancel:before { content: '\e816'; } /* '' */
.icon-refresh:before { content: '\e817'; } /* '' */
.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-audio:before { content: '\e821'; } /* '' */
.icon-comments:before { content: '\e822'; } /* '' */
......
......@@ -92,17 +92,17 @@
body {
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;
}
a:link {
color: var(--color-text);
text-decoration: none;
ul,
li {
padding: 0;
}
.fancybox-caption a, .fancybox-caption a:link, .fancybox-caption a:visited {
background-color: var(--color-button-bg);
color: var(--color-button-text);
a:link {
color: var(--color-text);
text-decoration: none;
}
......@@ -110,15 +110,31 @@ a: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:visited { */
/* color: var(--color-link); */
/* } */
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);
.ui-state-default a,
.ui-state-default a:link,
.ui-state-default a:visited,
.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 {
......@@ -126,6 +142,11 @@ li.feedItem:not(.error) a {
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:visited,
.feedHeader > .feedTitle > a:focus,
......@@ -151,11 +172,29 @@ table#jsLicenseTable td a:link {
text-decoration: underline;
}
.feedHeader .feedControls div {
margin: 0 2px 0 0;
}
div#logoTitle {
display: flex;
/* 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,
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.topNav > div.menuBarButton,
......@@ -165,18 +204,8 @@ i.tabIcon,
cursor: pointer;
}
.feedHeader .feedControls div {
margin: 0 2px 0 0;
}
.feedHeader > .feedToggle,
.feedHeader .feedControls div {
text-align: center;
}
#loadSpinner > div {
color: var(--color-text);
font-size: 12pt;
.middleButton {
margin: 0 5px;
}
p.dangerous {
......@@ -199,19 +228,22 @@ button.dangerous:hover {
transform: rotate(90deg);
}
.ui-spinner input {
width: 32px;
}
.topNav {
z-index: 20;
background-color: var(--color-ui-qua);
display: flex;
flex-direction: row;
overflow: hidden;
height: 45px;
}
.topNav > div.menuBarItem {
color: var(--color-ui-pri);
text-align: center;
}
/* .topNav > div.menuBarItem { */
/* color: var(--color-ui-pri); */
/* text-align: center; */
/* } */
.topNav .navLeft {
order: 1;
......@@ -228,11 +260,15 @@ button.dangerous:hover {
.topNav > div.menuBarItem > i.topMenuIcon {
display: block;
color: var(--color-ui-sec);
color: var(--color-text);
font-size: 16pt;
margin: 8px 8px 8px 12px;
}
.topNav > div.menuBarItem > i.topMenuIcon:hover {
color: var(--color-link-hover);
}
.topNav > div.menuBarItem > i.icon-reset {
margin: 11px 0 8px -28px;
color: #333;
......@@ -246,10 +282,6 @@ button.dangerous:hover {
margin: 4px 0 8px;
}
.topNav > div.menuBarItem i.topMenuIcon:hover {
color: var(--color-text);
}
.icon-w3c {
color: var(--color-ui-success);
}
......@@ -261,6 +293,17 @@ i.icon-petrolette {
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,
i.icon-petrolette:hover,
i.icon-petrolette.writing {
......@@ -273,15 +316,17 @@ div#logoTitle > div {
flex: 1 0;
}
.logoTitle {
color: var(--color-link-hover);
display: var(--logo-display);
font-family: LobsterRegular, Helvetica, Arial, sans-serif;
font-size: 36pt;
.ui-tab i.tabCloser {
top: 2px;
color: var(--color-tab-inactive-bg);
}
.ui-state-active i.tabCloser {
color: var(--color-text);
}
i.tabCloser:hover {
color: var(--color-link-hover);
color: var(--color-danger);
}
[class ^= "icon-"]::before,
......@@ -347,12 +392,8 @@ i.tabCloser:hover {
width: 0;
}
#preload > .logoTitle {
font-family: LobsterRegular, Helvetica, sans-serif;
}
.feedHeader > .feedTitle {
margin-top: 2px;
margin-top: 3px;
flex-basis: auto;
flex-grow: 4;
flex-shrink: 1;
......@@ -395,7 +436,7 @@ h1.rs-big-headline {
}
.rs-sub-headline {
word-break: normal;
word-break: normal !important;
}
h3 {
......@@ -427,7 +468,7 @@ ul {
width: -moz-available;
width: -webkit-fill-available;
width: fill-available;
align-items: center;
/* align-items: center; */
}
#questionDialog > .flexBox {
......@@ -442,11 +483,6 @@ ul {
flex-grow: 4;
}
/* legend, */
/* #dialogs p { */
/* color: var(--color-ui-pri); */
/* } */
ul.help li {
margin: 1em 0 0 1em;
}
......@@ -522,10 +558,6 @@ li.feedItem.error > strong.value {
z-index: 10;
}
.hidden {
display: none;
}
#newTabTab.hidden {
display: none;
}
......@@ -544,14 +576,12 @@ li.feedItem.error > strong.value {
select {
width: 100%;
height: 30px;
font-size: 1em;
}
fieldset {
border: 0;
}
fieldset.menuForm {
display: flex;
padding-top: 0.1em;
}
.sideMenuTitleToggleDiv {
......@@ -575,7 +605,7 @@ nav#sideMenu {
padding: 0.3em 0 0 0;
position: fixed;
top: 0;
transition: left 0.1s ease-out;
transition: background-color 0.2s, left 0.1s ease-out;
width: var(--side-menu-width-expanded);
z-index: 11;
overflow: auto;
......@@ -662,10 +692,6 @@ i.tabIcon {
right: 3px;
}
button#feedGuessButton {
margin-left: 0.4em;
}
a.feedErrorReportButton,
a.validateFeedButton {
flex: 1;
......@@ -757,26 +783,8 @@ ul.help li.cloud::before {
.grow,
.shrink,
.unique {
margin: 0.1em;
}
#tabs {
overflow: hidden;
white-space: nowrap;
}
#tabs > ul {
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
scrollbar-color: var(--color-fg4) var(--color-bg1);
}
#tabs > ul > li {
display: inline-block;
float: none;
vertical-align: bottom;
.unique:not(#feedTabSelect) {
margin: 0.2em;
}
.column {
......@@ -841,29 +849,19 @@ ul.column div.buttons {
li.feed {
position: relative;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
/* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; */
margin: 0 0 0.4em 0;
min-height: 20px !important;
width: 100%;
}
select,
.introjs-tooltipReferenceLayer *,
.introjs-button,
.ui-widget,
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button,
.ui-widget-content,
.ui-widget-header {
.rs-widget,
.ui-widget {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}
select {
font-size: 1em;
}
.introjs-button {
border: unset;
text-shadow: unset;
......@@ -1014,10 +1012,6 @@ li.feed div.feedBody {
scrollbar-color: var(--color-scrollbar) var(--color-dialog-border);
}
li.feed div.feedBody:hover {
scrollbar-color: var(--color-link-hover) var(--color-dialog-border);
}
li.feed div.feedBody::-webkit-scrollbar {
width: 4px;
}
......@@ -1031,6 +1025,10 @@ li.feed div.feedBody::-webkit-scrollbar-thumb {
background-color: var(--color-fg4);
}
li.feed div.feedBody:hover {
scrollbar-color: var(--color-link-hover) var(--color-dialog-border);
}
.folded {
height: 0 !important;
border-bottom: var(--color-background) !important;
......@@ -1073,7 +1071,7 @@ div.introjs-helperLayer {
/* IntroJS (help tooltips) */
.introjs-tooltip {
background-color: var(--color-background) !important;
border: 1px solid var(--color-ui-qua);
border: 1px solid var(--color-text);
color: var(--color-text) !important;
width: 360px !important;
max-width: 360px !important;
......@@ -1086,7 +1084,7 @@ div.fancybox-caption a.ui-button.ui-corner-all:hover {
}
#remotestorage-widget > .rs-widget {
margin: 0 0 0.4em 0;
margin: 0.2em 0 0.4em;
padding-left: 0;
border-radius: 3px;
background-color: var(--color-button-bg);
......@@ -1101,7 +1099,9 @@ div.fancybox-caption a.ui-button.ui-corner-all:hover {
color: var(--color-ui-sec) !important;
}
/* Javascript */
.ui-dialog p {
margin: 0.3em 0 0 0;
}
#js {
background-color: var(--color-ui-qua);
......@@ -1182,33 +1182,26 @@ video {
/* UI SHIT */
.ui-spinner {
height: 32px;
margin: 0;
}
.ui-spinner input {
width: 32px;
}
.ui-tab i.tabCloser {
top: 2px;
color: var(--color-tab-inactive-bg);
#tabs {
overflow: hidden;
white-space: nowrap;
}
.ui-tab.ui-state-active > i {
color: var(--color-link);
#tabs > ul {
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
scrollbar-color: var(--color-fg4) var(--color-bg1);
}
.ui-dialog p {
margin: 0.3em 0 0 0;
#tabs > ul > li {
display: inline-block;
float: none;