@@ -43,11 +43,7 @@ export BASE_C_PATH=/usr/local/etc/scanoss
4343export CONFIG_DIR=" ${BASE_C_PATH} /folder-hashing-api"
4444export LOG_DIR=/var/log/scanoss
4545export L_PATH=" ${LOG_DIR} /folder-hashing-api"
46- export DB_PATH_BASE=/var/lib/scanoss
47- export SQLITE_PATH=" ${DB_PATH_BASE} /db/sqlite/folder-hashing-api"
48- export SQLITE_DB_NAME=base.sqlite
49- export TARGET_SQLITE_DB_NAME=db.sqlite
50- export CONF_DOWNLOAD_URL=" https://raw.githubusercontent.com/scanoss/hfh/refs/heads/main/config/app-config-prod.json"
46+ export CONF_DOWNLOAD_URL=" https://raw.githubusercontent.com/scanoss/folder-hashing-api/refs/heads/main/configuration/app-config-prod.json"
5147
5248# Makes sure the scanoss user exists
5349export RUNTIME_USER=scanoss
@@ -103,6 +99,7 @@ if [ -f "$SC_SERVICE_FILE" ] ; then
10399 cp " $SC_SERVICE_FILE " /etc/systemd/system || { echo " Error: service copy failed" ; exit 1; }
104100fi
105101cp scanoss-folder-hashing-api.sh /usr/local/bin || { echo " Error: startup script copy failed" ; exit 1; }
102+ chmod +x /usr/local/bin/scanoss-folder-hashing-api.sh || { echo " Error: chmod failed for /usr/local/bin/scanoss-folder-hashing-api.sh" ; exit 1; }
106103
107104# ###################################################
108105# SEARCH CONFIG FILE #
@@ -118,40 +115,6 @@ elif [ -f "../$CONF" ]; then
118115 CONFIG_FILE_PATH=" ../$CONF "
119116fi
120117
121- # ###################################################
122- # SETUP SQLITE DB #
123- # ###################################################
124- if [ " $FORCE " = true ]; then
125- echo " [FORCE] Skipping all SQLite DB setup."
126- else
127- SQLITE_DB_PATH=" "
128- if [ -f " ./$SQLITE_DB_NAME " ]; then
129- SQLITE_DB_PATH=" ./$SQLITE_DB_NAME "
130- elif [ -f " ../$SQLITE_DB_NAME " ]; then
131- SQLITE_DB_PATH=" ../$SQLITE_DB_NAME "
132- fi
133-
134- mkdir -p " $SQLITE_PATH " || { echo " Error: Failed to create directory $SQLITE_PATH " ; exit 1; }
135- SQLITE_TARGET_PATH=" $SQLITE_PATH /$TARGET_SQLITE_DB_NAME "
136-
137- if [ -n " $SQLITE_DB_PATH " ]; then
138- if [ -f " $SQLITE_TARGET_PATH " ]; then
139- read -p " SQLite file found. Replace $SQLITE_TARGET_PATH ? (n/y) [n]: " -n 1 -r
140- echo
141- if [[ " $REPLY " =~ ^[Yy]$ ]] ; then
142- cp " $SQLITE_DB_PATH " " $SQLITE_TARGET_PATH " || { echo " Error copying DB" ; exit 1; }
143- else
144- echo " Skipping DB copy."
145- fi
146- else
147- echo " Copying SQLite DB..."
148- cp " $SQLITE_DB_PATH " " $SQLITE_TARGET_PATH " || { echo " Error copying DB" ; exit 1; }
149- fi
150- else
151- echo " Warning: No SQLite DB detected. Skipping DB setup."
152- fi
153- fi
154-
155118# ###################################################
156119# COPY CONFIG FILE #
157120# ###################################################
193156chown -R $RUNTIME_USER :$RUNTIME_USER " $BASE_C_PATH " || { echo " Error chown $BASE_C_PATH " ; exit 1; }
194157find " $CONFIG_DIR " -type d -exec chmod 0750 " {}" \;
195158find " $CONFIG_DIR " -type f -exec chmod 0600 " {}" \;
196- chown -R $RUNTIME_USER :$RUNTIME_USER " $DB_PATH_BASE "
197- find " $DB_PATH_BASE " -type d -exec chmod 0750 " {}" \;
198- find " $DB_PATH_BASE " -type f -exec chmod 0640 " {}" \;
199159
200160# Copy the binaries if requested
201161BINARY=scanoss-folder-hashing-api
0 commit comments