Page MenuHomePhabricator

delete 33,000 unnecessary front end files from production
Closed, ResolvedPublic

Description

If I'm reading the code correctly, we only need to deploy like 4 files to https://refill.toolforge.org/ for the front end. The 4 files created by the npm run build command:

image.png (126×343 px, 9 KB)

And all the backend stuff is at a different Toolforge website, https://refill-api.toolforge.org/

Yet the https://refill.toolforge.org/ (front end) server is a maze of folders and files. 33,032 files, to be exact.

tools.refill@tools-bastion-15:~$ find . -type f | wc -l
33032

Am I missing something?

  • finish T422370: figure out how to deploy the front end first
  • backup the existing Toolforge front end by copying the files to your local computer - zip -r -y archive.zip . -x "./archive.zip"
  • delete everything except the essential front end files, documented in the repo
  • test the front end and make sure there's no obvious breakage. please also test the result.php API used by the gadget (there is a .lighttpd.conf file that has a URL rewrite rule that makes this work)
  • monitor WT:REFILL for a few days to see if anyone reports a bug / breakage. if so it was likely caused by this ticket deleting something.

Event Timeline

Today I started redirecting absolutely all web traffic to /ng/index.html (the Vue app), using a URL rewrite rule in .lighttpd.conf. This should be a good "scream test" to figure out if there's any entry points in use that I'm not aware of.

https://github.com/CurbSafeCharmer/refill/commit/edcd27d6cf6a2925c930c2bf999ce0cf03070895

Just now I killed off the /ng/ directory, and also got rid of the /public_html/ symlink. The compiled Vue files now reside in ~/public_html/ on https://refill.toolforge.org/, and /refill.toolforge.org/public_html/ in the GitHub repo. This greatly simplifies the directory structure, and will be the final front end directory structure.

Now all that's left to do is delete all the files around it, leaving intact just public_html, .lighttpd.conf, and default Toolforge folders/files. I may wait a day or two to make rollback easier, or I may get impatient and do it soon. We'll see :)

Novem_Linguae claimed this task.
tools.refill@tools-bastion-15:~$ rm -fr .aptitude
tools.refill@tools-bastion-15:~$ rm -fr .cache
tools.refill@tools-bastion-15:~$ rm -fr .local
tools.refill@tools-bastion-15:~$ rm -fr .ssh
tools.refill@tools-bastion-15:~$ rm -fr .vim
tools.refill@tools-bastion-15:~$ rm -fr config
tools.refill@tools-bastion-15:~$ rm -fr Git
tools.refill@tools-bastion-15:~$ rm -fr logs
tools.refill@tools-bastion-15:~$ rm -fr old-ng
tools.refill@tools-bastion-15:~$ rm -fr refill-ng-dist
tools.refill@tools-bastion-15:~$ rm -fr versions
# removed a couple root directory files by deleting in my FTP client

tools.refill@tools-bastion-15:~$ ls -al
total 216
drwxrwsr-x    8 tools.refill tools.refill   4096 Apr 11 20:54 .
drwxr-xr-x 3958 root         root         135168 Apr 10 14:26 ..
-rw-------    1 tools.refill tools.refill  19952 Apr 11 07:12 .bash_history
drwxrwsr-x    3 tools.refill tools.refill   4096 Feb 26  2015 .composer
drwx-wS---    3 tools.refill tools.refill   4096 Feb 26  2015 .config
drwxrwsr-x    4 tools.refill tools.refill   4096 Aug 18  2023 .kube
-rw-------    1 tools.refill tools.refill     52 Apr  7 21:52 .lesshst
-rw-rw-r--    1 tools.refill tools.refill    964 Apr 10 10:46 .lighttpd.conf
drwxrwsr-x  311 tools.refill tools.refill  20480 Apr  7 22:09 .npm
drwxrwsr-x    2 tools.refill tools.refill   4096 Dec 17  2019 .toolskube
drwxrwsr-x    2 tools.refill tools.refill   4096 Apr 10 10:41 public_html
-r--------    1 tools.refill tools.refill     69 Sep  4  2025 replica.my.cnf
-rw-r--r--    1 tools.refill tools.refill    163 Apr 10 10:44 service.manifest