Compare commits

...

3 Commits

Author SHA1 Message Date
Juan Picado
6a1cdeaec4 chore(release): 5.0.1 2021-04-10 11:13:03 +02:00
Juan Picado
782dd1ca93 fix: logo and favicon configuration (#2180) 2021-04-10 11:09:50 +02:00
Juan Picado
e56fd19968 chore: prepare 5.x 2021-04-09 18:38:26 +02:00
8 changed files with 17 additions and 8 deletions

View File

@@ -36,7 +36,7 @@ jobs:
with:
images: ${{ github.repository }}
tag-custom: 5.x-next
tag-custom-only: ${{ github.ref == 'refs/heads/master' }}
tag-custom-only: ${{ github.ref == 'refs/heads/5.x' }}
tag-semver: |
{{version}}
{{major}}

View File

@@ -4,7 +4,6 @@ on:
push:
tags:
- '*'
jobs:
release:
name: Release

View File

@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [5.0.1](https://github.com/verdaccio/verdaccio/compare/v5.0.0...v5.0.1) (2021-04-10)
### Bug Fixes
* logo and favicon configuration ([#2180](https://github.com/verdaccio/verdaccio/issues/2180)) ([782dd1c](https://github.com/verdaccio/verdaccio/commit/782dd1ca93a1bd910b14c9e79910480fc6f86d36))
## [5.0.0](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.7...v5.0.0) (2021-04-09)

View File

@@ -19,6 +19,8 @@ web:
# sort_packages: asc
# convert your UI to the dark side
# darkMode: true
# logo: http://somedomain/somelogo.png
# favicon: http://somedomain/favicon.ico | /path/favicon.ico
# translate your registry, api i18n not available yet
# i18n:

View File

@@ -24,6 +24,8 @@ web:
# by default packages are ordercer ascendant (asc|desc)
# sort_packages: asc
# darkMode: true
# logo: http://somedomain/somelogo.png
# favicon: http://somedomain/favicon.ico | /path/favicon.ico
# translate your registry, api i18n not available yet
# i18n:

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio",
"version": "5.0.0",
"version": "5.0.1",
"description": "A lightweight private npm proxy registry",
"author": {
"name": "Verdaccio Maintainers",

View File

@@ -28,7 +28,7 @@ export function serveFavicon(config: Config) {
return function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {
try {
// @ts-ignore
const logoConf: string = config?.web?.logo as string;
const logoConf: string = config?.web?.favicon as string;
if (logoConf === '') {
debug('favicon disabled');
res.status(404);
@@ -42,6 +42,7 @@ export function serveFavicon(config: Config) {
) {
debug('redirect to %o', logoConf);
res.redirect(logoConf);
return;
} else {
const faviconPath = path.normalize(logoConf);
debug('serving favicon from %o', faviconPath);
@@ -52,11 +53,10 @@ export function serveFavicon(config: Config) {
} else {
res.setHeader('Content-Type', 'image/x-icon');
fs.createReadStream(faviconPath).pipe(res);
return;
debug('rendered custom ico');
}
});
}
return next();
} else {
res.setHeader('Content-Type', 'image/x-icon');
fs.createReadStream(path.join(__dirname, './web/html/favicon.ico')).pipe(res);

View File

@@ -36,7 +36,6 @@ export default function renderHTML(config, manifest, manifestFiles, req, res) {
const darkMode = config?.web?.darkMode ?? false;
const title = config?.web?.title ?? WEB_TITLE;
const scope = config?.web?.scope ?? '';
// FIXME: logo URI is incomplete
let logoURI = config?.web?.logo ?? '';
const version = pkgJSON.version;
const primaryColor = validatePrimaryColor(config?.web?.primary_color) ?? '#4b5e40';
@@ -56,7 +55,7 @@ export default function renderHTML(config, manifest, manifestFiles, req, res) {
base,
primaryColor,
version,
logoURI,
logo: logoURI,
title,
scope,
language,