4.8 KiB
4.8 KiB
| description | applyTo |
|---|---|
| Use when: deploying, staging, copying, or promoting regalamiunsorriso site files on server 83.149.164.4, especially for sync/** and www/** changes. | sync/**, www/** |
Regalami Un Sorriso Server 83.149.164.4
Instructions in this file are specific to the regalamiunsorriso site hosted on server 83.149.164.4 over SSH port 410.
Server Access
- SSH user:
marco - SSH key:
C:\Users\Maddo\.ssh\id_rsa - SSH port:
410 - Direct SSH login works with the key above.
- The login banner before authentication is expected.
Preferred SSH Workflow
Use an interactive TTY when a command may need sudo:
ssh -tt -i C:\Users\Maddo\.ssh\id_rsa -p 410 marco@83.149.164.4
For root access, use:
sudo tcsh
If you need a single elevated command:
ssh -tt -i C:\Users\Maddo\.ssh\id_rsa -p 410 marco@83.149.164.4 "sudo tcsh -c 'command here'"
Shell Behavior On This Host
- The remote login shell behaves as
tcsh. - POSIX shell constructs like
for ...; do ...; donefail unless you explicitly run them throughsh -c. - The server
shdoes not support-l, so usesh -c, notsh -lc. - If
sudoreports that a terminal is required, reconnect with-tt.
MCP Limitation
- The MCP SSH tools have not been reliable for this host and previously failed authentication or transport checks.
- Prefer direct terminal SSH commands for this server unless the MCP path is revalidated.
Site Paths
- Incoming staging root:
/home/marco/regalamiunsorriso/incoming/www - Live site root:
/home/sites/regalamiunsorriso/www
Staging Workflow
When www/** files need deployment:
- Build the file list from git changes after the initial
wwwimport baseline. - Include any required uncommitted working tree files explicitly if they must be deployed.
- Copy the selected files into
/home/marco/regalamiunsorriso/incoming/www, preserving thewww/...directory structure. - Prefer a streamed tar transfer over SSH for batches of files.
Example staging command pattern:
tar -cf - -C K:\various\regalamiunsorriso <file-list-under-www> | ssh -i C:\Users\Maddo\.ssh\id_rsa -p 410 marco@83.149.164.4 "tar -xf - -C /home/marco/regalamiunsorriso/incoming"
Promotion Rules
- Promotion to the live site must happen through
sudo tcsh. - Do not copy directly as
marcointo/home/sites/regalamiunsorriso/www. - Before replacing an existing live file, capture its exact owner, group, and mode.
- After copy, restore the same owner, group, and mode exactly.
- For new files, use the permissions of surrounding live files of the same type in the same directory.
- If same-extension files in the directory have mixed modes, choose an explicit metadata source file and reuse its owner, group, and mode.
Promotion Automation
Use these scripts for this site:
- Local helper:
sync/promote-file.sh - Local batch helper:
sync/promote-www-remaining.sh - Remote helper:
/home/marco/promote-file.sh - Remote batch helper:
/home/marco/promote-www-remaining.sh
Single File Promotion
Run:
ssh -tt -i C:\Users\Maddo\.ssh\id_rsa -p 410 marco@83.149.164.4 "sudo tcsh -c '/home/marco/promote-file.sh <staged-path> <live-path> [metadata-source]'"
Behavior of promote-file.sh:
- If the destination already exists, it copies the file and restores that destination file's original owner, group, and mode.
- If the destination does not exist, it can use an optional third argument as the metadata source file.
- If no third argument is provided for a new file, it falls back to sampling sibling files in the destination directory.
New PHP Files In Live Root
Root-level PHP files on this site do not all share one mode.
/home/sites/regalamiunsorriso/www/_inc_footer.phpisjenkins:wwwwith mode775/home/sites/regalamiunsorriso/www/gallery1.phpisjenkins:wwwwith mode775/home/sites/regalamiunsorriso/www/test.phpisjenkins:wwwwith mode644
For the faceai_*.php files, use /home/sites/regalamiunsorriso/www/_inc_footer.php as the explicit metadata source.
Verification
After staging or promotion, verify with:
ls -lfor owner, group, and visible modestat -ffor exact metadatacksumto compare staged and live file contents
Run verification commands separately if a parallel terminal run becomes unreliable.
Documentation Expectations
When performing deployments or promotions for this site:
- Record the list of changed files being deployed.
- Distinguish updated files from new files.
- Note whether any deployed file came from the working tree instead of a commit.
- Document every shell quirk or command failure encountered.
- Document the metadata source used for any new live file.
- Update
sync/www-deploy-manifest.mdwhen the deployment set or procedure changes.