Site promotion tools

This commit is contained in:
MaddoScientisto 2026-04-11 15:57:35 +02:00
commit f4d9772bd3
9 changed files with 723 additions and 2 deletions

18
.github/copilot-instructions.md vendored Normal file
View file

@ -0,0 +1,18 @@
# Workspace Instructions
Use this file only for rules that apply across the whole repository.
## Scope
- Keep site-specific or server-specific operational procedures out of this file.
- Put per-site deployment and SSH rules in `.github/instructions/*.instructions.md` files.
- Name site-specific instruction files clearly so the target host or site is obvious.
## Current Site-Specific Instructions
- `83.149.164.4` deployment and promotion rules live in `.github/instructions/regalamiunsorriso-83-149-164-4.instructions.md`.
## Deployment Documentation
- When deployment procedures change, update the matching site-specific instruction file.
- Keep operational manifests such as `sync/www-deploy-manifest.md` aligned with the latest validated workflow.

View file

@ -0,0 +1,270 @@
---
description: 'Guidelines for creating high-quality custom instruction files for GitHub Copilot'
applyTo: '**/*.instructions.md'
---
# Custom Instructions File Guidelines
Instructions for creating effective and maintainable custom instruction files that guide GitHub Copilot in generating domain-specific code and following project conventions.
## Project Context
- Target audience: Developers and GitHub Copilot working with domain-specific code
- File format: Markdown with YAML frontmatter
- File naming convention: lowercase with hyphens (e.g., `react-best-practices.instructions.md`)
- Location: `.github/instructions/` directory
- Purpose: Provide context-aware guidance for code generation, review, and documentation
## Required Frontmatter
Every instruction file must include YAML frontmatter with the following fields:
```yaml
---
description: 'Brief description of the instruction purpose and scope'
applyTo: 'glob pattern for target files (e.g., **/*.ts, **/*.py)'
---
```
### Frontmatter Guidelines
- **description**: Single-quoted string, 1-500 characters, clearly stating the purpose
- **applyTo**: Glob pattern(s) specifying which files these instructions apply to
- Single pattern: `'**/*.ts'`
- Multiple patterns: `'**/*.ts, **/*.tsx, **/*.js'`
- Specific files: `'src/**/*.py'`
- All files: `'**'`
## File Structure
A well-structured instruction file should include the following sections:
### 1. Title and Overview
- Clear, descriptive title using `#` heading
- Brief introduction explaining the purpose and scope
- Optional: Project context section with key technologies and versions
### 2. Core Sections
Organize content into logical sections based on the domain:
- **General Instructions**: High-level guidelines and principles
- **Best Practices**: Recommended patterns and approaches
- **Code Standards**: Naming conventions, formatting, style rules
- **Architecture/Structure**: Project organization and design patterns
- **Common Patterns**: Frequently used implementations
- **Security**: Security considerations (if applicable)
- **Performance**: Optimization guidelines (if applicable)
- **Testing**: Testing standards and approaches (if applicable)
### 3. Examples and Code Snippets
Provide concrete examples with clear labels:
```markdown
### Good Example
\`\`\`language
// Recommended approach
code example here
\`\`\`
### Bad Example
\`\`\`language
// Avoid this pattern
code example here
\`\`\`
```
### 4. Validation and Verification (Optional but Recommended)
- Build commands to verify code
- Linting and formatting tools
- Testing requirements
- Verification steps
## Content Guidelines
### Writing Style
- Use clear, concise language
- Write in imperative mood ("Use", "Implement", "Avoid")
- Be specific and actionable
- Avoid ambiguous terms like "should", "might", "possibly"
- Use bullet points and lists for readability
- Keep sections focused and scannable
### Best Practices
- **Be Specific**: Provide concrete examples rather than abstract concepts
- **Show Why**: Explain the reasoning behind recommendations when it adds value
- **Use Tables**: For comparing options, listing rules, or showing patterns
- **Include Examples**: Real code snippets are more effective than descriptions
- **Stay Current**: Reference current versions and best practices
- **Link Resources**: Include official documentation and authoritative sources
### Instruction Altitude (Goldilocks Zone)
- Start with the minimum rule set that fully defines expected outcomes
- Add constraints after observed failures, not hypothetical edge cases
- Prefer high-signal examples over exhaustive decision tables
| Altitude | Failure Mode | Result |
| --- | --- | --- |
| Over-specified | Brittle if-else prose | Breaks on unlisted cases |
| Under-specified | Assumes shared context | Generic outputs |
| Right altitude | Heuristics + examples | Stable, generalizable quality |
### Common Patterns to Include
1. **Naming Conventions**: How to name variables, functions, classes, files
2. **Code Organization**: File structure, module organization, import order
3. **Error Handling**: Preferred error handling patterns
4. **Dependencies**: How to manage and document dependencies
5. **Comments and Documentation**: When and how to document code
6. **Version Information**: Target language/framework versions
## Patterns to Follow
### Bullet Points and Lists
```markdown
## Security Best Practices
- Always validate user input before processing
- Use parameterized queries to prevent SQL injection
- Store secrets in environment variables, never in code
- Implement proper authentication and authorization
- Enable HTTPS for all production endpoints
```
### Tables for Structured Information
```markdown
## Common Issues
| Issue | Solution | Example |
| ---------------- | ------------------- | ----------------------------- |
| Magic numbers | Use named constants | `const MAX_RETRIES = 3` |
| Deep nesting | Extract functions | Refactor nested if statements |
| Hardcoded values | Use configuration | Store API URLs in config |
```
### Code Comparison
```markdown
### Good Example - Using TypeScript interfaces
\`\`\`typescript
interface User {
id: string;
name: string;
email: string;
}
function getUser(id: string): User {
// Implementation
}
\`\`\`
### Bad Example - Using any type
\`\`\`typescript
function getUser(id: any): any {
// Loses type safety
}
\`\`\`
```
### Conditional Guidance
```markdown
## Framework Selection
- **For small projects**: Use Minimal API approach
- **For large projects**: Use controller-based architecture with clear separation
- **For microservices**: Consider domain-driven design patterns
```
## Patterns to Avoid
- **Overly verbose explanations**: Keep it concise and scannable
- **Outdated information**: Always reference current versions and practices
- **Ambiguous guidelines**: Be specific about what to do or avoid
- **Missing examples**: Abstract rules without concrete code examples
- **Contradictory advice**: Ensure consistency throughout the file
- **Copy-paste from documentation**: Add value by distilling and contextualizing
- **Hypothetical-rule inflation**: Do not add rules for failures that have not occurred
## Testing Your Instructions
Before finalizing instruction files:
1. **Test with Copilot**: Try the instructions with actual prompts in VS Code
2. **Verify Examples**: Ensure code examples are correct and run without errors
3. **Check Glob Patterns**: Confirm `applyTo` patterns match intended files
## Example Structure
Here's a minimal example structure for a new instruction file:
```markdown
---
description: 'Brief description of purpose'
applyTo: '**/*.ext'
---
# Technology Name Development
Brief introduction and context.
## General Instructions
- High-level guideline 1
- High-level guideline 2
## Best Practices
- Specific practice 1
- Specific practice 2
## Code Standards
### Naming Conventions
- Rule 1
- Rule 2
### File Organization
- Structure 1
- Structure 2
## Common Patterns
### Pattern 1
Description and example
\`\`\`language
code example
\`\`\`
### Pattern 2
Description and example
## Validation
- Build command: `command to verify`
- Linting: `command to lint`
- Testing: `command to test`
```
## Maintenance
- Review instructions when dependencies or frameworks are updated
- Update examples to reflect current best practices
- Remove outdated patterns or deprecated features
- Add new patterns as they emerge in the community
- Keep glob patterns accurate as project structure evolves
## Additional Resources
- [Custom Instructions Documentation](https://code.visualstudio.com/docs/copilot/customization/custom-instructions)
- [Awesome Copilot Instructions](https://github.com/github/awesome-copilot/tree/main/instructions)
- [System Prompt Altitude — Effective Context Engineering for AI Agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents#the-anatomy-of-effective-context)

View file

@ -0,0 +1,131 @@
---
description: 'Use when: deploying, staging, copying, or promoting regalamiunsorriso site files on server 83.149.164.4, especially for sync/** and www/** changes.'
applyTo: '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:
```powershell
ssh -tt -i C:\Users\Maddo\.ssh\id_rsa -p 410 marco@83.149.164.4
```
For root access, use:
```tcsh
sudo tcsh
```
If you need a single elevated command:
```powershell
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 ...; done` fail unless you explicitly run them through `sh -c`.
- The server `sh` does not support `-l`, so use `sh -c`, not `sh -lc`.
- If `sudo` reports 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:
1. Build the file list from git changes after the initial `www` import baseline.
2. Include any required uncommitted working tree files explicitly if they must be deployed.
3. Copy the selected files into `/home/marco/regalamiunsorriso/incoming/www`, preserving the `www/...` directory structure.
4. Prefer a streamed tar transfer over SSH for batches of files.
Example staging command pattern:
```powershell
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 `marco` into `/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:
```powershell
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.php` is `jenkins:www` with mode `775`
- `/home/sites/regalamiunsorriso/www/gallery1.php` is `jenkins:www` with mode `775`
- `/home/sites/regalamiunsorriso/www/test.php` is `jenkins:www` with mode `644`
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 -l` for owner, group, and visible mode
- `stat -f` for exact metadata
- `cksum` to 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.md` when the deployment set or procedure changes.

78
sync/promote-file.sh Normal file
View file

@ -0,0 +1,78 @@
#!/bin/sh
set -eu
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
echo "usage: $0 <source> <destination> [metadata-source]" >&2
exit 64
fi
src="$1"
dst="$2"
metadata_source=${3:-}
dst_dir=$(dirname "$dst")
dst_name=$(basename "$dst")
dst_ext=""
case "$dst_name" in
*.*)
dst_ext=${dst_name##*.}
;;
esac
test -f "$src" || {
echo "source file not found: $src" >&2
exit 66
}
owner=""
group=""
mode=""
sample=""
if [ -e "$dst" ]; then
owner=$(stat -f '%Su' "$dst")
group=$(stat -f '%Sg' "$dst")
mode=$(stat -f '%Lp' "$dst")
else
if [ -n "$metadata_source" ]; then
test -e "$metadata_source" || {
echo "metadata source not found: $metadata_source" >&2
exit 66
}
sample=$metadata_source
elif [ -n "$dst_ext" ]; then
for candidate in "$dst_dir"/*."$dst_ext"; do
[ -e "$candidate" ] || continue
sample=$candidate
break
done
fi
if [ -z "$sample" ]; then
for candidate in "$dst_dir"/*; do
[ -f "$candidate" ] || continue
sample=$candidate
break
done
fi
if [ -n "$sample" ]; then
owner=$(stat -f '%Su' "$sample")
group=$(stat -f '%Sg' "$sample")
mode=$(stat -f '%Lp' "$sample")
else
owner=$(stat -f '%Su' "$dst_dir")
group=$(stat -f '%Sg' "$dst_dir")
mode=644
fi
fi
cp "$src" "$dst"
chown "$owner":"$group" "$dst"
chmod "$mode" "$dst"
printf 'copied %s -> %s\n' "$src" "$dst"
printf 'restored owner=%s group=%s mode=%s\n' "$owner" "$group" "$mode"
if [ -n "$sample" ]; then
printf 'metadata source=%s\n' "$sample"
fi

View file

@ -0,0 +1,37 @@
#!/bin/sh
set -eu
PROMOTE=/home/marco/promote-file.sh
INCOMING=/home/marco/regalamiunsorriso/incoming/www
LIVE=/home/sites/regalamiunsorriso/www
PHP_SAMPLE=$LIVE/_inc_footer.php
"$PROMOTE" "$INCOMING/_inc_footer.jsp" "$LIVE/_inc_footer.jsp"
"$PROMOTE" "$INCOMING/_js/rus-ecom-240621.js" "$LIVE/_js/rus-ecom-240621.js"
"$PROMOTE" "$INCOMING/associazione.jsp" "$LIVE/associazione.jsp"
"$PROMOTE" "$INCOMING/atleticaImmagine_chiSiamo-en.jsp" "$LIVE/atleticaImmagine_chiSiamo-en.jsp"
"$PROMOTE" "$INCOMING/atleticaImmagine_chiSiamo.jsp" "$LIVE/atleticaImmagine_chiSiamo.jsp"
"$PROMOTE" "$INCOMING/controlCode-en.jsp" "$LIVE/controlCode-en.jsp"
"$PROMOTE" "$INCOMING/controlCode.jsp" "$LIVE/controlCode.jsp"
"$PROMOTE" "$INCOMING/faceai_config.php" "$LIVE/faceai_config.php" "$PHP_SAMPLE"
"$PROMOTE" "$INCOMING/faceai_handoff.php" "$LIVE/faceai_handoff.php" "$PHP_SAMPLE"
"$PROMOTE" "$INCOMING/faceai_return.php" "$LIVE/faceai_return.php" "$PHP_SAMPLE"
"$PROMOTE" "$INCOMING/faceai_simulator.php" "$LIVE/faceai_simulator.php" "$PHP_SAMPLE"
"$PROMOTE" "$INCOMING/faceai_simulator_view.php" "$LIVE/faceai_simulator_view.php" "$PHP_SAMPLE"
"$PROMOTE" "$INCOMING/includes/inc-header.php" "$LIVE/includes/inc-header.php"
"$PROMOTE" "$INCOMING/lostPwd.jsp" "$LIVE/lostPwd.jsp"
"$PROMOTE" "$INCOMING/mailMessage/noMorePic.html" "$LIVE/mailMessage/noMorePic.html"
"$PROMOTE" "$INCOMING/mailMessage/noMorePic.txt" "$LIVE/mailMessage/noMorePic.txt"
"$PROMOTE" "$INCOMING/mailMessage/noMorePicCc.html" "$LIVE/mailMessage/noMorePicCc.html"
"$PROMOTE" "$INCOMING/mailMessage/noMorePicScad.html" "$LIVE/mailMessage/noMorePicScad.html"
"$PROMOTE" "$INCOMING/mailMessage/noMorePicScad.txt" "$LIVE/mailMessage/noMorePicScad.txt"
"$PROMOTE" "$INCOMING/mailMessage/perScadereMsg.html" "$LIVE/mailMessage/perScadereMsg.html"
"$PROMOTE" "$INCOMING/mailMessage/userMsg_it.html" "$LIVE/mailMessage/userMsg_it.html"
"$PROMOTE" "$INCOMING/mailMessage/userMsg_itCC.html" "$LIVE/mailMessage/userMsg_itCC.html"
"$PROMOTE" "$INCOMING/newsCR-en.jsp" "$LIVE/newsCR-en.jsp"
"$PROMOTE" "$INCOMING/newsCR.jsp" "$LIVE/newsCR.jsp"
"$PROMOTE" "$INCOMING/pg/controlCode.jsp" "$LIVE/pg/controlCode.jsp"
"$PROMOTE" "$INCOMING/pg/logon.jsp" "$LIVE/pg/logon.jsp"
"$PROMOTE" "$INCOMING/pg/registra.jsp" "$LIVE/pg/registra.jsp"
"$PROMOTE" "$INCOMING/users-en.jsp" "$LIVE/users-en.jsp"
"$PROMOTE" "$INCOMING/users.jsp" "$LIVE/users.jsp"

View file

@ -0,0 +1,51 @@
# Riepilogo Modifiche Pubblicate
Di seguito il riepilogo dei file aggiornati o aggiunti sul sito, con una breve descrizione delle modifiche effettuate. Il testo e' pensato per poter essere riutilizzato direttamente in una comunicazione al cliente.
## Nuovi File
| File | Descrizione |
| --- | --- |
| `www/faceai_config.php` | Nuovo file di configurazione FaceAI con impostazioni ambiente, utility per token firmati, risoluzione identita' utente, gestione errori e supporto alle chiamate JSON verso il backend. |
| `www/faceai_handoff.php` | Nuovo endpoint di handoff verso FaceAI: valida i parametri della gara e dell'utente e reindirizza al frontend FaceAI con payload firmato. |
| `www/faceai_return.php` | Nuovo endpoint di ritorno da FaceAI: valida la callback firmata e mostra i risultati filtrati all'interno del sito legacy. |
| `www/faceai_simulator.php` | Nuova pagina di simulazione per testare il flusso di ingresso verso FaceAI con dati demo e foto di esempio. |
| `www/faceai_simulator_view.php` | Nuovo renderer condiviso per la simulazione FaceAI, con visualizzazione stile galleria legacy e configurazione JS per i test. |
## File Aggiornati
| File | Descrizione |
| --- | --- |
| `www/_inc_footer.jsp` | Rimossa l'indicazione del contatto Gmail aggiuntivo nel footer, lasciando solo i riferimenti principali di supporto e PEC. |
| `www/_js/rus-ecom-240621.js` | Inserita la logica di avvio FaceAI nelle pagine gara: il selettore legacy del punto foto viene sostituito da un pulsante Face ID, con gestione URL e lingua. |
| `www/associazione-en.jsp` | Aggiornati i contenuti in inglese di presentazione dell'associazione/rivista, con testo piu' attuale su pubblicazione settimanale, integrazione con la piattaforma e pubblico di riferimento. |
| `www/associazione.jsp` | Aggiornata la sezione italiana dedicata allo statuto e ai dati associativi, con formulazione piu' chiara e riferimenti aggiornati, incluso il RUNTS. |
| `www/atleticaImmagine_chiSiamo-en.jsp` | Aggiornato il testo inglese "Chi siamo" di Atletica Immagine, con nuova descrizione editoriale e del ruolo della piattaforma. |
| `www/atleticaImmagine_chiSiamo.jsp` | Aggiornato il testo italiano "Chi siamo" di Atletica Immagine, con nuova descrizione editoriale e del ruolo della piattaforma. |
| `www/controlCode-en.jsp` | Sostituito il contatto email post-registrazione con l'indirizzo centralizzato `foto@regalamiunsorriso.it`. |
| `www/controlCode.jsp` | Aggiornato il contatto email post-registrazione con l'indirizzo centralizzato `foto@regalamiunsorriso.it` e sistemata la formulazione del messaggio in italiano. |
| `www/includes/inc-header.php` | Aggiornato l'indirizzo email del proprietario/metadati del sito con il contatto centralizzato `foto@regalamiunsorriso.it`. |
| `www/lostPwd.jsp` | Aggiornato il contatto di riferimento nella pagina di recupero password con l'indirizzo centralizzato `foto@regalamiunsorriso.it`. |
| `www/mailMessage/noMorePic.html` | Uniformato il template email HTML usando solo `foto@regalamiunsorriso.it` per invio ricevute, supporto e assistenza password. |
| `www/mailMessage/noMorePic.txt` | Uniformato il template email testuale usando solo `foto@regalamiunsorriso.it` per invio ricevute, supporto e assistenza password. |
| `www/mailMessage/noMorePicCc.html` | Uniformato il template email HTML usando solo `foto@regalamiunsorriso.it` per invio ricevute, supporto e assistenza password. |
| `www/mailMessage/noMorePicScad.html` | Uniformato il template email HTML per account in scadenza usando solo `foto@regalamiunsorriso.it` per attivazione e supporto. |
| `www/mailMessage/noMorePicScad.txt` | Uniformato il template email testuale per account in scadenza usando solo `foto@regalamiunsorriso.it` per attivazione e supporto. |
| `www/mailMessage/perScadereMsg.html` | Semplificato il riferimento di supporto nella mail di promemoria, lasciando un solo indirizzo `foto@regalamiunsorriso.it`. |
| `www/mailMessage/userMsg_it.html` | Sostituiti nei messaggi utente italiani i vari indirizzi storici con il contatto unico `foto@regalamiunsorriso.it`. |
| `www/mailMessage/userMsg_itCC.html` | Sostituiti nei messaggi utente italiani i vari indirizzi storici con il contatto unico `foto@regalamiunsorriso.it`. |
| `www/newsCR-en.jsp` | Aggiornato il paragrafo promozionale in inglese dedicato ad Atletica Immagine, con testo piu' sintetico e attuale. |
| `www/newsCR.jsp` | Aggiornato il paragrafo promozionale in italiano dedicato ad Atletica Immagine, con testo piu' sintetico e attuale. |
| `www/pg/controlCode.jsp` | Aggiornato il contatto email post-registrazione con l'indirizzo centralizzato `foto@regalamiunsorriso.it`. |
| `www/pg/logon.jsp` | Aggiornato il contatto per il recupero password nella pagina di accesso con l'indirizzo centralizzato `foto@regalamiunsorriso.it`. |
| `www/pg/registra.jsp` | Aggiornate le istruzioni di registrazione: rivisti i livelli di contributo, chiarite le indicazioni operative, aggiornato il contatto di supporto e aggiunta la nota sulla cancellazione dopo un mese delle registrazioni incomplete. |
| `www/users-en.jsp` | Aggiornato l'elenco informativo in inglese per la registrazione utenti, con contributi rivisti, istruzioni piu' chiare, nuovo contatto e nota sulle registrazioni incomplete. |
| `www/users.jsp` | Aggiornato l'elenco informativo in italiano per la registrazione utenti, con contributi rivisti, istruzioni piu' chiare, nuovo contatto e nota sulle registrazioni incomplete. |
## Nota Generale
Le modifiche si concentrano in tre aree principali:
- integrazione del nuovo flusso FaceAI;
- uniformazione dei contatti email verso l'indirizzo unico `foto@regalamiunsorriso.it`;
- aggiornamento dei testi informativi e di registrazione in italiano e inglese.

19
sync/server.md Normal file
View file

@ -0,0 +1,19 @@
ssh marco@83.149.164.4 -p 410
user marco
ssh key login works through default key C:\Users\Maddo\.ssh\id_rsa
sudo doesn't really work properly, to do administrator commands one must use "sudo tcsh" and insert the password
the server prints this banner before asking for the login name:
** READ THIS BEFORE ATTEMPTING TO LOGON **
WARNING: Unauthorized access to this system is forbidden and will be
prosecuted by law. By accessing this system, you agree that your actions
may be monitored. If such monitoring reveals possible criminal activity,
system personnel may provide the evidence of such monitoring to law
enforcement officials.

117
sync/www-deploy-manifest.md Normal file
View file

@ -0,0 +1,117 @@
# WWW Deployment Manifest
This document lists the files under `www/` that changed after the initial `www` import baseline and should be copied to the remote staging path:
`/home/marco/regalamiunsorriso/incoming/www`
## Baseline Used
- Excluded the initial `www` import history by using commit `cc69770608bd0f1c32eeac01e16042f4e8a47012` (`First commit`) as the baseline.
- Included committed changes after that baseline up to `HEAD`.
- Included the current uncommitted workspace change in `www/controlCode.jsp`.
## New Files
- `www/faceai_config.php`
- `www/faceai_handoff.php`
- `www/faceai_return.php`
- `www/faceai_simulator.php`
- `www/faceai_simulator_view.php`
## Updated Files
- `www/_inc_footer.jsp`
- `www/_js/rus-ecom-240621.js`
- `www/associazione-en.jsp`
- `www/associazione.jsp`
- `www/atleticaImmagine_chiSiamo-en.jsp`
- `www/atleticaImmagine_chiSiamo.jsp`
- `www/controlCode-en.jsp`
- `www/controlCode.jsp`
- `www/includes/inc-header.php`
- `www/lostPwd.jsp`
- `www/mailMessage/noMorePic.html`
- `www/mailMessage/noMorePic.txt`
- `www/mailMessage/noMorePicCc.html`
- `www/mailMessage/noMorePicScad.html`
- `www/mailMessage/noMorePicScad.txt`
- `www/mailMessage/perScadereMsg.html`
- `www/mailMessage/userMsg_it.html`
- `www/mailMessage/userMsg_itCC.html`
- `www/newsCR-en.jsp`
- `www/newsCR.jsp`
- `www/pg/controlCode.jsp`
- `www/pg/logon.jsp`
- `www/pg/registra.jsp`
- `www/users-en.jsp`
- `www/users.jsp`
## Local Workspace-Only Change Included
- `www/controlCode.jsp` currently has an uncommitted local modification and should be deployed from the working tree version, not just from `HEAD`.
## Remote Copy Target
- Source root: `K:\various\regalamiunsorriso`
- Remote host: `marco@83.149.164.4:410`
- Remote path: `/home/marco/regalamiunsorriso/incoming/www`
- Total files in this manifest: `30`
## Transfer Notes
- Transfer completed by streaming a tar archive over SSH and extracting it into `/home/marco/regalamiunsorriso/incoming` so the `www/...` directory structure was preserved.
- Representative remote verification succeeded for new files and updated files, including `www/faceai_config.php`, `www/faceai_handoff.php`, `www/faceai_return.php`, `www/faceai_simulator.php`, `www/faceai_simulator_view.php`, `www/controlCode.jsp`, `www/_js/rus-ecom-240621.js`, `www/includes/inc-header.php`, and `www/pg/logon.jsp`.
- `www/controlCode.jsp` was uploaded from the local working tree, which includes an uncommitted change.
## Issues Encountered
- The remote login shell behaves as `tcsh`, so POSIX shell loops like `for ...; do ...; done` fail unless they are explicitly run through `sh -c`.
- The server `sh` does not accept the `-l` option, so verification commands must use `sh -c`, not `sh -lc`.
- The direct SSH and tar-based copy path works; the MCP SSH tools were not used for this transfer because they were previously failing authentication or transport checks.
## Single-File Live Promotion Test
- Tested file: `www/associazione-en.jsp`
- Staged source: `/home/marco/regalamiunsorriso/incoming/www/associazione-en.jsp`
- Live destination: `/home/sites/regalamiunsorriso/www/associazione-en.jsp`
- Original live metadata before copy: owner `jenkins`, group `www`, mode `100644`, size `6289`
- Live metadata after copy: owner `jenkins`, group `www`, mode `100644`, size `6139`
- Content verification after copy succeeded: `cksum` matched for staged and live files.
## Promotion Script
- Local template: `sync/promote-file.sh`
- Remote installed script: `/home/marco/promote-file.sh`
- Purpose: copy one source file to one destination file, then restore the destination file owner, group, and mode from the original live file.
- Supports an optional third argument: a metadata source file to use when the destination file does not exist yet and the target directory has mixed permission patterns.
### Command That Worked
```powershell
ssh -tt -i C:\Users\Maddo\.ssh\id_rsa -p 410 marco@83.149.164.4 "sudo tcsh -c '/home/marco/promote-file.sh /home/marco/regalamiunsorriso/incoming/www/associazione-en.jsp /home/sites/regalamiunsorriso/www/associazione-en.jsp'"
```
## Additional Problems Found During Live Promotion
- Uploading a multi-line script inline from PowerShell was unreliable in the local terminal because the prompt layer interfered with the here-string before SSH execution. Using a normal local file plus `scp` worked cleanly.
- The live-site verification command was interrupted once when run in parallel with the promotion command. Re-running verification separately avoided that issue.
- Promotion to `/home/sites/regalamiunsorriso/www` must run through `sudo tcsh`; copying as `marco` alone is not sufficient for the live path and would not preserve the required live ownership.
- Root-level PHP files on the live site do not have a single uniform mode. For example, `_inc_footer.php` and `gallery1.php` are `775`, while `test.php` is `644`. The promotion helper was extended to accept an explicit metadata source so new files can follow a chosen live pattern instead of relying on the first sibling match.
## Recommended Replication Procedure
1. Stage the file under `/home/marco/regalamiunsorriso/incoming/www/...`.
2. Inspect the live destination metadata before changing anything.
3. Run `/home/marco/promote-file.sh <staged-path> <live-path> [metadata-source]` through `sudo tcsh` in an SSH session opened with `-tt`.
4. Verify the live file with `ls -l`, `stat -f`, and `cksum` against the staged source.
## Full Live Promotion Result
- After the single-file test with `www/associazione-en.jsp`, the remaining `29` files in the manifest were promoted successfully to `/home/sites/regalamiunsorriso/www`.
- Existing destination files kept their original live owner, group, and mode.
- The new `faceai_*.php` files were created as `jenkins:www` with mode `775`, using `/home/sites/regalamiunsorriso/www/_inc_footer.php` as the explicit metadata source.
- Representative content verification succeeded with matching `cksum` values for:
- `www/faceai_config.php`
- `www/controlCode.jsp`
- `www/pg/logon.jsp`
- Representative metadata verification succeeded for updated files in root, `pg`, `includes`, and `mailMessage` directories.

View file

@ -74,14 +74,14 @@
<div class="row">
<div class="col-lg-12 col-xs-12">
<p align="left"><acx:if wherecondition='<%=true ||bean.getCallingJsp().equals("newUser") %>'>
Complimenti <strong><%=utenteLogon.getCognomeNome()%></strong>, la registrazione completata.</acx:if>
Complimenti <strong><%=utenteLogon.getCognomeNome()%></strong>, la registrazione è completata.</acx:if>
<br>
<p>Salve,
<br>
questa la prima volta che accedi al ns. sito*.<br>
Nella mail che ti abbiamo inviato troverai un link che ti permetter di attivare i tuoi dati di accesso immediatamente. <br>
Se la mail non arrivata, contatta <a href="mailto:foto@pierogiacomelli.com">foto@pierogiacomelli.com</a> e verificheremo nel piu' breve tempo possibile.<br>
Se la mail non è arrivata, contatta <a href="mailto:foto@pierogiacomelli.com">foto@pierogiacomelli.com</a> e verificheremo nel piu' breve tempo possibile.<br>
<br>
<font color="#FF0000">
<%=msg%></font></span><br>