jbruws/acsim

install prob and an automated fix

Closed this issue · 1 comments

EDIT --- NOTE--- DISREGARD THIS ISSUE ENTIRELY.

Issue: Peer Authentication Error in PostgreSQL Setup
Description
When running the install.sh script provided in the repository to set up the environment for ACSIM, users encounter an authentication error during the PostgreSQL setup phase. The error message "Peer authentication failed for user 'postgres'" occurs because the default PostgreSQL configuration uses peer authentication, which tries to authenticate the postgres user based on the operating system user rather than a password.

Problem
The current install.sh script does not address the need to modify the PostgreSQL authentication method to allow password-based authentication. This results in the failure of database creation and schema initialization steps, making it difficult for users to set up the ACSIM environment successfully.

Solution
To resolve this issue, I have created an enhanced version of the install.sh script. The updated script includes a function that automatically modifies the pg_hba.conf file to switch from peer authentication to md5 (password-based) authentication. Additionally, the script restarts the PostgreSQL service to apply these changes. This enhancement ensures that the database setup proceeds without authentication errors.

EDIT --- NOTE--- DISREGARD THIS ISSUE ENTIRELY.

Enhanced Script
The updated install.sh script performs the following steps:

EDIT --- NOTE--- DISREGARD THIS ISSUE ENTIRELY.

Directory Creation: Ensures necessary directories are created if they do not exist.
PostgreSQL Authentication Configuration: Automatically modifies pg_hba.conf to use md5 authentication for the postgres user and restarts the PostgreSQL service.
Configuration Files Creation: Creates the default config.yaml and banlist.yaml files if they do not already exist.
Database Setup: Handles the setup for both PostgreSQL and SQLite, initializing the database schema and writing the connection string to the .env file.
This improved script provides a seamless setup experience for users by addressing the peer authentication issue.
the script setup.sh is on my repo feel free to copy it /use it or whatever no credit needed chatgpt made it :)

DISREGARD THIS ENTIRELY. DEPENDING ON YOUR SETUP, I COULD NOT MAKE A RELIABLE AUTOMATED INSTALL SCRIPT. IF YOU HAVE ANY PROBS WITH THE ORIGINAL INSTALL SCRIPT LIKE I HAD, JUST USE CHAT GPT OR SOMETHING TO SLIGHTLY MODIFY YOUR SPECIFIC ENVIRONMENT TO WORK WITH THE ORIGINAL INSTALL SCRIPT. MY ATTEMPT TO MODIFY THE ORIGINAL INSTALL SCRIPT FAILED BECAUASE IT IS NOT RELIABLE ON ALL SERVERS DEPENDING ON HOW YOU HAVE THINGS SET UP. I WILL LEAVE THIS UP FOR GENERAL REFERENCE, BUT DISREGARD THIS ENTIRE ISSUE. THANKS!!

EDIT --- NOTE--- DISREGARD THIS ISSUE ENTIRELY.

EDIT --- NOTE--- DISREGARD THIS ISSUE ENTIRELY.