feat: ✨ first release #10
@@ -1,46 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
name: Build and Push
|
|
||||||
runs-on: build-htz-01
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
run: |
|
|
||||||
docker build -t cr.jdbnet.co.uk/public/ssh:latest .
|
|
||||||
docker push cr.jdbnet.co.uk/public/ssh:latest
|
|
||||||
|
|
||||||
sonarqube:
|
|
||||||
name: SonarQube
|
|
||||||
runs-on: build-htz-01
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Create Valid Project Key
|
|
||||||
id: sonar_setup
|
|
||||||
run: |
|
|
||||||
CLEAN_KEY=$(echo "${{ gitea.repository }}" | tr '/' ':')
|
|
||||||
echo "key=$CLEAN_KEY" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: SonarQube Scan
|
|
||||||
uses: sonarsource/sonarqube-scan-action@master
|
|
||||||
continue-on-error: true
|
|
||||||
env:
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
|
||||||
with:
|
|
||||||
args: >
|
|
||||||
-Dsonar.projectKey=${{ steps.sonar_setup.outputs.key }}
|
|
||||||
-Dsonar.projectName=${{ gitea.repository }}
|
|
||||||
-Dsonar.qualitygate.wait=true
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'v')
|
||||||
|
runs-on: build-htz-01
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Extract Version
|
||||||
|
id: get_version
|
||||||
|
run: echo "VERSION=${{ github.head_ref }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# - name: Generate Changelog
|
||||||
|
# id: changelog
|
||||||
|
# uses: https://github.com/metcalfc/changelog-generator@v4.6.2
|
||||||
|
# with:
|
||||||
|
# myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
run: |
|
||||||
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||||
|
docker build -t cr.jdbnet.co.uk/public/ssh:$VERSION \
|
||||||
|
-t cr.jdbnet.co.uk/public/ssh:latest \
|
||||||
|
--build-arg VERSION=$VERSION \
|
||||||
|
.
|
||||||
|
docker push cr.jdbnet.co.uk/public/ssh:$VERSION
|
||||||
|
docker push cr.jdbnet.co.uk/public/ssh:latest
|
||||||
|
|
||||||
|
- name: Create Gitea Release
|
||||||
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
name: ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
@@ -8,6 +8,8 @@ RUN npm run build
|
|||||||
FROM python:3.14-slim
|
FROM python:3.14-slim
|
||||||
LABEL org.opencontainers.image.vendor="JDB-NET"
|
LABEL org.opencontainers.image.vendor="JDB-NET"
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
ARG VERSION=unknown
|
||||||
|
ENV VERSION=${VERSION}
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
|
|||||||
app.config["PERMANENT_SESSION_LIFETIME"] = timedelta(
|
app.config["PERMANENT_SESSION_LIFETIME"] = timedelta(
|
||||||
days=int(os.getenv("SESSION_DAYS", "14"))
|
days=int(os.getenv("SESSION_DAYS", "14"))
|
||||||
)
|
)
|
||||||
|
app.config["VERSION"] = os.getenv("VERSION", "unknown")
|
||||||
if os.getenv("SESSION_COOKIE_SECURE", "").lower() in ("1", "true", "yes"):
|
if os.getenv("SESSION_COOKIE_SECURE", "").lower() in ("1", "true", "yes"):
|
||||||
app.config["SESSION_COOKIE_SECURE"] = True
|
app.config["SESSION_COOKIE_SECURE"] = True
|
||||||
|
|
||||||
@@ -677,9 +678,10 @@ def api_logout():
|
|||||||
|
|
||||||
@app.route("/api/me", methods=["GET"])
|
@app.route("/api/me", methods=["GET"])
|
||||||
def api_me():
|
def api_me():
|
||||||
|
version = app.config.get("VERSION", "unknown")
|
||||||
if session.get("logged_in"):
|
if session.get("logged_in"):
|
||||||
return jsonify({"logged_in": True})
|
return jsonify({"logged_in": True, "app_version": version})
|
||||||
return jsonify({"logged_in": False})
|
return jsonify({"logged_in": False, "app_version": version})
|
||||||
|
|
||||||
|
|
||||||
@app.route("/api/identities", methods=["GET"])
|
@app.route("/api/identities", methods=["GET"])
|
||||||
|
|||||||
+13
-1
@@ -19,6 +19,7 @@ interface TabItem {
|
|||||||
|
|
||||||
const loggedIn = ref(false);
|
const loggedIn = ref(false);
|
||||||
const checking = ref(true);
|
const checking = ref(true);
|
||||||
|
const appVersion = ref("unknown");
|
||||||
const identities = ref<IdentityRow[]>([]);
|
const identities = ref<IdentityRow[]>([]);
|
||||||
const allHosts = ref<HostRow[]>([]);
|
const allHosts = ref<HostRow[]>([]);
|
||||||
const allFolders = ref<FolderRow[]>([]);
|
const allFolders = ref<FolderRow[]>([]);
|
||||||
@@ -176,6 +177,9 @@ onMounted(async () => {
|
|||||||
try {
|
try {
|
||||||
const m = await api.me();
|
const m = await api.me();
|
||||||
loggedIn.value = m.logged_in;
|
loggedIn.value = m.logged_in;
|
||||||
|
if (m.app_version) {
|
||||||
|
appVersion.value = m.app_version;
|
||||||
|
}
|
||||||
if (loggedIn.value) await refreshData();
|
if (loggedIn.value) await refreshData();
|
||||||
} catch {
|
} catch {
|
||||||
loggedIn.value = false;
|
loggedIn.value = false;
|
||||||
@@ -527,7 +531,15 @@ async function deleteIdentityRow(id: number) {
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<span class="truncate text-sm font-semibold text-white">JDB-NET SSH</span>
|
<a
|
||||||
|
href="https://git.jdbnet.co.uk/jamie/ssh"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="flex items-center gap-2 truncate"
|
||||||
|
>
|
||||||
|
<span class="truncate text-sm font-semibold text-white">JDB-NET SSH</span>
|
||||||
|
<span class="truncate text-xs text-slate-400 hover:text-slate-300">{{ appVersion }}</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<button
|
<button
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ function browseParams(folderId: number | null, q: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const api = {
|
export const api = {
|
||||||
async me(): Promise<{ logged_in: boolean }> {
|
async me(): Promise<{ logged_in: boolean; app_version?: string }> {
|
||||||
const res = await fetch("/api/me", { credentials: "include" });
|
const res = await fetch("/api/me", { credentials: "include" });
|
||||||
return handle(res);
|
return handle(res);
|
||||||
},
|
},
|
||||||
|
|||||||
Submodule
+1
Submodule jdbnet.co.uk added at 4c2697f274
Reference in New Issue
Block a user