-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added docker-compose for dev. Added dev build build and push job for dockerhub * Moved cors layer to check if /api now is not guarded * Added logging for error in response * Removed too strict validation rules for credentials * fix: x-subdmain was overwritten on correct request. Updated nginx-template and nginx now waits for server * proxy-fix: New nginx config as the previous one failed with subdomain * archive-fix: Remove skipping first component in path of entry. Zip archive should not containt root folder. * assets-fix: Remove root folder inside zips to pass tests. The root dir is not skipped now due to previous commit * tests-fix: enable logging to see error message in gh actions. Lokal tests work fine * fmt: for tests * tests-fix: disable logging to see error message in gh actions. That was gh issue * fmt: remove unused import * openapi-client: add build and publih with gh actions * fix-deploy: nginx now waits for server in dev also * fix-deploy: publsh to pypi
- Loading branch information
Showing
36 changed files
with
1,411 additions
and
1,338 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Test" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "dev" # matches every branch | ||
|
||
jobs: | ||
push-to-registry: | ||
name: "Build and push Docker image to Docker Hub" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Check out the repo" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Log in to Docker Hub" | ||
uses: "docker/login-action@v2" | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: "Build and push Docker image" | ||
uses: "docker/build-push-action@v3" | ||
with: | ||
context: . | ||
push: true | ||
tags: clowzed/sero:dev-unstable |
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,6 +1,6 @@ | ||
[package] | ||
name = "sero" | ||
version = "0.2.5" | ||
version = "0.2.6" | ||
edition = "2021" | ||
authors = ["clowzed <[email protected]>"] | ||
description = "Muiltidomain static site hosting" | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,69 @@ | ||
version: "3" | ||
|
||
services: | ||
database: | ||
image: postgres:16 | ||
user: postgres | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_DB=sero | ||
- POSTGRES_PASSWORD=1234 | ||
|
||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
volumes: | ||
- pgdata:/var/lib/postgresql/data | ||
|
||
|
||
proxy: | ||
image: nginx:alpine3.18-slim | ||
environment: | ||
- DOLLAR=$ | ||
- SERVER_PORT=8080 | ||
- SERVER=server | ||
# Edit this | ||
- DOMAIN= | ||
- ZONE= | ||
# End of edit | ||
volumes: | ||
- ./nginx-templates:/etc/nginx/templates | ||
ports: | ||
- 443:443 | ||
- 80:80 | ||
links: | ||
- server | ||
depends_on: | ||
- server | ||
|
||
server: | ||
image: clowzed/sero:dev-unstable | ||
build: . | ||
depends_on: | ||
database: | ||
condition: service_healthy | ||
volumes: | ||
- server-files:/app/sites-uploads | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
- DATABASE_URL=postgresql://postgres:1234@database/sero | ||
- PORT=8080 | ||
# You can edit this section | ||
# Empty means no limits | ||
- MAX_USERS=1 | ||
- MAX_SITES_PER_USER=100 | ||
- MAX_BODY_LIMIT_SIZE=10000000 # 10mb | ||
- RUST_LOG=none,sero=trace | ||
- JWT_SECRET=mysuperstrongjwtscret | ||
# end of section | ||
- JWT_TTL_SECONDS=120 | ||
- SQLX_LOGGING=true | ||
- UPLOAD_FOLDER=./sites-uploads | ||
|
||
|
||
volumes: | ||
server-files: | ||
pgdata: |
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 |
---|---|---|
|
@@ -35,6 +35,8 @@ services: | |
- 80:80 | ||
links: | ||
- server | ||
depends_on: | ||
- server | ||
|
||
server: | ||
image: clowzed/sero | ||
|
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,10 +1,22 @@ | ||
map $http_host $subdomain { | ||
~^(?<subdomain>[a-zA-Z0-9-]+)\.${DOMAIN}\.${ZONE}${DOLLAR} $subdomain; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name ~^(?<subdomain>[a-zA-Z0-9-]+)\.${DOMAIN}\.${ZONE}${DOLLAR}; | ||
|
||
location / { | ||
proxy_set_header X-Subdomain $subdomain; | ||
proxy_pass http://${SERVER}:${SERVER_PORT}; | ||
} | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name ~^(?<subdomain>\w*)\.${DOMAIN}.${ZONE}${DOLLAR}; | ||
server_name ${DOMAIN}.${ZONE}; | ||
|
||
location / { | ||
# Always set the X-subdomain header with the value from the subdomain in the URL | ||
proxy_set_header x-subdomain $subdomain; | ||
proxy_pass http://${SERVER}:${SERVER_PORT}/; | ||
proxy_pass http://${SERVER}:${SERVER_PORT}; | ||
} | ||
} |
Oops, something went wrong.