Skip to content

Instantly share code, notes, and snippets.

@apjanco
Last active March 26, 2022 19:45
Show Gist options
  • Save apjanco/91a6585dd190d03eeaa63690c89af29d to your computer and use it in GitHub Desktop.
Save apjanco/91a6585dd190d03eeaa63690c89af29d to your computer and use it in GitHub Desktop.

Care and Feeding of the Bridge Server

Here are the steps currently needed to fix texts.py after a new text is imported.

  • The main problem is that textFileDict (a dictionary that connects the human readable titles of texts to the Python file for that text either in data/Greek or data/Latin) gets deleted
  • textFileDict is needed for the selection of text sections.

Good housekeeping

  1. To connect to the Bridge server, open terminal and enter: ssh bmulliga@64.227.97.179
  2. The server is just like any other computer. You need to keep it up to date so that people can't hack into it and use it to mine bitcoin. Whenever you log in, it's a good practice to run two commands: sudo apt update to update the computer and sudo apt upgrade.
  3. Some updates need a reboot before they take effect. If you see *** System restart required ***, you can type sudo reboot and the computer will restart.
  4. Wait a few seconds and you can reconnect to the server: ssh bmulliga@64.227.97.179
  5. The application runs using the gunicorn application server and nginx webserver. If you need to restart the application, simply type sudo service gunicorn restart The configuration file is located here: /etc/systemd/system/gunicorn.service.
  6. To enter the application's virtual enviornment, you can type: source /srv/bridge_env/bin/activate

After importing a text:

  1. Connect to the Bridge server: ssh bmulliga@64.227.97.179
  2. If you imported a Latin text, open the texts.py file with sudo nano /srv/FastBridge/FastBridgeApp/data/Latin/texts.py
  3. For Greek texts.py use sudo nano /srv/FastBridge/FastBridgeApp/data/Greek/texts.py
  4. You should see two Python dictionaries in the file texts and textFileDict. If you see both, then all is well and stop here.
  5. If textFileDict is missing, go to GitHub to get a version of the file with the needed data: for Latin, for Greek and copy the section for textFileDict. Do not copy the texts dictionary because it will not include the new text that you just imported.
  6. Go back to the texts.py file from step 2 or 3. Paste textFileDict below texts.
  7. Press crtl-O to save your changes and then crtl-X to exit the editor
  8. Restart the application with sudo service gunicorn restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment