1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-02 19:16:23 -07:00

Move dbconnect.sh to a script

Also update frontend README and booststrap start text
This commit is contained in:
Eggbertx 2022-02-05 14:17:24 -08:00
parent 03e74ea8a4
commit 9656b9f3d0
5 changed files with 21 additions and 17 deletions

11
devtools/dbconnect.sh Normal file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# used for connecting to gochan's database whether it's using MySQL/MariaDB or PostgreSQL
if [ "$DBTYPE" = "mysql" ] || [ -z "$DBTYPE" ]; then
mysql -stu gochan -D gochan -pgochan
elif [ "$DBTYPE" = "postgresql" ]; then
psql -U gochan -h 127.0.0.1 gochan
else
echo "DB type '$DBTYPE' not supported"
fi

View file

@ -15,5 +15,6 @@ Depending on your npm version, you may need to run this if you have the most up
sudo npm install -g n
sudo n latest
sudo npm install -g npm
hash -d npm
npm install
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -109,17 +109,7 @@ if [ "$DBTYPE" = "postgresql" ]; then
fi
# a convenient script for connecting to the db, whichever type we're using
cat << EOF >/home/vagrant/dbconnect.sh
#!/usr/bin/env bash
if [ "$DBTYPE" = "mysql" ] || [ -z "$DBTYPE" ]; then
mysql -stu gochan -D gochan -pgochan
elif [ "$DBTYPE" = "postgresql" ]; then
psql -U gochan -h 127.0.0.1 gochan
else
echo "DB type '$DBTYPE' not supported"
fi
EOF
cp /vagrant/devtools/dbconnect.sh /home/vagrant/dbconnect.sh
chmod +x /home/vagrant/dbconnect.sh
cat <<EOF >>/home/vagrant/.bashrc
@ -147,10 +137,12 @@ cd /vagrant
# fi
cat - <<EOF
Server set up. To access the virtual machine, run 'vagrant ssh'. Then, to start the gochan server,
run 'sudo systemctl start gochan.service'. The virtual machine is set to run gochan on startup, so you
will not need to do this every time you start it. You can access it from a browser at http://172.27.0.3/
Server set up. To access the virtual machine, run 'vagrant ssh'.
To start the gochan server, run 'sudo systemctl start gochan.service'.
To have gochan run at startup, run 'sudo systemctl enable gochan.service'
You can access it from a browser at http://192.168.56.3/
The first time gochan is run, it will create a simple /test/ board.
If you want to do frontend development, you'll need to run 'apt install npm'
If you want to do frontend development, see frontend/README.md
EOF