Skip to content

Commit 7297c15

Browse files
committed
Update BASE_PATH and replace EoL characters
1 parent a0fad2e commit 7297c15

File tree

9 files changed

+293
-293
lines changed

9 files changed

+293
-293
lines changed

docker/web/Dockerfile

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
###############################################################################
2-
#---------------------------- IMPORT RUNTIME -----------------------------#
3-
###############################################################################
4-
5-
FROM codecompass:runtime as runtime
6-
7-
###############################################################################
8-
#------------------------ EXECUTABLE CONTAINER --------------------------#
9-
###############################################################################
10-
11-
FROM ubuntu:22.04
12-
13-
# tzdata package is installed implicitly in the following command. This package
14-
# sets timezone interactively during the installation process. This environment
15-
# variable prevents this interaction.
16-
ARG DEBIAN_FRONTEND=noninteractive
17-
18-
RUN set -x && apt-get update -qq \
19-
&& apt-get install -qqy --no-install-recommends \
20-
llvm-15 \
21-
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
22-
libsqlite3-dev \
23-
postgresql-server-dev-14 \
24-
default-jre \
25-
libgit2-dev \
26-
libldap-2.5-0 \
27-
libssl3 \
28-
libgvc6 \
29-
libthrift-dev \
30-
libpq5 \
31-
# To switch user and exec command.
32-
gosu \
33-
tini \
34-
curl ca-certificates gnupg \
35-
wget \
36-
gcc-11 g++-11 \
37-
&& ln -s /usr/bin/gcc-11 /usr/bin/gcc \
38-
&& ln -s /usr/bin/g++-11 /usr/bin/g++ \
39-
&& apt-get clean \
40-
&& rm -rf /var/lib/apt/lists/ \
41-
&& set +x
42-
43-
# Install NodeJS from NodeSource.
44-
RUN mkdir -p /etc/apt/keyrings && \
45-
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
46-
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
47-
apt-get update -qq && \
48-
apt-get install -y nodejs && \
49-
apt-get clean && \
50-
rm -rf /var/lib/apt/lists/
51-
52-
# Copy ODB install directory.
53-
COPY --from=runtime /opt/odb /opt/odb
54-
55-
ARG CC_GID=960
56-
ARG CC_UID=960
57-
58-
ENV CC_GID ${CC_GID}
59-
ENV CC_UID ${CC_UID}
60-
61-
# Create user and group for CodeCompass.
62-
RUN groupadd --system codecompass --gid ${CC_GID} && \
63-
useradd --system --no-log-init --no-create-home --uid ${CC_UID} --gid codecompass codecompass
64-
65-
# Copy CodeCompass install directory. (Change permission of the CodeCompass package.)
66-
# TODO: only the webserver's binaries should be included in this image.
67-
COPY --from=runtime --chown=codecompass:codecompass /codecompass /codecompass
68-
69-
ENV PATH="/codecompass/bin:/opt/odb/bin:$PATH"
70-
71-
COPY --chown=codecompass:codecompass docker/web/entrypoint.sh /usr/local/bin/entrypoint.sh
72-
RUN chmod a+x /usr/local/bin/entrypoint.sh
73-
74-
75-
EXPOSE 8080
76-
77-
ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.sh"]
78-
79-
CMD ["sh", "-c", "node ../../webgui-new/scripts/patch-basepath.js && CodeCompass_webserver -w /workspace -p 8080"]
80-
1+
###############################################################################
2+
#---------------------------- IMPORT RUNTIME -----------------------------#
3+
###############################################################################
4+
5+
FROM codecompass:runtime as runtime
6+
7+
###############################################################################
8+
#------------------------ EXECUTABLE CONTAINER --------------------------#
9+
###############################################################################
10+
11+
FROM ubuntu:22.04
12+
13+
# tzdata package is installed implicitly in the following command. This package
14+
# sets timezone interactively during the installation process. This environment
15+
# variable prevents this interaction.
16+
ARG DEBIAN_FRONTEND=noninteractive
17+
18+
RUN set -x && apt-get update -qq \
19+
&& apt-get install -qqy --no-install-recommends \
20+
llvm-15 \
21+
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
22+
libsqlite3-dev \
23+
postgresql-server-dev-14 \
24+
default-jre \
25+
libgit2-dev \
26+
libldap-2.5-0 \
27+
libssl3 \
28+
libgvc6 \
29+
libthrift-dev \
30+
libpq5 \
31+
# To switch user and exec command.
32+
gosu \
33+
tini \
34+
curl ca-certificates gnupg \
35+
wget \
36+
gcc-11 g++-11 \
37+
&& ln -s /usr/bin/gcc-11 /usr/bin/gcc \
38+
&& ln -s /usr/bin/g++-11 /usr/bin/g++ \
39+
&& apt-get clean \
40+
&& rm -rf /var/lib/apt/lists/ \
41+
&& set +x
42+
43+
# Install NodeJS from NodeSource.
44+
RUN mkdir -p /etc/apt/keyrings && \
45+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
46+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
47+
apt-get update -qq && \
48+
apt-get install -y nodejs && \
49+
apt-get clean && \
50+
rm -rf /var/lib/apt/lists/
51+
52+
# Copy ODB install directory.
53+
COPY --from=runtime /opt/odb /opt/odb
54+
55+
ARG CC_GID=960
56+
ARG CC_UID=960
57+
58+
ENV CC_GID ${CC_GID}
59+
ENV CC_UID ${CC_UID}
60+
61+
# Create user and group for CodeCompass.
62+
RUN groupadd --system codecompass --gid ${CC_GID} && \
63+
useradd --system --no-log-init --no-create-home --uid ${CC_UID} --gid codecompass codecompass
64+
65+
# Copy CodeCompass install directory. (Change permission of the CodeCompass package.)
66+
# TODO: only the webserver's binaries should be included in this image.
67+
COPY --from=runtime --chown=codecompass:codecompass /codecompass /codecompass
68+
69+
ENV PATH="/codecompass/bin:/opt/odb/bin:$PATH"
70+
71+
COPY --chown=codecompass:codecompass docker/web/entrypoint.sh /usr/local/bin/entrypoint.sh
72+
RUN chmod a+x /usr/local/bin/entrypoint.sh
73+
74+
75+
EXPOSE 8080
76+
77+
ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.sh"]
78+
79+
CMD ["sh", "-c", "node ../../webgui-new/scripts/patch-basepath.js && CodeCompass_webserver -w /workspace -p 8080"]
80+

