Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 40 additions & 30 deletions .docker/server.bake.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,54 @@ FROM ubuntu:24.04 AS web-base
#### SERVER ####
FROM web-base AS server

ARG PRODUCT_VERSION
ARG BUILD_ROOT
ARG TARGETARCH
ARG PRODUCT_VERSION
ARG COMPANY_NAME
ARG BUILD_ROOT
ARG TARGETARCH
ARG PRODUCT_NAME

ENV PRODUCT_VERSION=${PRODUCT_VERSION}
ARG BRANDING_DIR

COPY server/Common/package*.json /server/Common/
RUN --mount=type=cache,target=/root/.npm cd /server/Common && npm install
ENV PRODUCT_VERSION=${PRODUCT_VERSION}

COPY server/DocService/package*.json /server/DocService/
RUN --mount=type=cache,target=/root/.npm cd /server/DocService && npm install
COPY server/Common/package*.json /server/Common/
RUN --mount=type=cache,target=/root/.npm cd /server/Common && npm install

COPY server/FileConverter/package*.json /server/FileConverter/
RUN --mount=type=cache,target=/root/.npm cd /server/FileConverter && npm install
COPY server/DocService/package*.json /server/DocService/
RUN --mount=type=cache,target=/root/.npm cd /server/DocService && npm install

COPY server/Metrics/package*.json /server/Metrics/
RUN --mount=type=cache,target=/root/.npm cd /server/Metrics && npm install
COPY server/FileConverter/package*.json /server/FileConverter/
RUN --mount=type=cache,target=/root/.npm cd /server/FileConverter && npm install

COPY server/AdminPanel/server/package*.json /server/AdminPanel/server/
RUN --mount=type=cache,target=/root/.npm cd /server/AdminPanel/server && npm install
COPY server/Metrics/package*.json /server/Metrics/
RUN --mount=type=cache,target=/root/.npm cd /server/Metrics && npm install

COPY server/AdminPanel/client/package*.json /server/AdminPanel/client/
RUN --mount=type=cache,target=/root/.npm cd /server/AdminPanel/client && npm install
COPY server/AdminPanel/server/package*.json /server/AdminPanel/server/
RUN --mount=type=cache,target=/root/.npm cd /server/AdminPanel/server && npm install

COPY server/ /server
COPY server/AdminPanel/client/package*.json /server/AdminPanel/client/
RUN --mount=type=cache,target=/root/.npm cd /server/AdminPanel/client && npm install

ENV BUILD_ROOT=${BUILD_ROOT}
COPY server/ /server

RUN TARGETARCH_PKG=$(echo "$TARGETARCH" | sed 's/amd64/x64/') && \
cd /server/Common && \
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i sources/commondefines.js && \
cd /server/DocService && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/docservice" && \
cd /server/FileConverter && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/fileconverter" && \
cd /server/Metrics && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/metrics" && \
cd /server/AdminPanel/server && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/adminpanel"
### Branding
COPY ${BRANDING_DIR}/server/ /server

RUN cd /server/AdminPanel/client && npm run build
ENV BUILD_ROOT=${BUILD_ROOT}

RUN TARGETARCH_PKG=$(echo "$TARGETARCH" | sed 's/amd64/x64/') && \
cd /server/Common && \
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i sources/commondefines.js && \
cd /server/DocService && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/docservice" && \
cd /server/FileConverter && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/fileconverter" && \
cd /server/Metrics && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/metrics" && \
cd /server/AdminPanel/server && \
pkg . -t linux-"$TARGETARCH_PKG" --node-options="--max_old_space_size=4096" -o "${BUILD_ROOT}/adminpanel"

ENV APP_NAME=${COMPANY_NAME}

RUN cd /server/AdminPanel/client && \
npm run build
2 changes: 1 addition & 1 deletion AdminPanel/client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Document Server Admin Panel" />
<title>Euro-Office Admin</title>
<title><%= appName %> Admin</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 2 additions & 2 deletions AdminPanel/client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ body::-webkit-scrollbar-thumb {
}

a {
color: #ff6f3d;
color: #0082C9;
text-decoration: underline;
font-weight: 400;
}

a:hover {
color: #e55a2b;
color: #00a5fd;
}

