diff --git a/README.md b/README.md index bba5c18c..20141ec8 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ TODO 1. Download and install the server package for your system from the [Releases](https://github.com/cicchr/ARIS-Java/releases) section 2. Obtain signed SSL certificates from a valid certificate authority and save the ca certificate and private key using the x509 encoded pem format -3. Modify the file located in /etc/aris.cfg and set the ca and key options to the location where the certificate and key are stored +3. Create a configuration file in /etc/aris.d/ (You can add a 2 digit suffix to set the file's priority) and set the ca and key options to the location where the certificate and key are stored ``` - #/etc/aris.cfg + # /etc/aris.d/ # The CA certificate to use for connections. If this is not specified here or on the command line the server will run in self signing mode ca @@ -24,23 +24,55 @@ TODO # The private key for the above certificate. If this is not specified here of on the command line the server will run in self signing mode key ``` -4. Setup the database and start the server. +4. Setup the database. Note: The aris-configdb command exists to simplify this process. Otherwise follow the steps listed below. - 1. - 2. - -5. Run the aris-adduser command and follow the prompts to create an instructor on the server for access through the standard interface + 1. Create the database for aris in postgres. + ``` + # Open the postgres interactive terminal + sudo -u postgres psql + + # The following commands should be run in postgres + CREATE DATABASE ; + CREATE USER ; + ALTER USER WITH ENCRYPTED PASSWORD ''; + GRANT ALL PRIVILEGES ON DATABASE TO ; + + # To exit the interface type \q + ``` + 2. Either create a new configuration file in /etc/aris.d/ or use the same as in step 3 and add the following settings + ``` + # /etc/aris.d/ + + # The name of the postgres database for Aris to use + db-name + + # The postgres database user for Aris to login as + db-user + + # The postgres database password + db-pass + + # The domain name of the server + # Note this is only required when the server is running in self signing mode + domain + ``` +5. Start and enable the service + + ``` + sudo systemctl start aris + sudo systemctl enable aris ``` - sudo aris-adduser - ``` + 6. Ensure the port (default: 9001) is open on the server's firewall +7. Once the server has started you can use the client to login using the default login: + ``` + User: admin + Password: ArisAdmin1 + ``` -Note: To run the server in self signing mode skip steps 2 and 3 (not recommended) and set the domain setting in /etc/aris.cfg -``` -domain -``` +Note: To run the server in self signing mode skip steps 2 and 3 (not recommended) ## Authors diff --git a/libaris/res/edu/rpi/aris/VERSION b/libaris/res/edu/rpi/aris/VERSION index 5c49468d..2aa91601 100644 --- a/libaris/res/edu/rpi/aris/VERSION +++ b/libaris/res/edu/rpi/aris/VERSION @@ -1 +1 @@ -0.0.43 +0.0.44 diff --git a/server/src/edu/rpi/aris/net/server/DatabaseManager.java b/server/src/edu/rpi/aris/net/server/DatabaseManager.java index 52b4e978..f989bfe4 100644 --- a/server/src/edu/rpi/aris/net/server/DatabaseManager.java +++ b/server/src/edu/rpi/aris/net/server/DatabaseManager.java @@ -80,7 +80,7 @@ private void verifyDatabase(Connection connection) throws SQLException, IOExcept } } - private void createTables(Connection connection) throws SQLException { + private void createTables(Connection connection) throws SQLException, IOException { logger.warn("Creating non existent tables"); logger.warn("If this is not the first run of the program this may have unexpected results"); boolean autoCommit = connection.getAutoCommit(); @@ -137,6 +137,7 @@ private void createTables(Connection connection) throws SQLException { "constraint s_ufk foreign key (user_id) references users(id) on delete cascade," + "constraint s_pfk foreign key (proof_id) references proof(id) on delete cascade);"); connection.commit(); + createUser("admin", "ArisAdmin1", NetUtil.USER_INSTRUCTOR); } catch (Throwable e) { connection.rollback(); logger.error("An error occurred while creating the tables and the changes were rolled back");