Commit Graph
30 Commits
Author SHA1 Message Date
Lauri Ojansivu 8af1e8aec8 mirror.sh: the WeKan checkout is the source, not a second clone in .tools/wekan-github.
Syncing wekan/wekan cloned the whole GitHub repository - 365,000 objects,
500 MB - into .tools/wekan-github, although it is this checkout
(~/repos/wekan on Linux, ~/Documents/repos/wekan on macOS,
Downloads\repos\wekan on Windows). Only the destination mirrors
(wekan-gitlab, wekan-codeberg ...) need checkouts of their own.

The source's branches and tags are fetched into this checkout instead,
under the private namespace refs/mirror-source/<source>/, which already
holds nearly every object: 1.7 seconds for 1,278 refs, measured. That
namespace is not a branch; the working tree and local main are untouched,
so unpushed local commits never reach a mirror. The fetched refs are
deleted again in a finally, after the push and also when the fetch, the
push or the merge-preserving retry fails.

tests/activeForgeMirror.test.cjs and tests/mirrorGitDirectories.test.cjs
run syncGit against a stand-in checkout (WEKAN_MIRROR_SOURCE_CHECKOUT for
the CLI), assert that GitHub's wekan is not cloned, that only the
destination is, and that the source refs are cleared - also after a failed
fetch.

Thanks to xet7 !
2026-10-27 23:59:26 +02:00
Lauri Ojansivu 4caa929cfe Fix CodeQL alerts 562, 563 and 564, and the same shapes elsewhere.
Alert 564 (regex injection): releases/platform-native-packages.mjs compiled
its command-line platform and arch into a RegExp. The canvas package names
are now compared as strings. The upload naming of attachments and avatars,
the attachment rename popup and tools/mirror-menu.mjs built a RegExp from a
file extension or a name the same way; they use literal suffix and prefix
checks now. tests/noUnescapedDynamicRegExp.test.cjs parses every source file
and fails on a RegExp built from a value that is not escaped, unless the
site is listed with the reason its values are constants.

Alert 563 (incomplete escaping): name.replace('/', '%2F') replaced only the
first slash. registryPackagePath() replaces every one and refuses anything
that is not an npm package name. Seven tests escaped a regex the same
first-only way; 'g++'.replace('+', '\\+') let "- g+" pass a guard. They use
the complete escapeRegExp, and tests/noIncompleteRegExpEscaping.test.cjs
fails on any string-pattern replace that performs an escape.

Alert 562 (ReDoS): the CasaOS reverse-domain id pattern in
tests/platformTemplates.test.cjs let '.' be matched by both groups, so
'0.0.0...!' backtracked exponentially. Each separator now belongs to one
group, and the test runs CodeQL's attack string against it.

Thanks to GitHub CodeQL and xet7 !
2026-10-12 02:18:33 +03:00
Lauri Ojansivu 0172bc51e5 Keep the forge mirror CLI test away from real mirror checkouts.
The CLI test expected the fresh-clone path, but the mirror tool looked for
an existing checkout under the real .tools directory, so the test failed
on any machine that had .tools/wekan-gitlab. WEKAN_MIRROR_TOOLS_DIR now
relocates the checkouts and the test points it at its own temporary
directory.

Thanks to xet7 !
2026-09-29 10:05:55 +03:00
Lauri Ojansivu e2713cd0dd Keep Codeberg disabled and bootstrap missing mirror clones under tools
Honor the commented Codeberg registry entry even with stale saved settings. Create missing WeKan source and destination clones under the checkout-relative .tools directory, keeping fetched mirror refs out of the primary checkout. Cover fresh clones, paths with spaces, saved settings, failure handling and existing checkout protections with injected commands.

Thanks to xet7 !
2026-09-27 14:58:59 +03:00
Lauri Ojansivu d4ef9284b7 Reuse WeKan checkout as forge mirror source 2026-09-22 19:45:20 +03:00
Lauri Ojansivu f7da598ad2 Stop using archive.org for mirror linked files 2026-09-16 02:07:22 +03:00
Lauri Ojansivu 93e61a1d68 Prefer authenticated GitHub CLI for mirror source metadata 2026-09-14 17:00:26 +03:00
Lauri Ojansivu 7c98c00d9e Skip Wayback fallback for retired WeKan branch links 2026-09-14 16:53:55 +03:00
Lauri Ojansivu 23de748538 Reuse established mirror checkouts outside the content archive 2026-09-14 15:07:32 +03:00
Lauri Ojansivu 567c770c8a Stream mirror Git command output and force transfer progress 2026-09-14 15:04:10 +03:00
Lauri Ojansivu 44e3e1fd75 Recover unavailable mirror links from creation-date Wayback history
Bound attachment requests and defer long rate-limit cooldowns while preserving rate-limit state. Recover missing public links from the closest historical capture, retain provenance, and skip optional failures so remaining content synchronization continues.
2026-09-14 14:01:59 +03:00
Lauri Ojansivu 103e4dface Stage Git and archive sync before parallel destination mirroring
Synchronize Git to all active destinations before collecting source content. Reuse the local archive for concurrent destination processes, show combined per-mirror issue and release counters, and retain separate mirror-named logs. Stop content writes after archive failure and preserve restart checkpoints.
2026-09-14 13:58:58 +03:00
Lauri Ojansivu a744eb907f Standardize organization mirror log datetime directories
Use the shared log-directory reservation for organization reports and update remaining path examples. Verify report paths with offline organization fixtures.

