Allow instances to add prefixes by hand
This commit adds a method to allow instances to add specific prefixes to the global uri resolver.
This commit is contained in:
parent
210668a49b
commit
cb34e1144f
3 changed files with 17 additions and 0 deletions
|
|
@ -347,6 +347,9 @@ For example, if the domain name of the distillery instance is `wisski.example.co
|
||||||
The resolver configuration is automatically updated by the `update_prefix_config.sh` script.
|
The resolver configuration is automatically updated by the `update_prefix_config.sh` script.
|
||||||
It should not be neccessary to reload this configuration manually, as it is automatically called during `system_update.sh`.
|
It should not be neccessary to reload this configuration manually, as it is automatically called during `system_update.sh`.
|
||||||
|
|
||||||
|
It is also possible to manually add a URI prefix to an instance.
|
||||||
|
For this purpose, add a file named `prefixes` to the base directory of the instance, with one prefix per line.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project and associated files in this repository are licensed as follows:
|
This project and associated files in this repository are licensed as follows:
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,14 @@ GRAPHDB_REPO="${GRAPHDB_REPO_PREFIX}${USERNAME_BASE}"
|
||||||
INSTANCE_BASE_DIR="$DEPLOY_INSTANCES_DIR/$INSTANCE_DOMAIN"
|
INSTANCE_BASE_DIR="$DEPLOY_INSTANCES_DIR/$INSTANCE_DOMAIN"
|
||||||
INSTANCE_DATA_DIR="$INSTANCE_BASE_DIR/data/"
|
INSTANCE_DATA_DIR="$INSTANCE_BASE_DIR/data/"
|
||||||
|
|
||||||
|
# compute the prefix file
|
||||||
|
function compute_instance_prefixfile() {
|
||||||
|
INSTANCE_BASE_DIR="$1"
|
||||||
|
INSTANCE_PREFIX_FILE="$INSTANCE_BASE_DIR/prefixes"
|
||||||
|
echo "$INSTANCE_PREFIX_FILE"
|
||||||
|
}
|
||||||
|
INSTANCE_PREFIX_FILE="$(compute_instance_prefixfile "$INSTANCE_BASE_DIR" )"
|
||||||
|
|
||||||
if [ -n "$CERTBOT_EMAIL" ]; then
|
if [ -n "$CERTBOT_EMAIL" ]; then
|
||||||
LETSENCRYPT_HOST="$INSTANCE_DOMAIN"
|
LETSENCRYPT_HOST="$INSTANCE_DOMAIN"
|
||||||
LETSENCRYPT_EMAIL="$CERTBOT_EMAIL"
|
LETSENCRYPT_EMAIL="$CERTBOT_EMAIL"
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,12 @@ for slug in $(sql_bookkeep_list); do
|
||||||
read -r INSTANCE_BASE_DIR MYSQL_DATABASE MYSQL_USER GRAPHDB_REPO GRAPHDB_USER GRAPHDB_PASSWORD <<< "$(sql_bookkeep_load "${slug}" "filesystem_base,sql_database,sql_user,graphdb_repository,graphdb_user,graphdb_password" | tail -n +2)"
|
read -r INSTANCE_BASE_DIR MYSQL_DATABASE MYSQL_USER GRAPHDB_REPO GRAPHDB_USER GRAPHDB_PASSWORD <<< "$(sql_bookkeep_load "${slug}" "filesystem_base,sql_database,sql_user,graphdb_repository,graphdb_user,graphdb_password" | tail -n +2)"
|
||||||
|
|
||||||
pushd "$INSTANCE_BASE_DIR" > /dev/null
|
pushd "$INSTANCE_BASE_DIR" > /dev/null
|
||||||
|
|
||||||
|
INSTANCE_PREFIX_FILE="$(compute_instance_prefixfile "$INSTANCE_BASE_DIR" )"
|
||||||
|
if [ -f "$INSTANCE_PREFIX_FILE" ]; then
|
||||||
|
cat "$INSTANCE_PREFIX_FILE" | tee -a "$DEPLOY_PREFIX_CONFIG"
|
||||||
|
fi
|
||||||
|
|
||||||
docker-compose exec barrel /user_shell.sh -c "drush php:script /wisskiutils/list_uri_prefixes.php" | tee -a "$DEPLOY_PREFIX_CONFIG"
|
docker-compose exec barrel /user_shell.sh -c "drush php:script /wisskiutils/list_uri_prefixes.php" | tee -a "$DEPLOY_PREFIX_CONFIG"
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue