fix creating speacial user _zot

This commit is contained in:
Nadezhda Fedorova 2024-05-24 18:10:21 +03:00
parent 416276a1fc
commit cf8f9b7fd3
3 changed files with 5 additions and 55 deletions

View File

@ -1,5 +1,5 @@
name: Building zot from binaries with patch for login page
on: [push]
on: push
jobs:
build-process:
@ -14,7 +14,6 @@ jobs:
uses: actions/checkout@master
- name: Build image
run: |
cd zot
podman build --tag alt/zot-wo-auth:$ZOT_VER --build-arg="ZOT_VER=$ZOT_VER" --build-arg="ZUI_VER=$ZUI_VER" .
env:
ZOT_VER: 'v2.0.4'

View File

@ -1,4 +1,4 @@
FROM registry.altlinux.org/alt/alt:latest AS builder
FROM registry.altlinux.org/alt/alt:sisyphus AS builder
ARG ZOT_VER=v2.0.4
ARG ZUI_VER=commit-09ab447
@ -24,7 +24,7 @@ RUN make COMMIT=$ZOT_VER ZUI_BUILD_PATH="/workdir/zot/zui/build" binary cli benc
RUN export ARCH=$(go env GOARCH); bin/zli-linux-$ARCH completion bash > zli.bash
RUN export ARCH=$(go env GOARCH); bin/zot-linux-$ARCH completion bash > zot.bash
FROM registry.altlinux.org/alt/alt:latest
FROM registry.altlinux.org/alt/alt:sisyphus
MAINTAINER alt-cloud
LABEL org.opencontainers.image.title="zot"
@ -44,8 +44,8 @@ RUN apt-get update && apt-get install -y ca-certificates && \
rm -f /var/cache/apt/archives/*.rpm \
/var/cache/apt/*.bin \
/var/lib/apt/lists/*.*
RUN groupadd -r -f _zot
RUN useradd -r -g _zot -M -d /var/lib/_zot -s /dev/null -c "Zot registry user" _zot
RUN groupadd -r -f -g 10001 _zot
RUN useradd -r -g _zot -M -d /var/lib/zot -s /dev/null -c "Zot registry user" -u 10001 _zot
USER _zot:_zot

View File

@ -1,49 +0,0 @@
diff --git a/src/App.js b/src/App.js
index 6fdd96c..9728bc2 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,8 +1,7 @@
-import React, { useState } from 'react';
+import React from 'react';
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
-import { isAuthenticated, isApiKeyEnabled } from 'utilities/authUtilities';
-import { AuthWrapper } from 'utilities/AuthWrapper';
+import { isApiKeyEnabled } from 'utilities/authUtilities';
import HomePage from './pages/HomePage';
import LoginPage from './pages/LoginPage';
@@ -14,25 +13,18 @@ import UserManagementPage from 'pages/UserManagementPage';
import './App.css';
function App() {
- const [isLoggedIn, setIsLoggedIn] = useState(isAuthenticated());
-
return (
<div className="App" data-testid="app-container">
<Router>
<Routes>
- <Route element={<AuthWrapper isLoggedIn={isLoggedIn} hasHeader redirect="/login" />}>
- <Route path="/" element={<Navigate to="/home" />} />
- <Route path="/home" element={<HomePage />} />
- <Route path="/explore" element={<ExplorePage />} />
- <Route path="/image/:name" element={<RepoPage />} />
- <Route path="/image/:reponame/tag/:tag" element={<TagPage />} />
- {isApiKeyEnabled() && <Route path="/user/apikey" element={<UserManagementPage />} />}
- <Route path="*" element={<Navigate to="/home" />} />
- </Route>
- <Route element={<AuthWrapper isLoggedIn={!isLoggedIn} redirect="/" />}>
- <Route path="/login" element={<LoginPage isLoggedIn={isLoggedIn} setIsLoggedIn={setIsLoggedIn} />} />
- <Route path="*" element={<Navigate to="/login" />} />
- </Route>
+ <Route path="/" element={<Navigate to="/home" />} />
+ <Route path="/home" element={<HomePage />} />
+ <Route path="/login" element={<LoginPage />} />
+ <Route path="/explore" element={<ExplorePage />} />
+ <Route path="/image/:name" element={<RepoPage />} />
+ <Route path="/image/:reponame/tag/:tag" element={<TagPage />} />
+ {isApiKeyEnabled() && <Route path="/user/apikey" element={<UserManagementPage />} />}
+ <Route path="*" element={<Navigate to="/home" />} />
</Routes>
</Router>
</div>