Create new env file from example; fix installation & update (#9097)
This commit is contained in:
parent
afdcc2a624
commit
2cf7b446c0
21
ct/tududi.sh
21
ct/tududi.sh
@ -35,14 +35,15 @@ function update_script() {
|
|||||||
systemctl stop tududi
|
systemctl stop tududi
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Remove and backup Files"
|
msg_info "Backing up env file"
|
||||||
DB="$(sed -n '/^DB_FILE/s/[^=]*=//p' /opt/tududi/backend/.env)"
|
if [[ -f /opt/tududi/backend/.env ]]; then
|
||||||
export DB_FILE="$DB"
|
cp /opt/tududi/backend/.env /opt/tududi.env
|
||||||
cp /opt/tududi/backend/.env /opt/tududi.env
|
else
|
||||||
rm -rf /opt/tududi/backend/dist
|
cp /opt/tududi/.env /opt/tududi.env
|
||||||
msg_ok "Backup and removed Files"
|
fi
|
||||||
|
msg_ok "Backed up env file"
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "tududi" "chrisvel/tududi" "tarball" "latest" "/opt/tududi"
|
||||||
|
|
||||||
msg_info "Updating Tududi"
|
msg_info "Updating Tududi"
|
||||||
cd /opt/tududi
|
cd /opt/tududi
|
||||||
@ -50,9 +51,9 @@ function update_script() {
|
|||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
$STD npm run frontend:build
|
$STD npm run frontend:build
|
||||||
mv ./dist ./backend
|
mv ./dist ./backend
|
||||||
mv ./public/locales ./backend/dist
|
mv /opt/tududi.env /opt/tududi/backend/.env
|
||||||
mv ./public/favicon.* ./backend/dist
|
DB="$(sed -n '/^DB_FILE/s/[^=]*=//p' /opt/tududi/backend/.env)"
|
||||||
mv /opt/tududi.env /opt/tududi/.env
|
export DB_FILE="$DB"
|
||||||
sed -i -e 's|/tududi$|/tududi/backend|' \
|
sed -i -e 's|/tududi$|/tududi/backend|' \
|
||||||
-e 's|npm run start|bash /opt/tududi/backend/cmd/start.sh|' \
|
-e 's|npm run start|bash /opt/tududi/backend/cmd/start.sh|' \
|
||||||
/etc/systemd/system/tududi.service
|
/etc/systemd/system/tududi.service
|
||||||
|
|||||||
@ -28,8 +28,6 @@ $STD npm install
|
|||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
$STD npm run frontend:build
|
$STD npm run frontend:build
|
||||||
mv ./dist ./backend
|
mv ./dist ./backend
|
||||||
mv ./public/locales ./backend/dist
|
|
||||||
mv ./public/favicon.* ./backend/dist
|
|
||||||
msg_ok "Configured Tududi"
|
msg_ok "Configured Tududi"
|
||||||
|
|
||||||
msg_info "Creating env and database"
|
msg_info "Creating env and database"
|
||||||
@ -37,15 +35,16 @@ DB_LOCATION="/opt/tududi-db"
|
|||||||
UPLOAD_DIR="/opt/tududi-uploads"
|
UPLOAD_DIR="/opt/tududi-uploads"
|
||||||
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
|
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
|
||||||
SECRET="$(openssl rand -hex 64)"
|
SECRET="$(openssl rand -hex 64)"
|
||||||
cat <<EOF >/opt/tududi/backend/.env
|
sed -e '/^NODE_ENV=/s/=.*$/=production/' \
|
||||||
TUDUDI_SESSION_SECRET=${SECRET}
|
-e 's/^TUDUDI_USER/# TUDUDI_USER/g' \
|
||||||
TUDUDI_ALLOWED_ORIGINS=<your tududi IP or FQDN>
|
-e "/_SECRET=/s/=.*$/=${SECRET}/" \
|
||||||
NODE_ENV=production
|
-e "/^# DB_FILE/s/^# //; \
|
||||||
DB_FILE=${DB_LOCATION}/production.sqlite3
|
\|DB_FILE|s|/path.*$|${DB_LOCATION}/production.sqlite3|" \
|
||||||
TUDUDI_UPLOAD_PATH=${UPLOAD_DIR}
|
-e "/^# TUDUDI_ALLOWED/s/^# //; \
|
||||||
DISABLE_TELEGRAM=true
|
\|_ORIGINS=|s|=.*$|=<your tududi IP or FDQN>|" \
|
||||||
DIABLE_SCHEDULER=false
|
-e "/^# TUDUDI_UPLOAD/s/^# //; \
|
||||||
EOF
|
\|UPLOAD_PATH=|s|=.*$|=${UPLOAD_DIR}|" \
|
||||||
|
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
|
||||||
export DB_FILE="${DB_LOCATION}/production.sqlite3"
|
export DB_FILE="${DB_LOCATION}/production.sqlite3"
|
||||||
$STD npm run db:init
|
$STD npm run db:init
|
||||||
msg_ok "Created env and database"
|
msg_ok "Created env and database"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user