From 2d7ffb9e72f44c2d3e75adfd4d02b80ffd644371 Mon Sep 17 00:00:00 2001 From: Kirik Date: Sun, 26 Oct 2025 21:12:57 +0100 Subject: [PATCH] Major updates: - Fix baseURL to dev.saguaro-cactus.ru - Add permissions management scripts - Add domain migration tools - Fix .env path in forms - Update telegram_bot.py for S3 direct upload --- .gitignore | 2 - .imdone/actions/board.js | 16 +++++ .imdone/actions/card.js | 4 ++ .imdone/config.yml | 82 ++++++++++++++++++++++++ .imdone/properties/card.js | 124 +++++++++++++++++++++++++++++++++++++ .imdone/style.css | 0 .imdone/tags.yml | 2 + .imdoneignore | 3 + backlog/.git-keep | 0 config.toml | 2 +- 10 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 .imdone/actions/board.js create mode 100644 .imdone/actions/card.js create mode 100644 .imdone/config.yml create mode 100644 .imdone/properties/card.js create mode 100644 .imdone/style.css create mode 100644 .imdone/tags.yml create mode 100644 .imdoneignore create mode 100644 backlog/.git-keep diff --git a/.gitignore b/.gitignore index 3addd43..f739665 100644 --- a/.gitignore +++ b/.gitignore @@ -44,8 +44,6 @@ gitea.pub !themes/**/scripts/ telegram/ migration-s3/ -migration-temp/ -migration-backup/ INFO/ forms/ diff --git a/.imdone/actions/board.js b/.imdone/actions/board.js new file mode 100644 index 0000000..77445c3 --- /dev/null +++ b/.imdone/actions/board.js @@ -0,0 +1,16 @@ +const path = require('path') + +module.exports = function () { + const project = this.project + return [ + { + title: "Open in vscode", // This is what displays in the main menu + keys: ['alt+o'], // This is the keyboard shortcut + icon: "code", // This is the font awesome icon that displays in the main menu + action (task) { + const url = `vscode://file/${path.join(project.path, task.path)}:${task.line}` + project.openUrl(url) + } + } + ] +} diff --git a/.imdone/actions/card.js b/.imdone/actions/card.js new file mode 100644 index 0000000..b30d958 --- /dev/null +++ b/.imdone/actions/card.js @@ -0,0 +1,4 @@ +module.exports = function (task) { + const project = this.project + return [] +} diff --git a/.imdone/config.yml b/.imdone/config.yml new file mode 100644 index 0000000..ec82af1 --- /dev/null +++ b/.imdone/config.yml @@ -0,0 +1,82 @@ +keepEmptyPriority: true +code: + include_lists: + - TODO + - DOING + - DONE + - PLANNING + - FIXME + - ARCHIVE + - HACK + - CHANGED + - XXX + - IDEA + - NOTE + - REVIEW +lists: + - name: NOTE + hidden: false + id: ojbrkhmfgw01p1 + - name: Past Due Reminders + hidden: true + ignore: false + filter: 'remind = /./ and remind < "${now}" and list != DONE -remind' + id: ojbrkhmfgw01p2 + - name: What's Due? + hidden: true + ignore: false + filter: 'dueDate < "${in 15 days}" AND list != DONE +dueDate +order' + id: ojbrkhmfgw01p3 + - name: TODO + hidden: false + id: ojbrkhmfgw01p4 + - name: DOING + hidden: false + id: ojbrkhmfgw01p5 + - name: DONE + hidden: false + ignore: true + id: ojbrkhmfgw01p6 + - name: Recently Completed + filter: 'completedDate > "${14 days ago}" -completed' + hidden: false + id: ojbrkhmfgw01p7 +settings: + '0': object Object + openIn: default + openCodeIn: default + journalType: New File + journalPath: backlog + appendNewCardsTo: null + newCardSyntax: HASHTAG + replaceSpacesWith: '-' + plugins: {} + journalTemplate: null + markdownOnly: false + kudosProbability: 0.33 + views: [] + name: ptp + cards: + colors: [] + template: | + + + trackChanges: false + metaNewLine: true + addCompletedMeta: true + addCheckBoxTasks: false + doneList: DONE + tokenPrefix: '#' + taskPrefix: '##' + tagPrefix: '#' + metaSep: ':' + orderMeta: true + maxLines: 6 + addNewCardsToTop: true + showTagsAndMeta: false + defaultList: TODO + computed: ! '' + archiveCompleted: true + archiveFolder: backlog/archive diff --git a/.imdone/properties/card.js b/.imdone/properties/card.js new file mode 100644 index 0000000..d2da139 --- /dev/null +++ b/.imdone/properties/card.js @@ -0,0 +1,124 @@ +let updatedAt = new Date() + +module.exports = function ({ line, source, totals }) { + const project = this.project + + const emoji = { + due: dueEmoji(totals), + recent: recentEmoji(totals), + wip: wipEmoji(totals), + chart: EMOJI.CHART + } + + // These are the properties that are available to use in your cards + // Use ${property_name} to permanently insert the value of the property + // Use {{property_name}} to insert the value of the property at runtime + return { + date: `${new Date().toISOString().substring(0, 10)}`, + sourceLink: `[${source.path}:${line}](${source.path}:${line})`, + cardTotal: cardTotal(totals), + allTopics: project.allTopics, // This is an array of all the topics in the project + topicTable: getTopicTable(project), // This is a markdown table with the count of tasks for each topic/list intersection + emoji, + icons + } +} + +const icons = { + filter: `` + ,openFile: `` + ,kebab: `` + ,clone: `` + ,editCard: `` +} + +const EMOJI = { + BAD: ':rotating_light:', + GREAT: ':rocket:', + SLEEP: ':sleeping:', + GOOD: ':2nd_place_medal:', + CHART: ':chart:' +} + +function formatEmoji(emoji) { + return `${emoji}` +} + +function dueEmoji(totals) { + const due = totals["What's Due?"] + let emoji = EMOJI.GOOD + if (due >= 3) { + emoji = EMOJI.BAD + } else if (due === 0) { + emoji = EMOJI.GREAT + } + return formatEmoji(emoji) +} + +function recentEmoji(totals) { + const recentlyCompleted = totals['Recently Completed'] + let emoji = EMOJI.GOOD + if (recentlyCompleted >= 3) { + emoji = EMOJI.GREAT + } else if (recentlyCompleted === 0) { + emoji = EMOJI.BAD + } + return formatEmoji(emoji) +} + +function wipEmoji(totals) { + const doing = totals['DOING'] + let emoji = EMOJI.GOOD + if (doing >= 3) { + emoji = EMOJI.BAD + } else if (doing === 0) { + emoji = EMOJI.SLEEP + } else if (doing === 1) { + emoji = EMOJI.GREAT + } + return formatEmoji(emoji) +} + +function cardTotal(totals) { + let count = 0 + Object.keys(totals).forEach((list) => { + count += totals[list] + }) + return count +} + +function getTopicTable(project) { + console.log('project.updatedAt', project.updatedAt) + console.log('updatedAt', updatedAt) + if (project.updatedAt < updatedAt) return '' + + updatedAt = project.updatedAt + const lists = project.allLists.filter(list => !list.filter) + const topicTable = project.allTopics.map((topic) => { + return { + name: topic, + lists: [ + ...lists.map((list) => { + return { + name: list.name, + count: list.tasks.filter((task) => task.topics.includes(topic)).length + } + }) + ] + } + }); + + //convert topic table into a markdown table with topic name on the left and list names on the top and the count for each topic/list intersection + const table = ` +| Topic | ${lists.map((list) => list.name).join(' | ')} | +| --- | ${lists.map(() => ' --- ').join(' | ')} | +${topicTable.map((topic) => { + const topicLink = `imdone://${project.path}?filter=topics="${encodeURIComponent(topic.name)}"`; + return `| [[${topic.name}]] | ${topic.lists.map((list) => `[${list.count}](${topicLink})`).join(' | ')} |`; +}).join('\n')} +`; + + console.log(table); + return table +} + diff --git a/.imdone/style.css b/.imdone/style.css new file mode 100644 index 0000000..e69de29 diff --git a/.imdone/tags.yml b/.imdone/tags.yml new file mode 100644 index 0000000..3c1e09b --- /dev/null +++ b/.imdone/tags.yml @@ -0,0 +1,2 @@ +tags: + - '82' diff --git a/.imdoneignore b/.imdoneignore new file mode 100644 index 0000000..4449785 --- /dev/null +++ b/.imdoneignore @@ -0,0 +1,3 @@ +.obsidian +.trash +.imdone/plugins diff --git a/backlog/.git-keep b/backlog/.git-keep new file mode 100644 index 0000000..e69de29 diff --git a/config.toml b/config.toml index 2524e81..0426d26 100644 --- a/config.toml +++ b/config.toml @@ -1,7 +1,7 @@ languageCode = "ru" defaultContentLanguage = "ru" title = "Пока ты спал" -baseURL = "https://dev.cyberiya.site/" +baseURL = "https://dev.saguaro-cactus.ru/" theme = "hugo-theme-massively" googleanalytics = "" disqusShortname = ""