From bfb0c05e8389abea00bbfd9ff3427b8ab2dad700 Mon Sep 17 00:00:00 2001 From: Justin Zhang Date: Sun, 11 Sep 2022 00:20:05 +0800 Subject: [PATCH 1/3] Support subpath deployment - Make css font reference relative - Fix cover image loading error --- client/components/boards/boardsList.css | 2 +- client/components/cards/minicard.jade | 2 +- client/components/main/fonts.css | 10 +++++----- packages/wekan-accounts-cas/README.md | 22 +++++++++++++++------- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/client/components/boards/boardsList.css b/client/components/boards/boardsList.css index d7b05bce6..86bc42ac7 100644 --- a/client/components/boards/boardsList.css +++ b/client/components/boards/boardsList.css @@ -1,4 +1,4 @@ -@import url("/css/reset.css") print, screen; +@import url("../../../css/reset.css") print, screen; .board-list { margin: 0 8px; diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index 01cf711e7..42ff0a15f 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -10,7 +10,7 @@ template(name="minicard") else a.fa.fa-navicon.minicard-details-menu.js-open-minicard-details-menu(title="{{_ 'cardDetailsActionsPopup-title'}}") if cover - .minicard-cover(style="background-image: url('{{cover.link 'original' '/'}}?dummyReloadAfterSessionEstablished={{sess}}');") + .minicard-cover(style="background-image: url('{{cover.link 'original'}}?dummyReloadAfterSessionEstablished={{sess}}');") if labels .minicard-labels(class="{{#if hiddenMinicardLabelText}}minicard-labels-no-text{{/if}}") each labels diff --git a/client/components/main/fonts.css b/client/components/main/fonts.css index d379569fb..cc1af11ee 100644 --- a/client/components/main/fonts.css +++ b/client/components/main/fonts.css @@ -2,29 +2,29 @@ font-family: 'Roboto'; font-style: normal; font-weight: 400; - src: local('Roboto'), local('Roboto-Regular'), url("/fonts/roboto-regular.woff2") format('woff2'), url("/fonts/roboto-regular.woff") format('woff'); + src: local('Roboto'), local('Roboto-Regular'), url("../../../roboto-regular.woff2") format('woff2'), url("../../../roboto-regular.woff") format('woff'); } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; - src: local('Roboto Bold'), local('Roboto-Bold'), url("/fonts/roboto-bold.woff2") format('woff2'), url("/fonts/roboto-bold.woff") format('woff'); + src: local('Roboto Bold'), local('Roboto-Bold'), url("../../../roboto-bold.woff2") format('woff2'), url("../../../roboto-bold.woff") format('woff'); } @font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; - src: local('Poppins'), local('Poppins-Regular'), url("/fonts/poppins-regular.woff") format('woff'); + src: local('Poppins'), local('Poppins-Regular'), url("../../../poppins-regular.woff") format('woff'); } @font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; - src: local('Poppins Medium'), local('Poppins-Medium'), url("/fonts/poppins-medium.woff") format('woff'); + src: local('Poppins Medium'), local('Poppins-Medium'), url("../../../poppins-medium.woff") format('woff'); } @font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; - src: local('Poppins Bold'), local('Poppins-Bold'), url("/fonts/poppins-bold.woff") format('woff'); + src: local('Poppins Bold'), local('Poppins-Bold'), url("../../../poppins-bold.woff") format('woff'); } diff --git a/packages/wekan-accounts-cas/README.md b/packages/wekan-accounts-cas/README.md index 3e246c4f1..4e991ed64 100644 --- a/packages/wekan-accounts-cas/README.md +++ b/packages/wekan-accounts-cas/README.md @@ -23,9 +23,11 @@ meteor add wekan:accounts-cas ## Usage -Put CAS settings in Meteor.settings (for example using METEOR_SETTINGS env or --settings) like so: +Put CAS settings in Meteor.settings (for example using METEOR_SETTINGS env or +--settings) like so: -If casVersion is not defined, it will assume you use CAS 1.0. (note by xaionaro: option `casVersion` seems to be just ignored in the code, ATM). +If casVersion is not defined, it will assume you use CAS 1.0. (note by +xaionaro: option `casVersion` seems to be just ignored in the code, ATM). Server side settings: @@ -46,11 +48,17 @@ Meteor.settings = { CAS `attributes` settings : * `attributes`: by default `{}` : all default values below will apply -* * `debug` : by default `false` ; `true` will print to the server console the CAS attribute names to map, the CAS attributes values retrieved, if necessary the new user account created, and finally the user to use -* * `id` : by default, the CAS user is used for the user account, but you can specified another CAS attribute -* * `firstname` : by default `cas:givenName` ; but you can use your own CAS attribute -* * `lastname` : by default `cas:sn` (respectively) ; but you can use your own CAS attribute -* * `fullname` : by default unused, but if you specify your own CAS attribute, it will be used instead of the `firstname` + `lastname` +* * `debug` : by default `false` ; `true` will print to the server console the + CAS attribute names to map, the CAS attributes values retrieved, if necessary + the new user account created, and finally the user to use +* * `id` : by default, the CAS user is used for the user account, but you can + specified another CAS attribute +* * `firstname` : by default `cas:givenName` ; but you can use your own CAS + attribute +* * `lastname` : by default `cas:sn` (respectively) ; but you can use your own + CAS attribute +* * `fullname` : by default unused, but if you specify your own CAS attribute, + it will be used instead of the `firstname` + `lastname` * * `mail` : by default `cas:mail` Client side settings: From ef64b0a654595173e18c607d840775ce5e53e33d Mon Sep 17 00:00:00 2001 From: Justin Zhang Date: Thu, 6 Oct 2022 15:12:12 +0800 Subject: [PATCH 2/3] Fix avatar upload error - Set server-side avatar size limit to 72000 --- Dockerfile | 2 +- client/00-startup.js | 2 +- client/components/main/layouts.jade | 2 +- server/header-login.js | 10 ++++------ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96f03e034..3a3027e0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ ENV BUILD_DEPS="apt-utils libarchive-tools gnupg gosu wget curl bzip2 g++ build- ATTACHMENTS_UPLOAD_MAX_SIZE=0 \ AVATARS_UPLOAD_EXTERNAL_PROGRAM="" \ AVATARS_UPLOAD_MIME_TYPES="" \ - AVATARS_UPLOAD_MAX_SIZE=0 \ + AVATARS_UPLOAD_MAX_SIZE=72000 \ RICHER_CARD_COMMENT_EDITOR=false \ CARD_OPENED_WEBHOOK_ENABLED=false \ MAX_IMAGE_PIXEL="" \ diff --git a/client/00-startup.js b/client/00-startup.js index 4a717b67c..c768e7967 100644 --- a/client/00-startup.js +++ b/client/00-startup.js @@ -1,6 +1,6 @@ // PWA if ('serviceWorker' in navigator) { window.addEventListener('load', function() { - navigator.serviceWorker.register('/pwa-service-worker.js'); + navigator.serviceWorker.register('./pwa-service-worker.js'); }); } diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade index 0a4a092f6..ed0339353 100644 --- a/client/components/main/layouts.jade +++ b/client/components/main/layouts.jade @@ -10,7 +10,7 @@ head link(rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png") link(rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png") link(rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png") - link(rel="manifest" href="/site.webmanifest") + // link(rel="manifest" href="/site.webmanifest") link(rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5") meta(name="apple-mobile-web-app-title" content="Wekan") meta(name="application-name" content="Wekan") diff --git a/server/header-login.js b/server/header-login.js index 88d1a1a64..8ab8a2b91 100644 --- a/server/header-login.js +++ b/server/header-login.js @@ -1,10 +1,8 @@ Meteor.startup(() => { if (process.env.HEADER_LOGIN_ID) { - Meteor.settings.public.headerLoginId = process.env.HEADER_LOGIN_ID; - Meteor.settings.public.headerLoginEmail = process.env.HEADER_LOGIN_EMAIL; - Meteor.settings.public.headerLoginFirstname = - process.env.HEADER_LOGIN_FIRSTNAME; - Meteor.settings.public.headerLoginLastname = - process.env.HEADER_LOGIN_LASTNAME; + Meteor.settings.public.headerLoginId = process.env.HEADER_LOGIN_ID; + Meteor.settings.public.headerLoginEmail = process.env.HEADER_LOGIN_EMAIL; + Meteor.settings.public.headerLoginFirstname = process.env.HEADER_LOGIN_FIRSTNAME; + Meteor.settings.public.headerLoginLastname = process.env.HEADER_LOGIN_LASTNAME; } }); From 53e67ff57ad7c906c466ed92c9c4818d178197d8 Mon Sep 17 00:00:00 2001 From: Justin Zhang Date: Thu, 6 Oct 2022 15:09:51 +0800 Subject: [PATCH 3/3] Supress displaying subtask boards to avoid clutter --- client/components/boards/boardsList.js | 3 ++- imports/i18n/data/zh-CN.i18n.json | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 0576e02c3..3745bef20 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -152,7 +152,8 @@ BlazeComponent.extendComponent({ $and: [ { archived: false }, { type: { $in: ['board', 'template-container'] } }, - { $or: [] } + { $or: [] }, + { title: { $not: { $regex: /^\^.*\^$/ } } } ] }; diff --git a/imports/i18n/data/zh-CN.i18n.json b/imports/i18n/data/zh-CN.i18n.json index 5f3491958..a6bc82a0f 100644 --- a/imports/i18n/data/zh-CN.i18n.json +++ b/imports/i18n/data/zh-CN.i18n.json @@ -693,10 +693,10 @@ "active": "活跃", "card-received": "已接收", "card-received-on": "接收于", - "card-end": "终止", - "card-end-on": "终止于", + "card-end": "结束", + "card-end-on": "结束于", "editCardReceivedDatePopup-title": "修改接收日期", - "editCardEndDatePopup-title": "修改终止日期", + "editCardEndDatePopup-title": "修改结束日期", "setCardColorPopup-title": "设置颜色", "setCardActionsColorPopup-title": "选择一种颜色", "setSwimlaneColorPopup-title": "选择一种颜色", @@ -1195,4 +1195,4 @@ "register": "注册", "forgot-password": "忘记密码", "minicardDetailsActionsPopup-title": "卡片详情" -} \ No newline at end of file +}