From 74ce9dfb12d52b598fc5c73e4173ad9cdb02b56b Mon Sep 17 00:00:00 2001 From: Hardware Date: Sun, 6 Nov 2016 09:01:52 +0100 Subject: [PATCH] feat(): add support of custom composer file --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ run.sh | 6 ++++++ 2 files changed, 59 insertions(+) diff --git a/README.md b/README.md index 32ea663..bfe928d 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,59 @@ touch 403.html 404.html 500.html 503.html chown -R 991:991 /mnt/docker/flarum ``` +### Custom composer.json (experienced users) + +Customize your own composer.json file in `/mnt/docker/flarum/composer.custom.json`, for example add some privates repositories like this : + +```json +# /mnt/docker/flarum/composer.custom.json +{ + "name": "flarum/flarum", + "description": "Delightfully simple forum software.", + [...] + + "repositories": [ + { + "type": "package", + "package": { + "name": "xxxxx/flarum-ext-my-private-extension", + "version": "dev-master", + "type": "flarum-extension", + "authors": [ + { + "name": "Me", + "email": "me@domain.tld" + } + ], + "dist": { + "url": "/flarum/app/assets/extensions/flarum-ext-my-private-extension", + "type": "path", + "reference": "master" + }, + "require": { + "flarum/core": "^0.1.0-beta.6" + }, + "autoload": { + "psr-4": { + "xxx\\xxx\\": "src/" + } + }, + "extra": { + "flarum-extension": { + "title": "xxxxxx", + "icon": { + "name": "picture-o", + "backgroundColor": "#2196f3", + "color": "#fff" + } + } + } + } + } + ], +} +``` + ### Screenshot #### Installation diff --git a/run.sh b/run.sh index 40e7462..0a4ad5d 100644 --- a/run.sh +++ b/run.sh @@ -28,11 +28,17 @@ chown -R $UID:$GID /flarum /etc/nginx /etc/php7 /var/log /var/lib/nginx /tmp /et cd /flarum/app +# Custom HTTP errors pages if [ -d 'assets/errors' ]; then rm -rf vendor/flarum/core/error/* ln -s /flarum/app/assets/errors/* vendor/flarum/core/error fi +# Custom composer.json (eg. for privates extensions) +if [ -f 'assets/composer.custom.json' ]; then + cp -f assets/composer.custom.json composer.json +fi + # if no installation was performed before if [ -e 'assets/rev-manifest.json' ]; then