Update README.org

dotnetflags
C-xC-c 5 years ago committed by GitHub
parent 28293ecdb9
commit d196c55a12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,8 +24,8 @@ declarations. Update your hecking browser.
** Backend ** Backend
*** Prerequisites *** Prerequisites
- .NET core 3.1 - .NET Core 3.1
- Mariadb / mysql - MariaDB / MySQL
*** .NET dependancies *** .NET dependancies
- Nito.AsyncEX - Nito.AsyncEX
@ -33,38 +33,47 @@ declarations. Update your hecking browser.
- MySql.Data - MySql.Data
- Microsoft.AspNetCore.Mvc.NewtonsoftJson - Microsoft.AspNetCore.Mvc.NewtonsoftJson
- Microsoft.AspNetCore.StaticFiles - Microsoft.AspNetCore.StaticFiles
- Microsoft.AspNetCore.Razor
- Microsoft.EntityFrameworkCore.SqlServer - Microsoft.EntityFrameworkCore.SqlServer
- Microsoft.EntityFrameworkCore.Tools - Microsoft.EntityFrameworkCore.Tools
- Microsoft.VisualStudio.Web.CodeGeneration.Design
- Magick.NET-Q8-AnyCPU - Magick.NET-Q8-AnyCPU
*** Setup *** Setup
1. Install .NET 1. Install .NET Core
2. Clone and build the BantFlags solution. 2. Clone and build the BantFlags solution.
3. Create the database using [[https://github.com/C-xC-c/BantFlags/blob/master/Environment/database.sql][database.sql]]. 3. Create the database using [[https://github.com/C-xC-c/BantFlags/blob/master/Environment/database.sql][database.sql]].
+ *Change the password*. + *Change the password*.
4. configure =BantFlags/appsettings.example.json= with your connection 4. configure =BantFlags/appsettings.example.json= with your connection
string and webroot (where you'll serve the flags from *without a string and webroot (where you'll serve the flags from *without a
trailing /*) and rename it to =appsettings.json= trailing /*) and rename it to =appsettings.json=
+ The location of the BantFlags application and the served content + The location of the BantFlags application and the served content
are not necessarly the same. If you leave it empty, or provide a are not necessarly the same. If you leave it empty, or provide a
nonexistant path the application will look for the =wwwroot= nonexistant path the application will look for the =wwwroot=
folder inside the working directory. folder inside the working directory.
+ For example, you may place =BantFlags.dll= and + For example, you may place =BantFlags.dll= and
=appsettings.json= in =/etc/bantflags/= and point =webroot= at =appsettings.json= in =/etc/bantflags/= and point =webroot= at
=/var/www/html= and bantflags will server static content from =/var/www/html= and bantflags will server static content from
that directory, or leave =webroot= empty and bantflags will look that directory, or leave =webroot= empty and bantflags will look
for static content in =/etc/bantflags/wwwroot= for static content in =/etc/bantflags/wwwroot=
5. Add flags to the backend either by querying the database directly 5. Create a folder called =keys= in the directory you will be hosting
bantflags from.
+ E.G. =/etc/bantflags/keys/=
+ ASP.NET Core uses some cryptic bullshit anti forgery token when
processing HTML forms, and it's unable to persistantly store the
decryption keys in memory on GNU + Linux. This directory will
store said keys when you or users upload flags to /upload. The
path is hardcoded to =AppDomain.CurrentDomain.BaseDirectory=,
I.E. wherever the program is.
6. Add flags to the backend either by querying the database directly
and placing images *with the same name* in ={webroot}/flags/= or and placing images *with the same name* in ={webroot}/flags/= or
by using /upload. by using /upload.
6. Configure your webserver of choice to forward requests to kestral 7. Configure your webserver of choice to forward requests to kestral
+ [[https://github.com/C-xC-c/BantFlags/blob/master/Environment/nginx.conf][Example nginx config.]] + [[https://github.com/C-xC-c/BantFlags/blob/master/Environment/nginx.conf][Example nginx config.]]
7. Run with =dotnet BantFlags.dll= or create a service to run it as a 8. Run with =dotnet BantFlags.dll= or create a service to run it as a
daemon. daemon.
+ [[https://github.com/C-xC-c/BantFlags/blob/master/Environment/bantflags.service][Example systemd service.]] + [[https://github.com/C-xC-c/BantFlags/blob/master/Environment/bantflags.service][Example systemd service.]]
8. ??? 9. ???
9. profit. 10. profit.
*** Database *** Database
Tables look like this: Tables look like this:
@ -100,4 +109,4 @@ The API is 1:1 compatable with all previous versions of bantflags, but
also encodes a new =version= variable when getting flags which allows also encodes a new =version= variable when getting flags which allows
for breaking changes in the script while the backend only sends data for breaking changes in the script while the backend only sends data
it knows is parsable. See [[https://github.com/C-xC-c/BantFlags/tree/master/Docs/][Docs/{endpoint}]] it knows is parsable. See [[https://github.com/C-xC-c/BantFlags/tree/master/Docs/][Docs/{endpoint}]]
for version compatibility. for version compatibility.

Loading…
Cancel
Save