Thanks to xet7 !
2026-09-14 12:14:08 +03:00
Lauri Ojansivu 0d6be31986 Standardize build and release log directories on readable datetimes
Use operation/YYYY-MM-DD_HH-MM-SS for Unix and Windows build logs, mirror launcher and data reports, translation push reports, conformance and speed diagnostics. Preserve earlier same-second runs with reserved suffixes. Keep record timestamps in their existing data format.

Path and collision fixtures, build progress and parity, mirror launcher and Transifex suites pass. Shell syntax checks pass; Windows execution was not available. Update the internal release preflight inventory used by parity checks.

Thanks to xet7 !
2026-09-14 12:02:36 +03:00
Lauri Ojansivu 6dd41dd414 Handle unsupported attachment HTTP statuses without crashing mirror archives
Reject invalid statuses and malformed headers inside the HTTP response callback, close rejected streams and drain bodyless responses. Regression tests cover unsupported statuses, malformed headers and successful downloads.

Thanks to xet7 !
2026-09-14 11:11:45 +03:00
Lauri Ojansivu b53d81cea0 Recover missing mirror comment parents and print final log paths
Fetch missing parent issues and pull metadata through the existing rate-limited API client. Preserve page checkpoints on failure and retry missing pull metadata after interruption. Report logs after menu sync/check operations and command exit while retaining exit status. Offline collector, menu and shell launcher regressions pass.

Thanks to xet7.
2026-09-14 01:40:05 +03:00
Lauri Ojansivu 3a86fc7e34 Harden mirror host validation and shell-free command dispatch
Review saved scanning alerts 537 and 539. Make exact archive-host validation explicit, restrict executable dispatch and run Windows targets through the existing Node engine without cmd.exe command strings. Preserve preview flags and all archive/resume behavior. Twenty-five focused mirror test entries pass; native Windows and remote CodeQL rescanning remain unverified.

Thanks to xet7.
2026-09-14 01:35:54 +03:00
Lauri Ojansivu 5f8f22f8c3 Unify shell and Windows log directories by operation date and time 2026-09-14 00:02:30 +03:00
Lauri Ojansivu 7af015a56b Persist GitHub mirror data incrementally and resume interrupted synchronization 2026-09-13 23:49:16 +03:00
Lauri Ojansivu df4c049d52 Show module resolution and captured dependency command output during builds 2026-09-13 23:49:12 +03:00
Lauri Ojansivu 9e331e4098 Show immediate streaming progress during mirror synchronization 2026-09-13 22:40:10 +03:00
Lauri Ojansivu 02383540a5 Mirror configured organizations with linked files and offline indexes
Add organization management and per-destination namespaces to the shared Unix and Windows mirror menu. Discover all accessible repositories, create missing mirrors, retain PR conversations when issues are disabled, and copy enabled wiki history and portable Projects V2 data.

Archive linked media, files and webpage HTML per comment under host/organization/repository directories. Preserve old versions, generate static HTML and CSV catalogues, and support offline rebuilding from CSV. Attach archived files to corresponding destination comments where supported.

Honor GitHub and destination rate-limit headers, persistent cooldowns and bounded retries. Public GitHub REST reads fall back without a token. Add offline regressions and a static browser test; 1,014 Node suites pass, with final targeted checks passing. Chromium and Firefox static checks pass; local WebKit requires unavailable ICU 74.

Thanks to xet7.
2026-09-13 21:43:19 +03:00
Lauri Ojansivu 63f41589d8 Continue mirror destinations after reporting local archive failures
Preserve the existing launcher retry behavior: failed source inventory stops synchronization, but a local archive failure records an overall failure and still attempts supported data on every selected destination. Extend the injected-command regression to verify all targets run without live remote writes.

Thanks to xet7 !
2026-09-13 20:56:19 +03:00
Lauri Ojansivu 083a28c4f3 Preserve native attachment links when selecting a different mirror source
Resolve relative GitLab, Codeberg and SourceForge attachment paths against the original forge in destination text and persistent archive discovery. Recognize current GitLab project upload URLs, preserve original JSON metadata and exclude arbitrary websites from downloads. Offline link and archive regressions pass.

