Skip to content

Commit 8fdc256

Browse files
committed
Adjust bundled mode
1 parent 4c7dcfc commit 8fdc256

File tree

24 files changed

+239
-117
lines changed

24 files changed

+239
-117
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
server-password: CENTRAL_PASSWORD
6161
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
6262
gpg-passphrase: MAVEN_GPG_PASSPHRASE
63-
- run: $MVN deploy -P op,os,prod,release
63+
- run: $MVN deploy -P prod,op,feature-pack,standalone,os,release
6464
env:
6565
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
6666
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add Galleon feature pack
13+
1014
## [0.1.2] - 2026-02-23
1115

1216
### Fixed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This will open a browser at http://localhost:1234.
5252
## Standalone
5353

5454
halOP can run on its own. In this mode halOP starts a local web server and serves the console on its own without being part of a
55-
WildFly installation. halOP is just a single-page application (SPA) without any server side dependencies. The only requirement
55+
WildFly installation. halOP is "just" a single-page application (SPA) without any server side dependencies. The only requirement
5656
is a management interface of a running WIldFly instance.
5757

5858
### Java
@@ -63,7 +63,7 @@ To build halOP as a standalone Java application, run
6363
mvn install -P prod,op,standalone
6464
```
6565

66-
This will package the transpiled HTML, CSS and JavaScript resources into a Quarkus-based HTTP server. To start it, run
66+
This will package the transpiled HTML, CSS, and JavaScript resources into a Quarkus-based HTTP server. To start it, run
6767

6868
```shell
6969
java -jar op/standalone/target/quarkus-app/quarkus-run.jar
@@ -82,8 +82,8 @@ mvn install -P prod,op,standalone,native -Dquarkus.native.container-build=false
8282
Please make sure that you have a recent version of GraalVM installed.
8383
See https://quarkus.io/guides/building-native-image#configuring-graalvm for details.
8484

