From 8faca976d6ca94274d4ded9fb4ac20c453017e6b Mon Sep 17 00:00:00 2001 From: Arne Diekmann Date: Tue, 18 Jun 2024 14:36:50 +0200 Subject: [PATCH] refactor: remove magnolia module --- .github/workflows/publish-mvn-package.yaml | 21 -- README.md | 67 +------ paperboy-magnolia-module/.gitignore | 8 - paperboy-magnolia-module/pom.xml | 183 ------------------ .../de/neoskop/magnolia/PaperboyModule.java | 55 ------ .../magnolia/WebhookAuthorization.java | 7 - .../de/neoskop/magnolia/WebhookConfig.java | 107 ---------- .../magnolia/action/PreviewPageAction.java | 55 ------ .../PreviewPageActionDefinition.java | 10 - .../magnolia/command/SendChangeCommand.java | 18 -- .../extension/NativePagePreviewLink.java | 94 --------- .../magnolia/listener/ChangeListener.java | 34 ---- .../listener/DetailedChangeListener.java | 55 ------ .../listener/FuzzyChangeListener.java | 43 ---- .../de/neoskop/magnolia/model/Change.java | 23 --- .../magnolia/model/DetailedChange.java | 44 ----- .../de/neoskop/magnolia/model/Message.java | 25 --- .../service/ChangeAnnouncementService.java | 73 ------- .../magnolia/servlet/SitemapServlet.java | 53 ----- .../setup/PaperboyModuleVersionHandler.java | 81 -------- .../magnolia/task/ChangePasswordTask.java | 34 ---- .../resources/META-INF/magnolia/paperboy.xml | 39 ---- ...enerConfigurations.announceDamChanges.yaml | 10 - ...Configurations.announceWebsiteChanges.yaml | 10 - .../config.modules.paperboy.commands.yaml | 9 - .../paperboy/userroles.paperboy.yaml | 178 ----------------- .../paperboy/users.admin.paperboy.yaml | 83 -------- .../src/main/resources/rebel-remote.xml | 4 - release.sh | 3 - 29 files changed, 3 insertions(+), 1423 deletions(-) delete mode 100644 .github/workflows/publish-mvn-package.yaml delete mode 100644 paperboy-magnolia-module/.gitignore delete mode 100644 paperboy-magnolia-module/pom.xml delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/PaperboyModule.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookAuthorization.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookConfig.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/PreviewPageAction.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/definition/PreviewPageActionDefinition.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/command/SendChangeCommand.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/extension/NativePagePreviewLink.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/ChangeListener.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/DetailedChangeListener.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/FuzzyChangeListener.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Change.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/DetailedChange.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Message.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/service/ChangeAnnouncementService.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/servlet/SitemapServlet.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/setup/PaperboyModuleVersionHandler.java delete mode 100644 paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/task/ChangePasswordTask.java delete mode 100644 paperboy-magnolia-module/src/main/resources/META-INF/magnolia/paperboy.xml delete mode 100644 paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceDamChanges.yaml delete mode 100644 paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceWebsiteChanges.yaml delete mode 100644 paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.paperboy.commands.yaml delete mode 100644 paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/userroles.paperboy.yaml delete mode 100644 paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/users.admin.paperboy.yaml delete mode 100644 paperboy-magnolia-module/src/main/resources/rebel-remote.xml diff --git a/.github/workflows/publish-mvn-package.yaml b/.github/workflows/publish-mvn-package.yaml deleted file mode 100644 index 1ecb11f..0000000 --- a/.github/workflows/publish-mvn-package.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish package to GitHub Packages -on: - release: - types: [created] -jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: "11" - distribution: "adopt" - - name: Publish package - run: mvn --batch-mode deploy - working-directory: ./paperboy-magnolia-module - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 8bf5386..d4ea0fd 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,8 @@ In case we don't want to operate the delivery tier ourselves and instead use a C For the content management tier we provide two submodules which together with a queue handle the propagation of content change events: 1. [Paperboy push service](./paperboy-push-service): A small HTTP service that can be used as a webhook. -2. [Paperboy Magnolia module](./paperboy-magolia-module): A module that integrates directly into Magnolia and sends HTTP messages to the push service (or an arbitrary webhook) whenever a change in a watched workspace occurs. -The subscriber part of this system is currently comprised of three submodules in this repository: +The subscriber part of this system is currently comprised of two submodules in this repository: 1. [Paperboy Core](./paperboy-core): The core library which handles all generic configuration and knows how to execute the commands to trigger rebuilds. 2. [Paperboy CLI](./paperboy-cli): A simple CLI to ease usage and setup @@ -51,11 +50,7 @@ $ curl -X POST \ -d 'payload=%7B%22foo%22%3A%22bar%22%7D&source=foo' ``` -## Installation - -To get started with your project, execute the stepts in [Frontend Set-Up](#frontend-set-up) and [Magnolia Set-Up](#magnolia-set-up). Afterwards either execute the steps from [Custom delivery layer](#custom-delivery-layer) or [Netlify](#netlify) depending on your setup. - -### Frontend Set-Up +### Set-Up To use Paperboy in your Frontend you can simply install the CLI globally via: @@ -69,44 +64,12 @@ In case that you are writing the frontend with JavaScript you can also install t $ npm i --save-dev @neoskop/paperboy-cli ``` -### Magnolia Set-Up - -Generate a blank Magnolia project using Magnolia's archetype catalog: - -```bash -$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/ \ --Dfilter=info.magnolia.maven.archetypes:magnolia-project-archetype -``` - -Afterwards add the Paperboy Magnolia Module to the webapp's POM.xml: - -```xml - - de.neoskop.magnolia - paperboy - 2.0.0 - -``` - -Build the WAR and deploy it in a servlet container. - -### Custom delivery layer - -In case of a custom deliver layer, start the push service and a NATS server by running the following command in the root folder of this repository: +Start the push service and a NATS server by running the following command in the root folder of this repository: ```bash $ docker-compose up ``` -When the containers are up and running, import the following config into Magnolia's configuration under `/modules/paperboy/config`: - -```yaml -webhookConfig: - authorization: BEARER_TOKEN - bearerToken: supersecret - url: http://push-service:8080/ -``` - To configure the frontend, create a file called `paperboy.config.json` with the following contents: ```json @@ -124,30 +87,6 @@ Finally change to the frontend directory and run: $ paperboy start ``` -### Netlify - -To trigger a rebuild of the frontend whenever a change in Magnolia's content occurs, create a webhook in Netlify under `Settings > Build & Deploy` in your project. - -Click "Add build hook": - -![Webhook Creation pt. 1](images/netlify-webhook-01.png) - -Give the hook a meaningful name and press "Save": - -![Webhook Creation pt. 2](images/netlify-webhook-02.png) - -Copy the webhook's URL: - -![Webhook Creation pt. 2](images/netlify-webhook-03.png) - -Finally import the following config into Magnolia's configuration under `/modules/paperboy/config`: - -```yaml -webhookConfig: - authorization: NONE - url: https://api.netlify.com/build_hooks/ -``` - ## License This project is under the terms of the Apache License, Version 2.0. A [copy of this license](LICENSE) is included with the sources. diff --git a/paperboy-magnolia-module/.gitignore b/paperboy-magnolia-module/.gitignore deleted file mode 100644 index 64e5423..0000000 --- a/paperboy-magnolia-module/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.idea -target -*.iml -rebel.xml -.classpath -.project -.factorypath -org.eclipse.* \ No newline at end of file diff --git a/paperboy-magnolia-module/pom.xml b/paperboy-magnolia-module/pom.xml deleted file mode 100644 index ee9924b..0000000 --- a/paperboy-magnolia-module/pom.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - 4.0.0 - de.neoskop.magnolia - paperboy - 2.9.1 - jar - Paperboy Magnolia Module - - - 6.2.45 - 3.1.0 - 2.13 - 3.13.0 - 3.2.0 - 1.8 - UTF-8 - UTF-8 - 4.13.2 - 2.5 - 2.11.0 - 2.2.1 - 5.6.2 - 1.2.8 - 4.12.0 - - - - scm:git:git@bitbucket.org:neoskop/neoskop-magnolia-paperboy.git - scm:git:git@bitbucket.org:neoskop/neoskop-magnolia-paperboy.git - scm:git:git@bitbucket.org:neoskop/neoskop-magnolia-paperboy.git - - HEAD - - - - - github - GitHub Packages - https://maven.pkg.github.com/neoskop/paperboy - - - - - - info.magnolia - magnolia-core - ${magnoliaVersion} - - - javax.servlet - servlet-api - ${servlet-api.version} - provided - - - com.google.code.gson - gson - ${gson.version} - - - info.magnolia - magnolia-module-observation - ${magnolia-module-observation.version} - - - info.magnolia.pages - magnolia-pages-app - 6.2.35 - - - info.magnolia.pages - magnolia-pages-app-compatibility - 6.2.35 - - - info.magnolia - magnolia-module-mail - ${magnolia-module-mail.version} - - - info.magnolia.passwordmanager - magnolia-module-password-manager - ${magnolia-module-password-manager.version} - - - com.squareup.okhttp3 - okhttp - ${okhttp.version} - - - - - - junit - junit - ${junit.version} - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${javaVersion} - ${javaVersion} - - - - - com.coveo - fmt-maven-plugin - ${fmt-maven-plugin.version} - - - - format - - - - - - - org.apache.maven.plugins - maven-release-plugin - ${maven-release-plugin.version} - - v@{project.version} - true - - - - - - - - src/main/resources - - **/* - - - - true - src/main/resources - - META-INF/magnolia/* - - - - - - - - magnolia.public.releases - https://nexus.magnolia-cms.com/content/repositories/magnolia.public.releases/ - - - - magnolia.public.maintenance.releases - https://nexus.magnolia-cms.com/content/repositories/magnolia.public.maintenance.releases/ - - - - thirdparty.customized - https://nexus.magnolia-cms.com/content/repositories/thirdparty.customized/ - - - - - false - - github - GitHub Packages - https://maven.pkg.github.com/neoskop/paperboy - - - - diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/PaperboyModule.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/PaperboyModule.java deleted file mode 100644 index 6a9a06b..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/PaperboyModule.java +++ /dev/null @@ -1,55 +0,0 @@ -package de.neoskop.magnolia; - -import org.apache.commons.lang.StringUtils; - -public class PaperboyModule { - public static final String GLOBAL_ENV_PREFIX = "PAPERBOY_"; - private String previewUrl; - private boolean debugMode = false; - private boolean enabled = true; - private WebhookConfig webhookConfig = new WebhookConfig(); - - public String getPreviewUrl() { - final String envPreviewUrl = System.getenv("PREVIEW_URL"); - - if (StringUtils.isBlank(envPreviewUrl)) { - return normalize(previewUrl); - } - - return normalize(envPreviewUrl); - } - - private String normalize(String url) { - return StringUtils.isBlank(url) ? url : url.replaceAll("/$", ""); - } - - public void setPreviewUrl(String previewUrl) { - this.previewUrl = previewUrl; - } - - public boolean isDebugMode() { - return debugMode; - } - - public void setDebugMode(boolean debugMode) { - this.debugMode = debugMode; - } - - public WebhookConfig getWebhookConfig() { - return webhookConfig; - } - - public void setWebhookConfig(WebhookConfig webhookConfig) { - this.webhookConfig = webhookConfig; - } - - public boolean isEnabled() { - final String envValue = System.getenv(GLOBAL_ENV_PREFIX + "ENABLED"); - - return StringUtils.isBlank(envValue) ? enabled : "true".equals(envValue); - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookAuthorization.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookAuthorization.java deleted file mode 100644 index 3ebb65f..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookAuthorization.java +++ /dev/null @@ -1,7 +0,0 @@ -package de.neoskop.magnolia; - -public enum WebhookAuthorization { - BEARER_TOKEN, - BASIC_AUTH, - NONE -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookConfig.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookConfig.java deleted file mode 100644 index e45e215..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/WebhookConfig.java +++ /dev/null @@ -1,107 +0,0 @@ -package de.neoskop.magnolia; - -import okhttp3.Credentials; -import okhttp3.Request; -import org.apache.commons.lang.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -public class WebhookConfig { - public static final String ENV_PREFIX = PaperboyModule.GLOBAL_ENV_PREFIX + "WEBHOOK_"; - private String url; - private WebhookAuthorization authorization = WebhookAuthorization.NONE; - private String bearerToken; - private String username; - private String password; - private static final Logger LOG = LogManager.getLogger(WebhookConfig.class); - - public WebhookConfig() {} - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public WebhookAuthorization getAuthorization() { - return authorization; - } - - public void setAuthorization(WebhookAuthorization authorization) { - this.authorization = authorization; - } - - public String getBearerToken() { - return bearerToken; - } - - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public Request.Builder prepareRequest() { - final Request.Builder builder = new Request.Builder().url(getValueFromEnv(url, "URL")); - - switch (getAuthorizationFromEnv()) { - case BASIC_AUTH: - addBasicAuth(builder); - break; - case BEARER_TOKEN: - addBearerToken(builder); - break; - } - - return builder; - } - - private void addBearerToken(Request.Builder builder) { - final String bearerToken = getValueFromEnv(this.bearerToken, "BEARER_TOKEN"); - - if (StringUtils.isNotBlank(bearerToken)) { - builder.addHeader("Authorization", "Bearer " + bearerToken); - } - } - - private void addBasicAuth(Request.Builder builder) { - final String username = getValueFromEnv(this.username, "USERNAME"); - final String password = getValueFromEnv(this.password, "PASSWORD"); - - if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) { - final String credentials = Credentials.basic(username, password); - builder.addHeader("Authorization", credentials); - } - } - - public String getValueFromEnv(String fallbackValue, String variableName) { - final String envValue = System.getenv(ENV_PREFIX + variableName); - return StringUtils.isBlank(envValue) ? fallbackValue : envValue; - } - - public WebhookAuthorization getAuthorizationFromEnv() { - final String envValue = System.getenv(ENV_PREFIX + "AUTHORIZATION"); - try { - return StringUtils.isBlank(envValue) ? authorization : WebhookAuthorization.valueOf(envValue); - } catch (IllegalArgumentException e) { - LOG.error("Value in " + ENV_PREFIX + "AUTHORIZATION (" + envValue + ") is invalid", e); - return authorization; - } - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/PreviewPageAction.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/PreviewPageAction.java deleted file mode 100644 index e21d1c4..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/PreviewPageAction.java +++ /dev/null @@ -1,55 +0,0 @@ -package de.neoskop.magnolia.action; - -import com.vaadin.ui.UI; -import de.neoskop.magnolia.PaperboyModule; -import de.neoskop.magnolia.action.definition.PreviewPageActionDefinition; -import info.magnolia.context.MgnlContext; -import info.magnolia.jcr.util.NodeTypes; -import info.magnolia.objectfactory.Components; -import info.magnolia.ui.api.action.AbstractAction; -import info.magnolia.ui.api.action.ActionExecutionException; -import info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter; -import javax.inject.Inject; -import javax.jcr.Node; -import javax.jcr.RepositoryException; -import org.apache.commons.lang.StringUtils; - -public class PreviewPageAction extends AbstractAction { - private JcrItemAdapter item; - - @Inject - protected PreviewPageAction(D definition, JcrItemAdapter item) { - super(definition); - this.item = item; - } - - @Override - public void execute() throws ActionExecutionException { - try { - UI.getCurrent().getPage().open(getLivePreviewUrl(), "_blank"); - } catch (RepositoryException e) { - throw new ActionExecutionException(e); - } - } - - private String getLivePreviewUrl() throws RepositoryException { - final StringBuilder sb = new StringBuilder(); - final String previewUrl = Components.getComponent(PaperboyModule.class).getPreviewUrl(); - final String fallbackUrl = MgnlContext.getContextPath(); - sb.append(StringUtils.isBlank(previewUrl) ? fallbackUrl : previewUrl); - - if (item.getJcrItem().isNode()) { - Node node = (Node) item.getJcrItem(); - - while (!node.getPrimaryNodeType().isNodeType(NodeTypes.Page.NAME) && node.getDepth() > 0) { - node = node.getParent(); - } - - sb.append(node.getPath()); - } else { - sb.append(item.getJcrItem().getPath()); - } - - return sb.toString(); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/definition/PreviewPageActionDefinition.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/definition/PreviewPageActionDefinition.java deleted file mode 100644 index f068423..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/action/definition/PreviewPageActionDefinition.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.neoskop.magnolia.action.definition; - -import de.neoskop.magnolia.action.PreviewPageAction; -import info.magnolia.ui.api.action.ConfiguredActionDefinition; - -public class PreviewPageActionDefinition extends ConfiguredActionDefinition { - public PreviewPageActionDefinition() { - setImplementationClass(PreviewPageAction.class); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/command/SendChangeCommand.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/command/SendChangeCommand.java deleted file mode 100644 index 498e74f..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/command/SendChangeCommand.java +++ /dev/null @@ -1,18 +0,0 @@ -package de.neoskop.magnolia.command; - -import de.neoskop.magnolia.model.Change; -import de.neoskop.magnolia.service.ChangeAnnouncementService; -import info.magnolia.commands.MgnlCommand; -import info.magnolia.context.Context; -import info.magnolia.objectfactory.Components; -import org.apache.commons.lang.StringUtils; - -public class SendChangeCommand extends MgnlCommand { - @Override - public boolean execute(Context context) { - final String workspace = (String) context.get("workspace"); - - final Change change = new Change(StringUtils.isBlank(workspace) ? "website" : workspace); - return Components.getComponent(ChangeAnnouncementService.class).announce(change); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/extension/NativePagePreviewLink.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/extension/NativePagePreviewLink.java deleted file mode 100644 index 0a543d9..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/extension/NativePagePreviewLink.java +++ /dev/null @@ -1,94 +0,0 @@ -package de.neoskop.magnolia.extension; - -import de.neoskop.magnolia.PaperboyModule; -import info.magnolia.event.EventBus; -import info.magnolia.link.LinkUtil; -import info.magnolia.pages.app.editor.extension.AbstractExtension; -import info.magnolia.pages.app.editor.pagebar.nativepagepreviewlink.NativePagePreviewLinkExtensionDefinition; -import info.magnolia.pages.app.editor.pagebar.nativepagepreviewlink.NativePagePreviewLinkView; -import info.magnolia.pages.app.editor.parameters.PageEditorStatus; -import info.magnolia.ui.api.app.SubAppEventBus; -import info.magnolia.ui.api.view.View; -import info.magnolia.ui.contentapp.detail.DetailLocation; -import info.magnolia.ui.vaadin.editor.events.PageEditorNavigationEvent; -import java.net.MalformedURLException; -import java.net.URL; -import javax.inject.Inject; -import javax.inject.Named; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -public class NativePagePreviewLink extends AbstractExtension { - private final NativePagePreviewLinkView view; - private final NativePagePreviewLinkExtensionDefinition definition; - private final EventBus subAppEventBus; - private final PaperboyModule module; - private String url = StringUtils.EMPTY; - private static final Logger LOG = LogManager.getLogger(NativePagePreviewLink.class); - - @Inject - public NativePagePreviewLink( - NativePagePreviewLinkExtensionDefinition definition, - NativePagePreviewLinkView view, - @Named(SubAppEventBus.NAME) EventBus subAppEventBus, - PaperboyModule module) { - this.view = view; - this.definition = definition; - this.subAppEventBus = subAppEventBus; - this.module = module; - } - - @Override - public View start(DetailLocation location) { - subAppEventBus.addHandler( - PageEditorNavigationEvent.class, - event -> { - try { - final String newUrl = module.getPreviewUrl() + new URL(event.getUrl()).getPath(); - - if (!this.url.equals(newUrl)) { - updateView(addVersionParameter(newUrl, location.getVersion())); - } - } catch (MalformedURLException e) { - LOG.error("Event URL could not be parsed", e); - } - }); - - return view; - } - - @Override - public void onLocationUpdate(DetailLocation location) { - // Do not do anything, we relied on event bus to update link - } - - @Override - public void deactivate() { - view.setVisible(false); - } - - /** Add version parameter for showing page with version just in case. */ - private String addVersionParameter(String uri, String version) { - if (StringUtils.isEmpty(uri) || StringUtils.isEmpty(version)) { - return uri; - } - - if (!uri.contains(PageEditorStatus.VERSION_PARAMETER)) { - StringBuffer sb = new StringBuffer(uri); - LinkUtil.addParameter(sb, PageEditorStatus.VERSION_PARAMETER, version); - uri = sb.toString(); - } - - return uri; - } - - private void updateView(String url) { - if (StringUtils.isNotEmpty(definition.getTarget())) { - view.setTarget(definition.getTarget()); - } - view.setLink(url); - view.setVisible(definition.isVisible()); - this.url = url; - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/ChangeListener.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/ChangeListener.java deleted file mode 100644 index 0e44f6f..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/ChangeListener.java +++ /dev/null @@ -1,34 +0,0 @@ -package de.neoskop.magnolia.listener; - -import info.magnolia.jcr.util.NodeTypes; -import info.magnolia.module.observation.BaseConfiguration; -import info.magnolia.module.observation.ObservationConfiguration; -import javax.jcr.RepositoryException; -import javax.jcr.observation.Event; - -/** - * @author Arne Diekmann - * @since 03.01.18 - */ -public abstract class ChangeListener implements BaseConfiguration { - private ObservationConfiguration obs; - - boolean shouldProcess(Event event) throws RepositoryException { - String path = event.getPath(); - return !(path.contains(NodeTypes.JCR_PREFIX) || path.contains(NodeTypes.MGNL_PREFIX)); - } - - @Override - public ObservationConfiguration getConfiguration() { - return obs; - } - - @Override - public void setConfiguration(ObservationConfiguration obs) { - this.obs = obs; - } - - String getRepository() { - return obs.getRepository(); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/DetailedChangeListener.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/DetailedChangeListener.java deleted file mode 100644 index df6ffb6..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/DetailedChangeListener.java +++ /dev/null @@ -1,55 +0,0 @@ -package de.neoskop.magnolia.listener; - -import static javax.jcr.observation.Event.PROPERTY_ADDED; -import static javax.jcr.observation.Event.PROPERTY_CHANGED; -import static javax.jcr.observation.Event.PROPERTY_REMOVED; - -import de.neoskop.magnolia.model.DetailedChange; -import de.neoskop.magnolia.service.ChangeAnnouncementService; -import info.magnolia.objectfactory.Components; -import java.util.HashSet; -import java.util.Set; -import javax.jcr.RepositoryException; -import javax.jcr.observation.Event; -import javax.jcr.observation.EventIterator; -import javax.jcr.observation.EventListener; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -/** - * @author Arne Diekmann - * @since 03.01.18 - */ -public class DetailedChangeListener extends ChangeListener implements EventListener { - private static final Logger LOG = LogManager.getLogger(DetailedChangeListener.class); - - @Override - public void onEvent(EventIterator events) { - Set changes = new HashSet<>(); - - try { - while (events.hasNext()) { - final Event event = events.nextEvent(); - String path = event.getPath(); - - if (shouldProcess(event)) { - switch (event.getType()) { - case PROPERTY_CHANGED: - case PROPERTY_ADDED: - case PROPERTY_REMOVED: - path = StringUtils.substringBeforeLast(path, "/"); - } - - final DetailedChange change = - new DetailedChange(getRepository(), event.getIdentifier(), path); - changes.add(change); - } - } - } catch (RepositoryException e) { - LOG.error("Could not process change events", e); - } - - changes.forEach(c -> Components.getComponent(ChangeAnnouncementService.class).announce(c)); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/FuzzyChangeListener.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/FuzzyChangeListener.java deleted file mode 100644 index 7916417..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/listener/FuzzyChangeListener.java +++ /dev/null @@ -1,43 +0,0 @@ -package de.neoskop.magnolia.listener; - -import de.neoskop.magnolia.model.Change; -import de.neoskop.magnolia.service.ChangeAnnouncementService; -import info.magnolia.objectfactory.Components; -import javax.jcr.RepositoryException; -import javax.jcr.observation.Event; -import javax.jcr.observation.EventIterator; -import javax.jcr.observation.EventListener; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -/** - * @author Arne Diekmann - * @since 03.01.18 - */ -public class FuzzyChangeListener extends ChangeListener implements EventListener { - private static final Logger LOG = LogManager.getLogger(FuzzyChangeListener.class); - - @Override - public void onEvent(EventIterator events) { - boolean relevantEventOccurred = false; - - try { - while (events.hasNext()) { - final Event event = events.nextEvent(); - - if (shouldProcess(event)) { - relevantEventOccurred = true; - break; - } - } - } catch (RepositoryException e) { - LOG.error("Could not process change events", e); - relevantEventOccurred = true; - } - - if (relevantEventOccurred) { - final Change change = new Change(getRepository()); - Components.getComponent(ChangeAnnouncementService.class).announce(change); - } - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Change.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Change.java deleted file mode 100644 index 654e2f3..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Change.java +++ /dev/null @@ -1,23 +0,0 @@ -package de.neoskop.magnolia.model; - -import com.google.gson.Gson; - -/** - * @author Arne Diekmann - * @since 18.12.17 - */ -public class Change { - private final String workspace; - - public Change(String workspace) { - this.workspace = workspace; - } - - public String getWorkspace() { - return workspace; - } - - public String toJson() { - return new Gson().toJson(this); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/DetailedChange.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/DetailedChange.java deleted file mode 100644 index b4c2858..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/DetailedChange.java +++ /dev/null @@ -1,44 +0,0 @@ -package de.neoskop.magnolia.model; - -import java.util.Objects; - -/** - * @author Arne Diekmann - * @since 03.01.18 - */ -public class DetailedChange extends Change { - private final String uuid; - private final String path; - - public DetailedChange(String workspace, String uuid, String path) { - super(workspace); - this.uuid = uuid; - this.path = path; - } - - public String getUuid() { - return uuid; - } - - public String getPath() { - return path; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DetailedChange that = (DetailedChange) o; - return Objects.equals(uuid, that.uuid); - } - - @Override - public int hashCode() { - - return Objects.hash(uuid); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Message.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Message.java deleted file mode 100644 index 83326a0..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/model/Message.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.neoskop.magnolia.model; - -import com.google.gson.Gson; - -public class Message { - private final String source; - private final Change change; - - public Message(String source, Change change) { - this.source = source; - this.change = change; - } - - public String source() { - return source; - } - - public Change getChange() { - return change; - } - - public String toJson() { - return new Gson().toJson(this); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/service/ChangeAnnouncementService.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/service/ChangeAnnouncementService.java deleted file mode 100644 index 1625bc4..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/service/ChangeAnnouncementService.java +++ /dev/null @@ -1,73 +0,0 @@ -package de.neoskop.magnolia.service; - -import de.neoskop.magnolia.PaperboyModule; -import de.neoskop.magnolia.model.Change; -import de.neoskop.magnolia.model.Message; -import info.magnolia.cms.beans.config.ServerConfiguration; -import info.magnolia.objectfactory.Components; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import javax.inject.Inject; -import javax.inject.Singleton; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -/** - * @author Arne Diekmann - * @since 18.12.17 - */ -@Singleton -public class ChangeAnnouncementService { - private static final Logger LOG = LogManager.getLogger(ChangeAnnouncementService.class); - private static final String USER_AGENT = "Paperboy Magnolia Module"; - private static final MediaType CONTENT_TYPE = MediaType.parse("application/json"); - private final PaperboyModule module; - private final OkHttpClient client = new OkHttpClient.Builder().build(); - private String source; - - @Inject - public ChangeAnnouncementService(PaperboyModule module) { - this.module = module; - this.source = - "magnolia-" - + (Components.getComponent(ServerConfiguration.class).isAdmin() ? "admin" : "public"); - - try { - this.source = InetAddress.getLocalHost().getHostName(); - } catch (UnknownHostException e) { - LOG.error("Determining local hostname for source failed", e); - } - } - - public boolean announce(final Change change) { - if (!module.isEnabled()) { - LOG.debug("Dropping change since Paperboy is disabled"); - return true; - } - - final Request.Builder requestBuilder = module.getWebhookConfig().prepareRequest(); - final Message message = new Message(this.source, change); - final Request request = - requestBuilder - .post(RequestBody.create(CONTENT_TYPE, message.toJson())) - .header("User-Agent", USER_AGENT) - .build(); - - try (final Response response = client.newCall(request).execute()) { - if (!response.isSuccessful()) { - LOG.warn("Web hook responded to the announcement with status code " + response.code()); - return false; - } - } catch (IOException e) { - LOG.error("Announcing change to web hook failed", e); - } - - return true; - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/servlet/SitemapServlet.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/servlet/SitemapServlet.java deleted file mode 100644 index 6764fde..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/servlet/SitemapServlet.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.neoskop.magnolia.servlet; - -import static info.magnolia.repository.RepositoryConstants.WEBSITE; - -import com.google.gson.Gson; -import info.magnolia.context.MgnlContext; -import info.magnolia.jcr.predicate.NodeTypePredicate; -import info.magnolia.jcr.util.NodeTypes.Page; -import info.magnolia.jcr.util.NodeUtil; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import javax.jcr.InvalidItemStateException; -import javax.jcr.Node; -import javax.jcr.RepositoryException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -/** - * @author Arne Diekmann - * @since 15.12.17 - */ -public class SitemapServlet extends HttpServlet { - private static final Logger LOG = LogManager.getLogger(SitemapServlet.class); - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws IOException { - try { - final Node rootNode = MgnlContext.getInstance().getJCRSession(WEBSITE).getRootNode(); - final List paths = new ArrayList<>(); - final Iterable nodeIt = - NodeUtil.collectAllChildren(rootNode, new NodeTypePredicate(Page.NAME)); - - for (Node node : nodeIt) { - try { - paths.add(node.getPath()); - } catch (InvalidItemStateException ignored) { - } - } - - response.setContentType("application/json"); - response.setCharacterEncoding("UTF-8"); - response.getWriter().write(new Gson().toJson(paths)); - } catch (RepositoryException e) { - LOG.error("Could not retrieve pages", e); - response.sendError(500); - } - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/setup/PaperboyModuleVersionHandler.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/setup/PaperboyModuleVersionHandler.java deleted file mode 100644 index 583c44c..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/setup/PaperboyModuleVersionHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -package de.neoskop.magnolia.setup; - -import static info.magnolia.repository.RepositoryConstants.CONFIG; - -import de.neoskop.magnolia.PaperboyModule; -import de.neoskop.magnolia.task.ChangePasswordTask; -import info.magnolia.module.DefaultModuleVersionHandler; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.DeltaBuilder; -import info.magnolia.module.delta.ModuleBootstrapTask; -import info.magnolia.module.delta.SamplesBootstrapTask; -import info.magnolia.module.delta.SetPropertyTask; -import info.magnolia.module.delta.Task; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.commons.lang3.StringUtils; - -/** - * This class is optional and lets you manage the versions of your module, by registering "deltas" - * to maintain the module's configuration, or other type of content. If you don't need this, simply - * remove the reference to this class in the module descriptor xml. - * - * @see info.magnolia.module.DefaultModuleVersionHandler - * @see info.magnolia.module.ModuleVersionHandler - * @see info.magnolia.module.delta.Task - */ -public class PaperboyModuleVersionHandler extends DefaultModuleVersionHandler { - public PaperboyModuleVersionHandler() { - register( - DeltaBuilder.update("0.5.2", "") - .addTask(new ModuleBootstrapTask()) - .addTask(new SamplesBootstrapTask()) - .addTasks(getSetupPreviewTasks())); - } - - private static List getSetupPreviewTasks() { - return Arrays.asList( - new SetPropertyTask( - CONFIG, - "/modules/pages/apps/pages/subApps/browser/actions/preview", - "class", - "de.neoskop.magnolia.action.definition.PreviewPageActionDefinition"), - new SetPropertyTask( - CONFIG, - "/modules/pages/apps/pages/subApps/detail/actions/preview", - "class", - "de.neoskop.magnolia.action.definition.PreviewPageActionDefinition"), - new SetPropertyTask( - CONFIG, - "/modules/pages/apps/pages/subApps/detail/pageBar/extensions/nativePagePreviewLink", - "extensionClass", - "de.neoskop.magnolia.extension.NativePagePreviewLink")); - } - - private static List getWriteConfigViaEnvironmentTasks() { - List tasks = new ArrayList<>(); - - String userPassword = System.getenv(PaperboyModule.GLOBAL_ENV_PREFIX + "USER_PASSWORD"); - - if (StringUtils.isNotBlank(userPassword)) { - tasks.add(new ChangePasswordTask("/admin/paperboy", userPassword)); - } - - return tasks; - } - - @Override - protected List getExtraInstallTasks(InstallContext installContext) { - return getSetupPreviewTasks(); - } - - @Override - protected List getStartupTasks(InstallContext installContext) { - return Stream.concat( - getSetupPreviewTasks().stream(), getWriteConfigViaEnvironmentTasks().stream()) - .collect(Collectors.toList()); - } -} diff --git a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/task/ChangePasswordTask.java b/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/task/ChangePasswordTask.java deleted file mode 100644 index 40a836e..0000000 --- a/paperboy-magnolia-module/src/main/java/de/neoskop/magnolia/task/ChangePasswordTask.java +++ /dev/null @@ -1,34 +0,0 @@ -package de.neoskop.magnolia.task; - -import info.magnolia.cms.security.SecurityUtil; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.AbstractTask; -import info.magnolia.module.delta.TaskExecutionException; -import info.magnolia.repository.RepositoryConstants; -import javax.jcr.Node; -import javax.jcr.Property; -import javax.jcr.RepositoryException; -import javax.jcr.Session; - -public class ChangePasswordTask extends AbstractTask { - private String password, username; - - public ChangePasswordTask(String userPath, String password) { - super("Change password", "Change password a user's password, regardless of the current value."); - this.username = userPath; - this.password = password; - } - - @Override - public void execute(InstallContext installContext) throws TaskExecutionException { - try { - Session session = installContext.getJCRSession(RepositoryConstants.USERS); - Node node = session.getNode(username); - Property prop = node.getProperty("pswd"); - prop.setValue(SecurityUtil.getBCrypt(password)); - session.save(); - } catch (RepositoryException e) { - throw new TaskExecutionException("Exception setting password", e); - } - } -} diff --git a/paperboy-magnolia-module/src/main/resources/META-INF/magnolia/paperboy.xml b/paperboy-magnolia-module/src/main/resources/META-INF/magnolia/paperboy.xml deleted file mode 100644 index 9795665..0000000 --- a/paperboy-magnolia-module/src/main/resources/META-INF/magnolia/paperboy.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - paperboy - ${project.name} - ${project.description} - de.neoskop.magnolia.PaperboyModule - de.neoskop.magnolia.setup.PaperboyModuleVersionHandler - ${project.version} - - - main - - - de.neoskop.magnolia.service.ChangeAnnouncementService - de.neoskop.magnolia.service.ChangeAnnouncementService - singleton - true - - - - - - core - 5.6/* - - - - - - SitemapServlet - de.neoskop.magnolia.servlet.SitemapServlet - - - /sitemap - - - - diff --git a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceDamChanges.yaml b/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceDamChanges.yaml deleted file mode 100644 index 104e6a7..0000000 --- a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceDamChanges.yaml +++ /dev/null @@ -1,10 +0,0 @@ -'announceDamChanges': - 'active': 'true' - 'delay': '30' - 'description': 'Announces to Queue that assets were changed' - 'includeSubNodes': 'true' - 'maxDelay': '250' - 'path': '/' - 'repository': 'dam' - 'listener': - 'class': 'de.neoskop.magnolia.listener.DetailedChangeListener' diff --git a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceWebsiteChanges.yaml b/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceWebsiteChanges.yaml deleted file mode 100644 index d040489..0000000 --- a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.observation.config.listenerConfigurations.announceWebsiteChanges.yaml +++ /dev/null @@ -1,10 +0,0 @@ -'announceWebsiteChanges': - 'active': 'true' - 'delay': '30' - 'description': 'Announces to Queue that pages were changed' - 'includeSubNodes': 'true' - 'maxDelay': '250' - 'path': '/' - 'repository': 'website' - 'listener': - 'class': 'de.neoskop.magnolia.listener.FuzzyChangeListener' \ No newline at end of file diff --git a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.paperboy.commands.yaml b/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.paperboy.commands.yaml deleted file mode 100644 index 444e86b..0000000 --- a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/config.modules.paperboy.commands.yaml +++ /dev/null @@ -1,9 +0,0 @@ -'commands': - jcr:primaryType: 'mgnl:content' - 'paperboy': - jcr:primaryType: 'mgnl:content' - 'sendChange': - 'class': 'de.neoskop.magnolia.command.SendChangeCommand' - 'commandName': 'sendChange' - - diff --git a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/userroles.paperboy.yaml b/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/userroles.paperboy.yaml deleted file mode 100644 index 0ef7322..0000000 --- a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/userroles.paperboy.yaml +++ /dev/null @@ -1,178 +0,0 @@ -'paperboy': - jcr:primaryType: 'mgnl:role' - jcr:uuid: 'd78f7a43-7a39-47fc-ae0b-2bc709f033a2' - mgnl:activationStatus: true - mgnl:created: 2018-01-04T12:12:20.235+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.173+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:50.214+02:00 - mgnl:lastModifiedBy: 'superuser' - 'acl_userroles': - jcr:uuid: 'f3688227-3eaf-4403-9fab-db8fa35c0513' - mgnl:activationStatus: true - mgnl:created: 2018-01-04T12:12:20.237+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.174+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.747+02:00 - mgnl:lastModifiedBy: 'superuser' - '0': - 'path': '/paperboy' - 'permissions': 8 - jcr:uuid: '382f28b7-56c9-4c7a-ae07-bd61c72c90dc' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.747+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.174+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.747+02:00 - mgnl:lastModifiedBy: 'superuser' - 'acl_website': - jcr:uuid: 'e2ef5e11-7bef-4909-a90d-5a6d8fa61f8b' - mgnl:activationStatus: true - mgnl:created: 2018-01-04T12:12:20.284+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.178+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.873+02:00 - mgnl:lastModifiedBy: 'superuser' - '0': - 'path': '/' - 'permissions': 8 - jcr:uuid: '873aec34-2d21-4ae0-be42-ede8eb5c2ee0' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.873+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.179+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.873+02:00 - mgnl:lastModifiedBy: 'superuser' - '00': - 'path': '/*' - 'permissions': 8 - jcr:uuid: '1595348c-9481-4a86-abaf-4962148819f6' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.873+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.184+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.873+02:00 - mgnl:lastModifiedBy: 'superuser' - 'acl_dam': - jcr:uuid: 'dcad02aa-a269-46e5-8cfa-63e5f92e3902' - mgnl:activationStatus: true - mgnl:created: 2018-01-04T12:12:20.286+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.188+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.916+02:00 - mgnl:lastModifiedBy: 'superuser' - '0': - 'path': '/' - 'permissions': 8 - jcr:uuid: '5c0cb0b9-cbd2-4408-8e0b-784b94ec002a' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.916+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.188+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.916+02:00 - mgnl:lastModifiedBy: 'superuser' - '00': - 'path': '/*' - 'permissions': 8 - jcr:uuid: '78b6b00f-2b51-4cb9-9d8c-12a0c722b93e' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.916+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.193+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.916+02:00 - mgnl:lastModifiedBy: 'superuser' - 'acl_uri': - jcr:uuid: 'c05e49c5-6b17-4f8a-bb73-74159a7ed60c' - mgnl:activationStatus: true - mgnl:created: 2018-01-04T12:12:20.382+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.197+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:50.214+02:00 - mgnl:lastModifiedBy: 'superuser' - '0': - 'path': '/.magnolia/*' - 'permissions': 0 - jcr:uuid: '09733204-795d-4de4-9c7f-10d754a593e4' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:50.209+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.197+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:50.209+02:00 - mgnl:lastModifiedBy: 'superuser' - '00': - 'path': '/.rest/delivery/*' - 'permissions': 8 - jcr:uuid: '841817ed-5ef6-46ee-9982-4e58c4999da5' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:50.210+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.201+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:50.210+02:00 - mgnl:lastModifiedBy: 'superuser' - '01': - 'path': '/sitemap' - 'permissions': 8 - jcr:uuid: '7b1737d5-8185-4acc-ba7e-388097a2b509' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:50.213+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.205+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:50.213+02:00 - mgnl:lastModifiedBy: 'superuser' - '02': - 'path': '/dam/*' - 'permissions': 8 - jcr:uuid: '7e7b2975-0ccd-45ac-9f9b-d5df8f54cf4d' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:50.214+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.208+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:50.214+02:00 - mgnl:lastModifiedBy: 'superuser' - 'acl_resources': - jcr:uuid: 'bac564e3-8ab6-42a3-af28-388000f3c914' - mgnl:activationStatus: true - mgnl:created: 2018-01-04T12:14:11.739+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.215+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.995+02:00 - mgnl:lastModifiedBy: 'superuser' - '0': - 'path': '/' - 'permissions': 8 - jcr:uuid: '356971c5-e5da-4bd6-902c-3532d6b496ad' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.994+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.215+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.994+02:00 - mgnl:lastModifiedBy: 'superuser' - '00': - 'path': '/*' - 'permissions': 8 - jcr:uuid: 'a425a89b-e337-494c-b42e-50832d8fdafc' - mgnl:activationStatus: true - mgnl:created: 2018-05-06T11:54:49.995+02:00 - mgnl:createdBy: 'superuser' - mgnl:lastActivated: 2018-05-06T11:54:55.219+02:00 - mgnl:lastActivatedBy: 'superuser' - mgnl:lastModified: 2018-05-06T11:54:49.995+02:00 - mgnl:lastModifiedBy: 'superuser' - - diff --git a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/users.admin.paperboy.yaml b/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/users.admin.paperboy.yaml deleted file mode 100644 index 043c39f..0000000 --- a/paperboy-magnolia-module/src/main/resources/mgnl-bootstrap/paperboy/users.admin.paperboy.yaml +++ /dev/null @@ -1,83 +0,0 @@ -'paperboy': - 'email': 'paperboy@neoskop.de' - 'enabled': true - 'jcrName': 'paperboy' - 'language': 'en' - 'lastaccess': 2018-01-04T12:21:19.808+01:00 - 'name': 'paperboy' - 'pswd': '$2a$12$ME1wLXfR2U7IZ82Y0dKByeh0/oYgPRuYLrOfKIExmFVR2m4GJ5gTO' - 'title': 'Paperboy Read User' - jcr:primaryType: 'mgnl:user' - jcr:uuid: '3798f598-d901-4f41-ad9a-385857320024' - mgnl:created: 2018-01-04T12:04:05.309+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:12:35.883+01:00 - mgnl:lastModifiedBy: 'superuser' - 'acl_users': - jcr:uuid: '3b1a07bf-4c5b-43db-a264-9fd49dd4b761' - mgnl:created: 2018-01-04T12:04:05.641+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.641+01:00 - mgnl:lastModifiedBy: 'superuser' - '0': - 'path': '/admin/paperboy' - 'permissions': 8 - jcr:uuid: 'f08f7c35-7399-4fa7-8f50-7b21439470b3' - mgnl:created: 2018-01-04T12:04:05.642+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.642+01:00 - mgnl:lastModifiedBy: 'superuser' - '00': - 'path': '/admin/paperboy/email' - 'permissions': 63 - jcr:uuid: '293fa574-2b85-4eea-8a29-5149948ffa02' - mgnl:created: 2018-01-04T12:04:05.644+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.644+01:00 - mgnl:lastModifiedBy: 'superuser' - '01': - 'path': '/admin/paperboy/language' - 'permissions': 63 - jcr:uuid: 'bbc78aea-c032-439a-9008-3d817eef01c2' - mgnl:created: 2018-01-04T12:04:05.645+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.645+01:00 - mgnl:lastModifiedBy: 'superuser' - '02': - 'path': '/admin/paperboy/lastaccess' - 'permissions': 63 - jcr:uuid: 'd70b51b3-cd5c-463a-822e-5b6692b2d726' - mgnl:created: 2018-01-04T12:04:05.646+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.646+01:00 - mgnl:lastModifiedBy: 'superuser' - '03': - 'path': '/admin/paperboy/pswd' - 'permissions': 63 - jcr:uuid: 'aa6475ec-c5fa-42f4-8194-76d86f0bfc92' - mgnl:created: 2018-01-04T12:04:05.648+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.648+01:00 - mgnl:lastModifiedBy: 'superuser' - '04': - 'path': '/admin/paperboy/title' - 'permissions': 63 - jcr:uuid: 'd9c62024-1203-4d52-9a12-4084cdaa4fd2' - mgnl:created: 2018-01-04T12:04:05.650+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.650+01:00 - mgnl:lastModifiedBy: 'superuser' - '05': - 'path': '/admin/paperboy/timezone' - 'permissions': 63 - jcr:uuid: '3a31bab3-f6a4-4284-9514-9622fd0465ff' - mgnl:created: 2018-01-04T12:04:05.651+01:00 - mgnl:createdBy: 'superuser' - mgnl:lastModified: 2018-01-04T12:04:05.651+01:00 - mgnl:lastModifiedBy: 'superuser' - 'roles': - '01': '3061da39-9837-45fc-a7ee-0fb695399949' - '02': 'd78f7a43-7a39-47fc-ae0b-2bc709f033a2' - jcr:uuid: 'e06a3882-cedf-4dd0-8554-6829b4b7e772' - - diff --git a/paperboy-magnolia-module/src/main/resources/rebel-remote.xml b/paperboy-magnolia-module/src/main/resources/rebel-remote.xml deleted file mode 100644 index a6796e0..0000000 --- a/paperboy-magnolia-module/src/main/resources/rebel-remote.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - paperboy - diff --git a/release.sh b/release.sh index bc5635e..0061394 100755 --- a/release.sh +++ b/release.sh @@ -33,9 +33,6 @@ npm version $1 version=$(cat package.json | jq -r .version) npm publish -cd ../paperboy-magnolia-module -mvn versions:set -DnewVersion=${version} -DgenerateBackupPoms=false - cd ../paperboy-cli cat package.json | jq ".version = \"$version\" | .dependencies.\"@neoskop/paperboy\" = \"$version\"" >package.json.new mv package.json.new package.json