mirror of https://github.com/wg-easy/wg-easy
Browse Source
* add changelog, use semver for update message * use first line of release for short changelogpull/1618/head
committed by
Bernd Storath
9 changed files with 79 additions and 41 deletions
@ -0,0 +1,22 @@ |
|||||
|
# Changelog |
||||
|
|
||||
|
All notable changes to this project will be documented in this file. |
||||
|
|
||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
||||
|
|
||||
|
## [Unreleased] |
||||
|
|
||||
|
We're super excited to announce v15! |
||||
|
This update is an entire rewrite to make it even easier to set up your own VPN. |
||||
|
|
||||
|
## Major Changes |
||||
|
|
||||
|
- Almost all Environment variables removed |
||||
|
- New and Improved UI |
||||
|
|
||||
|
## [14.0.0] - 2024-09-04 |
||||
|
|
||||
|
### Major changes |
||||
|
|
||||
|
- `PASSWORD` has been replaced by `PASSWORD_HASH` |
@ -1,8 +1,9 @@ |
|||||
{ |
{ |
||||
"version": "1.0.1", |
"version": "1.0.0", |
||||
|
"private": true, |
||||
"scripts": { |
"scripts": { |
||||
"dev": "docker compose -f docker-compose.dev.yml up", |
"dev": "docker compose -f docker-compose.dev.yml up", |
||||
"build": "docker build -t wg-easy ." |
"build": "docker build -t wg-easy ." |
||||
}, |
}, |
||||
"packageManager": "pnpm@9.9.0" |
"packageManager": "pnpm@9.10.0" |
||||
} |
} |
||||
|
@ -62,6 +62,9 @@ importers: |
|||||
qrcode: |
qrcode: |
||||
specifier: ^1.5.4 |
specifier: ^1.5.4 |
||||
version: 1.5.4 |
version: 1.5.4 |
||||
|
semver: |
||||
|
specifier: ^7.6.3 |
||||
|
version: 7.6.3 |
||||
tailwindcss: |
tailwindcss: |
||||
specifier: ^3.4.10 |
specifier: ^3.4.10 |
||||
version: 3.4.10 |
version: 3.4.10 |
||||
@ -87,6 +90,9 @@ importers: |
|||||
'@types/qrcode': |
'@types/qrcode': |
||||
specifier: ^1.5.5 |
specifier: ^1.5.5 |
||||
version: 1.5.5 |
version: 1.5.5 |
||||
|
'@types/semver': |
||||
|
specifier: ^7.5.8 |
||||
|
version: 7.5.8 |
||||
eslint: |
eslint: |
||||
specifier: ^9.9.1 |
specifier: ^9.9.1 |
||||
version: 9.9.1([email protected]) |
version: 9.9.1([email protected]) |
||||
@ -1242,6 +1248,9 @@ packages: |
|||||
'@types/[email protected]': |
'@types/[email protected]': |
||||
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} |
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} |
||||
|
|
||||
|
'@types/[email protected]': |
||||
|
resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} |
||||
|
|
||||
'@typescript-eslint/[email protected]': |
'@typescript-eslint/[email protected]': |
||||
resolution: {integrity: sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==} |
resolution: {integrity: sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==} |
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} |
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} |
||||
@ -5687,6 +5696,8 @@ snapshots: |
|||||
|
|
||||
'@types/[email protected]': {} |
'@types/[email protected]': {} |
||||
|
|
||||
|
'@types/[email protected]': {} |
||||
|
|
||||
'@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])': |
'@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])': |
||||
dependencies: |
dependencies: |
||||
'@eslint-community/regexpp': 4.11.0 |
'@eslint-community/regexpp': 4.11.0 |
||||
|
@ -1,7 +1,12 @@ |
|||||
|
import { gt } from 'semver'; |
||||
|
|
||||
export default defineEventHandler(async () => { |
export default defineEventHandler(async () => { |
||||
|
// TODO: cache this
|
||||
const latestRelease = await fetchLatestRelease(); |
const latestRelease = await fetchLatestRelease(); |
||||
|
const updateAvailable = gt(latestRelease.version, RELEASE); |
||||
return { |
return { |
||||
currentRelease: RELEASE, |
currentRelease: RELEASE, |
||||
latestRelease: latestRelease, |
latestRelease: latestRelease, |
||||
|
updateAvailable, |
||||
}; |
}; |
||||
}); |
}); |
||||
|
@ -1,26 +1,27 @@ |
|||||
|
type GithubRelease = { |
||||
|
tag_name: string; |
||||
|
body: string; |
||||
|
}; |
||||
|
|
||||
export async function fetchLatestRelease() { |
export async function fetchLatestRelease() { |
||||
try { |
try { |
||||
const response = await $fetch<Record<string, string>>( |
const response = await $fetch<GithubRelease>( |
||||
'https://wg-easy.github.io/wg-easy/changelog.json', |
'https://api.github.com/repos/wg-easy/wg-easy/releases/latest', |
||||
{ method: 'get' } |
{ method: 'get' } |
||||
); |
); |
||||
const releasesArray = Object.entries(response).map( |
if (!response) { |
||||
([version, changelog]) => ({ |
throw new Error('Empty Response'); |
||||
version: parseInt(version, 10), |
|
||||
changelog: changelog, |
|
||||
}) |
|
||||
); |
|
||||
releasesArray.sort((a, b) => { |
|
||||
return b.version - a.version; |
|
||||
}); |
|
||||
|
|
||||
if (releasesArray.length === 0) { |
|
||||
throw new Error('Changelog is empty'); |
|
||||
} |
} |
||||
|
const changelog = response.body.split('\r\n\r\n')[0] ?? ''; |
||||
return releasesArray[0]!; |
return { |
||||
|
version: response.tag_name, |
||||
|
changelog, |
||||
|
}; |
||||
} catch (e) { |
} catch (e) { |
||||
SERVER_DEBUG('Failed to fetch latest releases: ', e); |
SERVER_DEBUG('Failed to fetch latest releases: ', e); |
||||
return { version: 0, changelog: '' }; |
throw createError({ |
||||
|
statusCode: 500, |
||||
|
statusMessage: 'Failed to fetch latest release', |
||||
|
}); |
||||
} |
} |
||||
} |
} |
||||
|
Loading…
Reference in new issue