docker/web/entrypoint.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/bin/bash
2-
3-
if [ "$(id -u)" == '0' ]; then
4-
# Change the owner of the workspace directory
5-
mkdir -p /workspace
6-
chown codecompass:codecompass /workspace
7-
8-
# Execute this script again with codecompass user.
9-
exec gosu codecompass "$0" "$@"
10-
fi
11-
12-
exec "$@"
1+
#!/bin/bash
2+
3+
if [ "$(id -u)" == '0' ]; then
4+
# Change the owner of the workspace directory
5+
mkdir -p /workspace
6+
chown codecompass:codecompass /workspace
7+
8+
# Execute this script again with codecompass user.
9+
exec gosu codecompass "$0" "$@"
10+
fi
11+
12+
exec "$@"

scripts/CodeCompass_logger

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
#!/usr/bin/env bash
2-
3-
if [ $# -ne 2 ]; then
4-
echo "Usage: $0 <output.json> \"<build command>\"" >&2
5-
exit 1
6-
fi
7-
8-
binDir=$(dirname $0)
9-
jsonFile=$1
10-
shift
11-
12-
if [ -f $jsonFile ]; then
13-
echo "The compilation database already exists!" >&2
14-
exit 1
15-
fi
16-
17-
export LDLOGGER_HOME=$binDir
18-
19-
source $binDir/../share/codecompass/setldlogenv.sh $jsonFile; \
20-
bash -c "$@"
21-
22-
if [ ! -f $jsonFile ]; then
23-
echo "Failed to log the build commands!" >&2
24-
exit 1
25-
elif [ $(wc -c <$jsonFile) -le 5 ]; then
26-
echo "Failed to log the build commands: the build log is empty!" >&2
27-
exit 1
28-
fi
1+
#!/usr/bin/env bash
2+
3+
if [ $# -ne 2 ]; then
4+
echo "Usage: $0 <output.json> \"<build command>\"" >&2
5+
exit 1
6+
fi
7+
8+
binDir=$(dirname $0)
9+
jsonFile=$1
10+
shift
11+
12+
if [ -f $jsonFile ]; then
13+
echo "The compilation database already exists!" >&2
14+
exit 1
15+
fi
16+
17+
export LDLOGGER_HOME=$binDir
18+
19+
source $binDir/../share/codecompass/setldlogenv.sh $jsonFile; \
20+
bash -c "$@"
21+
22+
if [ ! -f $jsonFile ]; then
23+
echo "Failed to log the build commands!" >&2
24+
exit 1
25+
elif [ $(wc -c <$jsonFile) -le 5 ]; then
26+
echo "Failed to log the build commands: the build log is empty!" >&2
27+
exit 1
28+
fi

scripts/install_latest_build2.sh

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
#!/bin/bash
2-
3-
if [ $# -lt 1 ]; then
4-
echo "No installation directory was provided for build2!" 1>&2
5-
exit 1
6-
fi
7-
8-
## download phase
9-
10-
install_dir=$1
11-
toolchain_file="toolchain.sha256"
12-
if [ "$1" = "--version" ]; then
13-
wget -q --no-verbose --no-clobber https://download.build2.org/toolchain.sha256 -O "${toolchain_file}"
14-
else
15-
wget --no-verbose --no-clobber https://download.build2.org/toolchain.sha256 -O "${toolchain_file}"
16-
fi
17-
18-
19-
version_line=$(grep -m 1 '' "$toolchain_file")
20-
version_number=$(echo "$version_line" | awk '{print $2}')
21-
22-
### Return with version string only without actually installing build2 if "--version" flag is specified.
23-
if [ "$1" = "--version" ]; then
24-
echo "${version_number}"
25-
rm -f "${toolchain_file}"
26-
exit 0
27-
fi
28-
29-
version_to_install=build2-install-${version_number}.sh
30-
download_url=https://download.build2.org/${version_number}/${version_to_install}
31-
wget --no-verbose --no-clobber "${download_url}" -O "${version_to_install}"
32-
33-
## sha256 check phase
34-
35-
line_with_version=$(grep "$version_to_install" "$toolchain_file")
36-
checksum_for_version=$(echo "$line_with_version" | awk '{print $1}')
37-
38-
if echo "${checksum_for_version} ${version_to_install}" | sha256sum -c; then
39-
echo "Build2 installer for version ${version_number} has been downloaded!"
40-
else
41-
echo "Expected checksum for build2 installer version ${version_number} doesn't match! Probably the file has been corrupted! Please install it manually!" 1>&2
42-
echo "Expected: ${checksum_for_version}" 1>&2
43-
rm "$version_to_install" "$toolchain_file"
44-
exit 1
45-
fi
46-
47-
## install phase
48-
49-
sh ${version_to_install} --yes --trust yes --jobs $(nproc) "${install_dir}"
50-
51-
## cleanup phase
52-
53-
compressed_toolchain="build2-toolchain-${version_number}.tar.xz"
54-
55-
rm -f "${toolchain_file}" "${version_to_install}" "${compressed_toolchain}"
56-
57-
echo "Build2 version ${version_number} has been successfully installed!"
1+
#!/bin/bash
2+
3+
if [ $# -lt 1 ]; then
4+
echo "No installation directory was provided for build2!" 1>&2
5+
exit 1
6+
fi
7+
8+
## download phase
9+
10+
install_dir=$1
11+
toolchain_file="toolchain.sha256"
12+
if [ "$1" = "--version" ]; then
13+
wget -q --no-verbose --no-clobber https://download.build2.org/toolchain.sha256 -O "${toolchain_file}"
14+
else
15+
wget --no-verbose --no-clobber https://download.build2.org/toolchain.sha256 -O "${toolchain_file}"
16+
fi
17+
18+
19+
version_line=$(grep -m 1 '' "$toolchain_file")
20+
version_number=$(echo "$version_line" | awk '{print $2}')
21+
22+
### Return with version string only without actually installing build2 if "--version" flag is specified.
23+
if [ "$1" = "--version" ]; then
24+
echo "${version_number}"
25+
rm -f "${toolchain_file}"
26+
exit 0
27+
fi
28+
29+
version_to_install=build2-install-${version_number}.sh
30+
download_url=https://download.build2.org/${version_number}/${version_to_install}
31+
wget --no-verbose --no-clobber "${download_url}" -O "${version_to_install}"
32+
33+
## sha256 check phase
34+
35+
line_with_version=$(grep "$version_to_install" "$toolchain_file")
36+
checksum_for_version=$(echo "$line_with_version" | awk '{print $1}')
37+
38+
if echo "${checksum_for_version} ${version_to_install}" | sha256sum -c; then
39+
echo "Build2 installer for version ${version_number} has been downloaded!"
40+
else
41+
echo "Expected checksum for build2 installer version ${version_number} doesn't match! Probably the file has been corrupted! Please install it manually!" 1>&2
42+
echo "Expected: ${checksum_for_version}" 1>&2
43+
rm "$version_to_install" "$toolchain_file"
44+
exit 1
45+
fi
46+
47+
## install phase
48+
49+
sh ${version_to_install} --yes --trust yes --jobs $(nproc) "${install_dir}"
50+
51+
## cleanup phase
52+
53+
compressed_toolchain="build2-toolchain-${version_number}.tar.xz"
54+
55+
rm -f "${toolchain_file}" "${version_to_install}" "${compressed_toolchain}"
56+
57+
echo "Build2 version ${version_number} has been successfully installed!"

scripts/remover.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#!/bin/bash
2-
3-
FILES=$(ls *.js)
4-
5-
for FILE in $FILES
6-
do
7-
if [ -f "$FILE" ]
8-
then
9-
sed -i -e "/if (typeof Int64 === 'undefined' && typeof require === 'function') {/,+2 d" "$FILE"
10-
fi
11-
done
1+
#!/bin/bash
2+
3+
FILES=$(ls *.js)
4+
5+
for FILE in $FILES
6+
do
7+
if [ -f "$FILE" ]
8+
then
9+
sed -i -e "/if (typeof Int64 === 'undefined' && typeof require === 'function') {/,+2 d" "$FILE"
10+
fi
11+
done

webgui-new/next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require('dotenv').config();
44

5-
const BASE_PLACEHOLDER = '__BASE_PATH__';
5+
const BASE_PLACEHOLDER = '/__URL_BASE_PATH__';
66

77
/** @type {import('next').NextConfig} */
88
const nextConfig = {

0 commit comments

Comments
 (0)