/* Spinner animation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

.addButton {
background: #ff6f3d;
background: #0082C9;
color: #ffffff;
border: none;
height: 48px;
Expand All @@ -56,7 +56,7 @@
justify-content: center;

&:hover:not(:disabled) {
background: #e55a2b;
background: #00a5fd;
}

&:disabled {
Expand Down
8 changes: 4 additions & 4 deletions AdminPanel/client/src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.button {
background: #ff6f3d;
background: #0082C9;
width: 154px;
height: 48px;
padding: 13px 24px;
Expand All @@ -16,16 +16,16 @@
justify-content: center;

&:hover:not(:disabled) {
background: #e55a2b;
background: #00a5fd;
}

&--disabled {
background: #ffd4c5;
background: #84c8ed;
cursor: not-allowed;
}

&--loading {
background: #ff6f3d;
background: #0082C9;
cursor: wait;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
}

.checkbox:checked ~ .checkmark {
background: #ff6f3d;
border-color: #ff6f3d;
background: #0082C9;
border-color: #0082C9;

&::after {
display: block;
Expand Down
4 changes: 3 additions & 1 deletion AdminPanel/client/src/components/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ function Menu({isOpen, onClose}) {
const navigate = useNavigate();
const dispatch = useDispatch();

const appName = process.env.APP_NAME;

const handleLogout = async () => {
try {
await logout();
Expand Down Expand Up @@ -40,7 +42,7 @@ function Menu({isOpen, onClose}) {
<button className={styles['menu__closeButton']} onClick={onClose} aria-label='Close menu' />
<div className={styles['menu__header']}>
<div className={styles['menu__logoContainer']}>
<img src={AppMenuLogo} alt='Euro-Office' className={styles['menu__logo']} />
<img src={AppMenuLogo} alt={appName} className={styles['menu__logo']} />
</div>
<div className={styles['menu__title']}>DocServer Admin Panel</div>
<div className={styles['menu__separator']}></div>
Expand Down
6 changes: 3 additions & 3 deletions AdminPanel/client/src/components/Note/Note.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ function Note({type = 'note', children}) {
className: styles.note,
icon: (
<svg className={styles.icon} width='24' height='24' viewBox='0 0 24 24' fill='none'>
<circle cx='12' cy='12' r='10' stroke='#FF6F3D' strokeWidth='2' />
<path d='M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z' fill='#FF6F3D' />
<circle cx='12' cy='12' r='10' stroke='#0082C9' strokeWidth='2' />
<path d='M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z' fill='#0082C9' />
<path
d='M12 10C12.5523 10 13 10.4477 13 11V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V11C11 10.4477 11.4477 10 12 10Z'
fill='#FF6F3D'
fill='#0082C9'
/>
</svg>
)
Expand Down
4 changes: 2 additions & 2 deletions AdminPanel/client/src/components/Note/Note.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@

/* Note variant - Orange */
.note {
border-left: 2px solid #ff6f3d;
border-left: 2px solid #0082C9;

.title {
color: #ff6f3d;
color: #0082C9;
}
}

Expand Down
2 changes: 1 addition & 1 deletion AdminPanel/client/src/components/Select/Select.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}

&--selected {
color: #ff6f3d;
color: #0082C9;
font-weight: 600;
}
}
6 changes: 3 additions & 3 deletions AdminPanel/client/src/components/Tabs/Tabs.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
}

&--active {
color: #ff6f3d;
color: #0082C9;

&:hover,
&:focus,
&:active {
color: #ff6f3d; /* ensure orange while focused/pressed */
color: #0082C9; /* ensure orange while focused/pressed */
}

&::after {
Expand All @@ -54,7 +54,7 @@
left: 0;
right: 0;
height: 2px;
background: #ff6f3d;
background: #0082C9;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion AdminPanel/client/src/pages/Login/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export default function Login() {
const dispatch = useDispatch();
const buttonRef = useRef();

const appName = process.env.APP_NAME;

const handleSubmit = async () => {
setError('');

Expand All @@ -37,7 +39,7 @@ export default function Login() {
return (
<div className={styles.loginContainer}>
<div className={styles.loginCard}>
<h1 className={styles.title}>Euro-Office Admin Panel</h1>
<h1 className={styles.title}>{appName} Admin Panel</h1>
<p className={styles.subtitle}>Enter your password to access the admin panel</p>
<div className={styles.descriptionContainer}>
<p className={styles.description}>The session is valid for 60 minutes.</p>
Expand Down
4 changes: 3 additions & 1 deletion AdminPanel/client/src/pages/Setup/SetupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default function Setup() {
const dispatch = useDispatch();
const buttonRef = useRef();

const appName = process.env.APP_NAME;

const {isValid: passwordIsValid, isLoading} = usePasswordValidation(password);

// Check if form can be submitted
Expand Down Expand Up @@ -64,7 +66,7 @@ export default function Setup() {
return (
<div className={styles.loginContainer}>
<div className={styles.loginCard}>
<h1 className={styles.title}>Euro-Office Admin Panel</h1>
<h1 className={styles.title}>{appName} Admin Panel</h1>
<p className={styles.subtitle}>Initial Setup</p>
<p className={styles.description}>Enter the bootstrap token from server logs and create your admin password.</p>

Expand Down
12 changes: 9 additions & 3 deletions AdminPanel/client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const outputDir = process.env.BUILD_ROOT
? path.resolve(process.env.BUILD_ROOT, 'build')
: path.resolve(__dirname, 'build');

const appName = process.env.APP_NAME || 'Euro-Office';

module.exports = (env, argv) => {
const mode = argv && argv.mode ? argv.mode : 'development';

Expand Down Expand Up @@ -52,7 +54,10 @@ module.exports = (env, argv) => {

plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'public', 'index.html')
template: path.join(__dirname, 'public', 'index.html'),
templateParameters: {
appName,
},
}),
new CopyPlugin({
patterns: [
Expand Down Expand Up @@ -90,8 +95,9 @@ module.exports = (env, argv) => {
]
}),
new webpack.DefinePlugin({
'process.env.REACT_APP_BACKEND_URL': JSON.stringify(process.env.REACT_APP_BACKEND_URL)
})
'process.env.REACT_APP_BACKEND_URL': JSON.stringify(process.env.REACT_APP_BACKEND_URL),
'process.env.APP_NAME': JSON.stringify(appName),
}),
],

module: {
Expand Down
Loading