Thanks to xet7 !
2026-09-13 20:55:44 +03:00
Lauri Ojansivu 675ca5d954 Add saved mirror menu, configurable sources and read-only checks
Default to GitHub as source and GitLab, Codeberg and SourceForge as mirrors. Share the six-action menu across Unix and Windows, save source and active destinations in .tools/mirror/settings.txt, and delegate synchronization to individual forge launchers. Support native source inventories and GitHub destinations, preserve original provenance and isolate source archives. Compare Git ancestry and inventory missing metadata without remote writes in check mode. Verify menu interaction, adapters, retries, settings validation and archive isolation with offline fixtures.

Thanks to xet7 !
2026-09-13 20:54:13 +03:00
Lauri Ojansivu e2338530cb Archive mirror issue, pull request and release files without deletion
Keep complete source files under .tools/mirror/issues/<number>, pulls/<number> and releases/<version>. Persist metadata, comments, reviews, patches, GitHub-hosted attachments, binaries and source archives. Rename removed or changed versions with old-YYYY-MM-DD_HH-MM-SS prefixes; preserve existing copies on download failures and retry on later runs.

Archive once before per-target synchronization, reuse verified release files and guard concurrent archive writers. Preserve destination main commits through the existing merge fallback without force or ref deletion. Exclude disabled GitHub Discussions, projects and wiki. Document the design and verify retention, retries, API pagination and launcher behavior with offline fixtures.

Thanks to xet7 !
2026-09-13 20:25:17 +03:00
Lauri Ojansivu b1983adbb6 Synchronize missing GitHub data to active WeKan mirrors
Repair Tools menu dispatch and run separate GitLab, Codeberg and SourceForge launchers through a shared engine on Unix and Windows. Read one paginated GitHub snapshot for all mirrors, match issue/comment provenance and release tags, and retry missing conversations and binary assets after partial runs. Preserve destination text and copy Git branches/tags without force or deletions. SourceForge uses Tracker tickets and SFTP release files; projects and wiki are excluded. Add offline API, retry, pagination, multipart upload and launcher regressions plus setup/scope documentation.
2026-09-13 20:05:29 +03:00
Lauri Ojansivu e8be344041 Install complete tooling for active mirrors across platforms
Install Git, SSH/SCP/SFTP, curl, jq, Node and Go prerequisites with native Debian/Ubuntu, Fedora, Brew and Windows package mappings. Use native Go builds for missing forge CLIs, verified current Go archive bootstrap for older Unix toolchains, repository-local binaries and refreshed PATH. Report remaining missing tools and failure status without stopping later attempts. Add SourceForge to the Windows mirror targets. Offline Unix, PowerShell, architecture, checksum and menu regressions pass; no remote mirroring, uploads or publishing ran.

Thanks to xet7 !
2026-09-13 19:41:25 +03:00
Lauri Ojansivu c29f5c7a66 Rename the dev helper rebuild-wekan.sh/.bat -> build.sh/.bat (shorter name).
Renames rebuild-wekan.sh -> build.sh, rebuild-wekan.bat -> build.bat, and the
guard test tests/rebuildWekanDevServer.test.cjs -> tests/buildDevServer.test.cjs,
and updates every reference across the repo: the docs (Build-from-source, Windows,
Sandstorm, Raspberry Pi, virtual-appliance, Debugging, Developer-Documentation,
FerretDB, OpLog, Rclone, Emoji, Multiverse roadmap, Security remediation, Tests),
README.md, CONTRIBUTING.md, CLAUDE.md, package.json (test:unit:node), the release
scripts (release-all.sh, fix-changelog-hashes.sh, node-update.sh), the disabled
playwright workflow, playwright.config.js, the REST spec comment, tools/forge-mirror.js,
and the CHANGELOG. The menu and every option are unchanged; only the filename and
its references. The website has no references.

Thanks to xet7 !
2026-07-24 19:32:24 +03:00
Lauri OjansivuandClaude Opus 4.8 bf6d89ec32 feat(rebuild): install forge CLIs + mirror GitHub to GitLab/Codeberg/Forgejo/Gitea
Add two menu options to rebuild-wekan.sh and rebuild-wekan.bat:

1. Install forge CLI tools — gh, glab, tea, git-bug, and the unified
   git-pkgs/forge, via the detected package manager or `go install`.

2. Mirror a repo from GitHub to GitLab/Codeberg/Forgejo/Gitea — pick source
   and target by number (e.g. "1 3" = GitHub -> Codeberg). Code (all
   branches/tags) is pushed with `git push --mirror`; issues, PRs and CI
   workflow syntax are handled by a new cross-platform Node engine,
   tools/forge-mirror.js, which:
     * creates only the issues/PRs MISSING at the target (drives the
       authenticated gh/glab/tea CLIs, de-dups by title, dry-run by default);
     * converts GitHub Actions YAML for the target — an annotated
       .forgejo/workflows/ copy flagging Forgejo/Gitea incompatibilities
       (hashFiles, permissions, continue-on-error, complex runs-on), or a
       .gitlab-ci.yml scaffold + guide pointing at GitLab's official converter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 21:10:33 +03:00