85-
Native binaries for Linux, macOS and Windows are also attached to every [release](https://github.com/hal/foundation/releases).
86-
Download the binary for your platform, make it executable and run it. Then open a browser at http://localhost:9090.
85+
Native binaries for Linux, macOS, and Windows are also attached to every [release](https://github.com/hal/foundation/releases).
86+
Download the binary for your platform, make it executable, and run it. Then open a browser at http://localhost:9090.
8787

8888
To make the binary executable, you might need to run something like this:
8989

@@ -113,6 +113,7 @@ halOP is also available as a feature pack that can be provisioned with [Galleon]
113113
3. `cd $TMPDIR/wildfly`
114114
4. Add a WildFly admin user with `bin/add-user.sh -u admin -p admin --silent`
115115
5. Start the server with `bin/standalone.sh --stability=experimental`
116+
6. Open http://localhost:9990/halop in your browser
116117

117118
# halOS (HAL on OpenShift)
118119

environment/src/main/java/org/jboss/hal/env/Endpoints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void init(String url) {
3939
dmr = url + MANAGEMENT;
4040
logout = url + LOGOUT;
4141
upload = url + UPLOAD;
42-
sameOrigin = url.isEmpty();
42+
sameOrigin = location.origin.equals(url);
4343
}
4444

4545
/** @return the endpoint used to execute management operations. */

op/console/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"start:server": "node server.js 1234 1235",
1414
"open:browser": "wait-on http://localhost:1234 && open http://localhost:1234",
1515
"watch": "concurrently \"npm run start:parcel\" \"npm run start:server\" \"npm run open:browser\"",
16-
"prod:standalone": "parcel build src/web/index.html --dist-dir target/console",
17-
"prod:feature-pack": "parcel build src/web/index.html --dist-dir target/console --public-url /halop"
16+
"prod:feature-pack": "parcel build src/web/index.html --dist-dir target/feature-pack-resources --public-url /halop",
17+
"prod:standalone": "parcel build src/web/index.html --dist-dir target/standalone-resources"
1818
},
1919
"dependencies": {
2020
"@patternfly-java/charts": "^0.0.13",

op/console/pom.xml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -138,28 +138,6 @@
138138
</execution>
139139
</executions>
140140
</plugin>
141-
<plugin>
142-
<groupId>org.apache.maven.plugins</groupId>
143-
<artifactId>maven-antrun-plugin</artifactId>
144-
<version>3.1.0</version>
145-
<executions>
146-
<execution>
147-
<!-- This is the phase j2cl:build uses -->
148-
<phase>prepare-package</phase>
149-
<goals>
150-
<goal>run</goal>
151-
</goals>
152-
<configuration>
153-
<target>
154-
<echo level="info" message="Environment"/>
155-
<echo level="info" message="environment.base: ${environment.base}"/>
156-
<echo level="info" message="environment.build: ${environment.build}"/>
157-
<echo level="info" message="environment.stability: ${environment.stability}"/>
158-
</target>
159-
</configuration>
160-
</execution>
161-
</executions>
162-
</plugin>
163141
<plugin>
164142
<groupId>org.kie.j2cl.tools</groupId>
165143
<artifactId>j2cl-maven-plugin</artifactId>
@@ -208,13 +186,23 @@
208186
<artifactId>frontend-maven-plugin</artifactId>
209187
<executions>
210188
<execution>
211-
<id>pnpm-run-prod</id>
189+
<id>pnpm-run-prod-feature-pack</id>
190+
<phase>prepare-package</phase>
191+
<goals>
192+
<goal>corepack</goal>
193+
</goals>
194+
<configuration>
195+
<arguments>pnpm run prod:feature-pack</arguments>
196+
</configuration>
197+
</execution>
198+
<execution>
199+
<id>pnpm-run-prod-standalone</id>
212200
<phase>prepare-package</phase>
213201
<goals>
214202
<goal>corepack</goal>
215203
</goals>
216204
<configuration>
217-
<arguments>pnpm run ${npm.script}</arguments>
205+
<arguments>pnpm run prod:standalone</arguments>
218206
</configuration>
219207
</execution>
220208
</executions>
@@ -224,14 +212,26 @@
224212
<artifactId>maven-assembly-plugin</artifactId>
225213
<executions>
226214
<execution>
227-
<id>resources</id>
215+
<id>assemble-feature-pack</id>
216+
<phase>package</phase>
217+
<goals>
218+
<goal>single</goal>
219+
</goals>
220+
<configuration>
221+
<descriptors>
222+
<descriptor>src/assembly/feature-pack.xml</descriptor>
223+
</descriptors>
224+
</configuration>
225+
</execution>
226+
<execution>
227+
<id>assemble-standalone</id>
228228
<phase>package</phase>
229229
<goals>
230230
<goal>single</goal>
231231
</goals>
232232
<configuration>
233233
<descriptors>
234-
<descriptor>src/assembly/resources.xml</descriptor>
234+
<descriptor>src/assembly/standalone.xml</descriptor>
235235
</descriptors>
236236
</configuration>
237237
</execution>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
3+
Copyright 2024 Red Hat
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
-->
18+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd">
21+
<id>feature-pack-resources</id>
22+
<formats>
23+
<format>jar</format>
24+
</formats>
25+
<includeBaseDirectory>false</includeBaseDirectory>
26+
<fileSets>
27+
<fileSet>
28+
<directory>${project.build.directory}/feature-pack-resources</directory>
29+
<outputDirectory>console</outputDirectory>
30+
</fileSet>
31+
</fileSets>
32+
<files>
33+
<file>
34+
<source>${project.build.directory}/console/console.js</source>
35+
<outputDirectory>console</outputDirectory>
36+
</file>
37+
</files>
38+
</assembly>
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@
1818
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
1919
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2020
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd">
21-
<id>resources</id>
21+
<id>standalone-resources</id>
2222
<formats>
2323
<format>jar</format>
2424
</formats>
2525
<includeBaseDirectory>false</includeBaseDirectory>
2626
<fileSets>
2727
<fileSet>
28-
<directory>${project.build.directory}/console</directory>
28+
<directory>${project.build.directory}/standalone-resources</directory>
2929
<outputDirectory>console</outputDirectory>
3030
</fileSet>
3131
</fileSets>
32-
</assembly>
32+
<files>
33+
<file>
34+
<source>${project.build.directory}/console/console.js</source>
35+
<outputDirectory>console</outputDirectory>
36+
</file>
37+
</files>
38+
</assembly>

op/console/src/main/java/org/jboss/hal/op/Main.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import jakarta.inject.Inject;
2020

2121
import org.jboss.elemento.router.PlaceManager;
22-
import org.jboss.hal.core.Notifications;
23-
import org.jboss.hal.env.Environment;
2422
import org.jboss.hal.op.bootstrap.Bootstrap;
2523
import org.jboss.hal.op.bootstrap.BootstrapError;
2624
import org.jboss.hal.op.endpoint.EndpointStorage;
@@ -39,10 +37,8 @@ public class Main {
3937

4038
@Inject Bootstrap bootstrap;
4139
@Inject EndpointStorage endpointStorage;
42-
@Inject Environment environment;
43-
@Inject PlaceManager placeManager;
44-
@Inject Notifications notifications;
4540
@Inject Navigation navigation;
41+
@Inject PlaceManager placeManager;
4642

4743
@GWT3EntryPoint
4844
public void onModuleLoad() {
@@ -53,7 +49,7 @@ public void onModuleLoad() {
5349
void init() {
5450
bootstrap.run().subscribe(context -> {
5551
if (context.isSuccessful()) {
56-
insertFirst(document.body, skeleton(environment, endpointStorage, notifications, navigation));
52+
insertFirst(document.body, skeleton(endpointStorage, navigation));
5753
placeManager.start();
5854
} else {
5955
BootstrapError error = context.pop(BootstrapError.UNKNOWN);

op/console/src/main/java/org/jboss/hal/op/bootstrap/SelectEndpoint.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,24 @@ public Promise<FlowContext> apply(FlowContext context) {
7979
return fail(context, NO_ENDPOINT_SPECIFIED, CONNECT_PARAMETER);
8080
}
8181
} else {
82-
return endpointModal(endpointStorage, false).open()
82+
return endpointModal(endpointStorage, false)
83+
.open()
8384
.then(endpoint -> connect(context, endpoint));
8485
}
8586
} else {
86-
return endpointModal(endpointStorage, false).open()
87-
.then(endpoint -> connect(context, endpoint));
87+
return Endpoint.ping(location.origin)
88+
.then(valid -> {
89+
if (valid) {
90+
return connect(context, Endpoint.origin());
91+
} else {
92+
return endpointModal(endpointStorage, false)
93+
.open()
94+
.then(endpoint -> connect(context, endpoint));
95+
}
96+
})
97+
.catch_(__ -> endpointModal(endpointStorage, false)
98+
.open()
99+
.then(endpoint -> connect(context, endpoint)));
88100
}
89101
}
90102

0 commit comments

Comments
 (0)