Page MenuHomePhabricator

[wlm-sito-autorizzazioni] Migrate https://autorizzazioni.wikilovesmonuments.it/ in WMIT-infrastructure
Closed, ResolvedPublic

Description

Preamble

Synapta said they will permanently discontinue hosting this service as of April 19, 2022.

So it was requested to migrate that tool to the WMIT-Infrastructure.

Info

Production URL:

https://autorizzazioni.wikilovesmonuments.it/

Repository:

github.com/synapta/maschera-inserimento-wikidata

https://gitlab.wikimedia.org/repos/wikimedia-it/wlm/wlm-sito-autorizzazioni

Project information:

https://wiki.wikimedia.it/wiki/Maschera_di_inserimento_delle_autorizzazioni_per_Wiki_Loves_Monuments_su_WikiData

Plan

  • 2022-03-24 project exploration
  • 2022-04-06 fork on Wikimedia's GitLab
  • 2022-04-06 requested production .env info to speedup migration
  • 2022-04-06 setup virtualhost on server intreccio
  • 2022-04-07 patch to allow a custom interface (instead of just 0.0.0.0) (check)
  • 2022-04-07 setup dependencies in Debian GNU/Linux buster
  • 2022-04-07 setup NextCloud connection (Q: why not asking these parameters from the production conf?)
  • 2022-04-07 setup OAuth (Q: why not recycling production OAuth profile?)
  • 2022-04-07 pre-migration local test
    • Wikidata OAuth login fully operational
    • Wikidata OAuth edit fully operational (check)
    • nextCloud push working (confirmed by Dario Crespi WMI)
  • 2022-04-07 DNS change by M/
  • 2022-04-07 new Let's Encrypt certificates
  • 2022-04-19 Synapta will switch-off the service
  • 2022-04 fix npm security auditing warnings

Nice to have:

  • 2022-04-06 master → main
  • 2022-04-06 update README

Attachments

/etc/systemd/system/wlm-sito-autorizzazioni.service
[Unit]
Description=WLM sito autorizzazioni
Documentation=https://phabricator.wikimedia.org/T304662

[Service]
WorkingDirectory=/var/www/wlm-autorizzazioni/project
ExecStart=/usr/bin/node ./server.js
Restart=always
RestartSec=10
User=wlm-sito-autorizzazioni
Group=wlm-sito-autorizzazioni

[Install]
WantedBy=multi-user.target

Event Timeline

Interested in moving from github to gitlab.wikimedia.org as an early adoptor by any chance?

Interested in moving from github to gitlab.wikimedia.org as an early adoptor by any chance?

Yep my friend! Spoiler:

hah! :) Very nice. Thanks. Let me know if you need any help importing existing repo.

valerio.bozzolan renamed this task from Migrate https://autorizzazioni.wikilovesmonuments.it/ in WMIT-infrastructure to [wlm-sito-autorizzazioni] Migrate https://autorizzazioni.wikilovesmonuments.it/ in WMIT-infrastructure.Apr 6 2022, 3:14 PM
valerio.bozzolan updated the task description. (Show Details)

Call me crazy but since the server wmi-intreccio is Debian GNU/Linux buster and comes with NodeJS version 10, I'm pulling the desired NodeJS version 12 via snap:

sudo apt install snapd
sudo snap install core
sudo snap install node --channel=12/stable --classic

About npm, it was already installed through buster-backports that was already enabled here.

BTW the snap package of node in Debian GNU/Linux buster seems borked.

$ /snap/bin/node server.js 
internal/modules/cjs/loader.js:1057
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: /snap/core/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /var/www/wlm-autorizzazioni/project/node_modules/better-sqlite3/build/better_sqlite3.node)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/var/www/wlm-autorizzazioni/project/node_modules/better-sqlite3/lib/database.js:5:21)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)

https://bugs.launchpad.net/snapcraft/+bug/1889409

Uhmf.

In the end we have just adopted nodejs from Debian GNU/Linux buster, even if it's version 10 (untested) instead of 12 (official) and everything now works like a charm.

Debian 1 - snap 0.

OK it seems the Nextcloud push system received our dummy authorization:

Screenshot_2022_04_07_160550.png (1,116×473 px, 351 KB)

Tested. DNS updated. Let's Encrypt certificates OK.

$ certbot certonly --webroot --webroot-path=/var/www/wlm-autorizzazioni/www -d autorizzazioni.wikilovesmonuments.it
Congratulations! Your certificate and chain have been saved

This operation can be considered completed.

Restricted Repository Identity mentioned this in Unknown Object (Diffusion Commit).Mar 15 2025, 1:36 PM