[TOOLS][PLUGINS][OAuth2] Add mechanism to allow plugins to have an install script. Add script for generating keys for OAuth
This commit is contained in:
parent
9b86794cda
commit
eccf21edef
5
Makefile
5
Makefile
@ -69,4 +69,7 @@ remove-file:
|
|||||||
flush-redis-cache:
|
flush-redis-cache:
|
||||||
docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli flushall'
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli flushall'
|
||||||
|
|
||||||
force-nuke-everything: down up flush-redis-cache database-force-nuke remove-var remove-file
|
install-plugins:
|
||||||
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) /var/www/social/bin/install_plugins.sh
|
||||||
|
|
||||||
|
force-nuke-everything: down remove-var remove-file up flush-redis-cache database-force-nuke install-plugins
|
||||||
|
11
bin/install_plugins.sh
Executable file
11
bin/install_plugins.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
for plugin in plugins/*; do
|
||||||
|
install="${plugin}/bin/install.sh"
|
||||||
|
if [ -x "${install}" ]; then
|
||||||
|
( # subshell, to clear options/environment
|
||||||
|
set -x
|
||||||
|
"${install}"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
done
|
@ -32,6 +32,8 @@ if [ ${DB_EXISTS} -ne 0 ]; then
|
|||||||
php bin/console doctrine:schema:create || exit 1
|
php bin/console doctrine:schema:create || exit 1
|
||||||
php bin/console app:populate_initial_values || exit 1
|
php bin/console app:populate_initial_values || exit 1
|
||||||
|
|
||||||
|
./bin/install_plugins.sh
|
||||||
|
|
||||||
echo "GNU social is installed"
|
echo "GNU social is installed"
|
||||||
else
|
else
|
||||||
echo "GNU social is already installed"
|
echo "GNU social is already installed"
|
||||||
|
14
plugins/OAuth2/bin/install.sh
Executable file
14
plugins/OAuth2/bin/install.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd /var/www/social/file || exit 1
|
||||||
|
|
||||||
|
mkdir -p oauth && cd oauth || exit 1
|
||||||
|
|
||||||
|
if [ ! -f private.key ]; then
|
||||||
|
openssl genrsa -out private.key 4096
|
||||||
|
openssl rsa -in private.key -pubout -out public.key
|
||||||
|
|
||||||
|
chown www-data:www-data private.key public.key
|
||||||
|
else
|
||||||
|
echo "Keys exist, nothing to do"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user