Skip to content

Commit

Permalink
Auth fix and some tweaks (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrofaria committed Sep 27, 2023
1 parent ebbbaf2 commit e7e7b3a
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-stretch
FROM golang:1.21.1-bullseye

RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.21.0
* Add Morocoo nationality #245
* Update go to 1.21.1
* Update go dependencies
* Fix Authorization issues
* Fix css from read only server list #247
* Fix README #228

## 1.20.1
* Add event metadata field #223
* Hide /admin on chat command #233
Expand Down
64 changes: 6 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ The successor of [acweb](https://github.com/assetto-corsa-web/acweb)! accweb let
1. [Features](#features)
2. [Changelog](#changelog)
3. [Installation](#installation)
4. ~~[Docker](#docker)~~
5. [Backup](#backup)
6. [Contribute and support](#support)
7. [Build release](#release)
8. [Links](#links)
9. [License](#license)
10. [ACCWeb Discord Server](#discord)
4. [Backup](#backup)
5. [Contribute and support](#support)
6. [Build release](#release)
7. [Links](#links)
8. [License](#license)
9. [ACCWeb Discord Server](#discord)

## Features
<a name="features" />
Expand All @@ -30,7 +29,6 @@ The successor of [acweb](https://github.com/assetto-corsa-web/acweb)! accweb let
* import/export server configuration files
* delete server configurations
* three different permissions: admin, mod and read only (using three different passwords)
* status page for non logged in users
* easy setup
* no database required
* simple configuration using environment variables
Expand Down Expand Up @@ -60,56 +58,6 @@ I recommend to setup an SSL certificate, but that's out of scope for this instru

**Note that you have to install [wine](https://www.winehq.org/) if you're on Linux.**

## Docker
<a name="docker" />

**Docker is not supported at the moment, you can try using the image, but I highly recommend waiting for v2 to be finished (which will have a new image).**

Keep in mind that this docker image doesn't include accserver.exe file, you will have to copy it manually to the /accserver directory inside the container after it started. Check the volumes section for details.

### Docker Image

To build the image manually:

* git clone https://github.com/assetto-corsa-web/accweb
* `cd accweb`
* `docker build --pull --rm -f "Dockerfile" -t accweb:latest "."`

An official image is availabe at: https://hub.docker.com/r/kugel/accweb. It can be pulled using: `docker pull kugel/accweb` and started by running `docker run -it accweb`.

By default this image exposes port 8080 in order to have the web UI working. If you want to run the game server you will need to open the ports manually. For example, if I want to run two server instances I need to open two differents port:

```
docker run -it accweb -p 8080:8080 -p 2600:2600 -p 2601:2601
```

This will allow you to run a server on 2600 and 2601 port.

### Docker Compose File

The docker-compose file at the root of the git repository can be used to deploy accweb. It comes with pre-defined env variables and volumes. **Keep in mind that this compose file is not secured. Please follow the documentation and check the recommandations.**

### Volumes

Here is the list of docker volumes and their purpose:
* `accweb`: Contains the accweb project
* `accserver`: Must contain the `accserver.exe`. It has to be put there manually as we can't bundle it inside docker
* `sslcerts`: This volume is dedicated to SSL certificates

### Environment Variables List

| Variable name | Description | Default value |
|---|---|---|
| ACCWEB_HOST | ACC web server host URL | 0.0.0.0:8080 (not secure) |
| ACCWEB_ENABLE_TLS | Enable or disable SSL | false (not secure) |
| ACCWEB_CERT_FILE | Certificate file location | /sslcerts/certificate.crt |
| ACCWEB_PRIV_FILE | Certificate key location | /sslcerts/private.key |
| ACCWEB_ADMIN_PASSWORD | Admin password | weakadminpassword |
| ACCWEB_MOD_PASSWORD | Moderator password | weakmodpassword |
| ACCWEB_RO_PASSWORD | Read only password | weakropassword |
| ACCWEB_LOGLEVEL | App log level | info |
| ACCWEB_CORS | Default CORS origin | "*" (accept all sources) |

## Backup
<a name="backup" />

Expand Down
84 changes: 54 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,30 +1,54 @@
module github.com/assetto-corsa-web/accweb

go 1.16

require (
github.com/appleboy/gin-jwt/v2 v2.9.1
github.com/bytedance/sonic v1.8.7 // indirect
github.com/gin-contrib/cors v1.4.0
github.com/gin-gonic/gin v1.9.0
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.20.8 // indirect
github.com/go-playground/validator/v10 v10.12.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.3 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.2
github.com/swaggo/swag v1.16.1
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/text v0.9.0
golang.org/x/tools v0.8.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1
)
module github.com/assetto-corsa-web/accweb

go 1.21

require (
github.com/appleboy/gin-jwt/v2 v2.9.1
github.com/gin-contrib/cors v1.4.0
github.com/gin-gonic/gin v1.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
github.com/swaggo/swag v1.16.2
golang.org/x/text v0.13.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/bytedance/sonic v1.10.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.15.4 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/knz/go-libedit v1.10.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
golang.org/x/arch v0.5.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
Loading

0 comments on commit e7e7b3a

Please sign in to comment.