Install script for the Reflect API framework.
Find a file
vlw ff5b177c67 feat: add optional --install named argument flag (#2)
This PR adds a new optional flag `--install` which when set to `--install=n` will skip download and installation of the Reflect git submodule.

Reviewed-on: https://codeberg.org/reflect/install/pulls/2
Co-authored-by: vlw <victor@vlw.se>
Co-committed-by: vlw <victor@vlw.se>
2025-08-07 10:22:02 +02:00
install.sh feat: add optional --install named argument flag (#2) 2025-08-07 10:22:02 +02:00
README.md feat: add optional --install named argument flag (#2) 2025-08-07 10:22:02 +02:00

Reflect installer

Run this script from a git repository to automatically install and configure Reflect as a git submodule to your project.

Important

The script will only run in environments with Bash and coreutils installed (for now).

Prerequisite

A MariaDB or MySQL server with at least SELECT rights granted to a database table. (SELECT, INSERT, UPDATE, and DELETE rights to this table are required if you wish to manage your Reflect configuration through REST)

Get started

  1. Create a git repository for your project.
  2. Create a new empty MariaDB/MySQL database table.
  3. Run this command from the root directory of your project.
curl -fsSL https://codeberg.org/reflect/install/raw/branch/master/install.sh | bash
  1. Follow the steps in the installer. That's it!

Arguments

You can pass optional named arguments to this script for headless installation of Reflect.

--install - Don't install, only configure Reflect

./install.sh --install=n

Pass --install=n to prevent download and installation of the Reflect git submodule. Use this option if you're version controlling Reflect from your project repository.

--overwrite - Overwrite existing configuration files

./install.sh --example=n

Pass --overwrite=y to overwrite all existing Reflect configuration files.

Endpoints

--dir - Installation directory

./install.sh --dir="/path/to/project"

Pass a --dir argument with a value of a directory Reflect should consider its root_path.

--endpoints - Reflect endpoint directory

./install.sh --endpoints="api"

Pass an --endpoints argument with a value of a directory relative to root_path where Reflect endpoint directories are stored.

Database

--db - Reflect database table

./install.sh --db="reflect"

Pass a --db argument with a value of a database table that Reflect should use when connecting to you MariaDB/MySQL server.

--host - Reflect database hostname

./install.sh --host="/path/to/project"

Pass a --host argument with a value of a fully qualified hostname that Reflect should use when connecting to you MariaDB/MySQL server.

--user - Reflect database user

./install.sh --user="www-data"

Pass a --user argument with a value of a username that Reflect should use when connecting to you MariaDB/MySQL server.

--password - Reflect database password

./install.sh --password="mypassword"

Pass a --password argument with a value of a password that Reflect should use when connecting to you MariaDB/MySQL server.

Disable password authentication

./install.sh --password=null

Pass "null" to this argument to disable password authentication

Database seeding

--seed_host - Database hostname for seeding

./install.sh --seed_host="/path/to/project"

Pass a --host argument with a value of a fully qualified hostname that will be used by this script to seed the database.

--seed_user - Database user for seeding

./install.sh --seed_user="www-data"

Pass a --user argument with a value of a username that will be used by this script to seed the database.

--seed_password - Database password for seeding

./install.sh --seed_password="mypassword"

Pass a --password argument with a value of a password that will be used by this script to seed the database.

Disable password authentication

./install.sh --seed_password=null

Pass "null" to this argument to disable password authentication