Fix linux permissions

This commit is contained in:
linoe97
2022-06-14 12:09:17 +02:00
committed by DomySh
parent 8eb077efa2
commit 236c3ad255
5 changed files with 13 additions and 8 deletions

View File

@@ -27,12 +27,11 @@ ADD ./backend/requirements.txt /execute/requirements.txt
RUN pip install --no-cache-dir -r /execute/requirements.txt
COPY ./backend/ /execute/
RUN c++ -O3 -o proxy/proxy proxy/proxy.cpp -pthread -lboost_system -lboost_regex
COPY ./config/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./config/nginx.conf /tmp/nginx.conf
COPY ./config/start_nginx.sh /tmp/start_nginx.sh
RUN c++ -O3 -o proxy/proxy proxy/proxy.cpp -pthread -lboost_system -lboost_regex
#Copy react app in the main container
COPY --from=frontend /app/build/ ./frontend/

View File

@@ -17,7 +17,7 @@ class SQLite():
try:
self.conn = sqlite3.connect("db/" + self.db_name + '.db', check_same_thread = False)
except Exception:
with open(self.db_name + '.db', 'x') as f:
with open("db/" + self.db_name + '.db', 'x') as f:
pass
self.conn = sqlite3.connect("db/" + self.db_name + '.db', check_same_thread = False)

View File

@@ -1,4 +1,5 @@
#/bin/bash
chmod g+w -R /execute/db
envsubst '$NGINX_PORT' < /tmp/nginx.conf > /etc/nginx/nginx.conf
/usr/sbin/nginx -g "daemon off;" || exit 1

View File

@@ -8,11 +8,16 @@ nodaemon = true
[program:backend]
directory=/execute
user = nobody
group = root
command=python3 app.py
startsecs=10
stopsignal=QUIT
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/supervisor/%(program_name)s_stderr.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/var/log/supervisor/%(program_name)s_stdout.log
stdout_logfile_maxbytes=10MB
[program:frontend]
directory=/execute

View File

@@ -45,9 +45,9 @@ function App() {
return <LoadingOverlay visible/>
}else if (reqError){
return <div className='center-flex-row' style={{padding:"100px"}}>
<Title order={1} align="center">Errore nel caricamento del firewall! 🔥</Title>
<Title order={1} align="center">Error launching Firegex! 🔥</Title>
<Space h="md" />
<Title order={4} align="center">Errore nella comunicazione con il backend</Title>
<Title order={4} align="center">Error communicating with backend</Title>
<Space h="md" />
Errore: {reqError}
<Space h="xl" />
@@ -132,9 +132,9 @@ function App() {
</Routes>
}else{
return <div className='center-flex-row' style={{padding:"100px"}}>
<Title order={1} align="center">Errore nel caricamento del firewall! 🔥</Title>
<Title order={1} align="center">Error launching Firegex! 🔥</Title>
<Space h="md" />
<Title order={4} align="center">Errore nella comunicazione con il backend</Title>
<Title order={4} align="center">Error communicating with backend</Title>
</div>
}
}