diff --git a/Web-app-general.md b/Web-app-general.md index d31666b..20ea0d0 100644 --- a/Web-app-general.md +++ b/Web-app-general.md @@ -1,30 +1,54 @@ ## Setup of web server -Two instances of photodiag-web server are hosted on sf-phmon-01.psi.ch virtual machine, both available only from beamline networks/control rooms: -- https://sf-photodiag.psi.ch (main server) -- https://sf-photodiag-test.psi.ch (test server) + +Two instances of the **photodiag-web** server are hosted on the **sf-phmon-01.psi.ch** virtual machine, both accessible only from the beamline networks/control rooms: + +- **Production server**: [https://sf-photodiag.psi.ch](https://sf-photodiag.psi.ch) +- **Test server**: [https://sf-photodiag-test.psi.ch](https://sf-photodiag-test.psi.ch) + ### Server updates -The service is hosted at https://gitlab.psi.ch/photon-diagnostics/photodiag_web -- Pushing a commit on the main branch will update the test server -- Pushing a tagged commit on the main branch will update both the test and prod servers. -To push a release to the main server -1. git pull the latest tested and operational version -1. python make_release.py -1. git push origin main --tags +- The service repository is hosted at: [https://gitlab.psi.ch/photon-diagnostics/photodiag_web](https://gitlab.psi.ch/photon-diagnostics/photodiag_web) +- **Pushing a commit** on the `main` branch updates the **test server**. +- **Pushing a tagged commit** on the `main` branch updates **both** the test and production servers. -The release status can be checked via gitlab CI/CD pipelines +To push a **release** to the main server: + +1. Pull the latest tested and operational version: + + git pull + +2. Create a new release (choose one of `patch`, `minor`, or `major`): + + python make_release.py patch + +3. Push the new tag(s): + + git push origin main --tags + +You can check the release status via **GitLab CI/CD pipelines**. ### Server logs -When on either sf-phmon-01 or sf-phmon-02 use the following: +When logged into either **sf-phmon-01** or **sf-phmon-02**, you can view logs with: -`sudo journalctl -u photodiag- -e ` + sudo journalctl -u photodiag- -e -use either `test` or `prod` +Replace `` with the desired instance. -``` -ssh sf-phmon-02 -sudo -i -journalctl -u photodiag-test.service -n 100 -``` -this will show the last 100 lines \ No newline at end of file +For example, to see the last 100 lines of logs on **sf-phmon-02**: + + ssh sf-phmon-02 + sudo -i + journalctl -u photodiag-test.service -n 100 + +### Restarting the VM or the service + +1. **Restart the entire VM**: + + sudo reboot + +2. **Restart a single service** (for example, photodiag test or prod): + + sudo systemctl restart .service + +Replace `` with `photodiag-test` or `photodiag-prod`. \ No newline at end of file