Auto enable gpoddersync
This commit is contained in:
parent
1f84c2c598
commit
318530da00
@ -19,7 +19,8 @@ RUN curl -sSLo /tmp/gpoddersync.tar.gz https://github.com/thrillfall/nextcloud-g
|
|||||||
rm /tmp/gpoddersync.tar.gz && \
|
rm /tmp/gpoddersync.tar.gz && \
|
||||||
cd apps/repod && make build && cd - && \
|
cd apps/repod && make build && cd - && \
|
||||||
php occ app:enable gpoddersync repod && \
|
php occ app:enable gpoddersync repod && \
|
||||||
php occ config:system:set debug --value=true && \
|
php occ config:system:set debug --value=true
|
||||||
php occ config:system:set memcache.local --value=none
|
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
RUN rm -f /usr/local/etc/php/conf.d/opcache-recommended.ini
|
||||||
|
@ -4,13 +4,36 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace OCA\RePod\AppInfo;
|
namespace OCA\RePod\AppInfo;
|
||||||
|
|
||||||
|
use OCP\App\IAppManager;
|
||||||
use OCP\AppFramework\App;
|
use OCP\AppFramework\App;
|
||||||
|
use OCP\AppFramework\Bootstrap\IBootContext;
|
||||||
|
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||||
|
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||||
|
use OCP\IUserSession;
|
||||||
|
|
||||||
class Application extends App
|
class Application extends App implements IBootstrap
|
||||||
{
|
{
|
||||||
public const APP_ID = 'repod';
|
public const APP_ID = 'repod';
|
||||||
|
private const GPODDERSYNC_ID = 'gpoddersync';
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
parent::__construct(self::APP_ID);
|
parent::__construct(self::APP_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function boot(IBootContext $context): void {
|
||||||
|
/** @psalm-suppress DeprecatedInterface */
|
||||||
|
$appContainer = $context->getAppContainer();
|
||||||
|
/** @var IAppManager $appManager */
|
||||||
|
$appManager = $appContainer->get(IAppManager::class);
|
||||||
|
/** @var IUserSession $userSession */
|
||||||
|
$userSession = $appContainer->get(IUserSession::class);
|
||||||
|
|
||||||
|
$gpoddersync = $appManager->isEnabledForUser(self::GPODDERSYNC_ID, $userSession->getUser());
|
||||||
|
if (!$gpoddersync) {
|
||||||
|
$appManager->enableApp(self::GPODDERSYNC_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function register(IRegistrationContext $context): void {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user