bump version.

docker image includes app
This commit is contained in:
kirill.labutin 2026-08-14 18:01:21 +03:00
parent 4da94338bf
commit 653c67062c
11 changed files with 46 additions and 13 deletions

View File

@ -1,13 +1,12 @@
FROM alpine:latest
RUN apk add --no-cache openjdk25 git curl
RUN apk add --no-cache openjdk25 git
RUN mkdir -p /data /data/local
COPY launcher.sh /launcher.sh
COPY docker/config.json /data/config.json
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /launcher.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ru.kirillius</groupId>
<artifactId>pf-sdn</artifactId>
<version>1.0.2.5</version>
<version>1.1.0.0</version>
</parent>
<artifactId>pf-sdn.app</artifactId>

View File

@ -24,6 +24,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.regex.Pattern;
@ -114,8 +115,10 @@ public class App implements Context, Closeable {
serviceManager.getService(ComponentHandlerService.class).syncComponentsWithConfig();
serviceManager.getService(ResourceUpdateService.class).start();
if(!isExternalManagement()) {
removeObsoleteVersions();
}
}
private void removeObsoleteVersions() {
var appVersion = serviceManager.getService(AppUpdateService.class).getAppVersion();
@ -175,8 +178,15 @@ public class App implements Context, Closeable {
*/
public void requestExit(boolean restart) {
running.set(false);
if(!isExternalManagement()) {
shouldRestart.set(restart);
}
}
@Override
public boolean isExternalManagement() {
return Objects.equals(System.getProperty("app.external.management", Boolean.FALSE.toString()), Boolean.TRUE.toString());
}
/**
* Closes all managed services.

View File

@ -122,10 +122,19 @@ public class System implements RPC {
@ProtectedMethod
@JRPCMethod
public void doUpdate() {
if(context.isExternalManagement()){
return;
}
var updateService = context.getServiceManager().getService(AppUpdateService.class);
updateService.updateApp();
}
@ProtectedMethod
@JRPCMethod
public boolean isExternalManaged() {
return context.isExternalManagement();
}
@ProtectedMethod
@JRPCMethod
public JSONArray getRepositoryTypes() {

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ru.kirillius</groupId>
<artifactId>pf-sdn</artifactId>
<version>1.0.2.5</version>
<version>1.1.0.0</version>
</parent>

View File

@ -26,4 +26,7 @@ public interface Context {
* @param shouldRestart {@code true} to exit with restart intent, {@code false} to shut down.
*/
void requestExit(boolean shouldRestart);
boolean isExternalManagement();
}

View File

@ -1,2 +1,2 @@
#!/bin/sh
exec /launcher.sh --c=/data/config.json
exec java -Xmx256m -jar default.pfapp --c=/data/config.json -Dapp.external.management=true -l=. -r="https://repo.kirillius.ru/apps/pf/"

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ru.kirillius</groupId>
<artifactId>pf-sdn</artifactId>
<version>1.0.2.5</version>
<version>1.1.0.0</version>
</parent>
<artifactId>launcher</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ru.kirillius</groupId>
<artifactId>pf-sdn</artifactId>
<version>1.0.2.5</version>
<version>1.1.0.0</version>
</parent>
<artifactId>pf-sdn.ovpn-connector</artifactId>

View File

@ -6,7 +6,7 @@
<groupId>ru.kirillius</groupId>
<artifactId>pf-sdn</artifactId>
<version>1.0.2.5</version>
<version>1.1.0.0</version>
<packaging>pom</packaging>

View File

@ -87,10 +87,14 @@ async function renderSystemAndManagerStatus() {
const currentVersion = (versionInfo && versionInfo.current) || '';
const downloadedVersion = (versionInfo && versionInfo.downloaded) || '';
configChanged = await JSONRPC.System.isConfigChanged();
const isExternalManaged = await JSONRPC.System.isExternalManaged();
const hasAvailableUpdate = availableVersion && availableVersion !== currentVersion;
const isDownloaded = hasAvailableUpdate && downloadedVersion === availableVersion;
const updateButtonDisabled = !hasAvailableUpdate || isDownloaded;
const updateButtonDisabled = !hasAvailableUpdate || isDownloaded || isExternalManaged;
const systemStatus = (() => {
if (isExternalManaged) {
return 'Управляется извне';
}
if (!hasAvailableUpdate) {
return 'Нет обновлений';
}
@ -104,6 +108,7 @@ async function renderSystemAndManagerStatus() {
<span>Текущая версия: <span class="${hasAvailableUpdate ? 'text-yellow-500' : 'text-green-500'}">${currentVersion || '-'}</span></span><br />
<span class="last-version">Последняя версия: <span class="${hasAvailableUpdate ? 'text-yellow-500' : 'text-green-500'}">${availableVersion || '-'}</span></span>
</div>
${isExternalManaged ? '<p class="status-line text-red-500">Обновление ПО управляется внешней системой, установка из веб-интерфейса недоступна.</p>' : ''}
<p class="status-line ${configChanged ? 'text-yellow-500' : 'text-green-500'}">
Конфигурация: ${configChanged ? 'изменена' : 'актуальна'}
</p>
@ -225,8 +230,15 @@ function attachEventHandlers() {
$btn.prop('disabled', true).text('Обновление...');
try {
await JSONRPC.System.doUpdate();
const updatePromise = JSONRPC.System.doUpdate();
alert('Обновление ПО запущено!');
await updatePromise;
if (confirm('Обновление завершено. Перезагрузить?')) {
await JSONRPC.System.restart();
setTimeout(() => {
window.location.reload();
}, 10000);
}
await renderSystemAndManagerStatus();
} catch (e) {
alert('Ошибка при запуске обновления ПО!');