-
-
Notifications
You must be signed in to change notification settings - Fork 89
/
entrypoint.sh
43 lines (32 loc) · 1.14 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
[ "$EXEC_TOOL" ] || EXEC_TOOL=gosu
[ "$FLATNOTES_PORT" ] || FLATNOTES_PORT=8080
set -e
echo "\
======================================
======== Welcome to flatnotes ========
======================================
If you enjoy using flatnotes, please
consider sponsoring the project at:
https://sponsor.flatnotes.io
It would really make my day 🙏.
──────────────────────────────────────
"
flatnotes_command="python -m \
uvicorn \
main:app \
--app-dir server \
--host 0.0.0.0 \
--port ${FLATNOTES_PORT} \
--proxy-headers \
--forwarded-allow-ips '*'"
if [ `id -u` -eq 0 ] && [ `id -g` -eq 0 ]; then
echo Setting file permissions...
chown -R ${PUID}:${PGID} ${FLATNOTES_PATH}
echo Starting flatnotes as user ${PUID}...
exec ${EXEC_TOOL} ${PUID}:${PGID} ${flatnotes_command}
else
echo "A user was set by docker, skipping file permission changes."
echo Starting flatnotes as user $(id -u)...
exec ${flatnotes_command}
fi