├── swh └── web │ ├── api │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── views │ │ │ ├── __init__.py │ │ │ └── test_ping.py │ └── views │ │ ├── __init__.py │ │ └── ping.py │ ├── alter │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── templatetags │ │ └── __init__.py │ ├── assets │ │ ├── index.js │ │ └── alter.css │ ├── apps.py │ └── templates │ │ ├── alter_common.html │ │ ├── emails │ │ ├── admin_message_notification.txt │ │ ├── admin_alteration_notification.txt │ │ ├── email_magic_link.txt │ │ ├── message_notification.txt │ │ ├── alteration_magic_link.txt │ │ └── alteration_confirmation.txt │ │ └── includes │ │ └── reasons_outcome.html │ ├── banners │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── urls.py │ └── templates │ │ └── hiring-banner.html │ ├── browse │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ ├── views │ │ │ ├── __init__.py │ │ │ └── conftest.py │ │ └── data │ │ │ └── content_iso-8859-7_encoded │ ├── views │ │ └── __init__.py │ ├── assets │ │ ├── origin_visits │ │ │ ├── index.js │ │ │ └── utils.js │ │ ├── revision │ │ │ └── index.js │ │ ├── browse │ │ │ ├── breadcrumbs.css │ │ │ └── index.js │ │ ├── guided_tour │ │ │ └── swh-introjs.css │ │ └── mathjax │ │ │ └── index.js │ ├── templates │ │ ├── browse-content.html │ │ ├── browse-directory.html │ │ └── includes │ │ │ ├── branch-search.html │ │ │ ├── empty-snapshot.html │ │ │ └── breadcrumbs.html │ └── identifiers.py │ ├── deposit │ ├── __init__.py │ └── tests │ │ └── __init__.py │ ├── metrics │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── test_app.py │ ├── urls.py │ └── views.py │ ├── settings │ ├── __init__.py │ └── development.py │ ├── tests │ ├── __init__.py │ ├── resources │ │ ├── repos │ │ │ ├── libtess2.zip │ │ │ ├── repo_with_cff_file.zip │ │ │ ├── repo_with_submodules.tgz │ │ │ ├── repo_with_metadata_file.zip │ │ │ ├── highlightjs-line-numbers.js.zip │ │ │ └── highlightjs-line-numbers.js_visit2.zip │ │ └── contents │ │ │ ├── code │ │ │ ├── extensions │ │ │ │ ├── test.dust │ │ │ │ ├── test.hbs │ │ │ │ ├── test.kt │ │ │ │ ├── test.ini │ │ │ │ ├── test.rb │ │ │ │ ├── test.lsl │ │ │ │ ├── test.properties │ │ │ │ ├── test.ceylon │ │ │ │ ├── test.go │ │ │ │ ├── test.golo │ │ │ │ ├── test.py │ │ │ │ ├── test.sh │ │ │ │ ├── test.json │ │ │ │ ├── test.erb │ │ │ │ ├── test.scad │ │ │ │ ├── test.wl │ │ │ │ ├── test.css │ │ │ │ ├── test.html │ │ │ │ ├── test.clj │ │ │ │ ├── test.applescript │ │ │ │ ├── test.coffee │ │ │ │ ├── test.sci │ │ │ │ ├── test.rs │ │ │ │ ├── test.swift │ │ │ │ ├── test.ts │ │ │ │ ├── test.haml │ │ │ │ ├── test.java │ │ │ │ ├── test.pde │ │ │ │ ├── test.leaf │ │ │ │ ├── test.cs │ │ │ │ ├── test.vim │ │ │ │ ├── test.au3 │ │ │ │ ├── test.hsp │ │ │ │ ├── test.ps1 │ │ │ │ ├── test.pony │ │ │ │ ├── test.cpp │ │ │ │ ├── test.adb │ │ │ │ ├── test.md │ │ │ │ ├── test.sqf │ │ │ │ ├── test.q │ │ │ │ ├── test.bf │ │ │ │ ├── test.sl │ │ │ │ ├── test.tex │ │ │ │ ├── test.elm │ │ │ │ ├── test.bas │ │ │ │ ├── test.bat │ │ │ │ ├── test.nim │ │ │ │ ├── test.nix │ │ │ │ ├── test.js │ │ │ │ ├── test.awk │ │ │ │ ├── test.ebnf │ │ │ │ ├── test.gml │ │ │ │ ├── test.bnf │ │ │ │ ├── test.cr │ │ │ │ ├── test.styl │ │ │ │ ├── test.f90 │ │ │ │ ├── test.ahk │ │ │ │ ├── test.sml │ │ │ │ ├── test.mel │ │ │ │ ├── test.cmake │ │ │ │ ├── test.abnf │ │ │ │ ├── test.gss │ │ │ │ ├── test.yml │ │ │ │ ├── test.as │ │ │ │ ├── test.gcode │ │ │ │ ├── test.cls │ │ │ │ ├── test.lc │ │ │ │ ├── test.proto │ │ │ │ ├── test.ldif │ │ │ │ ├── test.lisp │ │ │ │ ├── test.tcl │ │ │ │ ├── test.rsc │ │ │ │ ├── test.lua │ │ │ │ ├── test.ep │ │ │ │ ├── test.ml │ │ │ │ ├── test.p │ │ │ │ ├── test.thrift │ │ │ │ ├── test.rib │ │ │ │ ├── test.diff │ │ │ │ ├── test.glsl │ │ │ │ ├── test.moon │ │ │ │ ├── test.feature │ │ │ │ ├── test.ino │ │ │ │ ├── test.dcl │ │ │ │ ├── test.scm │ │ │ │ ├── test.tap │ │ │ │ ├── test.less │ │ │ │ ├── test.dfm │ │ │ │ ├── test.dts │ │ │ │ ├── test.ls │ │ │ │ ├── test.pbi │ │ │ │ ├── test.mk │ │ │ │ ├── test.nsi │ │ │ │ ├── test.cal │ │ │ │ ├── test.dart │ │ │ │ ├── test.do │ │ │ │ ├── test.xqy │ │ │ │ ├── test.subunit │ │ │ │ └── test.pl │ │ │ └── filenames │ │ │ │ ├── access.log │ │ │ │ ├── Makefile │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── .htaccess │ │ │ │ ├── httpd.conf │ │ │ │ └── pf.conf │ │ │ └── other │ │ │ └── extensions │ │ │ ├── swh-logo.jpeg │ │ │ ├── swh-logo.png │ │ │ ├── swh-logo.webp │ │ │ ├── swh-spinner.gif │ │ │ └── bash-cheatsheet.pdf │ ├── django_asserts.py │ ├── pytest_plugin.py │ └── test_create_users.py │ ├── vault │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── test_views.py │ └── assets │ │ ├── index.js │ │ └── vault.css │ ├── webapp │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── assets │ │ ├── webapp │ │ │ ├── heading-anchors.css │ │ │ ├── heading-anchors.js │ │ │ ├── history-counters.css │ │ │ ├── breadcrumbs.css │ │ │ ├── index.js │ │ │ └── status-widget.css │ │ └── vendors │ │ │ └── bootstrap.scss │ └── templates │ │ ├── includes │ │ ├── http-error.html │ │ └── favicon.html │ │ ├── error.html │ │ └── masked.html │ ├── admin │ ├── tests │ │ ├── __init__.py │ │ └── test_app.py │ ├── __init__.py │ └── apps.py │ ├── auth │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0003_delete_oidcuser.py │ │ ├── 0002_remove_stored_tokens.py │ │ └── 0009_create_provenance_permission.py │ ├── __init__.py │ ├── apps.py │ ├── assets │ │ └── auth.css │ ├── models.py │ └── templates │ │ └── login.html │ ├── badges │ ├── tests │ │ └── __init__.py │ ├── assets │ │ └── badges.css │ └── urls.py │ ├── jslicenses │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── test_jslicenses.py │ └── urls.py │ ├── mailmap │ ├── tests │ │ ├── __init__.py │ │ └── test_migrations.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── __init__.py │ └── apps.py │ ├── utils │ ├── tests │ │ └── __init__.py │ └── management │ │ ├── __init__.py │ │ └── commands │ │ └── __init__.py │ ├── archive_coverage │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── assets │ │ └── index.js │ └── urls.py │ ├── save_bulk │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── 0002_alter_savebulkorigin_origin_url.py │ ├── __init__.py │ ├── apps.py │ └── urls.py │ ├── add_forge_now │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0008_turn_request_forge_url_into_url_field.py │ │ ├── 0003_request_submitter_forward_username.py │ │ ├── 0004_rename_tables.py │ │ ├── 0010_alter_request_forge_contact_comment.py │ │ ├── 0005_prepare_inbound_email.py │ │ └── 0002_authorized_null_comment.py │ ├── __init__.py │ ├── assets │ │ ├── forge-success-email.ejs │ │ └── add-forge.css │ ├── apps.py │ └── templates │ │ └── add-forge-list.html │ ├── inbound_email │ ├── tests │ │ ├── __init__.py │ │ └── resources │ │ │ ├── __init__.py │ │ │ ├── plaintext.eml │ │ │ ├── multipart_mixed.eml │ │ │ ├── multipart_alternative_text_only.eml │ │ │ ├── multipart_mixed2.eml │ │ │ └── multipart_alternative.eml │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── process_inbound_email.py │ ├── __init__.py │ ├── apps.py │ └── urls.py │ ├── save_code_now │ ├── tests │ │ └── __init__.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0012_saveoriginrequest_note.py │ │ ├── 0014_saveoriginrequest_snapshot_swhid.py │ │ ├── 0002_saveoriginrequest_visit_date.py │ │ ├── 0006_rename_origin_type.py │ │ ├── 0016_alter_saveoriginrequest_origin_url.py │ │ ├── 0010_saveoriginrequest_user_id.py │ │ ├── 0011_saveoriginrequest_user_ids.py │ │ ├── 0013_saveoriginrequest_webhook_info.py │ │ ├── 0005_remove_duplicated_authorized_origins.py │ │ └── 0008_save-code-now_indexes_20210106_1327.py │ ├── __init__.py │ ├── assets │ │ └── index.js │ └── apps.py │ ├── save_origin_webhooks │ ├── __init__.py │ ├── tests │ │ ├── __init__.py │ │ └── data │ │ │ └── sourceforge_webhook_payload_svn.json │ └── urls.py │ ├── py.typed │ ├── static │ ├── img │ │ ├── logos │ │ │ ├── bitbucket-hg.png │ │ │ ├── arch.png │ │ │ ├── aur.png │ │ │ ├── bower.png │ │ │ ├── cgit.png │ │ │ ├── conda.png │ │ │ ├── cpan.png │ │ │ ├── cran.png │ │ │ ├── dlang.png │ │ │ ├── elife.png │ │ │ ├── gitea.png │ │ │ ├── gnu.png │ │ │ ├── gogs.png │ │ │ ├── guix.png │ │ │ ├── hal.png │ │ │ ├── inria.jpg │ │ │ ├── ipol.png │ │ │ ├── maven.png │ │ │ ├── nixos.png │ │ │ ├── npm.png │ │ │ ├── opam.png │ │ │ ├── osdn.png │ │ │ ├── pypi.png │ │ │ ├── rpm.png │ │ │ ├── crates.png │ │ │ ├── debian.png │ │ │ ├── github.png │ │ │ ├── gitlab.png │ │ │ ├── gitweb.png │ │ │ ├── golang.png │ │ │ ├── hackage.png │ │ │ ├── pagure.png │ │ │ ├── pubdev.png │ │ │ ├── puppet.png │ │ │ ├── zenodo.png │ │ │ ├── bitbucket.png │ │ │ ├── gitorious.png │ │ │ ├── googlecode.png │ │ │ ├── heptapod.png │ │ │ ├── launchpad.png │ │ │ ├── packagist.png │ │ │ ├── rubygems.png │ │ │ ├── bioconductor.png │ │ │ ├── phabricator.png │ │ │ └── sourceforge.png │ │ ├── swh-logo.png │ │ ├── swh-donor.png │ │ ├── swh-mirror.png │ │ ├── swh-spinner.gif │ │ ├── swh-vault.png │ │ ├── arrow-up-small.png │ │ ├── swh-spinner-small.gif │ │ └── icons │ │ │ ├── swh-logo-32x32.png │ │ │ ├── swh-logo-archive-180x180.png │ │ │ ├── swh-logo-archive-192x192.png │ │ │ └── swh-logo-archive-270x270.png │ ├── security.txt │ └── xml │ │ └── swh-opensearch.xml │ ├── __init__.py │ ├── provenance │ ├── __init__.py │ ├── urls.py │ ├── apps.py │ └── tests │ │ └── test_apps.py │ └── gunicorn_config.py ├── docs ├── _static │ └── .placeholder ├── _templates │ └── .placeholder ├── .gitignore ├── conf.py ├── uri-scheme-api-graph.rst ├── Makefile ├── uri-scheme-api-release.rst ├── uri-scheme-api-snapshot.rst ├── uri-scheme-api-directory.rst ├── uri-scheme-api-stat.rst ├── uri-scheme-api-extid.rst ├── uri-scheme-api-provenance.rst ├── uri-scheme-api-revision.rst ├── uri-scheme-api-swhids.rst ├── index.rst ├── uri-scheme-api-content.rst ├── uri-scheme-api-origin.rst ├── uri-scheme-api-vault.rst ├── uri-scheme-api.rst └── uri-scheme-browse-release.rst ├── MANIFEST.in ├── cypress ├── fixtures │ ├── swh-logo.png │ ├── example.json │ ├── swh_1_dir_cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz │ ├── swh_1_rev_1c480a4573d2a003fc2630c21c2b25829de49972.git.tar │ └── save-task-info.json └── e2e │ ├── statics.js │ └── back-to-top.cy.js ├── conftest.py ├── mirror_demo ├── static │ └── partner_logo.png ├── templates │ ├── mirror-homepage.html │ └── mirror-footer.html └── config.yml ├── AUTHORS ├── Makefile ├── CONTRIBUTORS ├── requirements-swh.txt ├── assets └── src │ └── utils │ ├── mathjax.js │ ├── org.js │ ├── showdown.js │ ├── requests-filter-checkbox.ejs │ ├── showdown.css │ ├── constants.js │ └── highlightjs.css ├── .git-blame-ignore-revs ├── .copier-answers.yml ├── nyc.config.js ├── requirements-test.txt ├── requirements.txt └── .gitignore /swh/web/api/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_static/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_templates/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/alter/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/banners/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/browse/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/deposit/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/vault/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/webapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/admin/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/alter/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/api/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/api/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/auth/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/badges/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/banners/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/browse/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/browse/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/deposit/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/jslicenses/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/mailmap/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/metrics/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/utils/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/vault/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/webapp/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/alter/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/alter/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/api/tests/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/archive_coverage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/auth/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/browse/tests/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/jslicenses/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/mailmap/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/mailmap/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_bulk/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/utils/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/add_forge_now/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/archive_coverage/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/inbound_email/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_bulk/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_code_now/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_origin_webhooks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include swh/web/static * -------------------------------------------------------------------------------- /swh/web/add_forge_now/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/inbound_email/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/mailmap/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | -------------------------------------------------------------------------------- /swh/web/save_code_now/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_origin_webhooks/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/utils/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _build/ 2 | apidoc/ 3 | *-stamp 4 | -------------------------------------------------------------------------------- /swh/web/inbound_email/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/inbound_email/tests/resources/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/save_code_now/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /swh/web/static/img/logos/bitbucket-hg.png: -------------------------------------------------------------------------------- 1 | bitbucket.png -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | from swh.docs.sphinx.conf import * # noqa 2 | -------------------------------------------------------------------------------- /cypress/fixtures/swh-logo.png: -------------------------------------------------------------------------------- 1 | ../../swh/web/static/img/swh-logo.png -------------------------------------------------------------------------------- /conftest.py: -------------------------------------------------------------------------------- 1 | pytest_plugins = ["swh.auth.pytest_plugin", "swh.scheduler.pytest_plugin"] 2 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-graph.rst: -------------------------------------------------------------------------------- 1 | Graph 2 | ----- 3 | 4 | .. autosimple:: swh.web.api.views.graph.api_graph 5 | -------------------------------------------------------------------------------- /swh/web/__init__.py: -------------------------------------------------------------------------------- 1 | from pkgutil import extend_path 2 | 3 | __path__ = extend_path(__path__, __name__) 4 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | include Makefile.sphinx 2 | APIDOC_EXCLUDES += ../assets ../cypress ../swh/web/static ../swh/*/settings 3 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-release.rst: -------------------------------------------------------------------------------- 1 | Release 2 | ------- 3 | 4 | .. autosimple:: swh.web.api.views.release.api_release 5 | 6 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-snapshot.rst: -------------------------------------------------------------------------------- 1 | Snapshot 2 | -------- 3 | 4 | .. autosimple:: swh.web.api.views.snapshot.api_snapshot 5 | -------------------------------------------------------------------------------- /swh/web/static/img/swh-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/swh-logo.png -------------------------------------------------------------------------------- /docs/uri-scheme-api-directory.rst: -------------------------------------------------------------------------------- 1 | Directory 2 | --------- 3 | 4 | .. autosimple:: swh.web.api.views.directory.api_directory 5 | -------------------------------------------------------------------------------- /swh/web/static/img/logos/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/arch.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/aur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/aur.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/bower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/bower.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/cgit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/cgit.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/conda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/conda.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/cpan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/cpan.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/cran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/cran.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/dlang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/dlang.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/elife.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/elife.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/gitea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/gitea.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/gnu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/gnu.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/gogs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/gogs.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/guix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/guix.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/hal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/hal.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/inria.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/inria.jpg -------------------------------------------------------------------------------- /swh/web/static/img/logos/ipol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/ipol.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/maven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/maven.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/nixos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/nixos.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/npm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/npm.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/opam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/opam.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/osdn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/osdn.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/pypi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/pypi.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/rpm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/rpm.png -------------------------------------------------------------------------------- /swh/web/static/img/swh-donor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/swh-donor.png -------------------------------------------------------------------------------- /swh/web/static/img/swh-mirror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/swh-mirror.png -------------------------------------------------------------------------------- /swh/web/static/img/swh-spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/swh-spinner.gif -------------------------------------------------------------------------------- /swh/web/static/img/swh-vault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/swh-vault.png -------------------------------------------------------------------------------- /docs/uri-scheme-api-stat.rst: -------------------------------------------------------------------------------- 1 | Archive statistics 2 | ------------------ 3 | 4 | .. autosimple:: swh.web.api.views.stat.api_stats 5 | -------------------------------------------------------------------------------- /mirror_demo/static/partner_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/mirror_demo/static/partner_logo.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/crates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/crates.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/debian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/debian.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/github.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/gitlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/gitlab.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/gitweb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/gitweb.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/golang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/golang.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/hackage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/hackage.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/pagure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/pagure.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/pubdev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/pubdev.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/puppet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/puppet.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/zenodo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/zenodo.png -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015-2019 The Software Heritage developers 2 | 3 | See http://www.softwareheritage.org/ for more information. 4 | -------------------------------------------------------------------------------- /swh/web/static/img/arrow-up-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/arrow-up-small.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/bitbucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/bitbucket.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/gitorious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/gitorious.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/googlecode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/googlecode.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/heptapod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/heptapod.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/launchpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/launchpad.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/packagist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/packagist.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/rubygems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/rubygems.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/bioconductor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/bioconductor.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/phabricator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/phabricator.png -------------------------------------------------------------------------------- /swh/web/static/img/logos/sourceforge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/logos/sourceforge.png -------------------------------------------------------------------------------- /swh/web/static/img/swh-spinner-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/swh-spinner-small.gif -------------------------------------------------------------------------------- /swh/web/static/security.txt: -------------------------------------------------------------------------------- 1 | Contact: mailto:security@softwareheritage.org 2 | Expires: 2026-11-30T23:00:00.000Z 3 | Preferred-Languages: en,fr -------------------------------------------------------------------------------- /swh/web/static/img/icons/swh-logo-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/icons/swh-logo-32x32.png -------------------------------------------------------------------------------- /swh/web/tests/resources/repos/libtess2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/repos/libtess2.zip -------------------------------------------------------------------------------- /swh/web/browse/tests/data/content_iso-8859-7_encoded: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/browse/tests/data/content_iso-8859-7_encoded -------------------------------------------------------------------------------- /swh/web/static/img/icons/swh-logo-archive-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/icons/swh-logo-archive-180x180.png -------------------------------------------------------------------------------- /swh/web/static/img/icons/swh-logo-archive-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/icons/swh-logo-archive-192x192.png -------------------------------------------------------------------------------- /swh/web/static/img/icons/swh-logo-archive-270x270.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/static/img/icons/swh-logo-archive-270x270.png -------------------------------------------------------------------------------- /swh/web/tests/resources/repos/repo_with_cff_file.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/repos/repo_with_cff_file.zip -------------------------------------------------------------------------------- /swh/web/tests/resources/repos/repo_with_submodules.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/repos/repo_with_submodules.tgz -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.dust: -------------------------------------------------------------------------------- 1 |

