-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix deletion bug * autoImport * buildscript * m time instead of c time! * Gitignore * animation * zoomable, better animation * zoom fixes, better scrolling to picture * Open in album feature * fix * Fix scroll resize * Fix scrollbar, font * Patch face download (#79) * Update requirements.txt * Update Dockerfile * newest pic in album as default? * Show newest picture as album cover * properly select album picture * Search features (#82) * selection * search changes * fixed video and shade * better search * tag search * better label fetching * fix dockerfile * fix dockerfile * navigation changes * fix detectron * fix detectron dockerfile * keyboard navigation * Make the CLI installation more platform agnostic (#88) * Create a separate script for OpenRC, including corresponding init script files for the .service files and add checks for the package managers present to make the scripts more distro-agnostic. For distros not based on Debian/Ubuntu, skip the manual nodejs installation, as their repos generally contain more up-to date versions of it. Remove the manual installation of postgresql altogether, the version referenced in this script is two versions behind even the debian stable branch. * add init scripts for OpenRC. Implement checks for the presence of /etc/nginx/sites-enabled and whether it is enabled in nginx.conf * Updated readme with information about using OpenRC * make photo search work with new photos * enable legacy deps * Added map * clear searchbar on navigation via menubar * Folders (#98) Added folders for albums * do not fetch so much * performance fix * fix build * fix build 2 * revert package-lock.json * fix build 3 * fix face * search fixes --------- Co-authored-by: Your Name <you@example.com> Co-authored-by: Marcelina Hołub <86662980+154pinkchairs@users.noreply.github.com>
- Loading branch information
1 parent
536bf42
commit d5d26c7
Showing
47 changed files
with
3,515 additions
and
3,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/sbin/openrc-run | ||
|
||
description="ImageStore Backend" | ||
#extra_commands="checkconfig" | ||
#need to implement a function to check configuration for errors | ||
extra_started_commands="reload" | ||
depend() { | ||
need net | ||
after postgresql nginx | ||
} | ||
|
||
command="/usr/bin/npm start --prefix /etc/imagestore/backend" | ||
command_background="yes" | ||
start_stop_daemon_args="--quiet" | ||
cfgfile=${cfgfile:-/etc/imagestore/backend/tsconfig.json} | ||
|
||
pidfile="/run/$RC_SVCNAME/npm.pid" | ||
retry="SIGTERM/20" | ||
|
||
reload() { | ||
ebegin "Reloading $description" | ||
start-stop-daemon --signal HUP --pidfile "${pidfile}" | ||
eend $? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/sbin/openrc-run | ||
|
||
description="ImageStore Frontend" | ||
#extra_commands="checkconfig" | ||
extra_started_commands="reload" | ||
|
||
depend() { | ||
need net | ||
after postgresql nginx | ||
want ImageStoreBACK | ||
} | ||
|
||
command="/usr/bin/npx serve -w /etc/imagestore/frontend -s build -l tcp://localhost:3000" | ||
#Not sure if npx is supposed to run in background here, if yes, please uncomment these lines: | ||
#command_background="yes" | ||
#start_stop_daemon_args="--quiet" | ||
pidfile="/run/$RC_SVCNAME/npm.pid" | ||
retry="SIGTERM/20" | ||
cfgfile=${cfgfile:=/etc/imagestore/frontend/tsconfig.json} | ||
|
||
reload() { | ||
ebegin "Reloading $description" | ||
start-stop-daemon --signal HUP --pidfile "${pidfile}" | ||
eend $? | ||
} | ||
|
||
#need to implement a function to check configuration for errors | ||
#checkconfig() { | ||
#} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
#!/bin/bash | ||
|
||
#Check for the package manager used by the system | ||
if [[ $(which apk) != "apk not found" ]]; then | ||
pkgman="apk" | ||
install="add" | ||
update="update" | ||
elif [[ $(which apt) != "apt not found" ]]; then | ||
pkgman="apt" | ||
install="install" | ||
update="update" | ||
elif [[ $(which yum) != "yum not found" ]]; then | ||
pkgman="yum" | ||
install="install" | ||
update="update" | ||
elif [[ $(which pacman) != "pacman not found" ]]; then | ||
pkgman="pacman" | ||
install="-S" | ||
update="-Syy" | ||
fi | ||
|
||
#Install the required programs | ||
|
||
$pkgman $update | ||
|
||
##On Debian/Ubuntu based distros gotta do a little extra for Node | ||
if [[ "$pkgman" == "apt" ]]; then | ||
apt install curl -y | ||
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - | ||
apt install nodejs -y | ||
fi | ||
|
||
case $pkgman in | ||
|
||
yum | apt) | ||
$pkgman $install postgresql npm build-essential nginx -y | ||
;; | ||
|
||
pacman | apk) | ||
$pkgman $install postgresql npm build-essential nginx | ||
;; | ||
|
||
esac | ||
|
||
#Make an Config folder | ||
mkdir /etc/imagestore | ||
cp -r ../frontend /etc/imagestore/ | ||
cp -r ../backend /etc/imagestore/ | ||
|
||
#Load up the system with the proper configurations | ||
|
||
if (ss -ln | grep ":8080") | ||
then | ||
loopcheck=1 | ||
read -p "Port conflict detected. Select new port to host ImageStore: " port | ||
while [ $loopcheck -eq 1 ] | ||
do | ||
if [[ "$port" =~ [a-zA-Z] ]] | ||
then | ||
echo "Invalid input detected" | ||
read -p "Port conflict detected. Select new port to host ImageStore: " port | ||
else | ||
sed -i "s/8080/$port/" default.conf | ||
loopcheck=0 | ||
fi | ||
done | ||
fi | ||
|
||
#Check if sites-enabled is present and enabled in nginx.conf | ||
cd /etc/nginx | ||
if [[ ! -d "sites-enabled" ]]; then | ||
mkdir -p sites-enabled | ||
fi | ||
|
||
if ! grep -q '^include /etc/nginx/sites-enabled/' nginx.conf; then | ||
sed -ir '/^http {*/a \\tinclude /etc/nginx/sites-enabled/*.conf' nginx.conf | ||
fi | ||
|
||
cp default.conf /etc/nginx/sites-enabled/imagestore.conf | ||
cp ImageStoreFRONT /etc/init.d/ImageStoreFRONT | ||
cp ImageStoreBACK /etc/init.d/ImageStoreBACK | ||
|
||
#Init an user and the database | ||
ranpass=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | ||
|
||
su postgres -c "./postgresql.sh $ranpass" | ||
echo "PGSTRING=postgres://imagestore:$ranpass@localhost:5432/imagestore" > /etc/imagestore/backend/.env | ||
|
||
#Install node modules | ||
cd /etc/imagestore/frontend | ||
/usr/bin/npm i | ||
/usr/bin/npm run-script build | ||
cd /etc/imagestore/backend | ||
/usr/bin/npm i | ||
/usr/bin/npm install ts-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.