From a34d8e975321a68f67b50a9b99ea7ea6928af6e6 Mon Sep 17 00:00:00 2001 From: Gilberto Vidal Date: Mon, 11 Sep 2023 11:21:46 -0600 Subject: [PATCH 1/8] fix: Fix Turkish translation linting (#504) --- client/src/locales/tr/core.js | 385 +++++++++++++++++----------------- 1 file changed, 190 insertions(+), 195 deletions(-) diff --git a/client/src/locales/tr/core.js b/client/src/locales/tr/core.js index 94eca8e6..c3bd8ad9 100644 --- a/client/src/locales/tr/core.js +++ b/client/src/locales/tr/core.js @@ -24,201 +24,196 @@ export default { all: 'Tümü', allChangesWillBeAutomaticallySavedAfterConnectionRestored: 'Bağlantı yeniden kurulduğunda tüm değişiklikler kaydedilecektir.', - areYouSureYouWantToDeleteThisAttachment: - 'Bu eki silmek istediğinize emin misiniz?', - areYouSureYouWantToDeleteThisBoard: 'Bu panoyu silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisCard: 'Bu kartı silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisComment: - 'Bu yorumu silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisLabel: 'Bu etiketi silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisList: 'Bu listeyi silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisProject: - 'Bu projeyi silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisTask: 'Bu görevi silmek istediğinizden emin misiniz?', - areYouSureYouWantToDeleteThisUser: - 'Bu kullanıcıyı silmek istediğinizden emin misiniz?', - areYouSureYouWantToLeaveBoard: 'Panodan ayrılmak istediğinizden emin misiniz?', - areYouSureYouWantToLeaveProject: 'Projeden ayrılmak istediğinizden emin misiniz?', - areYouSureYouWantToRemoveThisManagerFromProject: - 'Bu yöneticiyi projeden çıkarmak istediğinizden emin misiniz?', - areYouSureYouWantToRemoveThisMemberFromBoard: - 'Bu üyeyi panodan çıkarmak istediğinizden emin misiniz?', - attachment: 'ek', - attachments: 'ekler', - authentication: 'kimlik doğrulama', - background: 'arka plan', - board: 'pano', - boardNotFound_title: 'Pano bulunamadı', - cardActions_title: 'Kart İşlemleri', - cardNotFound_title: 'Kart bulunamadı', - cardOrActionAreDeleted: 'Kart veya işlem silindi', - color: 'renk', - createBoard_title: 'Pano Oluştur', - createLabel_title: 'Etiket Oluştur', - createNewOneOrSelectExistingOne: - 'Yeni bir tane oluşturun veya mevcut bir tanesini seçin.', - createProject_title: 'Proje Oluştur', - createTextFile_title: 'Metin Dosyası Oluştur', - currentPassword: 'Geçerli şifre', - dangerZone_title: 'Tehlikeli Bölge', - date: 'tarih', - dueDate_title: 'Termin Tarihi', - deleteAttachment_title: 'Eki Sil', - deleteBoard_title: 'Panoyu Sil', - deleteCard_title: 'Kartı Sil', - deleteComment_title: 'Yorumu Sil', - deleteLabel_title: 'Etiketi Sil', - deleteList_title: 'Listeyi Sil', - deleteProject_title: 'Projeyi Sil', - deleteTask_title: 'Görevi Sil', - deleteUser_title: 'Kullanıcıyı Sil', - description: 'açıklama', - detectAutomaically: 'Otomatik olarak algıla', - dropFileToUpload: 'Yüklenecek dosyayı buraya bırakın', - editAttachment_title: 'Eki Düzenle', - editAvatar_title: 'Avatarı Düzenle', - editBoard_title: 'Panoyu Düzenle', - editDueDate_title: 'Son Tarihi Düzenle', - editEmail_title: 'E-posta Adresini Düzenle', - editLabel_title: 'Etiketi Düzenle', - editPassword_title: 'Şifreyi Değiştir', - editStopwatch_title: 'Kronometreyi Düzenle', - editUsername_title: 'Kullanıcı Adını Düzenle', - email: 'e-posta', - emailAlreadyInUse: 'E-posta adresi zaten kullanımda', - enterCardTitle: 'Kart başlığını girin', - enterDescription: 'Açıklamayı girin', - enterFilename: 'Dosya adını girin', - enterListTitle: 'Liste başlığını girin', - enterProjectTitle: 'Proje başlığını girin', - enterTaskDescription: 'Görev açıklamasını girin', - filterByLabels_title: 'Etikete Göre Filtrele', - filterByMembers_title: 'Üyelere göre filtrele', - fromComputer_title: 'Bilgisayardan', - general: 'Genel', - hours: 'saat', - invalidCurrentPassword: 'Mevcut şifre yanlış', - labels: 'etiketler', - language: 'dil', - leaveBoard_title: 'Panodan Ayrıl', - leaveProject_title: 'Projeden Ayrıl', - list: 'Listeler', - listActions_title: 'Görevleri Listele', - managers: 'Yöneticiler', - members: 'Üyeler', - minutes: 'dakika', - moveCard_title: 'Kartı Taşı', - name: 'isim', - newEmail: 'Yeni e-posta adresi', - newPassword: 'Yeni şifre', - newUsername: 'Yeni kullanıcı adı', - noConnectionToServer: 'Sunucuya bağlantı yok', - noBoards: 'Pano yok', - noLists: 'Liste yok', - noProjects: 'Proje yok', - notifications: 'Bildirimler', - noUnreadNotifications: 'Okunmamış bildirim yok', - openBoard_title: 'Açık Pano', - optional_inline: 'İsteğe bağlı', - organization: 'Organizasyon', - phone: 'telefon', - preferences: 'Tercihler', - pressPasteShortcutToAddAttachmentFromClipboard: - 'İpucu: Panodan bir ek eklemek için CTRL-V ye (Macte Cmd-V) basın', - project: 'Proje', - projectNotFound_title: 'Proje bulunamadı', - removeManager_title: 'Yöneticiyi Kaldır', - removeMember_title: 'Üyeyi Kaldır', - seconds: 'saniye', - selectBoard: 'Pano Seç', - selectList: 'Liste seç', - selectProject: 'Proje seç', - settings: 'Ayarlar', - stopwatch: 'kronometre', - subscribeToMyOwnCardsByDefault: 'Varsayılan olarak kendi kartlarıma abone ol', - taskActions_title: 'Görev Eylemleri', - tasks: 'Görevler', - thereIsNoPreviewAvailableForThisAttachment: 'Bu ek için önizleme mevcut değil', - time: 'zaman', - title: 'başlık', - userActions_title: 'Kullanıcı İşlemleri', - userAddedThisCardToList: '<0>{{user}}<1> bu kartı {{list} listesine ekledi', - userLeftNewCommentToCard: - '{{user}} yeni bir yorum yazdı: <2>{{card} kartına «{{comment}}»', - userMovedCardFromListToList: - '{{user}}, <2>{{card}> kartını {{fromList}} listesinden {{toList}} listesine taşıdı', - userMovedThisCardFromListToList: - '<0>{{user}}<1> bu kartı {{fromList}} konumundan {{toList}} konumuna taşıdı', - username: 'kullanıcı adı', - usernameAlreadyInUse: 'Kullanıcı adı zaten kullanımda', - users: 'kullanıcı', - writeComment: 'Yorum yazın', - }, - action: { - addAnotherCard: 'Başka bir kart ekle', - addAnotherList: 'Başka bir liste ekle', - addAnotherTask: 'Başka bir görev ekle', - addCard: 'Kart ekle', - addCard_title: 'Kart Ekle', - addComment: 'Yorum ekle', - addList: 'Liste ekle', - addMoreDetailedDescription: 'Ayrıntılı bir açıklama ekleyin', - addTask: 'Görev ekle', - addToCard: 'Karta ekle', - addUser: 'Kullanıcı ekle', - createBoard: 'Pano oluştur', - createFile: 'Dosya oluştur', - createLabel: 'Etiket Oluştur', - createNewLabel: 'Yeni etiket oluştur', - createProject: 'Proje oluştur', - delete: 'Sil', - deleteAttachment: 'Eki sil', - deleteAvatar: 'Avatarı sil', - deleteBoard: 'Panoyu Sil', - deleteCard: 'Kartı sil', - deleteCard_title: 'Kartı Sil', - deleteComment: 'Yorumu sil', - deleteImage: 'Resmi sil', - deleteLabel: 'Etiketi sil', - deleteList: 'Listeyi sil', - deleteList_title: 'Listeyi Sil', - deleteProject: 'Projeyi sil', - deleteProject_title: 'Projeyi Sil', - deleteTask: 'Görevi sil', - deleteTask_title: 'Görevi Sil', - deleteUser: 'Kullanıcıyı sil', - edit: 'Düzenle', - editDueDate_title: 'Son Tarihi Düzenle', - editDescription_title: 'Açıklamayı Düzenle', - editEmail_title: 'E-posta Adresini Düzenle', - editPassword_title: 'Şifreyi Değiştir', - editStopwatch_title: 'Kronometreyi Düzenle', - editTitle_title: 'Başlığı düzenle', - editUsername_title: 'Kullanıcı Adını Düzenle', - hideDetails: 'Ayrıntıları gizle', - leaveBoard: 'Panodan Ayrıl', - leaveProject: 'Projeden ayrıl', - logOut_title: 'Çıkış', - makeCover_title: 'Önizleme olarak ayarla', - move: 'Taşı', - moveCard_title: 'Kartı Taşı', - remove: 'Sil', - removeBackground: 'Arka planı kaldır', - removeCover_title: 'Önizlemeyi Kaldır', - removeFromBoard: 'Panodan kaldır', - removeFromProject: 'Projeden kaldır', - removeManager: 'Yöneticiyi kaldır', - removeMember: 'Üyeyi kaldır', - save: 'Kaydet', - showAllAttachments: 'Tüm ekleri göster ({{hidden}} gizli)', - showDetails: 'Ayrıntıları göster', - showFewerAttachments: 'Daha az ek göster', - start: 'başlat', - stop: 'dur', - subscribe: 'Abone ol', - unsubscribe: 'Abonelikten çık', - uploadNewAvatar: 'Yeni avatar yükle', - uploadNewImage: 'Yeni resim yükle', + areYouSureYouWantToDeleteThisAttachment: 'Bu eki silmek istediğinize emin misiniz?', + areYouSureYouWantToDeleteThisBoard: 'Bu panoyu silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisCard: 'Bu kartı silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisComment: 'Bu yorumu silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisLabel: 'Bu etiketi silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisList: 'Bu listeyi silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisProject: 'Bu projeyi silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisTask: 'Bu görevi silmek istediğinizden emin misiniz?', + areYouSureYouWantToDeleteThisUser: 'Bu kullanıcıyı silmek istediğinizden emin misiniz?', + areYouSureYouWantToLeaveBoard: 'Panodan ayrılmak istediğinizden emin misiniz?', + areYouSureYouWantToLeaveProject: 'Projeden ayrılmak istediğinizden emin misiniz?', + areYouSureYouWantToRemoveThisManagerFromProject: + 'Bu yöneticiyi projeden çıkarmak istediğinizden emin misiniz?', + areYouSureYouWantToRemoveThisMemberFromBoard: + 'Bu üyeyi panodan çıkarmak istediğinizden emin misiniz?', + attachment: 'ek', + attachments: 'ekler', + authentication: 'kimlik doğrulama', + background: 'arka plan', + board: 'pano', + boardNotFound_title: 'Pano bulunamadı', + cardActions_title: 'Kart İşlemleri', + cardNotFound_title: 'Kart bulunamadı', + cardOrActionAreDeleted: 'Kart veya işlem silindi', + color: 'renk', + createBoard_title: 'Pano Oluştur', + createLabel_title: 'Etiket Oluştur', + createNewOneOrSelectExistingOne: 'Yeni bir tane oluşturun veya mevcut bir tanesini seçin.', + createProject_title: 'Proje Oluştur', + createTextFile_title: 'Metin Dosyası Oluştur', + currentPassword: 'Geçerli şifre', + dangerZone_title: 'Tehlikeli Bölge', + date: 'tarih', + dueDate_title: 'Termin Tarihi', + deleteAttachment_title: 'Eki Sil', + deleteBoard_title: 'Panoyu Sil', + deleteCard_title: 'Kartı Sil', + deleteComment_title: 'Yorumu Sil', + deleteLabel_title: 'Etiketi Sil', + deleteList_title: 'Listeyi Sil', + deleteProject_title: 'Projeyi Sil', + deleteTask_title: 'Görevi Sil', + deleteUser_title: 'Kullanıcıyı Sil', + description: 'açıklama', + detectAutomaically: 'Otomatik olarak algıla', + dropFileToUpload: 'Yüklenecek dosyayı buraya bırakın', + editAttachment_title: 'Eki Düzenle', + editAvatar_title: 'Avatarı Düzenle', + editBoard_title: 'Panoyu Düzenle', + editDueDate_title: 'Son Tarihi Düzenle', + editEmail_title: 'E-posta Adresini Düzenle', + editLabel_title: 'Etiketi Düzenle', + editPassword_title: 'Şifreyi Değiştir', + editStopwatch_title: 'Kronometreyi Düzenle', + editUsername_title: 'Kullanıcı Adını Düzenle', + email: 'e-posta', + emailAlreadyInUse: 'E-posta adresi zaten kullanımda', + enterCardTitle: 'Kart başlığını girin', + enterDescription: 'Açıklamayı girin', + enterFilename: 'Dosya adını girin', + enterListTitle: 'Liste başlığını girin', + enterProjectTitle: 'Proje başlığını girin', + enterTaskDescription: 'Görev açıklamasını girin', + filterByLabels_title: 'Etikete Göre Filtrele', + filterByMembers_title: 'Üyelere göre filtrele', + fromComputer_title: 'Bilgisayardan', + general: 'Genel', + hours: 'saat', + invalidCurrentPassword: 'Mevcut şifre yanlış', + labels: 'etiketler', + language: 'dil', + leaveBoard_title: 'Panodan Ayrıl', + leaveProject_title: 'Projeden Ayrıl', + list: 'Listeler', + listActions_title: 'Görevleri Listele', + managers: 'Yöneticiler', + members: 'Üyeler', + minutes: 'dakika', + moveCard_title: 'Kartı Taşı', + name: 'isim', + newEmail: 'Yeni e-posta adresi', + newPassword: 'Yeni şifre', + newUsername: 'Yeni kullanıcı adı', + noConnectionToServer: 'Sunucuya bağlantı yok', + noBoards: 'Pano yok', + noLists: 'Liste yok', + noProjects: 'Proje yok', + notifications: 'Bildirimler', + noUnreadNotifications: 'Okunmamış bildirim yok', + openBoard_title: 'Açık Pano', + optional_inline: 'İsteğe bağlı', + organization: 'Organizasyon', + phone: 'telefon', + preferences: 'Tercihler', + pressPasteShortcutToAddAttachmentFromClipboard: + 'İpucu: Panodan bir ek eklemek için CTRL-V ye (Macte Cmd-V) basın', + project: 'Proje', + projectNotFound_title: 'Proje bulunamadı', + removeManager_title: 'Yöneticiyi Kaldır', + removeMember_title: 'Üyeyi Kaldır', + seconds: 'saniye', + selectBoard: 'Pano Seç', + selectList: 'Liste seç', + selectProject: 'Proje seç', + settings: 'Ayarlar', + stopwatch: 'kronometre', + subscribeToMyOwnCardsByDefault: 'Varsayılan olarak kendi kartlarıma abone ol', + taskActions_title: 'Görev Eylemleri', + tasks: 'Görevler', + thereIsNoPreviewAvailableForThisAttachment: 'Bu ek için önizleme mevcut değil', + time: 'zaman', + title: 'başlık', + userActions_title: 'Kullanıcı İşlemleri', + userAddedThisCardToList: '<0>{{user}}<1> bu kartı {{list} listesine ekledi', + userLeftNewCommentToCard: + '{{user}} yeni bir yorum yazdı: <2>{{card} kartına «{{comment}}»', + userMovedCardFromListToList: + '{{user}}, <2>{{card}> kartını {{fromList}} listesinden {{toList}} listesine taşıdı', + userMovedThisCardFromListToList: + '<0>{{user}}<1> bu kartı {{fromList}} konumundan {{toList}} konumuna taşıdı', + username: 'kullanıcı adı', + usernameAlreadyInUse: 'Kullanıcı adı zaten kullanımda', + users: 'kullanıcı', + writeComment: 'Yorum yazın', + }, + action: { + addAnotherCard: 'Başka bir kart ekle', + addAnotherList: 'Başka bir liste ekle', + addAnotherTask: 'Başka bir görev ekle', + addCard: 'Kart ekle', + addCard_title: 'Kart Ekle', + addComment: 'Yorum ekle', + addList: 'Liste ekle', + addMoreDetailedDescription: 'Ayrıntılı bir açıklama ekleyin', + addTask: 'Görev ekle', + addToCard: 'Karta ekle', + addUser: 'Kullanıcı ekle', + createBoard: 'Pano oluştur', + createFile: 'Dosya oluştur', + createLabel: 'Etiket Oluştur', + createNewLabel: 'Yeni etiket oluştur', + createProject: 'Proje oluştur', + delete: 'Sil', + deleteAttachment: 'Eki sil', + deleteAvatar: 'Avatarı sil', + deleteBoard: 'Panoyu Sil', + deleteCard: 'Kartı sil', + deleteCard_title: 'Kartı Sil', + deleteComment: 'Yorumu sil', + deleteImage: 'Resmi sil', + deleteLabel: 'Etiketi sil', + deleteList: 'Listeyi sil', + deleteList_title: 'Listeyi Sil', + deleteProject: 'Projeyi sil', + deleteProject_title: 'Projeyi Sil', + deleteTask: 'Görevi sil', + deleteTask_title: 'Görevi Sil', + deleteUser: 'Kullanıcıyı sil', + edit: 'Düzenle', + editDueDate_title: 'Son Tarihi Düzenle', + editDescription_title: 'Açıklamayı Düzenle', + editEmail_title: 'E-posta Adresini Düzenle', + editPassword_title: 'Şifreyi Değiştir', + editStopwatch_title: 'Kronometreyi Düzenle', + editTitle_title: 'Başlığı düzenle', + editUsername_title: 'Kullanıcı Adını Düzenle', + hideDetails: 'Ayrıntıları gizle', + leaveBoard: 'Panodan Ayrıl', + leaveProject: 'Projeden ayrıl', + logOut_title: 'Çıkış', + makeCover_title: 'Önizleme olarak ayarla', + move: 'Taşı', + moveCard_title: 'Kartı Taşı', + remove: 'Sil', + removeBackground: 'Arka planı kaldır', + removeCover_title: 'Önizlemeyi Kaldır', + removeFromBoard: 'Panodan kaldır', + removeFromProject: 'Projeden kaldır', + removeManager: 'Yöneticiyi kaldır', + removeMember: 'Üyeyi kaldır', + save: 'Kaydet', + showAllAttachments: 'Tüm ekleri göster ({{hidden}} gizli)', + showDetails: 'Ayrıntıları göster', + showFewerAttachments: 'Daha az ek göster', + start: 'başlat', + stop: 'dur', + subscribe: 'Abone ol', + unsubscribe: 'Abonelikten çık', + uploadNewAvatar: 'Yeni avatar yükle', + uploadNewImage: 'Yeni resim yükle', }, }, }; From 91bc889fed6c8feebd8607f14feffd1f2a810814 Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Tue, 12 Sep 2023 01:12:38 +0200 Subject: [PATCH 2/8] feat: Use environment variables for default admin configuration --- .../UserInformationEdit.jsx | 21 ++- .../components/UserInformationEditStep.jsx | 51 ++++---- .../AccountPane/AccountPane.jsx | 121 +++++++++--------- .../UserSettingsModal/UserSettingsModal.jsx | 3 + .../UsersModal/Item/ActionsStep.jsx | 45 ++++--- .../src/components/UsersModal/Item/Item.jsx | 5 +- .../src/components/UsersModal/UsersModal.jsx | 1 + .../containers/UserSettingsModalContainer.js | 2 + client/src/models/User.js | 3 + docker-compose.yml | 6 + server/.env.sample | 7 + server/api/controllers/users/delete.js | 4 + server/api/controllers/users/update-email.js | 4 + .../api/controllers/users/update-password.js | 4 + .../api/controllers/users/update-username.js | 4 + server/api/controllers/users/update.js | 7 + server/api/models/User.js | 1 + server/config/custom.js | 2 + server/db/init.js | 6 +- server/db/seeds/default.js | 48 +++++-- 20 files changed, 224 insertions(+), 121 deletions(-) diff --git a/client/src/components/UserInformationEdit/UserInformationEdit.jsx b/client/src/components/UserInformationEdit/UserInformationEdit.jsx index f580cdc8..0a740591 100644 --- a/client/src/components/UserInformationEdit/UserInformationEdit.jsx +++ b/client/src/components/UserInformationEdit/UserInformationEdit.jsx @@ -1,4 +1,5 @@ import { dequal } from 'dequal'; +import omit from 'lodash/omit'; import pickBy from 'lodash/pickBy'; import React, { useCallback, useMemo, useRef } from 'react'; import PropTypes from 'prop-types'; @@ -9,7 +10,7 @@ import { useForm } from '../../hooks'; import styles from './UserInformationEdit.module.scss'; -const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => { +const UserInformationEdit = React.memo(({ defaultData, isNameEditable, onUpdate }) => { const [t] = useTranslation(); const [data, handleFieldChange] = useForm(() => ({ @@ -32,13 +33,17 @@ const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => { const nameField = useRef(null); const handleSubmit = useCallback(() => { - if (!cleanData.name) { - nameField.current.select(); - return; - } + if (isNameEditable) { + if (!cleanData.name) { + nameField.current.select(); + return; + } - onUpdate(cleanData); - }, [onUpdate, cleanData]); + onUpdate(cleanData); + } else { + onUpdate(omit(cleanData, 'name')); + } + }, [isNameEditable, onUpdate, cleanData]); return (
@@ -48,6 +53,7 @@ const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => { ref={nameField} name="name" value={data.name} + disabled={!isNameEditable} className={styles.field} onChange={handleFieldChange} /> @@ -74,6 +80,7 @@ const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => { UserInformationEdit.propTypes = { defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types + isNameEditable: PropTypes.bool.isRequired, onUpdate: PropTypes.func.isRequired, }; diff --git a/client/src/components/UserInformationEditStep.jsx b/client/src/components/UserInformationEditStep.jsx index f8d1f8ab..3601a7dd 100644 --- a/client/src/components/UserInformationEditStep.jsx +++ b/client/src/components/UserInformationEditStep.jsx @@ -5,33 +5,40 @@ import { Popup } from '../lib/custom-ui'; import UserInformationEdit from './UserInformationEdit'; -const UserInformationEditStep = React.memo(({ defaultData, onUpdate, onBack, onClose }) => { - const [t] = useTranslation(); +const UserInformationEditStep = React.memo( + ({ defaultData, isNameEditable, onUpdate, onBack, onClose }) => { + const [t] = useTranslation(); - const handleUpdate = useCallback( - (data) => { - onUpdate(data); - onClose(); - }, - [onUpdate, onClose], - ); + const handleUpdate = useCallback( + (data) => { + onUpdate(data); + onClose(); + }, + [onUpdate, onClose], + ); - return ( - <> - - {t('common.editInformation', { - context: 'title', - })} - - - - - - ); -}); + return ( + <> + + {t('common.editInformation', { + context: 'title', + })} + + + + + + ); + }, +); UserInformationEditStep.propTypes = { defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types + isNameEditable: PropTypes.bool.isRequired, onUpdate: PropTypes.func.isRequired, onBack: PropTypes.func, onClose: PropTypes.func.isRequired, diff --git a/client/src/components/UserSettingsModal/AccountPane/AccountPane.jsx b/client/src/components/UserSettingsModal/AccountPane/AccountPane.jsx index 1a581349..7333cf5d 100644 --- a/client/src/components/UserSettingsModal/AccountPane/AccountPane.jsx +++ b/client/src/components/UserSettingsModal/AccountPane/AccountPane.jsx @@ -23,6 +23,7 @@ const AccountPane = React.memo( phone, organization, language, + isLocked, isAvatarUpdating, usernameUpdateForm, emailUpdateForm, @@ -74,6 +75,7 @@ const AccountPane = React.memo( phone, organization, }} + isNameEditable={!isLocked} onUpdate={onUpdate} /> @@ -102,63 +104,67 @@ const AccountPane = React.memo( value={language || 'auto'} onChange={handleLanguageChange} /> - -
- {t('common.authentication', { - context: 'title', - })} -
-
-
- - - -
-
- - - -
-
- - - -
+ {!isLocked && ( + <> + +
+ {t('common.authentication', { + context: 'title', + })} +
+
+
+ + + +
+
+ + + +
+
+ + + +
+ + )} ); }, @@ -172,6 +178,7 @@ AccountPane.propTypes = { phone: PropTypes.string, organization: PropTypes.string, language: PropTypes.string, + isLocked: PropTypes.bool.isRequired, isAvatarUpdating: PropTypes.bool.isRequired, /* eslint-disable react/forbid-prop-types */ usernameUpdateForm: PropTypes.object.isRequired, diff --git a/client/src/components/UserSettingsModal/UserSettingsModal.jsx b/client/src/components/UserSettingsModal/UserSettingsModal.jsx index da4cbf5e..6cc0b826 100644 --- a/client/src/components/UserSettingsModal/UserSettingsModal.jsx +++ b/client/src/components/UserSettingsModal/UserSettingsModal.jsx @@ -16,6 +16,7 @@ const UserSettingsModal = React.memo( phone, organization, language, + isLocked, subscribeToOwnCards, isAvatarUpdating, usernameUpdateForm, @@ -48,6 +49,7 @@ const UserSettingsModal = React.memo( phone={phone} organization={organization} language={language} + isLocked={isLocked} isAvatarUpdating={isAvatarUpdating} usernameUpdateForm={usernameUpdateForm} emailUpdateForm={emailUpdateForm} @@ -104,6 +106,7 @@ UserSettingsModal.propTypes = { phone: PropTypes.string, organization: PropTypes.string, language: PropTypes.string, + isLocked: PropTypes.bool.isRequired, subscribeToOwnCards: PropTypes.bool.isRequired, isAvatarUpdating: PropTypes.bool.isRequired, /* eslint-disable react/forbid-prop-types */ diff --git a/client/src/components/UsersModal/Item/ActionsStep.jsx b/client/src/components/UsersModal/Item/ActionsStep.jsx index c9b2c8ac..a97d13a8 100644 --- a/client/src/components/UsersModal/Item/ActionsStep.jsx +++ b/client/src/components/UsersModal/Item/ActionsStep.jsx @@ -64,6 +64,7 @@ const ActionsStep = React.memo( return ( - - {t('action.editUsername', { - context: 'title', - })} - - - {t('action.editEmail', { - context: 'title', - })} - - - {t('action.editPassword', { - context: 'title', - })} - - - {t('action.deleteUser', { - context: 'title', - })} - + {!user.isLocked && ( + <> + + {t('action.editUsername', { + context: 'title', + })} + + + {t('action.editEmail', { + context: 'title', + })} + + + {t('action.editPassword', { + context: 'title', + })} + + + {t('action.deleteUser', { + context: 'title', + })} + + + )} diff --git a/client/src/components/UsersModal/Item/Item.jsx b/client/src/components/UsersModal/Item/Item.jsx index 248de7fc..0627baf6 100755 --- a/client/src/components/UsersModal/Item/Item.jsx +++ b/client/src/components/UsersModal/Item/Item.jsx @@ -17,6 +17,7 @@ const Item = React.memo( organization, phone, isAdmin, + isLocked, emailUpdateForm, passwordUpdateForm, usernameUpdateForm, @@ -46,7 +47,7 @@ const Item = React.memo( {username || '-'} {email} - + { phone, organization, language, + isLocked, subscribeToOwnCards, isAvatarUpdating, emailUpdateForm, @@ -29,6 +30,7 @@ const mapStateToProps = (state) => { phone, organization, language, + isLocked, subscribeToOwnCards, isAvatarUpdating, emailUpdateForm, diff --git a/client/src/models/User.js b/client/src/models/User.js index 8e2f6768..39a4330f 100755 --- a/client/src/models/User.js +++ b/client/src/models/User.js @@ -50,6 +50,9 @@ export default class extends BaseModel { isAdmin: attr({ getDefault: () => false, }), + isLocked: attr({ + getDefault: () => false, + }), isAvatarUpdating: attr({ getDefault: () => false, }), diff --git a/docker-compose.yml b/docker-compose.yml index 20f5e1be..c77790de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,12 @@ services: - DATABASE_URL=postgresql://postgres@postgres/planka - SECRET_KEY=notsecretkey + # Can be removed after installation + - DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted + - DEFAULT_ADMIN_PASSWORD=demo + - DEFAULT_ADMIN_NAME=Demo Demo + - DEFAULT_ADMIN_USERNAME=demo + # related: https://github.com/knex/knex/issues/2354 # As knex does not pass query parameters from the connection string we # have to use environment variables in order to pass the desired values, e.g. diff --git a/server/.env.sample b/server/.env.sample index 9024a6b5..36de1985 100644 --- a/server/.env.sample +++ b/server/.env.sample @@ -4,6 +4,13 @@ BASE_URL=http://localhost:1337 DATABASE_URL=postgresql://postgres@localhost/planka SECRET_KEY=notsecretkey +## Can be removed after installation + +DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted +DEFAULT_ADMIN_PASSWORD=demo +DEFAULT_ADMIN_NAME=Demo Demo +DEFAULT_ADMIN_USERNAME=demo + ## Optional # TRUST_PROXY=0 diff --git a/server/api/controllers/users/delete.js b/server/api/controllers/users/delete.js index 37df2d6f..46edb042 100755 --- a/server/api/controllers/users/delete.js +++ b/server/api/controllers/users/delete.js @@ -26,6 +26,10 @@ module.exports = { throw Errors.USER_NOT_FOUND; } + if (user.email === sails.config.custom.defaultAdminEmail) { + throw Errors.USER_NOT_FOUND; // Forbidden + } + user = await sails.helpers.users.deleteOne.with({ record: user, request: this.req, diff --git a/server/api/controllers/users/update-email.js b/server/api/controllers/users/update-email.js index a148099f..182e0c10 100644 --- a/server/api/controllers/users/update-email.js +++ b/server/api/controllers/users/update-email.js @@ -59,6 +59,10 @@ module.exports = { throw Errors.USER_NOT_FOUND; } + if (user.email === sails.config.custom.defaultAdminEmail) { + throw Errors.USER_NOT_FOUND; // Forbidden + } + if ( inputs.id === currentUser.id && !bcrypt.compareSync(inputs.currentPassword, user.password) diff --git a/server/api/controllers/users/update-password.js b/server/api/controllers/users/update-password.js index 1cf27361..c3d9c724 100644 --- a/server/api/controllers/users/update-password.js +++ b/server/api/controllers/users/update-password.js @@ -58,6 +58,10 @@ module.exports = { throw Errors.USER_NOT_FOUND; } + if (user.email === sails.config.custom.defaultAdminEmail) { + throw Errors.USER_NOT_FOUND; // Forbidden + } + if ( inputs.id === currentUser.id && !bcrypt.compareSync(inputs.currentPassword, user.password) diff --git a/server/api/controllers/users/update-username.js b/server/api/controllers/users/update-username.js index 13fc4bc4..03bb1d3c 100644 --- a/server/api/controllers/users/update-username.js +++ b/server/api/controllers/users/update-username.js @@ -61,6 +61,10 @@ module.exports = { throw Errors.USER_NOT_FOUND; } + if (user.email === sails.config.custom.defaultAdminEmail) { + throw Errors.USER_NOT_FOUND; // Forbidden + } + if ( inputs.id === currentUser.id && !bcrypt.compareSync(inputs.currentPassword, user.password) diff --git a/server/api/controllers/users/update.js b/server/api/controllers/users/update.js index a6631027..7de8a730 100755 --- a/server/api/controllers/users/update.js +++ b/server/api/controllers/users/update.js @@ -67,6 +67,13 @@ module.exports = { throw Errors.USER_NOT_FOUND; } + if (user.email === sails.config.custom.defaultAdminEmail) { + /* eslint-disable no-param-reassign */ + delete inputs.isAdmin; + delete inputs.name; + /* eslint-enable no-param-reassign */ + } + const values = { ..._.pick(inputs, [ 'isAdmin', diff --git a/server/api/models/User.js b/server/api/models/User.js index 73e876b6..f63dc68f 100755 --- a/server/api/models/User.js +++ b/server/api/models/User.js @@ -114,6 +114,7 @@ module.exports = { avatarUrl: this.avatar && `${sails.config.custom.userAvatarsUrl}/${this.avatar.dirname}/square-100.${this.avatar.extension}`, + isLocked: this.email === sails.config.custom.defaultAdminEmail, }; }, }; diff --git a/server/config/custom.js b/server/config/custom.js index 4d21b642..6608ee0a 100644 --- a/server/config/custom.js +++ b/server/config/custom.js @@ -40,4 +40,6 @@ module.exports.custom = { oidcJwksUri: process.env.OIDC_JWKS_URI, oidcScopes: process.env.OIDC_SCOPES || 'openid profile email', oidcSkipUserInfo: process.env.OIDC_SKIP_USER_INFO === 'true', + + defaultAdminEmail: process.env.DEFAULT_ADMIN_EMAIL, }; diff --git a/server/db/init.js b/server/db/init.js index 6646e925..cd68752b 100644 --- a/server/db/init.js +++ b/server/db/init.js @@ -6,12 +6,8 @@ const knex = initKnex(knexfile); (async () => { try { - const isExists = await knex.schema.hasTable(knexfile.migrations.tableName); - await knex.migrate.latest(); - if (!isExists) { - await knex.seed.run(); - } + await knex.seed.run(); } catch (error) { process.exitCode = 1; diff --git a/server/db/seeds/default.js b/server/db/seeds/default.js index f1f81ecc..8fa4cdc2 100644 --- a/server/db/seeds/default.js +++ b/server/db/seeds/default.js @@ -1,12 +1,42 @@ const bcrypt = require('bcrypt'); -exports.seed = (knex) => - knex('user_account').insert({ - email: 'demo@demo.demo', - password: bcrypt.hashSync('demo', 10), +const buildData = () => { + const data = { isAdmin: true, - name: 'Demo Demo', - username: 'demo', - subscribeToOwnCards: false, - createdAt: new Date().toISOString(), - }); + }; + + if (process.env.DEFAULT_ADMIN_PASSWORD) { + data.password = bcrypt.hashSync(process.env.DEFAULT_ADMIN_PASSWORD, 10); + } + if (process.env.DEFAULT_ADMIN_NAME) { + data.name = process.env.DEFAULT_ADMIN_NAME; + } + if (process.env.DEFAULT_ADMIN_USERNAME) { + data.username = process.env.DEFAULT_ADMIN_USERNAME; + } + + return data; +}; + +exports.seed = async (knex) => { + if (!process.env.DEFAULT_ADMIN_EMAIL) { + return; + } + + const data = buildData(); + + try { + await knex('user_account').insert({ + ...data, + email: process.env.DEFAULT_ADMIN_EMAIL, + subscribeToOwnCards: false, + createdAt: new Date().toISOString(), + }); + } catch (error) { + if (Object.keys(data).length === 0) { + return; + } + + await knex('user_account').update(data).where('email', process.env.DEFAULT_ADMIN_EMAIL); + } +}; From 875895b331e7529867600c370c2722e2373a8119 Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Tue, 12 Sep 2023 01:20:21 +0200 Subject: [PATCH 3/8] fix: Fix starting without OIDC environment variables Closes #503 --- server/config/custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/config/custom.js b/server/config/custom.js index 6608ee0a..a132e5ad 100644 --- a/server/config/custom.js +++ b/server/config/custom.js @@ -35,7 +35,7 @@ module.exports.custom = { oidcAudience: process.env.OIDC_AUDIENCE, oidcClientId: process.env.OIDC_CLIENT_ID, oidcRolesAttribute: process.env.OIDC_ROLES_ATTRIBUTE || 'groups', - oidcAdminRoles: process.env.OIDC_ADMIN_ROLES.split(',') || [], + oidcAdminRoles: process.env.OIDC_ADMIN_ROLES ? process.env.OIDC_ADMIN_ROLES.split(',') : [], oidcredirectUri: process.env.OIDC_REDIRECT_URI, oidcJwksUri: process.env.OIDC_JWKS_URI, oidcScopes: process.env.OIDC_SCOPES || 'openid profile email', From 7cb9774e05d0a2dd868409b25a4b925b9fe767a6 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Wed, 13 Sep 2023 22:38:37 +0200 Subject: [PATCH 4/8] chore: Switch to pnpm package manager --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf7816d9..456d717c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ WORKDIR /app COPY server/package.json server/package-lock.json . RUN npm install npm@latest --global \ - && npm clean-install --omit=dev + && npm install pnpm --global \ + && pnpm install --prod FROM node:lts AS client @@ -14,7 +15,8 @@ WORKDIR /app COPY client/package.json client/package-lock.json . RUN npm install npm@latest --global \ - && npm clean-install --omit=dev + && npm install pnpm --global \ + && pnpm install --prod COPY client . RUN DISABLE_ESLINT_PLUGIN=true npm run build From 90a30961ff6efc5ea0619f0eee1e7af6aa426ad0 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Wed, 13 Sep 2023 22:39:37 +0200 Subject: [PATCH 5/8] chore: Add dev container, based on latest commit --- .../build-and-push-docker-image-amd64-dev.yml | 34 +++++++++++++++++++ .../build-and-push-docker-image-arm-dev.yml | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/build-and-push-docker-image-amd64-dev.yml create mode 100644 .github/workflows/build-and-push-docker-image-arm-dev.yml diff --git a/.github/workflows/build-and-push-docker-image-amd64-dev.yml b/.github/workflows/build-and-push-docker-image-amd64-dev.yml new file mode 100644 index 00000000..5ace01ee --- /dev/null +++ b/.github/workflows/build-and-push-docker-image-amd64-dev.yml @@ -0,0 +1,34 @@ +name: Build and push Docker DEV image amd64 + +on: + push: + branches: [master] + +jobs: + build-and-push-docker-image-dev-amd64: + runs-on: [self-hosted, ubuntu-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + ghcr.io/plankanban/planka:dev diff --git a/.github/workflows/build-and-push-docker-image-arm-dev.yml b/.github/workflows/build-and-push-docker-image-arm-dev.yml new file mode 100644 index 00000000..eb5691fa --- /dev/null +++ b/.github/workflows/build-and-push-docker-image-arm-dev.yml @@ -0,0 +1,34 @@ +name: Build and push Docker DEV image arm + +on: + push: + branches: [master] + +jobs: + build-and-push-docker-image-dev-arm: + runs-on: [self-hosted, ubuntu-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/arm64,linux/arm/v7 + push: true + tags: | + ghcr.io/plankanban/planka:dev From 211c841379e238fe07eacd6dbbd7d87ad047a6f7 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Wed, 13 Sep 2023 22:47:08 +0200 Subject: [PATCH 6/8] chore: Switch to self hostet action runner --- .../workflows/build-and-push-docker-base-image.yml | 12 ++++++------ .../build-and-push-docker-image-amd64-dev.yml | 2 +- .../build-and-push-docker-image-arm-dev.yml | 2 +- .github/workflows/build-and-push-docker-image.yml | 12 ++++++------ .github/workflows/helm-chart-release.yml | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-push-docker-base-image.yml b/.github/workflows/build-and-push-docker-base-image.yml index 7e808ae4..dddc48d5 100644 --- a/.github/workflows/build-and-push-docker-base-image.yml +++ b/.github/workflows/build-and-push-docker-base-image.yml @@ -13,26 +13,26 @@ env: jobs: build-and-push-docker-base-image: - runs-on: ubuntu-latest + runs-on: [self-hosted] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 diff --git a/.github/workflows/build-and-push-docker-image-amd64-dev.yml b/.github/workflows/build-and-push-docker-image-amd64-dev.yml index 5ace01ee..b2a4697c 100644 --- a/.github/workflows/build-and-push-docker-image-amd64-dev.yml +++ b/.github/workflows/build-and-push-docker-image-amd64-dev.yml @@ -6,7 +6,7 @@ on: jobs: build-and-push-docker-image-dev-amd64: - runs-on: [self-hosted, ubuntu-latest] + runs-on: [self-hosted] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-and-push-docker-image-arm-dev.yml b/.github/workflows/build-and-push-docker-image-arm-dev.yml index eb5691fa..1a8b8931 100644 --- a/.github/workflows/build-and-push-docker-image-arm-dev.yml +++ b/.github/workflows/build-and-push-docker-image-arm-dev.yml @@ -6,7 +6,7 @@ on: jobs: build-and-push-docker-image-dev-arm: - runs-on: [self-hosted, ubuntu-latest] + runs-on: [self-hosted] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-and-push-docker-image.yml b/.github/workflows/build-and-push-docker-image.yml index a210dd4c..d3e906a1 100644 --- a/.github/workflows/build-and-push-docker-image.yml +++ b/.github/workflows/build-and-push-docker-image.yml @@ -6,19 +6,19 @@ on: jobs: build-and-push-docker-image: - runs-on: ubuntu-latest + runs-on: [self-hosted] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -32,7 +32,7 @@ jobs: script: return context.payload.release.tag_name.replace('v', '') - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index f4ad1bc0..c010e361 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -13,10 +13,10 @@ jobs: # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token permissions: contents: write - runs-on: ubuntu-latest + runs-on: [self-hosted] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 From 13ee0c346658cbd7a79f7a6f38449fc77cbe38e4 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Wed, 13 Sep 2023 22:55:09 +0200 Subject: [PATCH 7/8] chore: fix runs-on name --- .github/workflows/build-and-push-docker-base-image.yml | 2 +- .github/workflows/build-and-push-docker-image-amd64-dev.yml | 2 +- .github/workflows/build-and-push-docker-image-arm-dev.yml | 2 +- .github/workflows/build-and-push-docker-image.yml | 2 +- .github/workflows/helm-chart-release.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-push-docker-base-image.yml b/.github/workflows/build-and-push-docker-base-image.yml index dddc48d5..427435da 100644 --- a/.github/workflows/build-and-push-docker-base-image.yml +++ b/.github/workflows/build-and-push-docker-base-image.yml @@ -13,7 +13,7 @@ env: jobs: build-and-push-docker-base-image: - runs-on: [self-hosted] + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-and-push-docker-image-amd64-dev.yml b/.github/workflows/build-and-push-docker-image-amd64-dev.yml index b2a4697c..5369cfe5 100644 --- a/.github/workflows/build-and-push-docker-image-amd64-dev.yml +++ b/.github/workflows/build-and-push-docker-image-amd64-dev.yml @@ -6,7 +6,7 @@ on: jobs: build-and-push-docker-image-dev-amd64: - runs-on: [self-hosted] + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-and-push-docker-image-arm-dev.yml b/.github/workflows/build-and-push-docker-image-arm-dev.yml index 1a8b8931..2ab356fa 100644 --- a/.github/workflows/build-and-push-docker-image-arm-dev.yml +++ b/.github/workflows/build-and-push-docker-image-arm-dev.yml @@ -6,7 +6,7 @@ on: jobs: build-and-push-docker-image-dev-arm: - runs-on: [self-hosted] + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-and-push-docker-image.yml b/.github/workflows/build-and-push-docker-image.yml index d3e906a1..47bb7376 100644 --- a/.github/workflows/build-and-push-docker-image.yml +++ b/.github/workflows/build-and-push-docker-image.yml @@ -6,7 +6,7 @@ on: jobs: build-and-push-docker-image: - runs-on: [self-hosted] + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index c010e361..5e7f150e 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -13,7 +13,7 @@ jobs: # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token permissions: contents: write - runs-on: [self-hosted] + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 From d896c3183bb434680d99437aa96d11a766b14fef Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Thu, 14 Sep 2023 01:27:29 +0200 Subject: [PATCH 8/8] chore: fix docker dev build --- .../build-and-push-docker-image-arm-dev.yml | 34 ------------------- ...ml => build-and-push-docker-image-dev.yml} | 6 ++-- 2 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/build-and-push-docker-image-arm-dev.yml rename .github/workflows/{build-and-push-docker-image-amd64-dev.yml => build-and-push-docker-image-dev.yml} (84%) diff --git a/.github/workflows/build-and-push-docker-image-arm-dev.yml b/.github/workflows/build-and-push-docker-image-arm-dev.yml deleted file mode 100644 index 2ab356fa..00000000 --- a/.github/workflows/build-and-push-docker-image-arm-dev.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build and push Docker DEV image arm - -on: - push: - branches: [master] - -jobs: - build-and-push-docker-image-dev-arm: - runs-on: self-hosted - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - platforms: linux/arm64,linux/arm/v7 - push: true - tags: | - ghcr.io/plankanban/planka:dev diff --git a/.github/workflows/build-and-push-docker-image-amd64-dev.yml b/.github/workflows/build-and-push-docker-image-dev.yml similarity index 84% rename from .github/workflows/build-and-push-docker-image-amd64-dev.yml rename to .github/workflows/build-and-push-docker-image-dev.yml index 5369cfe5..88027278 100644 --- a/.github/workflows/build-and-push-docker-image-amd64-dev.yml +++ b/.github/workflows/build-and-push-docker-image-dev.yml @@ -1,11 +1,11 @@ -name: Build and push Docker DEV image amd64 +name: Build and push Docker DEV image on: push: branches: [master] jobs: - build-and-push-docker-image-dev-amd64: + build-and-push-docker-image-dev: runs-on: self-hosted steps: - name: Checkout @@ -28,7 +28,7 @@ jobs: uses: docker/build-push-action@v4 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: | ghcr.io/plankanban/planka:dev