Cleaned up the update instructions and moved them into their own home.

Added more code blocks to make the instructions easier to follow.
This commit is contained in:
Azareal 2018-08-26 15:56:56 +10:00
parent 90821ebe39
commit 5ff6d8b6ee
3 changed files with 101 additions and 65 deletions

View File

@ -71,6 +71,10 @@ On Windows, you might want to try the [GosoraBootstrapper](https://github.com/Az
Consult [installation](https://github.com/Azareal/Gosora/blob/master/docs/installation.md) for instructions on how to install Gosora. Consult [installation](https://github.com/Azareal/Gosora/blob/master/docs/installation.md) for instructions on how to install Gosora.
# Updating
Consult [updating](https://github.com/Azareal/Gosora/blob/master/docs/updating.md) for instructions on how to update Gosora.
# Running the program # Running the program
@ -78,17 +82,17 @@ Consult [installation](https://github.com/Azareal/Gosora/blob/master/docs/instal
If you have setup a service, you can run: If you have setup a service, you can run:
./pre-run-linux `./pre-run-linux`
service gosora start `service gosora start`
You can then, check Gosora's current status (to see if it started up properly) with: You can then, check Gosora's current status (to see if it started up properly) with:
service gosora status `service gosora status`
And you can stop it with: And you can stop it with:
service gosora stop `service gosora stop`
If you haven't setup a service, you can run `./run-linux`, although you will be responsible for finding a way to run it in the background, so that it doesn't close when the terminal does. If you haven't setup a service, you can run `./run-linux`, although you will be responsible for finding a way to run it in the background, so that it doesn't close when the terminal does.
@ -96,44 +100,7 @@ One method might be to use: https://serverfault.com/questions/34750/is-it-possib
*Windows* *Windows*
Run run.bat, e.g. double-clicking on it. Run `run.bat`, e.g. double-clicking on it.
*Updating Dependencies*
Dependencies are little libraries Gosora relies on to function.
You can update themn by running `update-deps.bat` on Windows or `./update-deps-linux` on Linux. These dependencies do not include Go or MySQL, those have to be updated separately.
You'll need to restart the server after you change a template or update Gosora, e.g. with `run.bat` or killing the process and running `./run-linux` or via `./pre-run-linux` followed by `service gosora restart`.
# Updating the software
You will first want to follow the instructions in the section for updating dependencies.
The update system is currently under development, but you can run `dev-update.bat` or `quick-update-linux` in `/home/gosora/src`to update your instance to the latest commit and to update the associated database schema, etc.
If you're logged in as `root`, then you might want to switch to the `gosora` user with `su gosora`, you can switch back by typing `exit`.
If this is the first time you've done an update as the `gosora` user, then you might have to configure Git, simply do:
git config --global user.name "Lalala"
git config --global user.email "lalala@example.com"
Replace that name and email with whatever you like. This name and email only applies to the `gosora` user. If you see a zillion modified files pop-up, then that is due to you changing their permissions, don't worry about it.
If you get an access denied error, then you might need to run `chown -R gosora /home/gosora` and `chgrp -R www-data /home/gosora` to fix the ownership of the files.
If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first have to create a copy of `./schema/schema.json` named `./schema/lastSchema.json`, and then, you'll overwrite the files with the new ones.
After that, you'll need to run `go build ./patcher` on Windows or the following code block on Linux:
```
cd ./patcher
go build -o Patcher
mv ./Patcher ..
```
Once you've done that, you just need to run `patcher.exe` (Windows) or `./Patcher` to apply the latest patches to the database, etc.
# How do I install plugins? # How do I install plugins?

View File

@ -1,6 +1,6 @@
# Windows Installation # Windows Installation
Run install.bat, e.g. double-click on it. You will also have to start-up MySQL, which if you're using Wnmp or friends is just a matter of opening that program and starting the MySQL process via it. Run `install.bat`, e.g. double-click on it. You will also have to start-up MySQL, which if you're using Wnmp or friends is just a matter of opening that program and starting the MySQL process via it.
Follow the instructions shown on the screen. Follow the instructions shown on the screen.
@ -11,7 +11,7 @@ To navigate to the folder the software is in at any time in the future, you can
Simple installations are usually recommended for trying out the software rather than for deploying it in production as they are less hardened and have fewer service facilities. Simple installations are usually recommended for trying out the software rather than for deploying it in production as they are less hardened and have fewer service facilities.
This might also be fine, if you're using something else as a reverse-proxy (e.g. Nginx). This might also be fine, if you're using something else as a reverse-proxy (e.g. Nginx or Apache).
First, we need somewhere for the software to live, if you're familiar with Linux, then you might have some ideas of your own, otherwise we may just go for `~/gosora`. First, we need somewhere for the software to live, if you're familiar with Linux, then you might have some ideas of your own, otherwise we may just go for `~/gosora`.
@ -23,21 +23,23 @@ And now, we're going to rename the downloaded folder from Gosora to gosora becau
We can now hop into that folder with the same command we used for getting to the home folder: We can now hop into that folder with the same command we used for getting to the home folder:
cd gosora `cd gosora`
And now, we'll change the permissions on the installer script, otherwise we'll get an access denied error: And now, we'll change the permissions on the installer script, otherwise we'll get an access denied error:
chmod 755 ./install-linux `chmod 755 ./install-linux`
Just run this to run the installer: Just run this to run the installer:
./install-linux `./install-linux`
Follow the instructions shown on the screen. Follow the instructions shown on the screen.
# Linux Installation with Systemd Service # Linux Installation with Systemd Service
You will need administrator privileges on the machine (aka root) to add a service.
First, you will need to jump to the place where you want to put the code, we will use `/home/gosora/src/` here, but if you want to use something else, then you'll have to modify the service file with your own path (but *never* in a folder where the files are automatically served by a webserver). First, you will need to jump to the place where you want to put the code, we will use `/home/gosora/src/` here, but if you want to use something else, then you'll have to modify the service file with your own path (but *never* in a folder where the files are automatically served by a webserver).
If you place it in `/www/`, `/public_html/` or any similar folder, then there's a chance that your server might be compromised. If you place it in `/www/`, `/public_html/` or any similar folder, then there's a chance that your server might be compromised.
@ -48,43 +50,43 @@ If you're just casually setting up an installation on your own machine which isn
Please type the following commands into the console and hit enter: Please type the following commands into the console and hit enter:
cd /home/ `cd /home/`
useradd gosora `useradd gosora`
passwd gosora `passwd gosora`
Type in a strong password for the `gosora` user, please oh please... Don't use "password", just... don't, okay? Type in a strong password for the `gosora` user, please oh please... Don't use "password", just... don't, okay? Also, you might want to note this down somewhere.
mkdir gosora `mkdir gosora`
cd gosora `cd gosora`
git clone https://github.com/Azareal/Gosora `git clone https://github.com/Azareal/Gosora`
mv Gosora src `mv Gosora src`
chown -R gosora ../gosora `chown -R gosora ../gosora`
chgrp -R www-data ../gosora `chgrp -R www-data ../gosora`
cd src `cd src`
chmod 2775 logs `chmod 2775 logs`
chmod 755 ./install-linux `chmod 755 ./install-linux`
./install-linux `./install-linux`
Follow the instructions shown on the screen. Follow the instructions shown on the screen.
You will also want to setup a service to manage Gosora more easily, although this will require administrator priviledges on the machine: We will also want to setup a service:
chmod 755 ./pre-run-linux `chmod 755 ./pre-run-linux`
cp ./gosora_example.service /lib/systemd/system/gosora.service `cp ./gosora_example.service /lib/systemd/system/gosora.service`
systemctl daemon-reload `systemctl daemon-reload`
# Advanced Installation # Advanced Installation

67
docs/updating.md Normal file
View File

@ -0,0 +1,67 @@
# Updating Gosora (Windows)
The update system is currently under development, but you can run `dev-update.bat` to update your instance to the latest commit and to update the associated database schema, etc.
If you run into any issues doing so, please open an issue: https://github.com/Azareal/Gosora/issues/new
If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first have to create a copy of `./schema/schema.json` named `./schema/lastSchema.json`, and then, you'll overwrite the files with the new ones with `git pull origin master`.
After that, you'll need to run `go build ./patcher`.
Once you've done that, you just need to run `patcher.exe` to apply the latest patches to the database, etc.
# Updating a software with a simple installation (Linux)
The update system is currently under development, but you can run `dev-update-linux` to update your instance to the latest commit and to update the associated database schema, etc.
If you run into any issues doing so, please open an issue: https://github.com/Azareal/Gosora/issues/new
If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first have to create a copy of `./schema/schema.json` named `./schema/lastSchema.json`, and then, you'll overwrite the files with the new ones with `git pull origin master`.
After that, you'll need to run the following code block:
```
cd ./patcher
go build -o Patcher
mv ./Patcher ..
```
Once you've done that, you just need to run `./Patcher` to apply the latest patches to the database, etc.
# Updating a software using systemd (Linux)
You will first want to follow the instructions in the section for updating dependencies.
The update system is currently under development, but you can run `quick-update-linux` in `/home/gosora/src`to update your instance to the latest commit and to update the associated database schema, etc.
If you run into any issues doing so, please open an issue: https://github.com/Azareal/Gosora/issues/new
If you're using a systemd service, then you might want to switch to the `gosora` user with `su gosora` (you may be prompted for the password to the user), you can switch back by typing `exit`.
If this is the first time you've done an update as the `gosora` user, then you might have to configure Git, simply do:
`git config --global user.name "Lalala"`
`git config --global user.email "lalala@example.com"`
Replace that name and email with whatever you like. This name and email only applies to the `gosora` user. If you see a zillion modified files pop-up, then that is due to you changing their permissions, don't worry about it.
If you get an access denied error, then you might need to run `chown -R gosora /home/gosora` and `chgrp -R www-data /home/gosora` to fix the ownership of the files.
If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first have to create a copy of `./schema/schema.json` named `./schema/lastSchema.json`, and then, you'll overwrite the files with the new ones with `git pull origin master`.
After that, you'll need to run:
```
cd ./patcher
go build -o Patcher
mv ./Patcher ..
```
Once you've done that, you just need to run `./Patcher` to apply the latest patches to the database, etc.
# Updating Dependencies
Dependencies are third party scripts and programs which Gosora relies on to function. The instructions here do not cover updating MySQL / MariaDB or Go.
You can update themn by running `update-deps.bat` on Windows or `./update-deps-linux` on Linux.
You'll need to restart the server after you change a template or update Gosora, e.g. with `run.bat` or killing the process and running `./run-linux` or via `./pre-run-linux` followed by `service gosora restart`.