-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: full rewrite of application (#48)
* misc: trigger release * misc(deps): update dependencies (#41) * misc: rewrite (#43) * misc(repo): rebrand the project as central-command * feat(repo)!: first stone of the rewrite * feat(repo): feature parity with last attempt * misc: linter * misc: get rid of useless env for creating directories * misc: get rid of commented line in docker-compose.yml * misc: use Bob's email as example * feat: add is_active field to admin view for accounts * feat: improve models by adding help text instead of obscure comments * fix: fixes username validation doing literally nothing * misc: migration update * misc: rewrite continuation (#47) * fix: make public account data actually public * feat: readd needed html templates * fix: accounts that change their email will now have to confirm the new email * feat: attempting to log in before confirmation will now raise and explain the issue * feat: writing data to other-data will now only update keys if present or append new data if not. We also won't need a create endpoint anymore, since write will do it if the record doesn't previously exist. * feat: load environmental variables from a .env file with python-dotenv * feat: adds account verification endpoint for game servers
- Loading branch information
Showing
64 changed files
with
1,095 additions
and
982 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
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
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 |
---|---|---|
@@ -1,33 +1,27 @@ | ||
version: "3" | ||
|
||
x-django-defaults: &django_defaults | ||
build: . | ||
env_file: ./.env | ||
|
||
services: | ||
db: | ||
image: postgres | ||
image: postgres:14.1-alpine | ||
environment: | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
|
||
web_migration: | ||
<<: *django_defaults | ||
command: migrate | ||
depends_on: | ||
- db | ||
|
||
web: | ||
<<: *django_defaults | ||
depends_on: | ||
- web_migration | ||
- db | ||
build: . | ||
env_file: ./.env | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- ./src:/src | ||
command: python manage.py runserver 0.0.0.0:8000 | ||
|
||
volumes: | ||
db-data: | ||
static-volume: | ||
media-volume: |
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 |
---|---|---|
@@ -1,29 +1,37 @@ | ||
version: "3" | ||
|
||
x-django-defaults: &django_defaults | ||
image: unitystation/unitystation_auth | ||
env_file: ./.env | ||
x-common-volumes: &common-volumes | ||
volumes: | ||
- static-volume:/home/website/statics | ||
- media-volume:/home/website/media | ||
|
||
services: | ||
db: | ||
image: postgres | ||
image: postgres:14.1-alpine | ||
environment: | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
|
||
web_migration: | ||
<<: *django_defaults | ||
command: migrate | ||
depends_on: | ||
- db | ||
|
||
web: | ||
<<: *django_defaults | ||
depends_on: | ||
- web_migration | ||
image: unitystation/central-command:latest | ||
environment: | ||
- DEBUG=0 | ||
env_file: ./.env | ||
expose: | ||
- 8000 | ||
command: gunicorn central-command.wsgi:application --bind 0.0.0.0:8000 | ||
<<: *common-volumes | ||
|
||
nginx: | ||
build: ./nginx | ||
ports: | ||
- "8000:8000" | ||
- 80:80 | ||
depends_on: | ||
- web | ||
<<: *common-volumes | ||
|
||
volumes: | ||
db-data: | ||
static-volume: | ||
media-volume: |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
EMAIL_HOST=smtp.gmail.com | ||
EMAIL_PORT=587 | ||
EMAIL_HOST_USER=me@gmail.com | ||
EMAIL_HOST_USER=bob@example.com | ||
EMAIL_HOST_PASSWORD=password | ||
EMAIL_PAGE_DOMAIN=http://mydomain.com/ | ||
SECRET_KEY=MYSECRET | ||
EMAIL_PAGE_DOMAIN=http://localhost:8000 | ||
SECRET_KEY=MYSECRET | ||
DEBUG=1 | ||
DB_ENGINE=django.db.backends.postgresql | ||
DB_NAME=postgres | ||
DB_HOST=db | ||
DB_PORT=5432 |
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,7 @@ | ||
FROM nginx:1.21-alpine | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
RUN mkdir /home/website | ||
RUN mkdir /home/website/statics | ||
RUN mkdir /home/website/media | ||
COPY nginx.conf /etc/nginx/conf.d |
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 @@ | ||
upstream central_command { | ||
server web:8000; | ||
} | ||
|
||
server { | ||
|
||
listen 80; | ||
|
||
location / { | ||
proxy_pass http://central_command; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $host; | ||
proxy_redirect off; | ||
client_max_body_size 100M; | ||
} | ||
|
||
location /static/ { | ||
alias /home/website/statics/; | ||
} | ||
|
||
location /media/ { | ||
alias /home/website/media/; | ||
} | ||
} |
Oops, something went wrong.