Hours

2 | 3 | 8 | -------------------------------------------------------------------------------- /swh/web/tests/resources/repos/repo_with_metadata_file.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/repos/repo_with_metadata_file.zip -------------------------------------------------------------------------------- /swh/web/tests/resources/repos/highlightjs-line-numbers.js.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/repos/highlightjs-line-numbers.js.zip -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/other/extensions/swh-logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/contents/other/extensions/swh-logo.jpeg -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/other/extensions/swh-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/contents/other/extensions/swh-logo.png -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/other/extensions/swh-logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/contents/other/extensions/swh-logo.webp -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile driver for SWH Python modules. DO NOT CHANGE. 2 | # You can add custom Makefile rules to Makefile.local 3 | 4 | include ../Makefile.python 5 | -include Makefile.local 6 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/other/extensions/swh-spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/contents/other/extensions/swh-spinner.gif -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/other/extensions/bash-cheatsheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/contents/other/extensions/bash-cheatsheet.pdf -------------------------------------------------------------------------------- /swh/web/tests/resources/repos/highlightjs-line-numbers.js_visit2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/swh/web/tests/resources/repos/highlightjs-line-numbers.js_visit2.zip -------------------------------------------------------------------------------- /cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } -------------------------------------------------------------------------------- /cypress/fixtures/swh_1_dir_cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/cypress/fixtures/swh_1_dir_cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz -------------------------------------------------------------------------------- /docs/uri-scheme-api-extid.rst: -------------------------------------------------------------------------------- 1 | External IDentifiers 2 | -------------------- 3 | 4 | .. autosimple:: swh.web.api.views.extid.api_extid 5 | 6 | .. autosimple:: swh.web.api.views.extid.api_extid_target 7 | -------------------------------------------------------------------------------- /cypress/fixtures/swh_1_rev_1c480a4573d2a003fc2630c21c2b25829de49972.git.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoftwareHeritage/swh-web/HEAD/cypress/fixtures/swh_1_rev_1c480a4573d2a003fc2630c21c2b25829de49972.git.tar -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.hbs: -------------------------------------------------------------------------------- 1 |
2 | {{!-- only show if author exists --}} 3 | {{#if author}} 4 |

{{firstName}} {{lastName}}

5 | {{/if}} 6 |
7 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-provenance.rst: -------------------------------------------------------------------------------- 1 | Provenance 2 | ---------- 3 | 4 | .. autosimple:: swh.web.provenance.api_views.api_provenance_whereis 5 | 6 | .. autosimple:: swh.web.provenance.api_views.api_provenance_whereare 7 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anirudh Lakhotia 2 | Daniele Serafini 3 | Ishan Bhanuka 4 | Kalpit Kothari 5 | Katrin Leinweber 6 | Krithik Vaidya 7 | Kumar Shivendu 8 | Mihir Karbelkar 9 | Shankhadeep Dey 10 | Siddharth Ravikumar 11 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.kt: -------------------------------------------------------------------------------- 1 | import kotlin.lang.test 2 | 3 | trait A { 4 | fun x() 5 | } 6 | 7 | fun xxx() : Int { 8 | return 888 9 | } 10 | 11 | public fun main(args : Array) { 12 | } 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/filenames/access.log: -------------------------------------------------------------------------------- 1 | 20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" 2 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-revision.rst: -------------------------------------------------------------------------------- 1 | Revision 2 | -------- 3 | 4 | .. autosimple:: swh.web.api.views.revision.api_revision 5 | 6 | .. autosimple:: swh.web.api.views.revision.api_revision_directory 7 | 8 | .. autosimple:: swh.web.api.views.revision.api_revision_log 9 | 10 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ini: -------------------------------------------------------------------------------- 1 | ; boilerplate 2 | [package] 3 | name = "some_name" 4 | authors = ["Author"] 5 | description = "This is \ 6 | a description" 7 | 8 | [[lib]] 9 | name = ${NAME} 10 | default = True 11 | auto = no 12 | counter = 1_000 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.rb: -------------------------------------------------------------------------------- 1 | # The Greeter class 2 | class Greeter 3 | def initialize(name) 4 | @name = name.capitalize 5 | end 6 | 7 | def salute 8 | puts "Hello #{@name}!" 9 | end 10 | end 11 | 12 | g = Greeter.new("world") 13 | g.salute -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.lsl: -------------------------------------------------------------------------------- 1 | default 2 | { 3 | state_entry() 4 | { 5 | llSay(PUBLIC_CHANNEL, "Hello, Avatar!"); 6 | } 7 | 8 | touch_start(integer num_detected) 9 | { 10 | llSay(PUBLIC_CHANNEL, "Touched."); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.properties: -------------------------------------------------------------------------------- 1 | # .properties 2 | ! Exclamation mark = comments, too 3 | 4 | key1 = value1 5 | key2 : value2 6 | key3 value3 7 | key\ spaces multiline\ 8 | value4 9 | empty_key 10 | ! Key can contain escaped chars 11 | \:\= = value5 -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/filenames/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | BUILDDIR = _build 4 | EXTRAS ?= $(BUILDDIR)/extras 5 | 6 | .PHONY: main clean 7 | 8 | main: 9 | @echo "Building main facility..." 10 | build_main $(BUILDDIR) 11 | 12 | clean: 13 | rm -rf $(BUILDDIR)/* 14 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ceylon: -------------------------------------------------------------------------------- 1 | shared void run() { 2 | print("Hello, `` process.arguments.first else "World" ``!"); 3 | } 4 | class Counter(count=0) { 5 | variable Integer count; 6 | shared Integer currentValue => count; 7 | shared void increment() => count++; 8 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | ch := make(chan float64) 7 | ch <- 1.0e10 // magic number 8 | x, ok := <- ch 9 | defer fmt.Println(`exitting now\`) 10 | go println(len("hello world!")) 11 | return 12 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.golo: -------------------------------------------------------------------------------- 1 | module hello 2 | 3 | function dyno = -> DynamicObject() 4 | 5 | struct human = { name } 6 | 7 | @annotated 8 | function main = |args| { 9 | let a = 1 10 | var b = 2 11 | 12 | println("hello") 13 | 14 | let john = human("John Doe") 15 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | 4 | def somefunc(param1="", param2=0): 5 | r"""A docstring""" 6 | if param1 > param2: # interesting 7 | print("Gre'ater") 8 | return (param2 - param1 + 1) or None 9 | 10 | 11 | class SomeClass: 12 | pass 13 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-swhids.rst: -------------------------------------------------------------------------------- 1 | SWHIDs (SoftWare Hash IDentifiers) 2 | ---------------------------------- 3 | 4 | .. autosimple:: swh.web.api.views.identifiers.api_resolve_swhid 5 | 6 | .. autosimple:: swh.web.api.views.identifiers.api_swhid_known 7 | 8 | .. autosimple:: swh.web.api.views.raw.api_raw_object 9 | 10 | -------------------------------------------------------------------------------- /requirements-swh.txt: -------------------------------------------------------------------------------- 1 | swh.auth[django] >= 0.6.7 2 | swh.core >= 4.0.0 3 | swh.counters >= 0.5.1 4 | swh.graph >= 6.7.3 5 | swh.indexer >= 4.3.0 6 | swh.model >= 8.1.0 7 | swh.provenance >= 0.1.1 8 | swh.scheduler >= 3.0.0 9 | swh.search >= 0.22.2 10 | swh.storage >= 4.1.2 11 | swh-vault >= 2.0.0 12 | swh.webhooks >= 0.1.1 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ###### CONFIG 4 | ACCEPTED_HOSTS="/root/.hag_accepted.conf" 5 | BE_VERBOSE=false 6 | 7 | if [ "$UID" -ne 0 ] 8 | then 9 | echo "Superuser rights required" 10 | exit 2 11 | fi 12 | 13 | genApacheConf(){ 14 | echo -e "# Host ${HOME_DIR}$1/$2 :" 15 | } 16 | -------------------------------------------------------------------------------- /swh/web/admin/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.admin.apps.AdminConfig" 7 | -------------------------------------------------------------------------------- /swh/web/auth/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.auth.apps.AuthConfig" 7 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "apples", 4 | "count": [12000, 20000], 5 | "description": {"text": "...", "sensitive": false} 6 | }, 7 | { 8 | "title": "oranges", 9 | "count": [17500, null], 10 | "description": {"text": "...", "sensitive": false} 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /swh/web/mailmap/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.mailmap.apps.MailmapConfig" 7 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.erb: -------------------------------------------------------------------------------- 1 | <%# this is a comment %> 2 | 3 | <% @posts.each do |post| %> 4 |

<%= link_to post.title, post %>

5 | <% end %> 6 | 7 | <%- available_things = things.select(&:available?) -%> 8 | <%%- x = 1 + 2 -%%> 9 | <%% value = 'real string #{@value}' %%> 10 | <%%= available_things.inspect %%> 11 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.scad: -------------------------------------------------------------------------------- 1 | use 2 | include <../common/base.scad> 3 | 4 | //draw a foobar 5 | module foobar(){ 6 | translate([0,-10,0]) 7 | difference(){ 8 | cube([5,10.04,15]); 9 | sphere(r=10,$fn=100); 10 | } 11 | } 12 | 13 | foobar(); 14 | #cube ([5,5,5]); 15 | echo("done"); -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.wl: -------------------------------------------------------------------------------- 1 | (* ::Package:: *) 2 | 3 | (* Mathematica Package *) 4 | 5 | BeginPackage["SomePkg`"] 6 | 7 | Begin["`Private`"] 8 | 9 | SomeFn[ns_List] := Fold[Function[{x, y}, x + y], 0, Map[# * 2 &, ns]]; 10 | Print[$ActivationKey]; 11 | 12 | End[] (* End Private Context *) 13 | 14 | EndPackage[] 15 | -------------------------------------------------------------------------------- /swh/web/save_bulk/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.save_bulk.apps.SaveBulkConfig" 7 | -------------------------------------------------------------------------------- /assets/src/utils/mathjax.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2020-2025 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | export * from 'mathjax/tex-mml-chtml'; 9 | -------------------------------------------------------------------------------- /swh/web/provenance/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.provenance.apps.ProvenanceConfig" 7 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Apply black formatting to Python code and add pre-commit hook 2 | 0503cce23f70d1cca279fd9f4794c1f5df63a325 3 | 4 | # test_origin_save: Fix black formatting 5 | 00cc0c4daef20455144845214f52330063a211c3 6 | 7 | # python: Reformat code with black 8 | f9f5854c3af9fbaa164187c56ba544454041d26e 9 | d7809352485e8dcd96290c424b9c1155087744cc 10 | -------------------------------------------------------------------------------- /swh/web/add_forge_now/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.add_forge_now.apps.AddForgeNowConfig" 7 | -------------------------------------------------------------------------------- /swh/web/inbound_email/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.inbound_email.apps.InboundEmailConfig" 7 | -------------------------------------------------------------------------------- /swh/web/save_code_now/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | default_app_config = "swh.web.save_code_now.apps.SaveCodeNowConfig" 7 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Chunkfive; src: url('Chunkfive.otf'); 3 | } 4 | 5 | body, .usertext { 6 | color: #F0F0F0; background: #600; 7 | font-family: Chunkfive, sans; 8 | } 9 | 10 | @import url(print.css); 11 | @media print { 12 | a[href^=http]::after { 13 | content: attr(href) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.html: -------------------------------------------------------------------------------- 1 | 2 | Title 3 | 4 | 5 | 6 | 9 | 10 | 11 |

Title

12 | 13 | 14 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.clj: -------------------------------------------------------------------------------- 1 | (def ^:dynamic chunk-size 17) 2 | 3 | (defn next-chunk [rdr] 4 | (let [buf (char-array chunk-size) 5 | s (.read rdr buf)] 6 | (when (pos? s) 7 | (java.nio.CharBuffer/wrap buf 0 s)))) 8 | 9 | (defn chunk-seq [rdr] 10 | (when-let [chunk (next-chunk rdr)] 11 | (cons chunk (lazy-seq (chunk-seq rdr))))) -------------------------------------------------------------------------------- /swh/web/save_code_now/assets/index.js: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2022 The Software Heritage developers 2 | * See the AUTHORS file at the top-level directory of this distribution 3 | * License: GNU Affero General Public License version 3, or any later version 4 | * See top-level LICENSE file for more information 5 | */ 6 | 7 | export * from './origin-save'; 8 | export * from './origin-save-admin'; 9 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.applescript: -------------------------------------------------------------------------------- 1 | repeat 5 times 2 | if foo is greater than bar then 3 | display dialog "Hello there" 4 | else 5 | beep 6 | end if 7 | end repeat 8 | 9 | (* comment (*nested comment*) *) 10 | on do_something(s, y) 11 | return {s + pi, y mod 4} 12 | end do_something 13 | 14 | do shell script "/bin/echo 'hello'" -------------------------------------------------------------------------------- /.copier-answers.yml: -------------------------------------------------------------------------------- 1 | # Changes here will be overwritten by Copier 2 | _commit: v0.3.5 3 | _src_path: https://gitlab.softwareheritage.org/swh/devel/swh-py-template.git 4 | description: Software Heritage web UI 5 | distribution_name: swh-web 6 | have_cli: false 7 | have_workers: false 8 | package_root: swh/web 9 | project_name: swh.web 10 | python_minimal_version: '3.10' 11 | readme_format: rst 12 | -------------------------------------------------------------------------------- /swh/web/alter/assets/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2025 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // bundle for add forge views 9 | 10 | export * from './alter.css'; 11 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.coffee: -------------------------------------------------------------------------------- 1 | grade = (student, period=(if b? then 7 else 6)) -> 2 | if student.excellentWork 3 | "A+" 4 | else if student.okayStuff 5 | if student.triedHard then "B" else "B-" 6 | else 7 | "C" 8 | 9 | class Animal extends Being 10 | constructor: (@name) -> 11 | 12 | move: (meters) -> 13 | alert @name + " moved #{meters}m." -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.sci: -------------------------------------------------------------------------------- 1 | // A comment 2 | function I = foo(dims, varargin) 3 | d=[1; matrix(dims(1:$-1),-1,1)] 4 | for i=1:size(varargin) 5 | if varargin(i)==[] then 6 | I=[], 7 | return; 8 | end 9 | end 10 | endfunction 11 | 12 | b = cos(a) + cosh(a); 13 | bar_matrix = [ "Hello", "world" ]; 14 | foo_matrix = [1, 2, 3; 4, 5, 6]; 15 | -------------------------------------------------------------------------------- /swh/web/add_forge_now/assets/forge-success-email.ejs: -------------------------------------------------------------------------------- 1 | Dear forge administrator, 2 | 3 | We are happy to announce to you that your forge is now successfully 4 | archived. 5 | 6 | The forge repositories are now available in the archive : 7 | https://archive.softwareheritage.org/browse/search/?q=<%= forgeUrl %>&with_visit=true&with_content=true 8 | 9 | Kind regards, 10 | 11 | The Software Heritage team -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | pub enum State { 3 | Start, 4 | Transient, 5 | Closed, 6 | } 7 | 8 | impl From<&'a str> for State { 9 | fn from(s: &'a str) -> Self { 10 | match s { 11 | "start" => State::Start, 12 | "closed" => State::Closed, 13 | _ => unreachable!(), 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /swh/web/auth/migrations/0003_delete_oidcuser.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.19 on 2021-03-22 15:41 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | dependencies = [ 8 | ("swh_web_auth", "0002_remove_stored_tokens"), 9 | ] 10 | 11 | operations = [ 12 | migrations.DeleteModel( 13 | name="OIDCUser", 14 | ), 15 | ] 16 | -------------------------------------------------------------------------------- /swh/web/provenance/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from swh.web.provenance.api_views import provenance_api_urls 7 | 8 | urlpatterns = provenance_api_urls.get_url_patterns() 9 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | @objc class Person: Entity { 4 | var name: String! 5 | var age: Int! 6 | 7 | init(name: String, age: Int) { 8 | /* /* ... */ */ 9 | } 10 | 11 | // Return a descriptive string for this person 12 | func description(offset: Int = 0) -> String { 13 | return "\(name) is \(age + offset) years old" 14 | } 15 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ts: -------------------------------------------------------------------------------- 1 | class MyClass { 2 | public static myValue: string; 3 | constructor(init: string) { 4 | this.myValue = init; 5 | } 6 | } 7 | import fs = require("fs"); 8 | module MyModule { 9 | export interface MyInterface extends Other { 10 | myProperty: any; 11 | } 12 | } 13 | declare magicNumber number; 14 | myArray.forEach(() => { }); // fat arrow syntax -------------------------------------------------------------------------------- /assets/src/utils/org.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // org-js chunk that will be lazily loaded 9 | 10 | import './org.css'; 11 | export * from 'org'; 12 | -------------------------------------------------------------------------------- /swh/web/browse/assets/origin_visits/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // origin visits reporting bundle 9 | 10 | export * from './visits-reporting'; 11 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.haml: -------------------------------------------------------------------------------- 1 | !!! XML 2 | %html 3 | %body 4 | %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js 5 | /html comment 6 | -# ignore this line 7 | %ul(style='margin: 0') 8 | -items.each do |i| 9 | %i= i 10 | = variable 11 | =variable2 12 | ~ variable3 13 | ~variable4 14 | The current year is #{DataTime.now.year}. -------------------------------------------------------------------------------- /assets/src/utils/showdown.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // showdown chunk that will be lazily loaded 9 | 10 | import './showdown.css'; 11 | export * from 'showdown'; 12 | -------------------------------------------------------------------------------- /mirror_demo/templates/mirror-homepage.html: -------------------------------------------------------------------------------- 1 |
2 |

[mirror partner] section

3 |

4 | [mirror partner] has provided this mirror as part of their commitment 5 | to preserving and promoting open-source software, allowing the Software 6 | Heritage international network of mirrors to ensure accessibility and 7 | preservation of such software for future generations. 8 |

9 |
10 | -------------------------------------------------------------------------------- /swh/web/auth/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class AuthConfig(AppConfig): 10 | name = "swh.web.auth" 11 | label = "swh_web_auth" 12 | -------------------------------------------------------------------------------- /swh/web/admin/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class AdminConfig(AppConfig): 10 | name = "swh.web.admin" 11 | label = "swh_web_admin" 12 | -------------------------------------------------------------------------------- /mirror_demo/templates/mirror-footer.html: -------------------------------------------------------------------------------- 1 | [mirror partner] — 2 | Copyright (C), [mirror partner]. 3 | License: GNU 4 | AGPLv3+. 5 |
6 | {% if "swh.web.jslicenses" in SWH_DJANGO_APPS %} 7 | JavaScript license information- 8 | {% endif %} 9 | Web API 10 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author John Smith 3 | */ 4 | package l2f.gameserver.model; 5 | 6 | public abstract class L2Char extends L2Object { 7 | public static final Short ERROR = 0x0001; 8 | 9 | public void moveTo(int x, int y, int z) { 10 | _ai = null; 11 | log("Should not be called"); 12 | if (1 > 5) { // wtf!? 13 | return; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /swh/web/archive_coverage/assets/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2022-2024 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | import '@iframe-resizer/child'; 9 | import 'webapp/assets/webapp/webapp.css'; 10 | import './coverage.css'; 11 | -------------------------------------------------------------------------------- /swh/web/mailmap/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class MailmapConfig(AppConfig): 10 | name = "swh.web.mailmap" 11 | label = "swh_web_mailmap" 12 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.pde: -------------------------------------------------------------------------------- 1 | import java.util.LinkedList; 2 | import java.awt.Point; 3 | 4 | PGraphics pg; 5 | String load; 6 | 7 | void setup() { 8 | size(displayWidth, displayHeight, P3D); 9 | pg = createGraphics(displayWidth*2,displayHeight,P2D); 10 | pg.beginDraw(); 11 | pg.background(255,255,255); 12 | //pg.smooth(8); 13 | pg.endDraw(); 14 | } 15 | void draw(){ 16 | background(255); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /swh/web/save_bulk/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class SaveBulkConfig(AppConfig): 10 | name = "swh.web.save_bulk" 11 | label = "swh_web_save_bulk" 12 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.leaf: -------------------------------------------------------------------------------- 1 | #empty(friends) { 2 | Try adding some friends! 3 | } ##loop(friends, "friend") { 4 |
  • #(friend.name)
  • 5 | } 6 | 7 | #someTag(parameter.list, goes, "here") { 8 | This is an optional body here 9 | } 10 | 11 | #index(friends, "0") { 12 | Hello, #(self)! 13 | } ##else() { 14 | Nobody's there! 15 | } 16 | 17 | #() 18 | 19 | #raw() { 20 |
  • Hello
  • 21 | } 22 | -------------------------------------------------------------------------------- /swh/web/provenance/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class ProvenanceConfig(AppConfig): 10 | name = "swh.web.provenance" 11 | label = "swh_web_provenance" 12 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.cs: -------------------------------------------------------------------------------- 1 | using System.IO.Compression; 2 | 3 | #pragma warning disable 414, 3021 4 | 5 | namespace MyApplication 6 | { 7 | [Obsolete("...")] 8 | class Program : IInterface 9 | { 10 | public static List JustDoIt(int count) 11 | { 12 | Console.WriteLine($"Hello {Name}!"); 13 | return new List(new int[] { 1, 2, 3 }) 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.vim: -------------------------------------------------------------------------------- 1 | if foo > 2 || has("gui_running") 2 | syntax on 3 | set hlsearch 4 | endif 5 | 6 | set autoindent 7 | 8 | " switch on highlighting 9 | function UnComment(fl, ll) 10 | while idx >= a:ll 11 | let srclines=getline(idx) 12 | let dstlines=substitute(srclines, b:comment, "", "") 13 | call setline(idx, dstlines) 14 | endwhile 15 | endfunction 16 | 17 | let conf = {'command': 'git'} 18 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.au3: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | #AutoIt3Wrapper_Run_Tidy=Y 3 | #include 4 | 5 | _Singleton(@ScriptName) ; Allow only one instance 6 | example(0, 10) 7 | 8 | Func example($min, $max) 9 | For $i = $min To $max 10 | If Mod($i, 2) == 0 Then 11 | MsgBox(64, "Message", $i & ' is even number!') 12 | Else 13 | MsgBox(64, "Message", $i & ' is odd number!') 14 | EndIf 15 | Next 16 | EndFunc ;==>example -------------------------------------------------------------------------------- /swh/web/save_code_now/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class SaveCodeNowConfig(AppConfig): 10 | name = "swh.web.save_code_now" 11 | label = "swh_web_save_code_now" 12 | -------------------------------------------------------------------------------- /swh/web/vault/assets/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // bundle for the vault related views 9 | 10 | import './vault.css'; 11 | export * from './vault-ui'; 12 | export * from './vault-create-tasks'; 13 | -------------------------------------------------------------------------------- /swh/web/alter/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | APP_LABEL = "swh_web_alter" 9 | 10 | 11 | class AlterConfig(AppConfig): 12 | name = "swh.web.alter" 13 | label = APP_LABEL 14 | -------------------------------------------------------------------------------- /swh/web/browse/assets/revision/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // bundle for browse/revision view 9 | 10 | import './revision.css'; 11 | export * from './diff-utils'; 12 | export * from './log-utils'; 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.hsp: -------------------------------------------------------------------------------- 1 | #include "foo.hsp" 2 | 3 | // line comment 4 | message = "Hello, World!" 5 | message2 = {"Multi 6 | line 7 | string"} 8 | num = 0 9 | mes message 10 | 11 | input num : button "sqrt", *label 12 | stop 13 | 14 | *label 15 | /* 16 | block comment 17 | */ 18 | if(num >= 0) { 19 | dialog "sqrt(" + num + ") = " + sqrt(num) 20 | } else { 21 | dialog "error", 1 22 | } 23 | stop -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. _swh-web: 2 | 3 | .. include:: README.rst 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | :caption: Contents: 8 | 9 | developers-info 10 | uri-scheme-api 11 | uri-scheme-browse 12 | uri-scheme-swhids 13 | uri-scheme-misc 14 | 15 | 16 | .. only:: standalone_package_doc 17 | 18 | Indices and tables 19 | ------------------ 20 | 21 | * :ref:`genindex` 22 | * :ref:`modindex` 23 | * :ref:`routingtable` 24 | * :ref:`search` 25 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ps1: -------------------------------------------------------------------------------- 1 | $initialDate = [datetime]'2013/1/8' 2 | 3 | $rollingDate = $initialDate 4 | 5 | do { 6 | $client = New-Object System.Net.WebClient 7 | $results = $client.DownloadString("http://not.a.real.url") 8 | Write-Host "$rollingDate.ToShortDateString() - $results" 9 | $rollingDate = $rollingDate.AddDays(21) 10 | $username = [System.Environment]::UserName 11 | } until ($rollingDate -ge [datetime]'2013/12/31') -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.pony: -------------------------------------------------------------------------------- 1 | use "collections" 2 | 3 | class StopWatch 4 | """ 5 | A simple stopwatch class for performance micro-benchmarking 6 | """ 7 | var _s: U64 = 0 8 | 9 | fun delta(): U64 => 10 | Time.nanos() - _s 11 | 12 | actor LonelyPony 13 | """ 14 | A simple manifestation of the lonely pony problem 15 | """ 16 | var env: Env 17 | let sw: StopWatch = StopWatch 18 | 19 | new create(env': Env) => 20 | env = env -------------------------------------------------------------------------------- /docs/uri-scheme-api-content.rst: -------------------------------------------------------------------------------- 1 | Content 2 | ------- 3 | 4 | .. autosimple:: swh.web.api.views.content.api_check_content_known 5 | 6 | .. autosimple:: swh.web.api.views.content.api_content_metadata 7 | 8 | .. autosimple:: swh.web.api.views.content.api_content_raw 9 | 10 | .. autosimple:: swh.web.api.views.content.api_content_filetype 11 | 12 | .. autosimple:: swh.web.api.views.content.api_content_language 13 | 14 | .. autosimple:: swh.web.api.views.content.api_content_license 15 | -------------------------------------------------------------------------------- /swh/web/inbound_email/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | 9 | class InboundEmailConfig(AppConfig): 10 | default_auto_field = "django.db.models.BigAutoField" 11 | name = "swh.web.inbound_email" 12 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int main(int argc, char *argv[]) { 8 | 9 | /* An annoying "Hello World" example */ 10 | for (auto i = 0; i < 0xFFFF; i++) 11 | cout << "Hello, World!" << endl; 12 | 13 | char c = '\n'; 14 | unordered_map> m; 15 | m["key"] = "\\\\"; // this is an error 16 | 17 | return -2e3 + 12l; 18 | } -------------------------------------------------------------------------------- /nyc.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | let reportDir = 'cypress/coverage'; 4 | let tempDir = '.nyc_output'; 5 | const parallelBuildId = process.env.CYPRESS_PARALLEL_BUILD_ID; 6 | if (parallelBuildId !== undefined) { 7 | reportDir += parallelBuildId; 8 | tempDir += parallelBuildId; 9 | } 10 | 11 | module.exports = { 12 | exclude: [ 13 | 'assets/src/bundles/vendors/index.js', 14 | 'assets/src/thirdparty/**/*.js' 15 | ], 16 | 'report-dir': reportDir, 17 | 'temp-dir': tempDir 18 | }; 19 | -------------------------------------------------------------------------------- /swh/web/alter/assets/alter.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2025 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .process-steps i.mdi { 9 | font-size: 2rem; 10 | } 11 | 12 | .activity-log { 13 | max-height: 80vw; 14 | padding-top: 0.75rem; 15 | background-color: #fdfdfe; 16 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.adb: -------------------------------------------------------------------------------- 1 | package body Sqlite.Simple is 2 | 3 | Foo : int := int'Size; 4 | Bar : int := long'Size; 5 | 6 | Error_Message_C : chars_ptr := Sqlite_Errstr (Error); 7 | Error_Message : String := Null_Ignore_Value (Error_Message_C); 8 | begin 9 | 10 | Named : for Index in Foo..Bar loop 11 | Put ("Hi[]{}"); 12 | end loop Named; 13 | 14 | Foo := Bar; 15 | end Message; 16 | 17 | end Sqlite.Simple; 18 | -------------------------------------------------------------------------------- /swh/web/archive_coverage/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018-2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.urls import re_path as url 7 | 8 | from swh.web.archive_coverage.views import swh_coverage 9 | 10 | urlpatterns = [ 11 | url(r"^coverage/$", swh_coverage, name="swh-coverage"), 12 | ] 13 | -------------------------------------------------------------------------------- /swh/web/inbound_email/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.urls import re_path as url 7 | 8 | from .views import InboundEmailView 9 | 10 | urlpatterns = [ 11 | url(r"^inbound-email/$", InboundEmailView.as_view(), name="process-inbound-email") 12 | ] 13 | -------------------------------------------------------------------------------- /swh/web/add_forge_now/assets/add-forge.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2022 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .request-actions { 9 | padding-right: 10px; 10 | } 11 | 12 | .details-text { 13 | padding-top: 5px; 14 | } 15 | 16 | .history-item { 17 | padding-bottom: 5px; 18 | } 19 | -------------------------------------------------------------------------------- /swh/web/metrics/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.urls import re_path as url 7 | 8 | from swh.web.metrics.views import prometheus_metrics 9 | 10 | urlpatterns = [ 11 | url(r"^metrics/prometheus/$", prometheus_metrics, name="metrics-prometheus"), 12 | ] 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.md: -------------------------------------------------------------------------------- 1 | # hello world 2 | 3 | you can write text [with links](http://example.com) inline or [link references][1]. 4 | 5 | * one _thing_ has *em*phasis 6 | * two __things__ are **bold** 7 | 8 | [1]: http://example.com 9 | 10 | --- 11 | 12 | hello world 13 | =========== 14 | 15 | 16 | 17 | > markdown is so cool 18 | 19 | so are code segments 20 | 21 | 1. one thing (yeah!) 22 | 2. two thing `i can write code`, and `more` wipee! -------------------------------------------------------------------------------- /swh/web/alter/templates/alter_common.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% comment %} 4 | # Copyright (C) 2025 The Software Heritage developers 5 | # See the AUTHORS file at the top-level directory of this distribution 6 | # License: GNU Affero General Public License version 3, or any later version 7 | # See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% load render_bundle from webpack_loader %} 11 | 12 | {% block header %} 13 | {% render_bundle 'alter' %} 14 | {% endblock header %} 15 | -------------------------------------------------------------------------------- /swh/web/gunicorn_config.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019-2020 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from sentry_sdk.integrations.django import DjangoIntegration 7 | 8 | from swh.core.sentry import init_sentry 9 | 10 | 11 | def post_fork(server, worker): 12 | init_sentry(sentry_dsn=None, integrations=[DjangoIntegration()]) 13 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.sqf: -------------------------------------------------------------------------------- 1 | /*** 2 | Arma Scripting File 3 | Edition: 1.66 4 | ***/ 5 | 6 | // Enable eating to improve health. 7 | _unit addAction ["Eat Energy Bar", { 8 | if (_this getVariable ["EB_NumActivation", 0] > 0) then { 9 | _this setDamage (0 max (damage _this - 0.25)); 10 | } else { 11 | hint "You have eaten it all"; 12 | }; 13 | // 4 - means something... 14 | Z_obj_vip = nil; 15 | [_boat, ["Black", 1], true] call BIS_fnc_initVehicle; 16 | }]; -------------------------------------------------------------------------------- /swh/web/tests/django_asserts.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019-2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from pytest_django.asserts import assertContains, assertNotContains, assertTemplateUsed 7 | 8 | assert_template_used = assertTemplateUsed 9 | assert_contains = assertContains 10 | assert_not_contains = assertNotContains 11 | -------------------------------------------------------------------------------- /swh/web/alter/templates/emails/admin_message_notification.txt: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2025 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | {% load alter_extras %} 8 | {{ alteration }}: {% absolute_url alteration.get_admin_url %} 9 | 10 | {% if event.author %}From: {{ event.author }}{% endif %} 11 | 12 | {{ event.content }} -------------------------------------------------------------------------------- /swh/web/badges/assets/badges.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018-2023 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .swh-badge { 9 | padding-bottom: 1rem; 10 | cursor: pointer; 11 | } 12 | 13 | .swh-badge-html, 14 | .swh-iframe-html, 15 | .swh-badge-md, 16 | .swh-badge-rst { 17 | white-space: pre-wrap !important; 18 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.q: -------------------------------------------------------------------------------- 1 | select time, price by date,stock from quote where price=(max;price)fby stock 2 | data:raze value flip trade 3 | select vwap:size wavg price by 5 xbar time.minute from aapl where date within (.z.d-10;.z.d) 4 | f1:{[x;y;z] show (x;y+z);sum 1 2 3} 5 | .z.pc:{[handle] show -3!(`long$.z.p;"Closed";handle)} 6 | // random normal distribution, e.g. nor 10 7 | nor:{$[x=2*n:x div 2;raze sqrt[-2*log n?1f]*/:(sin;cos)@\:(2*pi)*n?1f;-1_.z.s 1+x]} 8 | 9 | mode:{where g=max g:count each group x} // mode function -------------------------------------------------------------------------------- /swh/web/add_forge_now/migrations/0008_turn_request_forge_url_into_url_field.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.28 on 2022-08-16 13:08 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | dependencies = [ 8 | ("swh_web_add_forge_now", "0007_rename_denied_request_status"), 9 | ] 10 | 11 | operations = [ 12 | migrations.AlterField( 13 | model_name="request", 14 | name="forge_url", 15 | field=models.URLField(), 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /swh/web/inbound_email/tests/resources/plaintext.eml: -------------------------------------------------------------------------------- 1 | Return-Path: 2 | X-Mailer: MessagingEngine.com Webmail Interface 3 | User-Agent: Cyrus-JMAP/3.7.0-alpha0-382-g88b93171a9-fm-20220330.001-g88b93171 4 | Mime-Version: 1.0 5 | Message-Id: <21e17bca-d6a7-40fb-bab8-5dadd939835b@www.fastmail.com> 6 | Date: Mon, 04 Apr 2022 17:08:04 +0200 7 | From: "Test User" 8 | To: test@example.com 9 | Subject: Plain text email 10 | Content-Type: text/plain 11 | 12 | Plain text email. 13 | 14 | -- 15 | Test User 16 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.bf: -------------------------------------------------------------------------------- 1 | ++++++++++ 2 | [ 3*10 and 10*10 3 | ->+++>++++++++++<< 4 | ]>> 5 | [ filling cells 6 | ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[> 7 | ]< 8 | +++++++++<< 9 | [ rough codes correction loop 10 | ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< 11 | ] 12 | more accurate сodes correction 13 | >>>++> 14 | -->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> 15 | ++>+++++++++++>++++++++++++>------>+++ 16 | rewind and output 17 | [<]>[.>] 18 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.sl: -------------------------------------------------------------------------------- 1 | #define TEST_DEFINE 3.14 2 | /* plastic surface shader 3 | * 4 | * Pixie is: 5 | * (c) Copyright 1999-2003 Okan Arikan. All rights reserved. 6 | */ 7 | 8 | surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1; 9 | color specularcolor = 1;) { 10 | normal Nf = faceforward (normalize(N),I); 11 | Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks * 12 | specular(Nf,-normalize(I),roughness); 13 | Oi = Os; 14 | Ci *= Oi; 15 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[koi8-r]{inputenc} 3 | \hoffset=0pt 4 | \voffset=.3em 5 | \tolerance=400 6 | \newcommand{\eTiX}{\TeX} 7 | \begin{document} 8 | \section*{Highlight.js} 9 | \begin{table}[c|c] 10 | $\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $ 11 | \end{table} 12 | Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b 13 | G\"otterd\"ammerung~45\%=34. 14 | $$ 15 | \int\limits_{0}^{\pi}\frac{4}{x-7}=3 16 | $$ 17 | \end{document} -------------------------------------------------------------------------------- /swh/web/vault/assets/vault.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .swh-vault-table { 9 | border-bottom: none !important; 10 | margin-bottom: 0 !important; 11 | } 12 | 13 | .swh-vault-table td { 14 | vertical-align: middle !important; 15 | border-top: 1px solid #ddd !important; 16 | } 17 | -------------------------------------------------------------------------------- /swh/web/browse/assets/origin_visits/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018-2025 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | export const visitStatusColor = { 9 | full: '#008000', 10 | partial: '#edc344', 11 | failed: '#ff0000', 12 | ongoing: '#0000ff', 13 | not_found: '#000', 14 | created: '#7d8080', 15 | undefined: '#ff0000' 16 | }; 17 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.elm: -------------------------------------------------------------------------------- 1 | import Html exposing (div, button, text) 2 | import Html.App exposing (beginnerProgram) 3 | import Html.Events exposing (onClick) 4 | 5 | type Msg 6 | = Increment 7 | 8 | main = 9 | beginnerProgram 10 | { model = 0, view = view 11 | , update = \Increment model -> model + 1 } 12 | 13 | view model = 14 | div [] [ div [] [ text (toString model) ] 15 | , button [ onClick Increment ] [ text "+" ] ] 16 | 17 | chars = 18 | String.cons 'C' <| String.cons 'h' <| "ars" 19 | -------------------------------------------------------------------------------- /swh/web/add_forge_now/migrations/0003_request_submitter_forward_username.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.24 on 2022-03-21 16:37 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | dependencies = [ 8 | ("swh_web_add_forge_now", "0002_authorized_null_comment"), 9 | ] 10 | 11 | operations = [ 12 | migrations.AddField( 13 | model_name="request", 14 | name="submitter_forward_username", 15 | field=models.BooleanField(default=False), 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /swh/web/browse/templates/browse-content.html: -------------------------------------------------------------------------------- 1 | {% extends "./browse.html" %} 2 | 3 | {% comment %} 4 | Copyright (C) 2017-2023 The Software Heritage developers 5 | See the AUTHORS file at the top-level directory of this distribution 6 | License: GNU Affero General Public License version 3, or any later version 7 | See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% block swh-browse-content %} 11 | {% include "./includes/top-navigation.html" %} 12 | {% include "./includes/content-display.html" %} 13 | {% endblock swh-browse-content %} 14 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.bas: -------------------------------------------------------------------------------- 1 | 10 CLS 2 | 20 FOR I = 0 TO 15 3 | 22 FOR J = 0 TO 7 4 | 30 COLOR I,J 5 | 40 PRINT " ** "; 6 | 45 NEXT J 7 | 46 COLOR I,0 8 | 47 GOSUB 100 9 | 48 PRINT 10 | 50 NEXT I 11 | 60 COLOR 15,0 12 | 99 END 13 | 100 FOR T = 65 TO 90 14 | 101 PRINT CHR$(T); 15 | 102 NEXT T 16 | 103 RETURN 17 | 200 REM Data types test 18 | 201 TOTAL# = 3.30# 'Double precision variable 19 | 202 BALANCE! = 3! 'Single precision variable 20 | 203 B2! = 12e5 '120000 21 | 204 ITEMS% = 10 'Integer variable 22 | 205 HEXTEST = &H12DB 'Hex value 23 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.bat: -------------------------------------------------------------------------------- 1 | cd \ 2 | copy a b 3 | ping 192.168.0.1 4 | @rem ping 192.168.0.1 5 | net stop sharedaccess 6 | del %tmp% /f /s /q 7 | del %temp% /f /s /q 8 | ipconfig /flushdns 9 | taskkill /F /IM JAVA.EXE /T 10 | 11 | cd Photoshop/Adobe Photoshop CS3/AMT/ 12 | if exist application.sif ( 13 | ren application.sif _application.sif 14 | ) else ( 15 | ren _application.sif application.sif 16 | ) 17 | 18 | taskkill /F /IM proquota.exe /T 19 | 20 | sfc /SCANNOW 21 | 22 | set path = test 23 | 24 | xcopy %1\*.* %2 -------------------------------------------------------------------------------- /swh/web/tests/pytest_plugin.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | import os 7 | 8 | import pytest 9 | 10 | 11 | @pytest.hookimpl(tryfirst=True) 12 | def pytest_load_initial_conftests(args, early_config, parser): 13 | # avoid side effects in tests if a local config file exists 14 | os.environ["SWH_CONFIG_FILENAME"] = "non/existing/config" 15 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.nim: -------------------------------------------------------------------------------- 1 | import module1, module2, module3 2 | from module4 import nil 3 | 4 | type 5 | TFoo = object ## Doc comment 6 | a: int32 7 | PFoo = ref TFoo 8 | 9 | proc do_stuff314(param_1: TFoo, par2am: var PFoo): PFoo {.exportc: "dostuff" .} = 10 | # Regular comment 11 | discard """ 12 | dfag 13 | sdfg"" 14 | """ 15 | result = nil 16 | 17 | method abc(a: TFoo) = discard 1u32 + 0xabcdefABCDEFi32 + 0o01234567i8 + 0b010 18 | 19 | discard rawstring"asdf""adfa" 20 | var normalstring = "asdf" 21 | let a: uint32 = 0xFFaF'u32 22 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.nix: -------------------------------------------------------------------------------- 1 | { stdenv, foo, bar ? false, ... }: 2 | 3 | /* 4 | * foo 5 | */ 6 | 7 | let 8 | a = 1; # just a comment 9 | b = null; 10 | c = toString 10; 11 | in stdenv.mkDerivation rec { 12 | name = "foo-${version}"; 13 | version = "1.3"; 14 | 15 | configureFlags = [ "--with-foo2" ] ++ stdenv.lib.optional bar "--with-foo=${ with stdenv.lib; foo }" 16 | 17 | postInstall = '' 18 | ${ if true then "--${test}" else false } 19 | ''; 20 | 21 | meta = with stdenv.lib; { 22 | homepage = https://nixos.org; 23 | }; 24 | } -------------------------------------------------------------------------------- /swh/web/api/tests/views/test_ping.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from swh.web.tests.helpers import check_api_get_responses 7 | from swh.web.utils import reverse 8 | 9 | 10 | def test_api_1_ping(api_client): 11 | url = reverse("api-1-ping") 12 | rv = check_api_get_responses(api_client, url, status_code=200) 13 | assert rv.data == "pong" 14 | -------------------------------------------------------------------------------- /swh/web/webapp/assets/webapp/heading-anchors.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2024 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | /* to prevent headings being covered by sticky top bar */ 9 | :target::before { 10 | content: ""; 11 | display: block; 12 | margin-top: -30px; 13 | height: 30px; 14 | width: 1px; 15 | } 16 | 17 | .swh-heading-anchor { 18 | color: #e20026; 19 | } -------------------------------------------------------------------------------- /swh/web/webapp/templates/includes/http-error.html: -------------------------------------------------------------------------------- 1 | {% extends "./error-base.html" %} 2 | 3 | {% comment %} 4 | Copyright (C) 2018-2024 The Software Heritage developers 5 | See the AUTHORS file at the top-level directory of this distribution 6 | License: GNU Affero General Public License version 3, or any later version 7 | See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% load static %} 11 | 12 | {% block error-description %} 13 |
    14 |
    {{ error_description }}
    15 |
    16 | {% endblock error-description %} 17 | -------------------------------------------------------------------------------- /requirements-test.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | decorator # dependency of swh.core[http] 3 | djangorestframework-stubs 4 | django-stubs[compatible-mypy] >= 5.0.2 5 | django-test-migrations 6 | hypothesis 7 | msgpack-types 8 | pytest >= 8.1 9 | pytest-django 10 | pytest-mock 11 | pytest-postgresql 12 | requests-mock != 1.9.0, != 1.9.1 13 | swh.core[http] >= 4.0.0 14 | swh.graph >= 5.1.1 15 | swh.loader.git >= 0.8.0 16 | swh.scheduler[pytest] >= 3.1.0 17 | swh.storage >= 4.1.2 18 | types-beautifulsoup4 19 | types-cryptography 20 | types-docutils 21 | types-Pygments 22 | types-pyyaml 23 | types-requests 24 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.js: -------------------------------------------------------------------------------- 1 | function $initHighlight(block, cls) { 2 | try { 3 | if (cls.search(/\bno\-highlight\b/) != -1) 4 | return process(block, true, 0x0F) + 5 | ` class="${cls}"`; 6 | } catch (e) { 7 | /* handle exception */ 8 | } 9 | for (var i = 0 / 2; i < classes.length; i++) { 10 | if (checkCondition(classes[i]) === undefined) 11 | console.log('undefined'); 12 | } 13 | 14 | return ( 15 |
    16 | {block} 17 |
    18 | ) 19 | } 20 | 21 | export $initHighlight; -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.awk: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | POPService = "/inet/tcp/0/emailhost/pop3" 3 | RS = ORS = "\r\n" 4 | print "user name" |& POPService 5 | POPService |& getline 6 | print "pass password" |& POPService 7 | POPService |& getline 8 | print "retr 1" |& POPService 9 | POPService |& getline 10 | if ($1 != "+OK") exit 11 | print "quit" |& POPService 12 | RS = "\r\n\\.\r\n" 13 | POPService |& getline 14 | print $0 15 | close(POPService) 16 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ebnf: -------------------------------------------------------------------------------- 1 | (* line comment *) 2 | 3 | rule = [optional] , symbol , { letters } , ( digit | symbol ) ; 4 | 5 | optional = ? something unnecessary ? ; (* trailing comment *) 6 | 7 | symbol = '!' | '@' | '#' | '$' | '%' | '&' | '*' ; 8 | digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; 9 | letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" 10 | | "H" | "I" | "J" | "K" | "L" | "M" | "N" 11 | | "O" | "P" | "Q" | "R" | "S" | "T" | "U" 12 | | "V" | "W" | "X" | "Y" | "Z" ; -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.gml: -------------------------------------------------------------------------------- 1 | /// @description Collision code 2 | // standard collision handling 3 | 4 | // Horizontal collisions 5 | if(place_meeting(x+hspd, y, obj_wall)) { 6 | while(!place_meeting(x+sign(hspd), y, obj_wall)) { 7 | x += sign(hspd); 8 | } 9 | hspd = 0; 10 | } 11 | x += hspd; 12 | 13 | // Vertical collisions 14 | if(place_meeting(x, y+vspd, collide_obj)) { 15 | while(!place_meeting(x, y+sign(vspd), collide_obj)) { 16 | y += sign(vspd); 17 | } 18 | vspd = 0; 19 | } 20 | y += vspd; 21 | 22 | show_debug_message("This is a test"); -------------------------------------------------------------------------------- /swh/web/auth/assets/auth.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2020 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | #swh-token-error-message { 9 | color: red; 10 | font-weight: bold; 11 | } 12 | 13 | #swh-token-success-message { 14 | color: green; 15 | font-weight: bold; 16 | } 17 | 18 | #swh-bearer-token { 19 | overflow-wrap: break-word; 20 | white-space: break-spaces; 21 | } 22 | -------------------------------------------------------------------------------- /swh/web/browse/assets/browse/breadcrumbs.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .swh-browse-bread-crumbs { 9 | font-size: inherit; 10 | vertical-align: text-top; 11 | margin-bottom: 1px; 12 | } 13 | 14 | .swh-browse-bread-crumbs li:nth-child(n+2)::before { 15 | content: ""; 16 | display: inline-block; 17 | margin: 0 2px; 18 | } 19 | -------------------------------------------------------------------------------- /swh/web/mailmap/tests/test_migrations.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | 7 | APP_NAME = "swh_web_mailmap" 8 | 9 | MIGRATION_0001 = "0001_initial" 10 | 11 | 12 | def test_mailmap_django_app(migrator): 13 | state = migrator.apply_tested_migration((APP_NAME, MIGRATION_0001)) 14 | UserMailmap = state.apps.get_model(APP_NAME, "UserMailmap") 15 | assert UserMailmap 16 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.bnf: -------------------------------------------------------------------------------- 1 | ::= | 2 | ::= "<" ">" "::=" 3 | ::= " " | "" 4 | ::= | "|" 5 | ::= | 6 | ::= | 7 | ::= | "<" ">" 8 | ::= '"' '"' | "'" "'" 9 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.cr: -------------------------------------------------------------------------------- 1 | class Person 2 | def initialize(@name : String) 3 | end 4 | 5 | def greet 6 | puts "Hi, I'm #{@name}" 7 | end 8 | end 9 | 10 | class Employee < Person 11 | end 12 | 13 | employee = Employee.new "John" 14 | employee.greet # => "Hi, I'm John" 15 | employee.is_a?(Person) # => true 16 | 17 | @[Link("m")] 18 | lib C 19 | # In C: double cos(double x) 20 | fun cos(value : Float64) : Float64 21 | end 22 | 23 | C.cos(1.5_f64) # => 0.0707372 24 | 25 | s = uninitialized String 26 | s = <<-'STR' 27 | \hello\world 28 | \hello\world 29 | STR -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.styl: -------------------------------------------------------------------------------- 1 | @import "nib" 2 | 3 | // variables 4 | $green = #008000 5 | $green_dark = darken($green, 10) 6 | 7 | // mixin/function 8 | container() 9 | max-width 980px 10 | 11 | // mixin/function with parameters 12 | buttonBG($color = green) 13 | if $color == green 14 | background-color #008000 15 | else if $color == red 16 | background-color #B22222 17 | 18 | button 19 | buttonBG(red) 20 | 21 | #content, .content 22 | font Tahoma, Chunkfive, sans-serif 23 | background url('hatch.png') 24 | color #F0F0F0 !important 25 | width 100% 26 | -------------------------------------------------------------------------------- /swh/web/jslicenses/tests/test_jslicenses.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from swh.web.tests.helpers import check_html_get_response 7 | from swh.web.utils import reverse 8 | 9 | 10 | def test_js_licenses(client): 11 | url = reverse("jslicenses") 12 | check_html_get_response( 13 | client, url, status_code=200, template_used="jslicenses.html" 14 | ) 15 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.f90: -------------------------------------------------------------------------------- 1 | subroutine test_sub(k) 2 | implicit none 3 | 4 | !=============================== 5 | ! This is a test subroutine 6 | !=============================== 7 | 8 | integer, intent(in) :: k 9 | double precision, allocatable :: a(:) 10 | integer, parameter :: nmax=10 11 | integer :: i 12 | 13 | allocate (a(nmax)) 14 | 15 | do i=1,nmax 16 | a(i) = dble(i)*5.d0 17 | enddo 18 | 19 | print *, 'Hello world' 20 | write (*,*) a(:) 21 | 22 | end subroutine test_sub 23 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ahk: -------------------------------------------------------------------------------- 1 | ; hotkeys and hotstrings 2 | #a::WinSet, AlwaysOnTop, Toggle, A 3 | #Space:: 4 | MsgBox, Percent sign (`%) need to be escaped. 5 | Run "C:\Program Files\some\program.exe" 6 | Gosub, label1 7 | return 8 | ::btw::by the way 9 | ; volume 10 | #Numpad8::Send {Volume_Up} 11 | #Numpad5::Send {Volume_Mute} 12 | #Numpad2::Send {Volume_Down} 13 | 14 | label1: 15 | if (Clipboard = "") 16 | { 17 | MsgBox, , Clipboard, Empty! 18 | } 19 | else 20 | { 21 | StringReplace, temp, Clipboard, old, new, All 22 | MsgBox, , Clipboard, %temp% 23 | } 24 | return -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.sml: -------------------------------------------------------------------------------- 1 | structure List : LIST = 2 | struct 3 | 4 | val op + = InlineT.DfltInt.+ 5 | 6 | datatype list = datatype list 7 | 8 | exception Empty = Empty 9 | 10 | fun last [] = raise Empty 11 | | last [x] = x 12 | | last (_::r) = last r 13 | 14 | fun loop ([], []) = EQUAL 15 | | loop ([], _) = LESS 16 | | loop (_, []) = GREATER 17 | | loop (x :: xs, y :: ys) = 18 | (case compare (x, y) of 19 | EQUAL => loop (xs, ys) 20 | | unequal => unequal) 21 | in 22 | loop 23 | end 24 | 25 | end (* structure List *) -------------------------------------------------------------------------------- /swh/web/add_forge_now/migrations/0004_rename_tables.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.27 on 2022-03-29 11:42 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | dependencies = [ 8 | ("swh_web_add_forge_now", "0003_request_submitter_forward_username"), 9 | ] 10 | 11 | operations = [ 12 | migrations.AlterModelTable( 13 | name="request", 14 | table="add_forge_request", 15 | ), 16 | migrations.AlterModelTable( 17 | name="requesthistory", 18 | table="add_forge_request_history", 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.mel: -------------------------------------------------------------------------------- 1 | proc string[] getSelectedLights() 2 | 3 | { 4 | string $selectedLights[]; 5 | 6 | string $select[] = `ls -sl -dag -leaf`; 7 | 8 | for ( $shape in $select ) 9 | { 10 | // Determine if this is a light. 11 | // 12 | string $class[] = getClassification( `nodeType $shape` ); 13 | 14 | 15 | if ( ( `size $class` ) > 0 && ( "light" == $class[0] ) ) 16 | { 17 | $selectedLights[ `size $selectedLights` ] = $shape; 18 | } 19 | } 20 | 21 | // Result is an array of all lights included in 22 | 23 | // current selection list. 24 | return $selectedLights; 25 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.cmake: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.8) 2 | project(cmake_example) 3 | 4 | # Show message on Linux platform 5 | if (${CMAKE_SYSTEM_NAME} MATCHES Linux) 6 | message("Good choice, bro!") 7 | endif() 8 | 9 | # Tell CMake to run moc when necessary: 10 | set(CMAKE_AUTOMOC ON) 11 | # As moc files are generated in the binary dir, 12 | # tell CMake to always look for includes there: 13 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 14 | 15 | # Widgets finds its own dependencies. 16 | find_package(Qt5Widgets REQUIRED) 17 | 18 | add_executable(myproject main.cpp mainwindow.cpp) 19 | qt5_use_modules(myproject Widgets) 20 | -------------------------------------------------------------------------------- /swh/web/webapp/templates/error.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% comment %} 4 | Copyright (C) 2017-2023 The Software Heritage developers 5 | See the AUTHORS file at the top-level directory of this distribution 6 | License: GNU Affero General Public License version 3, or any later version 7 | See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% block page_title %} 11 | Error {{ error_code }} 12 | {% endblock page_title %} 13 | 14 | {% block navbar-content %} 15 |

    Error

    16 | {% endblock navbar-content %} 17 | 18 | {% block content %} 19 | {% include "includes/http-error.html" %} 20 | {% endblock content %} 21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/filenames/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.8) 2 | project(cmake_example) 3 | 4 | # Show message on Linux platform 5 | if (${CMAKE_SYSTEM_NAME} MATCHES Linux) 6 | message("Good choice, bro!") 7 | endif() 8 | 9 | # Tell CMake to run moc when necessary: 10 | set(CMAKE_AUTOMOC ON) 11 | # As moc files are generated in the binary dir, 12 | # tell CMake to always look for includes there: 13 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 14 | 15 | # Widgets finds its own dependencies. 16 | find_package(Qt5Widgets REQUIRED) 17 | 18 | add_executable(myproject main.cpp mainwindow.cpp) 19 | qt5_use_modules(myproject Widgets) 20 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.abnf: -------------------------------------------------------------------------------- 1 | ; line comment 2 | 3 | ruleset = [optional] *(group1 / group2 / SP) CRLF ; trailing comment 4 | 5 | group1 = alt1 6 | group1 =/ alt2 7 | 8 | alt1 = %x41-4D / %d78-90 9 | 10 | alt2 = %b00100001 11 | 12 | group2 = *1DIGIT / 2*HEXDIG / 3*4OCTET 13 | 14 | optional = hex-codes 15 | / literal 16 | / sensitive 17 | / insensitive 18 | 19 | hex-codes = %x68.65.6C.6C.6F 20 | literal = "string literal" 21 | sensitive = %s"case-sensitive string" 22 | insensitive = %i"case-insensitive string" 23 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.gss: -------------------------------------------------------------------------------- 1 | // This is a test 2 | #include pv.sdf 3 | 4 | proc (1) = calc(local__row, fin); 5 | if local__row; 6 | nr = local__row; 7 | else; 8 | k = colsf(fin); 9 | nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); 10 | endif; 11 | retp(nr); 12 | endp; 13 | 14 | s = "{% test string %}"; 15 | 16 | fn twopi=pi*2; 17 | 18 | /* Takes in multiple numbers. 19 | Output sum */ 20 | keyword add(str); 21 | local tok,sum; 22 | sum = 0; 23 | do until str $== ""; 24 | { tok, str } = token(str); 25 | sum = sum + stof(tok); 26 | endo; 27 | print "Sum is: " sum; 28 | endp; 29 | -------------------------------------------------------------------------------- /swh/web/browse/assets/guided_tour/swh-introjs.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2021 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .introjs-tooltip { 9 | min-width: 500px; 10 | } 11 | 12 | .introjs-tooltip.introjs-floating { 13 | /* center tooltip not attached to a DOM element to the center of the screen */ 14 | position: fixed !important; 15 | top: 50% !important; 16 | margin: 0 auto !important; 17 | transform: translate(-50%, -50%) !important; 18 | } 19 | -------------------------------------------------------------------------------- /docs/uri-scheme-api-origin.rst: -------------------------------------------------------------------------------- 1 | Origin 2 | ------ 3 | 4 | .. autosimple:: swh.web.api.views.origin.api_origins 5 | 6 | .. autosimple:: swh.web.api.views.origin.api_origin 7 | 8 | .. autosimple:: swh.web.api.views.origin.api_origin_search 9 | 10 | .. autosimple:: swh.web.api.views.origin.api_origin_visits 11 | 12 | .. autosimple:: swh.web.api.views.origin.api_origin_visit 13 | 14 | .. autosimple:: swh.web.api.views.origin.api_origin_visit_latest 15 | 16 | .. autosimple:: swh.web.api.views.origin.api_origin_metadata_search 17 | 18 | .. autosimple:: swh.web.api.views.origin.api_origin_intrinsic_metadata 19 | 20 | .. autosimple:: swh.web.api.views.origin.api_origin_extrinsic_metadata 21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # comment 3 | string_1: "Bar" 4 | string_2: 'bar' 5 | string_3: bar 6 | inline_keys_ignored: sompath/name/file.jpg 7 | keywords_in_yaml: 8 | - true 9 | - false 10 | - TRUE 11 | - FALSE 12 | - 21 13 | - 21.0 14 | - !!str 123 15 | "quoted_key": &foobar 16 | bar: foo 17 | foo: 18 | "foo": bar 19 | 20 | reference: *foobar 21 | 22 | multiline_1: | 23 | Multiline 24 | String 25 | multiline_2: > 26 | Multiline 27 | String 28 | multiline_3: " 29 | Multiline string 30 | " 31 | 32 | ansible_variables: "foo {{variable}}" 33 | 34 | array_nested: 35 | - a 36 | - b: 1 37 | c: 2 38 | - b 39 | - comment 40 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/filenames/.htaccess: -------------------------------------------------------------------------------- 1 | # rewrite`s rules for wordpress pretty url 2 | LoadModule rewrite_module modules/mod_rewrite.so 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule . index.php [NC,L] 6 | 7 | ExpiresActive On 8 | ExpiresByType application/x-javascript "access plus 1 days" 9 | 10 | Order Deny,Allow 11 | Allow from All 12 | 13 | 14 | RewriteMap map txt:map.txt 15 | RewriteMap lower int:tolower 16 | RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC] 17 | RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND 18 | RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L] 19 | 20 | -------------------------------------------------------------------------------- /swh/web/webapp/templates/masked.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% comment %} 4 | Copyright (C) 2024 The Software Heritage developers 5 | See the AUTHORS file at the top-level directory of this distribution 6 | License: GNU Affero General Public License version 3, or any later version 7 | See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% block page_title %} 11 | Access restricted (Error {{ error_code }}) 12 | {% endblock page_title %} 13 | 14 | {% block navbar-content %} 15 |

    Access restricted

    16 | {% endblock navbar-content %} 17 | 18 | {% block content %} 19 | {% include "includes/masking-error.html" %} 20 | {% endblock content %} 21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.as: -------------------------------------------------------------------------------- 1 | package org.example.dummy { 2 | import org.dummy.*; 3 | 4 | /*define package inline interface*/ 5 | public interface IFooBarzable { 6 | public function foo(... pairs):Array; 7 | } 8 | 9 | public class FooBar implements IFooBarzable { 10 | static private var cnt:uint = 0; 11 | private var bar:String; 12 | 13 | //constructor 14 | public function TestBar(bar:String):void { 15 | bar = bar; 16 | ++cnt; 17 | } 18 | 19 | public function foo(... pairs):Array { 20 | pairs.push(bar); 21 | return pairs; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /swh/web/browse/assets/browse/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018-2022 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | // main bundle for the swh-web/browse application 9 | 10 | import './breadcrumbs.css'; 11 | import './browse.css'; 12 | import './content.css'; 13 | import './snapshot-navigation.css'; 14 | 15 | export * from './browse-utils'; 16 | export * from './iframe'; 17 | export * from './origin-search'; 18 | export * from './snapshot-navigation'; 19 | export * from './sidetabs'; 20 | -------------------------------------------------------------------------------- /cypress/fixtures/save-task-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "scheduled": "2020-06-24T11:48:12.561643+00:00", 3 | "started": "2020-06-24T12:59:11.103188+00:00", 4 | "ended": "2020-06-24T12:59:12.065313+00:00", 5 | "status": "eventful", 6 | "type": "load-git", 7 | "arguments": { 8 | "args": [], 9 | "kwargs": { 10 | "url": "https://gitlab.inria.fr/solverstack/maphys/maphys/" 11 | } 12 | }, 13 | "duration": "1.0600971020758152", 14 | "message": "[2020-06-24 12:59:12,063: INFO/ForkPoolWorker-161] Task swh.loader.git.tasks.UpdateGitRepository[4ff8b555-9535-4e75-b8ec-8e76165e14ec] succeeded in 1.0600971020758152s: {'status': 'eventful'}", 15 | "name": "swh.loader.git.tasks.UpdateGitRepository" 16 | } -------------------------------------------------------------------------------- /swh/web/alter/templates/emails/admin_alteration_notification.txt: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2025 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | {% load alter_extras %} 8 | {{ alteration.get_category_display }}: {% absolute_url alteration.get_admin_url %} 9 | 10 | # Origins: 11 | 12 | {% for origin in alteration.origins.all %}- {{ origin.url }} 13 | {% endfor %} 14 | # Reasons 15 | 16 | {{ alteration.reasons|safe }} 17 | 18 | # Expected outcome 19 | 20 | {{ alteration.expected_outcome|safe }} -------------------------------------------------------------------------------- /swh/web/banners/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022-2023 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.urls import re_path as url 7 | 8 | from swh.web.banners.views import downtime_banner, fundraising_banner, hiring_banner 9 | 10 | urlpatterns = [ 11 | url(r"^fundraising/banner/$", fundraising_banner, name="swh-fundraising-banner"), 12 | url(r"^hiring/banner/$", hiring_banner, name="swh-hiring-banner"), 13 | url(r"^downtime/banner/$", downtime_banner, name="swh-downtime-banner"), 14 | ] 15 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.gcode: -------------------------------------------------------------------------------- 1 | O003 (DIAMOND SQUARE) 2 | N2 G54 G90 G49 G80 3 | N3 M6 T1 (1.ENDMILL) 4 | N4 M3 S1800 5 | N5 G0 X-.6 Y2.050 6 | N6 G43 H1 Z.1 7 | N7 G1 Z-.3 F50. 8 | N8 G41 D1 Y1.45 9 | N9 G1 X0 F20. 10 | N10 G2 J-1.45 11 | (CUTTER COMP CANCEL) 12 | N11 G1 Z-.2 F50. 13 | N12 Y-.990 14 | N13 G40 15 | N14 G0 X-.6 Y1.590 16 | N15 G0 Z.1 17 | N16 M5 G49 G28 G91 Z0 18 | N17 CALL O9456 19 | N18 #500=0.004 20 | N19 #503=[#500+#501] 21 | N20 VC45=0.0006 22 | VS4=0.0007 23 | N21 G90 G10 L20 P3 X5.Y4. Z6.567 24 | N22 G0 X5000 25 | N23 IF [#1 LT 0.370] GOTO 49 26 | N24 X-0.678 Y+.990 27 | N25 G84.3 X-0.1 28 | N26 #4=#5*COS[45] 29 | N27 #4=#5*SIN[45] 30 | N28 VZOFZ=652.9658 31 | % -------------------------------------------------------------------------------- /swh/web/browse/templates/browse-directory.html: -------------------------------------------------------------------------------- 1 | {% extends "./browse.html" %} 2 | 3 | {% comment %} 4 | Copyright (C) 2017-2023 The Software Heritage developers 5 | See the AUTHORS file at the top-level directory of this distribution 6 | License: GNU Affero General Public License version 3, or any later version 7 | See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% block swh-browse-content %} 11 | {% include "./includes/top-navigation.html" %} 12 | {% include "./includes/directory-display.html" %} 13 | {% endblock swh-browse-content %} 14 | 15 | {% block swh-browse-after-content %} 16 | {% include "./includes/readme-display.html" %} 17 | {% endblock swh-browse-after-content %} 18 | -------------------------------------------------------------------------------- /assets/src/utils/requests-filter-checkbox.ejs: -------------------------------------------------------------------------------- 1 | <%# 2 | Copyright (C) 2022 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | %> 7 |
    8 | 11 | checked="checked" 12 | <% } %> 13 | id="<%= inputId %>"> 14 | 17 |
    18 | -------------------------------------------------------------------------------- /swh/web/add_forge_now/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.apps import AppConfig 7 | 8 | APP_LABEL = "swh_web_add_forge_now" 9 | 10 | 11 | class AddForgeNowConfig(AppConfig): 12 | name = "swh.web.add_forge_now" 13 | label = APP_LABEL 14 | 15 | def ready(self): 16 | from ..inbound_email.signals import email_received 17 | from .signal_receivers import handle_inbound_message 18 | 19 | email_received.connect(handle_inbound_message) 20 | -------------------------------------------------------------------------------- /swh/web/alter/templates/emails/email_magic_link.txt: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2025 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | {% load alter_extras %} 8 | {% absolute_url token.get_absolute_url as url %} 9 | {% blocktranslate with expiration=token.expires_at|timeuntil %} 10 | Greetings, 11 | 12 | Please click the following link to confirm your email address: 13 | 14 | {{ url }} 15 | 16 | This link will expire in {{ expiration }}. 17 | 18 | Best regards, 19 | The SWH team 20 | {% endblocktranslate %} -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.cls: -------------------------------------------------------------------------------- 1 | #dim test as %Library.Integer 2 | SET test = 123.099 3 | set ^global = %request.Content 4 | Write "Current date """, $ztimestamp, """, result: ", test + ^global = 125.099 5 | do ##class(Cinema.Utils).AddShow("test") // class method call 6 | do ##super() ; another one-line comment 7 | d:(^global = 2) ..thisClassMethod(1, 2, "test") 8 | /* 9 | * Sub-languages support: 10 | */ 11 | &sql( SELECT * FROM Cinema.Film WHERE Length > 2 ) 12 | &js 15 | &html< 16 | 17 | 18 | Test 19 | > 20 | 21 | quit $$$OK 22 | -------------------------------------------------------------------------------- /swh/web/webapp/assets/webapp/heading-anchors.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2024 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | import AnchorJS from 'anchor-js'; 9 | import './heading-anchors.css'; 10 | 11 | export function addHeadingAnchors(parentSelector = '.app-content') { 12 | $(function() { 13 | const anchors = new AnchorJS({ 14 | class: 'swh-heading-anchor', 15 | ariaLabel: 'anchor to heading' 16 | }); 17 | anchors.add(`${parentSelector} :is(h2, h3, h4, h5, h6)`); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /swh/web/inbound_email/management/commands/process_inbound_email.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | import sys 7 | 8 | from django.core.management.base import BaseCommand 9 | 10 | from ...handle_message import MessageHandler 11 | 12 | 13 | class Command(BaseCommand): 14 | help = "Process a new inbound email" 15 | 16 | def handle(self, *args, **options): 17 | MessageHandler( 18 | raw_message=sys.stdin.buffer.read(), sender=self.__class__ 19 | ).handle() 20 | -------------------------------------------------------------------------------- /swh/web/save_bulk/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.urls import path as url 7 | 8 | from swh.web.save_bulk.api_views import save_bulk_api_urls 9 | from swh.web.save_bulk.views import api_save_bulk_origins_list 10 | 11 | urlpatterns = [ 12 | url( 13 | "origin/save/bulk//list/", 14 | api_save_bulk_origins_list, 15 | name="save-origin-bulk-origins-list", 16 | ), 17 | ] 18 | urlpatterns += save_bulk_api_urls.get_url_patterns() 19 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/filenames/httpd.conf: -------------------------------------------------------------------------------- 1 | ServerRoot "/etc/httpd" 2 | Listen 80 3 | Include conf.modules.d/*.conf 4 | 5 | User apache 6 | Group apache 7 | 8 | ServerAdmin root@localhost 9 | 10 | 11 | AllowOverride none 12 | Require all denied 13 | 14 | 15 | DocumentRoot "/var/www/html" 16 | 17 | 18 | AllowOverride None 19 | Require all granted 20 | 21 | 22 | 23 | Options Indexes FollowSymLinks 24 | 25 | AllowOverride None 26 | 27 | Require all granted 28 | 29 | 30 | 31 | DirectoryIndex index.html 32 | 33 | 34 | IncludeOptional conf.d/*.conf -------------------------------------------------------------------------------- /swh/web/alter/templates/emails/message_notification.txt: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2025 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | {% load alter_extras %} 8 | {% absolute_url alteration.get_absolute_url as url %} 9 | {% blocktranslate with category=alteration.get_category_display %}Greetings, 10 | 11 | You've received a new message regarding your «{{ category }}» archive alteration request. Please follow this link to access it: 12 | 13 | {{ url }} 14 | 15 | Best regards, 16 | The SWH team 17 | {% endblocktranslate %} -------------------------------------------------------------------------------- /swh/web/alter/templates/emails/alteration_magic_link.txt: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2025 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | {% load alter_extras %} 8 | {% absolute_url token.get_absolute_url as url %} 9 | {% blocktranslate with expiration=token.expires_at|timeuntil %} 10 | Greetings, 11 | 12 | The following link will give you access to your alteration request: 13 | 14 | {{ url }} 15 | 16 | Please note that this link will expire in {{ expiration }}. 17 | 18 | Best regards, 19 | The SWH team 20 | {% endblocktranslate %} -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.lc: -------------------------------------------------------------------------------- 1 | 2000000000 then 21 | put "Welcome to the future!" 22 | else 23 | return "something" 24 | end if 25 | end myFunction 26 | 27 | 28 | --| END OF blog.lc 29 | --| Location: ./system/application/controllers/blog.lc 30 | ---------------------------------------------------------------------- -------------------------------------------------------------------------------- /docs/uri-scheme-api-vault.rst: -------------------------------------------------------------------------------- 1 | Vault 2 | ----- 3 | 4 | .. autosimple:: swh.web.vault.api_views.api_vault_cook_flat 5 | 6 | .. autosimple:: swh.web.vault.api_views.api_vault_download_flat 7 | 8 | .. autosimple:: swh.web.vault.api_views.api_vault_cook_git_bare 9 | 10 | .. autosimple:: swh.web.vault.api_views.api_vault_download_revision_git_bare 11 | 12 | .. autosimple:: swh.web.vault.api_views.api_vault_cook_gitfast 13 | 14 | .. autosimple:: swh.web.vault.api_views.api_vault_download_revision_gitfast 15 | 16 | .. autosimple:: swh.web.vault.api_views.api_vault_cook_directory 17 | 18 | .. autosimple:: swh.web.vault.api_views.api_vault_download_directory 19 | 20 | .. autosimple:: swh.web.vault.api_views.api_vault_cook_revision_gitfast 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/uri-scheme-api.rst: -------------------------------------------------------------------------------- 1 | .. _swh-web-api-urls: 2 | 3 | swh-web API URLs 4 | ================ 5 | 6 | .. include:: uri-scheme-api-content.rst 7 | 8 | .. include:: uri-scheme-api-directory.rst 9 | 10 | .. include:: uri-scheme-api-extid.rst 11 | 12 | .. include:: uri-scheme-api-graph.rst 13 | 14 | .. include:: uri-scheme-api-swhids.rst 15 | 16 | .. include:: uri-scheme-api-origin.rst 17 | 18 | .. include:: uri-scheme-api-provenance.rst 19 | 20 | .. include:: uri-scheme-api-release.rst 21 | 22 | .. include:: uri-scheme-api-request-archival.rst 23 | 24 | .. include:: uri-scheme-api-revision.rst 25 | 26 | .. include:: uri-scheme-api-snapshot.rst 27 | 28 | .. include:: uri-scheme-api-stat.rst 29 | 30 | .. include:: uri-scheme-api-vault.rst 31 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/0012_saveoriginrequest_note.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | dependencies = [ 11 | ("swh_web_save_code_now", "0011_saveoriginrequest_user_ids"), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name="saveoriginrequest", 17 | name="note", 18 | field=models.TextField(null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.proto: -------------------------------------------------------------------------------- 1 | package languages.protobuf; 2 | 3 | option java_package = "org.highlightjs.languages.protobuf"; 4 | 5 | message Customer { 6 | required int64 customer_id = 1; 7 | optional string name = 2; 8 | optional string real_name = 3 [default = "Anonymous"]; 9 | optional Gender gender = 4; 10 | repeated string email_addresses = 5; 11 | 12 | optional bool is_admin = 6 [default = false]; // or should this be a repeated field in Account? 13 | 14 | enum Gender { 15 | MALE = 1, 16 | FEMALE = 2 17 | } 18 | } 19 | 20 | service CustomerSearch { 21 | rpc FirstMatch(CustomerRequest) returns (CustomerResponse); 22 | rpc AllMatches(CustomerRequest) returns (CustomerResponse); 23 | } -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ldif: -------------------------------------------------------------------------------- 1 | # Example LDAP user 2 | dn: uid=user.0,ou=People,dc=example,dc=com 3 | objectClass: top 4 | objectClass: person 5 | objectClass: organizationalPerson 6 | objectClass: inetOrgPerson 7 | givenName: Morris 8 | sn: Day 9 | cn: Morris Day 10 | initials: MD 11 | employeeNumber: 0 12 | uid: user.0 13 | mail: user.0@example.com 14 | userPassword: password 15 | telephoneNumber: +1 042 100 3866 16 | homePhone: +1 039 680 4135 17 | pager: +1 284 199 0966 18 | mobile: +1 793 707 0251 19 | street: 90280 Spruce Street 20 | l: Minneapolis 21 | st: MN 22 | postalCode: 50401 23 | postalAddress: Morris Day$90280 Spruce Street$Minneapolis, MN 50401 24 | description: This is the description for Morris Day. 25 | 26 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.lisp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env csi 2 | 3 | (defun prompt-for-cd () 4 | "Prompts 5 | for CD" 6 | (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6)) 7 | (prompt-read "Artist" &rest) 8 | (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0) 9 | (if x (format t "yes") (format t "no" nil) ;and here comment 10 | ) 11 | ;; second line comment 12 | '(+ 1 2) 13 | (defvar *lines*) ; list of all lines 14 | (position-if-not #'sys::whitespacep line :start beg)) 15 | (quote (privet 1 2 3)) 16 | '(hello world) 17 | (* 5 7) 18 | (1 2 34 5) 19 | (:use "aaaa") 20 | (let ((x 10) (y 20)) 21 | (print (+ x y)) 22 | ) -------------------------------------------------------------------------------- /swh/web/auth/models.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020-2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.db import models 7 | 8 | 9 | class OIDCUserOfflineTokens(models.Model): 10 | """ 11 | Model storing encrypted bearer tokens generated by users. 12 | """ 13 | 14 | user_id = models.CharField(max_length=50) 15 | creation_date = models.DateTimeField(auto_now_add=True) 16 | offline_token = models.BinaryField() 17 | 18 | class Meta: 19 | app_label = "swh_web_auth" 20 | db_table = "oidc_user_offline_tokens" 21 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Add here external Python modules dependencies, one per line. Module names 2 | # should match https://pypi.python.org/pypi names. For the full spec or 3 | # dependency lines, see https://pip.readthedocs.org/en/1.1/requirements.html 4 | 5 | chardet 6 | charset-normalizer >= 3.4.3 7 | cryptography 8 | disposable-email-domains 9 | django 10 | django-admin-logs 11 | django-bootstrap5 12 | django-cors-headers 13 | django-js-reverse 14 | django-minify-html 15 | django-ratelimit 16 | djangorestframework 17 | django-webpack-loader >= 3 18 | docutils 19 | iso8601 20 | looseversion 21 | msgpack 22 | prometheus-client 23 | psycopg 24 | pybadges2 25 | pygments 26 | pymemcache 27 | python-magic >= 0.4.0 28 | pyyaml 29 | requests 30 | rfc3987 31 | sentry-sdk 32 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.tcl: -------------------------------------------------------------------------------- 1 | package json 2 | 3 | source helper.tcl 4 | # randomness verified by a die throw 5 | set ::rand 4 6 | 7 | proc give::recursive::count {base p} { ; # 2 mandatory params 8 | while {$p > 0} { 9 | set result [expr $result * $base]; incr p -1 10 | } 11 | return $result 12 | } 13 | 14 | set a {a}; set b "bcdef"; set lst [list "item"] 15 | puts [llength $a$b] 16 | 17 | set ::my::tid($id) $::my::tid(def) 18 | lappend lst $arr($idx) $::my::arr($idx) $ar(key) 19 | lreplace ::my::tid($id) 4 4 20 | puts $::rand ${::rand} ${::AWESOME::component::variable} 21 | 22 | puts "$x + $y is\t [expr $x + $y]" 23 | 24 | proc isprime x { 25 | expr {$x>1 && ![regexp {^(oo+?)\1+$} [string repeat o $x]]} 26 | } -------------------------------------------------------------------------------- /swh/web/save_bulk/migrations/0002_alter_savebulkorigin_origin_url.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ("swh_web_save_bulk", "0001_initial"), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name="savebulkorigin", 18 | name="origin_url", 19 | field=models.CharField(max_length=4096, null=False), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.rsc: -------------------------------------------------------------------------------- 1 | # Берем список DNS серверов из /ip dns 2 | # Проверяем их доступность, 3 | # и только рабочие прописываем в настройки DHCP сервера 4 | :global ActiveDNSServers [] 5 | :local PingResult 0 6 | :foreach serv in=[/ip dns get servers] do={ 7 | :do {:set PingResult [ping $serv count=3]} on-error={:set PingResult 0} 8 | :if ($PingResult=3) do={ :set ActiveDNSServers ($ActiveDNSServers,$serv) } 9 | # отладочный вывод в журнал 10 | :log info "Server: $serv, Ping-result: $PingResult"; 11 | } 12 | 13 | /ip dhcp-server network set [find address=192.168.254.0/24] dns-server=$ActiveDNSServers 14 | 15 | #--- FIX TTL ---- 16 | /ip firewall mangle chain=postrouting action=change-ttl new-ttl=set:128 comment="NAT hide" 17 | -------------------------------------------------------------------------------- /swh/web/auth/migrations/0002_remove_stored_tokens.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | 7 | from django.db import migrations 8 | 9 | from swh.web.auth.models import OIDCUserOfflineTokens 10 | 11 | 12 | def _remove_stored_encrypted_tokens(apps, schema_editor): 13 | OIDCUserOfflineTokens.objects.all().delete() 14 | 15 | 16 | class Migration(migrations.Migration): 17 | dependencies = [ 18 | ("swh_web_auth", "0001_initial"), 19 | ] 20 | 21 | operations = [migrations.RunPython(_remove_stored_encrypted_tokens)] 22 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Simple signal/slot implementation 3 | ]] 4 | local signal_mt = { 5 | __index = { 6 | register = table.insert 7 | } 8 | } 9 | function signal_mt.__index:emit(... --[[ Comment in params ]]) 10 | for _, slot in ipairs(self) do 11 | slot(self, ...) 12 | end 13 | end 14 | local function create_signal() 15 | return setmetatable({}, signal_mt) 16 | end 17 | 18 | -- Signal test 19 | local signal = create_signal() 20 | signal:register(function(signal, ...) 21 | print(...) 22 | end) 23 | signal:emit('Answer to Life, the Universe, and Everything:', 42) 24 | 25 | --[==[ [=[ [[ 26 | Nested ]] 27 | multi-line ]=] 28 | comment ]==] 29 | [==[ Nested 30 | [=[ multi-line 31 | [[ string 32 | ]] ]=] ]==] 33 | -------------------------------------------------------------------------------- /swh/web/tests/test_create_users.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | 7 | def test_create_users_test_users_exist(db): 8 | from .create_test_users import User, users 9 | 10 | for username, (_, _, permissions, groups) in users.items(): 11 | user = User.objects.filter(username=username).get() 12 | assert user is not None 13 | 14 | for permission in permissions: 15 | assert user.has_perm(permission) 16 | 17 | for group in groups: 18 | assert user.groups.filter(name=group).exists() 19 | -------------------------------------------------------------------------------- /swh/web/vault/tests/test_views.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from swh.web.tests.helpers import check_html_get_response 7 | from swh.web.utils import reverse 8 | 9 | 10 | def test_vault_view(client): 11 | url = reverse("vault") 12 | check_html_get_response(client, url, status_code=200, template_used="vault-ui.html") 13 | 14 | 15 | def test_browse_vault_view(client): 16 | url = reverse("browse-vault") 17 | resp = check_html_get_response(client, url, status_code=302) 18 | assert resp["location"] == reverse("vault") 19 | -------------------------------------------------------------------------------- /assets/src/utils/showdown.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018-2019 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | .swh-showdown a { 9 | border: none; 10 | } 11 | 12 | .swh-showdown table { 13 | border-collapse: collapse; 14 | } 15 | 16 | .swh-showdown table, 17 | .swh-showdown table th, 18 | .swh-showdown table td { 19 | padding: 6px 13px; 20 | border: 1px solid #dfe2e5; 21 | } 22 | 23 | .swh-showdown table tr:nth-child(even) { 24 | background-color: #f2f2f2; 25 | } 26 | 27 | .swh-showdown img, 28 | .swh-showdown svg { 29 | max-width: 100%; 30 | } 31 | -------------------------------------------------------------------------------- /swh/web/api/views/ping.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020-2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from rest_framework.request import Request 7 | 8 | from swh.web.api.apidoc import api_doc 9 | from swh.web.api.apiurls import api_route 10 | 11 | 12 | @api_route(r"/ping/", "api-1-ping") 13 | @api_doc("/ping/", category="Miscellaneous", noargs=True) 14 | def ping(request: Request): 15 | """ 16 | .. http:get:: /api/1/ping/ 17 | 18 | A simple endpoint used to check if the API is working. 19 | 20 | :statuscode 200: no error 21 | 22 | """ 23 | return "pong" 24 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/0014_saveoriginrequest_snapshot_swhid.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | dependencies = [ 11 | ("swh_web_save_code_now", "0013_saveoriginrequest_webhook_info"), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name="saveoriginrequest", 17 | name="snapshot_swhid", 18 | field=models.CharField(max_length=200, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ep: -------------------------------------------------------------------------------- 1 | %layout 'bootstrap'; 2 | % title "Import your subs"; 3 | %= form_for '/settings/import' => (method => 'post', enctype => 'multipart/form-data') => begin 4 | %= file_field 'opmlfile' => multiple => 'true' 5 | %= submit_button 'Import', 'class' => 'btn' 6 | % end 7 |
    8 | % if ($subs) { 9 |
    10 | % for my $item (@$subs) { 11 | % my ($dir, $align) = ($item->{rtl}) ? ('rtl', 'right') : ('ltr', 'left'); 12 |
    rss 13 | <%== $item->{title} %> 14 |
    15 |
    Categories 16 | %= join q{, }, sort @{ $item->{categories} || [] }; 17 |
    18 |
    19 | % } 20 |
    21 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.ml: -------------------------------------------------------------------------------- 1 | (* This is a 2 | multiline, (* nested *) comment *) 3 | type point = { x: float; y: float };; 4 | let some_string = "this is a string";; 5 | let rec length lst = 6 | match lst with 7 | [] -> 0 8 | | head :: tail -> 1 + length tail 9 | ;; 10 | exception Test;; 11 | type expression = 12 | Const of float 13 | | Var of string 14 | | Sum of expression * expression (* e1 + e2 *) 15 | | Diff of expression * expression (* e1 - e2 *) 16 | | Prod of expression * expression (* e1 * e2 *) 17 | | Quot of expression * expression (* e1 / e2 *) 18 | class point = 19 | object 20 | val mutable x = 0 21 | method get_x = x 22 | method private move d = x <- x + d 23 | end;; 24 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.p: -------------------------------------------------------------------------------- 1 | @CLASS 2 | base 3 | 4 | @USE 5 | module.p 6 | 7 | @BASE 8 | class 9 | 10 | # Comment for code 11 | @create[aParam1;aParam2][local1;local2] 12 | ^connect[mysql://host/database?ClientCharset=windows-1251] 13 | ^for[i](1;10){ 14 |

    ^eval($i+10)

    15 | ^connect[mysql://host/database]{ 16 | $tab[^table::sql{select * from `table` where a='1'}] 17 | $var_Name[some${value}] 18 | } 19 | } 20 | 21 | ^rem{ 22 | Multiline comment with code: $var 23 | ^while(true){ 24 | ^for[i](1;10){ 25 | ^sleep[] 26 | } 27 | } 28 | } 29 | ^taint[^#0A] 30 | 31 | @GET_base[] 32 | ## Comment for code 33 | # Isn't comment 34 | $result[$.hash_item1[one] $.hash_item2[two]] -------------------------------------------------------------------------------- /swh/web/settings/development.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2017-2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | """ 7 | Django development settings for swh-web. 8 | """ 9 | 10 | from django.core.cache import cache 11 | 12 | from swh.web.config import get_config 13 | 14 | swh_web_config = get_config() 15 | 16 | swh_web_config.update( 17 | { 18 | "show_corner_ribbon": True, 19 | "corner_ribbon_text": "Development", 20 | } 21 | ) 22 | 23 | from .common import * # noqa 24 | 25 | AUTH_PASSWORD_VALIDATORS = [] # disable any pwd validation mechanism 26 | 27 | cache.clear() 28 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.thrift: -------------------------------------------------------------------------------- 1 | namespace * thrift.test 2 | 3 | /** 4 | * Docstring! 5 | */ 6 | enum Numberz 7 | { 8 | ONE = 1, 9 | TWO, 10 | THREE, 11 | FIVE = 5, 12 | SIX, 13 | EIGHT = 8 14 | } 15 | 16 | const Numberz myNumberz = Numberz.ONE; 17 | // the following is expected to fail: 18 | // const Numberz urNumberz = ONE; 19 | 20 | typedef i64 UserId 21 | 22 | struct Msg 23 | { 24 | 1: string message, 25 | 2: i32 type 26 | } 27 | struct NestedListsI32x2 28 | { 29 | 1: list> integerlist 30 | } 31 | struct NestedListsI32x3 32 | { 33 | 1: list>> integerlist 34 | } 35 | service ThriftTest 36 | { 37 | void testVoid(), 38 | string testString(1: string thing), 39 | oneway void testInit() 40 | } 41 | 42 | -------------------------------------------------------------------------------- /swh/web/metrics/views.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from prometheus_client.exposition import CONTENT_TYPE_LATEST, generate_latest 7 | 8 | from django.http import HttpResponse 9 | 10 | from swh.web.metrics.prometheus import ( 11 | SWH_WEB_METRICS_REGISTRY, 12 | compute_save_requests_metrics, 13 | ) 14 | 15 | 16 | def prometheus_metrics(request): 17 | compute_save_requests_metrics() 18 | 19 | return HttpResponse( 20 | content=generate_latest(registry=SWH_WEB_METRICS_REGISTRY), 21 | content_type=CONTENT_TYPE_LATEST, 22 | ) 23 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/0002_saveoriginrequest_visit_date.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from __future__ import unicode_literals 7 | 8 | from django.db import migrations, models 9 | 10 | 11 | class Migration(migrations.Migration): 12 | dependencies = [ 13 | ("swh_web_save_code_now", "0001_initial"), 14 | ] 15 | 16 | operations = [ 17 | migrations.AddField( 18 | model_name="saveoriginrequest", 19 | name="visit_date", 20 | field=models.DateTimeField(null=True), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /swh/web/save_origin_webhooks/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | 7 | # register Web API endpoints 8 | import swh.web.save_origin_webhooks.bitbucket # noqa 9 | import swh.web.save_origin_webhooks.gitea # noqa 10 | import swh.web.save_origin_webhooks.github # noqa 11 | import swh.web.save_origin_webhooks.gitlab # noqa 12 | import swh.web.save_origin_webhooks.sourceforge # noqa 13 | 14 | from swh.web.save_origin_webhooks.generic_receiver import ( # isort: skip 15 | webhooks_api_urls, 16 | ) 17 | 18 | urlpatterns = webhooks_api_urls.get_url_patterns() 19 | -------------------------------------------------------------------------------- /cypress/e2e/statics.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2023-205 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | const filesToCheck = [ 9 | {name: 'robots.txt', path: '/robots.txt', should_contain: 'Disallow'}, 10 | {name: 'security.txt', path: '/security.txt', should_contain: 'Expires'} 11 | ]; 12 | 13 | describe('Static content', function() { 14 | 15 | filesToCheck.forEach(file => { 16 | it(`should access '${file.name}' and find '${file.should_contain} in it'`, function() { 17 | cy.visit(file.path); 18 | cy.contains(file.should_contain); 19 | }); 20 | 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /swh/web/auth/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% comment %} 4 | Copyright (C) 2018-2024 The Software Heritage developers 5 | See the AUTHORS file at the top-level directory of this distribution 6 | License: GNU Affero General Public License version 3, or any later version 7 | See top-level LICENSE file for more information 8 | {% endcomment %} 9 | 10 | {% load static %} 11 | 12 | {% block page_title %} 13 | Login 14 | {% endblock page_title %} 15 | 16 | {% block navbar-content %} 17 |

    Login

    18 | {% endblock navbar-content %} 19 | 20 | {% block content %} 21 |
    22 | {% csrf_token %} 23 | {{ form.as_p }} 24 | 25 |
    26 | {% endblock content %} 27 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/0006_rename_origin_type.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from __future__ import unicode_literals 7 | 8 | from django.db import migrations 9 | 10 | 11 | class Migration(migrations.Migration): 12 | dependencies = [ 13 | ("swh_web_save_code_now", "0005_remove_duplicated_authorized_origins"), 14 | ] 15 | 16 | operations = [ 17 | migrations.RenameField( 18 | model_name="saveoriginrequest", 19 | old_name="origin_type", 20 | new_name="visit_type", 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /swh/web/webapp/assets/vendors/bootstrap.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2024 The Software Heritage developers 3 | * See the AUTHORS file at the top-level directory of this distribution 4 | * License: GNU Affero General Public License version 3, or any later version 5 | * See top-level LICENSE file for more information 6 | */ 7 | 8 | @import "swh-custom"; 9 | @import "~admin-lte"; 10 | 11 | // define button style similar to the default one from adminlte 3.x 12 | // that was previously used. 13 | .btn-secondary { 14 | @include button-variant($background: $secondary, 15 | $border: #ddd, 16 | $color: #2b2b2b, 17 | $hover-background: #e9ecef); 18 | --bs-btn-focus-box-shadow: 0 0 0 #{$btn-focus-width} rgba(226, 0, 38, .25); 19 | } -------------------------------------------------------------------------------- /swh/web/alter/templates/emails/alteration_confirmation.txt: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2025 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | {% load alter_extras %} 8 | {% blocktranslate %}Greetings, 9 | 10 | We have received your alteration request for the following origins: 11 | {% endblocktranslate %} 12 | {% for origin in alteration.origins.all %}- {{ origin.url }} 13 | {% endfor %} 14 | 15 | {% absolute_url alteration.get_absolute_url as url %} 16 | {% blocktranslate %} 17 | You can track its progress here: 18 | 19 | {{ url }} 20 | 21 | Best regards, 22 | The SWH team 23 | {% endblocktranslate %} -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.rib: -------------------------------------------------------------------------------- 1 | FrameBegin 0 2 | Display "Scene" "framebuffer" "rgb" 3 | Option "searchpath" "shader" "+&:/home/kew" 4 | Option "trace" "int maxdepth" [4] 5 | Attribute "visibility" "trace" [1] 6 | Attribute "irradiance" "maxerror" [0.1] 7 | Attribute "visibility" "transmission" "opaque" 8 | Format 640 480 1.0 9 | ShadingRate 2 10 | PixelFilter "catmull-rom" 1 1 11 | PixelSamples 4 4 12 | Projection "perspective" "fov" 49.5502811377 13 | Scale 1 1 -1 14 | 15 | WorldBegin 16 | 17 | ReadArchive "Lamp.002_Light/instance.rib" 18 | Surface "plastic" 19 | ReadArchive "Cube.004_Mesh/instance.rib" 20 | # ReadArchive "Sphere.010_Mesh/instance.rib" 21 | # ReadArchive "Sphere.009_Mesh/instance.rib" 22 | ReadArchive "Sphere.006_Mesh/instance.rib" 23 | 24 | WorldEnd 25 | FrameEnd 26 | -------------------------------------------------------------------------------- /swh/web/browse/templates/includes/branch-search.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2021-2024 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | 8 |
    9 | 14 | 17 |
    18 | -------------------------------------------------------------------------------- /swh/web/browse/templates/includes/empty-snapshot.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Copyright (C) 2018-2023 The Software Heritage developers 3 | See the AUTHORS file at the top-level directory of this distribution 4 | License: GNU Affero General Public License version 3, or any later version 5 | See top-level LICENSE file for more information 6 | {% endcomment %} 7 | 8 | {% load static %} 9 | 10 |
    11 |   
    12 |   {% if snapshot_context and snapshot_context.origin_info %}
    13 |     

    14 | The snapshot associated to the visit of origin {{ snapshot_context.origin_info.url }} 15 | on {{ snapshot_context.timestamp }} is empty ! 16 |

    17 | {% else %} 18 |

    The snapshot is empty !

    19 | {% endif %} 20 |
    21 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/0016_alter_saveoriginrequest_origin_url.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.db import migrations, models 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ("swh_web_save_code_now", "0015_alter_saveoriginrequest_loading_task_status"), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name="saveoriginrequest", 18 | name="origin_url", 19 | field=models.CharField(max_length=4096, null=False), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.diff: -------------------------------------------------------------------------------- 1 | Index: languages/ini.js 2 | =================================================================== 3 | --- languages/ini.js (revision 199) 4 | +++ languages/ini.js (revision 200) 5 | @@ -1,8 +1,7 @@ 6 | hljs.LANGUAGES.ini = 7 | { 8 | case_insensitive: true, 9 | - defaultMode: 10 | - { 11 | + defaultMode: { 12 | contains: ['comment', 'title', 'setting'], 13 | illegal: '[^\\s]' 14 | }, 15 | 16 | *** /path/to/original timestamp 17 | --- /path/to/new timestamp 18 | *************** 19 | *** 1,3 **** 20 | --- 1,9 ---- 21 | + This is an important 22 | + notice! It should 23 | + therefore be located at 24 | + the beginning of this 25 | + document! 26 | 27 | ! compress the size of the 28 | ! changes. 29 | 30 | It is important to spell 31 | -------------------------------------------------------------------------------- /swh/web/badges/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022-2024 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU Affero General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | 6 | from django.urls import path as url 7 | 8 | from swh.web.badges import swh_badge, swh_badge_swhid 9 | from swh.web.utils.url_path_converters import register_url_path_converters 10 | 11 | register_url_path_converters() 12 | 13 | urlpatterns = [ 14 | url( 15 | "badge//", 16 | swh_badge_swhid, 17 | name="swh-badge-swhid", 18 | ), 19 | url( 20 | "badge///", 21 | swh_badge, 22 | name="swh-badge", 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /swh/web/save_code_now/migrations/0010_saveoriginrequest_user_id.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021 The Software Heritage developers 2 | # See the AUTHORS file at the top-level directory of this distribution 3 | # License: GNU General Public License version 3, or any later version 4 | # See top-level LICENSE file for more information 5 | # Generated by Django 2.2.20 on 2021-05-03 14:16 6 | 7 | from django.db import migrations, models 8 | 9 | 10 | class Migration(migrations.Migration): 11 | dependencies = [ 12 | ("swh_web_save_code_now", "0009_saveoriginrequest_visit_status"), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name="saveoriginrequest", 18 | name="user_id", 19 | field=models.CharField(max_length=200, null=True), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.glsl: -------------------------------------------------------------------------------- 1 | // vertex shader 2 | #version 150 3 | in vec2 in_Position; 4 | in vec3 in_Color; 5 | 6 | out vec3 ex_Color; 7 | void main(void) { 8 | gl_Position = vec4(in_Position.x, in_Position.y, 0.0, 1.0); 9 | ex_Color = in_Color; 10 | } 11 | 12 | 13 | // geometry shader 14 | #version 150 15 | 16 | layout(triangles) in; 17 | layout(triangle_strip, max_vertices = 3) out; 18 | 19 | void main() { 20 | for(int i = 0; i < gl_in.length(); i++) { 21 | gl_Position = gl_in[i].gl_Position; 22 | EmitVertex(); 23 | } 24 | EndPrimitive(); 25 | } 26 | 27 | 28 | // fragment shader 29 | #version 150 30 | precision highp float; 31 | 32 | in vec3 ex_Color; 33 | out vec4 gl_FragColor; 34 | 35 | void main(void) { 36 | gl_FragColor = vec4(ex_Color, 1.0); 37 | } 38 | -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.moon: -------------------------------------------------------------------------------- 1 | print "I am #{math.random! * 100}% sure." 2 | 3 | my_function = (name="something", height=100) -> 4 | print "Hello I am", name 5 | print "My height is", height 6 | 7 | my_function dance: "Tango", partner: "none" 8 | 9 | my_func 5,4,3, -- multi-line arguments 10 | 8,9,10 11 | 12 | table = { 13 | name: "Bill", 14 | age: 200, 15 | ["favorite food"]: "rice", 16 | :keyvalue, 17 | [1+7]: 'eight' 18 | } 19 | 20 | class Inventory 21 | new: => 22 | @items = {} 23 | 24 | add_item: (name) => 25 | if @items[name] 26 | @items[name] += 1 27 | else 28 | @items[name] = 1 29 | 30 | inv = Inventory! 31 | inv\add_item "t-shirt" 32 | inv\add_item "pants" 33 | 34 | import 35 | assert_csrf 36 | require_login 37 | from require "helpers" -------------------------------------------------------------------------------- /swh/web/tests/resources/contents/code/extensions/test.feature: -------------------------------------------------------------------------------- 1 | # language: en 2 | Feature: Addition 3 | In order to avoid silly mistakes 4 | As a math idiot 5 | I want to be told the sum of two numbers 6 | 7 | @this_is_a_tag 8 | Scenario Outline: Add two numbers 9 | * I have a calculator 10 | Given I have entered into the calculator 11 | And I have entered into the calculator 12 | When I press