Skip to content

Latest commit

 

History

History
76 lines (63 loc) · 2.87 KB

README.md

File metadata and controls

76 lines (63 loc) · 2.87 KB

FSS

A file synchronisation service to keep a directory in sync across multiple devices.

Setup Instructions

  1. Clone the repository and create a file named "db_password.txt" in fss/app/. This will hold the password to your database.
    The db_password.txt file

    A sample db_password file

  2. Create a .env file under fss/. In this file, define the following environment variables.
    DB_USER=postgres (This must be postgres and shouldn't be changed)
    DB_PASSWORD= (This must be identical to the password defined in db_password.txt)
    DB_HOST=db (This must be db and shouldn't be changed)
    DB_PORT=5432 (This can be any valid port but 5432 is the convention for a postgres database. If you decide to change it to another port number, you will also need to modify the docker-compose.yml file, specifically the ports property under the db service)
    DB_NAME=fss (This must be fss)
    USERSPACES= (This can be any valid path within the backend container)
    A sample .env file

  3. Run the following command from within the fss directory
    docker compose up

  4. The services should be up and the api endpoints can now be accessed at "localhost/docs" Openapi specification

Possible issue with postgres

You may face an issue described in the following thread: https://stackoverflow.com/questions/76781095/how-do-i-fix-scram-authentication-errors-when-connecting-dbeaver-to-a-docker-pos

To solve this:

  1. Delete the volumes that were created for the services.

  2. Run the following command to start the database service:
    docker compose up db

  3. Once the db service is up, edit the pg_hba.conf to allow all connections from all IPv4 addresses. Open pg_hba.conf

    Allow all connections to postgres

  4. Restart the db service.

  5. Connect to postgres. You will not be prompted for a password.
    Connect to postgres

  6. Reset the password for the postgres user. The password must be identical to the password present in db_password.txt.
    Reset the password of postgres user

  7. Change the allowed IPv4 addresses back to its default value in pg_hba.conf.
    Change the allowed connections, reset to default value

  8. Restart the db service. Run docker compose up and the backend will now be able to access the database.