Add docker environment and fix sharing folder
This commit is contained in:
parent
4a30c02521
commit
0fe00a2654
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
/vendor/
|
||||||
|
/build/
|
||||||
|
node_modules/
|
||||||
|
/.php-cs-fixer.cache
|
||||||
|
js/*hot-update.*
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM nextcloud:27
|
||||||
|
|
||||||
|
ENV NEXTCLOUD_UPDATE 1
|
||||||
|
ENV NEXTCLOUD_ADMIN_USER epubreader
|
||||||
|
ENV NEXTCLOUD_ADMIN_PASSWORD epubreader
|
||||||
|
ENV NEXTCLOUD_INIT_HTACCESS 1
|
||||||
|
ENV SQLITE_DATABASE epubreader
|
||||||
|
|
||||||
|
RUN curl -sSLo /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar && \
|
||||||
|
chmod +x /usr/local/bin/composer && \
|
||||||
|
rm -f /usr/local/etc/php/conf.d/opcache-recommended.ini && \
|
||||||
|
/entrypoint.sh true
|
||||||
|
|
||||||
|
USER www-data
|
||||||
|
|
||||||
|
COPY --chown=www-data:www-data . apps/epubreader
|
||||||
|
RUN cd apps/epubreader && composer install && cd - && \
|
||||||
|
php occ app:enable epubreader && \
|
||||||
|
php occ config:system:set debug --value=true
|
||||||
|
|
||||||
|
USER root
|
@ -45,19 +45,19 @@ class Hooks
|
|||||||
{
|
{
|
||||||
// Nextcloud encodes this as JSON, Owncloud does not (yet) (#75)
|
// Nextcloud encodes this as JSON, Owncloud does not (yet) (#75)
|
||||||
// TODO: remove this when Owncloud starts encoding oc_appconfig as JSON just like it already encodes most other properties
|
// TODO: remove this when Owncloud starts encoding oc_appconfig as JSON just like it already encodes most other properties
|
||||||
$user = Server::get(IUserSession::class)->getUser();
|
if (is_array($settings['array'])
|
||||||
if ($user
|
|
||||||
&& is_array($settings['array'])
|
|
||||||
&& array_key_exists('oc_appconfig', $settings['array'])
|
&& array_key_exists('oc_appconfig', $settings['array'])
|
||||||
) {
|
) {
|
||||||
$isJson = self::isJson($settings['array']['oc_appconfig']);
|
$isJson = self::isJson($settings['array']['oc_appconfig']);
|
||||||
|
$user = Server::get(IUserSession::class)->getUser();
|
||||||
|
$userId = $user ? $user->getUID() : null;
|
||||||
|
|
||||||
/** @var array $array */
|
/** @var array $array */
|
||||||
$array = ($isJson) ? json_decode((string) $settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig'];
|
$array = ($isJson) ? json_decode((string) $settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig'];
|
||||||
$array['filesReader'] = [
|
$array['filesReader'] = [
|
||||||
'enableEpub' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'epub_enable', true),
|
'enableEpub' => Server::get(IConfig::class)->getUserValue($userId, Application::APP_ID, 'epub_enable', true),
|
||||||
'enablePdf' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'pdf_enable', true),
|
'enablePdf' => Server::get(IConfig::class)->getUserValue($userId, Application::APP_ID, 'pdf_enable', true),
|
||||||
'enableCbx' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'cbx_enable', true),
|
'enableCbx' => Server::get(IConfig::class)->getUserValue($userId, Application::APP_ID, 'cbx_enable', true),
|
||||||
];
|
];
|
||||||
$settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array;
|
$settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user