This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now it's getting big, Welcome aosus.org!
- Loading branch information
Showing
4 changed files
with
123 additions
and
0 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,51 @@ | ||
name: deploy-aosus-wordpress | ||
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/aosus-wordpress.yml' | ||
- 'aosus-wordpress/**' | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: aosus.org | ||
url: https://aosus.org | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Tailscale | ||
uses: tailscale/github-action@7a0b30ed3517c2244d1330e39467b95f067a33bd | ||
with: | ||
oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }} | ||
oauth-secret: ${{ secrets.TAILSCALE_SECRET }} | ||
tags: tag:deploy-ci | ||
hostname: Github-actions | ||
version: ${{ vars.TAILSCALE_VERSION }} | ||
|
||
- name: Add secrets to compose | ||
env: | ||
MARIADB_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_password }} | ||
MARIADB_ROOT_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_root_password }} | ||
run: | | ||
sed -i "s|(aosus_wordpress_mariadb_password)|$MARIADB_PASSWORD|g" $GITHUB_WORKSPACE/aosus-wordpress/docker-compose.yml | ||
sed -i "s|(aosus_wordpress_mariadb_root_password)|$MARIADB_ROOT_PASSWORD|g" $GITHUB_WORKSPACE/aosus-wordpress/docker-compose.yml | ||
- name: Start Deployment | ||
uses: FarisZR/[email protected] | ||
env: | ||
MARIADB_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_password }} | ||
MARIADB_ROOT_PASSWORD: ${{ secrets.aosus_wordpress_mariadb_root_password }} | ||
with: | ||
remote_docker_host: ${{ secrets.server_address }} | ||
tailscale_ssh: true # no need for manual private and public keys | ||
compose_file_path: aosus-wordpress/docker-compose.yml | ||
args: -p aosus-wordpress up -d --remove-orphans | ||
upload_directory: true | ||
docker_compose_directory: aosus-wordpress |
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,5 @@ | ||
file_uploads = On | ||
memory_limit = 256M | ||
upload_max_filesize = 64M | ||
post_max_size = 64M | ||
max_execution_time = 600 |
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,45 @@ | ||
networks: | ||
default: | ||
enable_ipv6: true | ||
web: | ||
external: true | ||
|
||
services: | ||
wordpress: | ||
image: wordpress:6.4.3-apache@sha256:01fb62485c4a70c13a7f5fd02d56235c904b748f810be29027a337f1400dc4ea | ||
container_name: aosus-wordpress | ||
restart: always | ||
environment: | ||
WORDPRESS_DB_HOST: mariadb | ||
WORDPRESS_DB_USER: aosusworddb | ||
WORDPRESS_DB_NAME: wordpress | ||
WORDPRESS_DB_PASSWORD: (aosus_wordpress_mariadb_password) | ||
# WORDPRESS_DEBUG: true | ||
networks: | ||
default: | ||
web: | ||
volumes: | ||
- /home/aosus/aosus-wordpress/html:/var/www/html:rw | ||
configs: | ||
- source: custom-ini | ||
target: /usr/local/etc/php/conf.d/custom.ini | ||
|
||
mariadb: | ||
image: mariadb:11.2.2@sha256:a9385bb457ebf4600da632cc331f11a5328c582bfb492aa76517282bcae1dcc9 | ||
restart: always | ||
environment: | ||
MARIADB_USER: aosusworddb | ||
MARIADB_DATABASE: wordpress | ||
MARIADB_PASSWORD: (aosus_wordpress_mariadb_password) | ||
MARIADB_AUTO_UPGRADE: true | ||
#MARIADB_RANDOM_ROOT_PASSWORD: '1' | ||
MARIADB_ROOT_PASSWORD: (aosus_wordpress_mariadb_root_password | ||
volumes: | ||
- mariadb:/var/lib/mysql | ||
|
||
volumes: | ||
mariadb: | ||
|
||
configs: | ||
custom-ini: | ||
file: /home/aosus/aosus-wordpress/custom.ini |
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,22 @@ | ||
aosus.org { | ||
header { | ||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" | ||
} | ||
handle_errors { | ||
# handle_errors is only triggerd on erros from Caddy and not the proxy, that's why we don't specifiy any errors here. | ||
rewrite * /proxy_error_page.html | ||
file_server { | ||
root /srv/ | ||
} | ||
} | ||
# https://matrix-org.github.io/synapse/latest/reverse_proxy.html#caddy-v2 | ||
header /.well-known/matrix/* Content-Type application/json | ||
header /.well-known/matrix/* Access-Control-Allow-Origin * | ||
respond /.well-known/matrix/server `{"m.server": "matrix.aosus.org:443"}` | ||
# add sliding sync availability (https://github.com/matrix-org/sliding-sync) | ||
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://matrix.aosus.org:443"},"org.matrix.msc3575.proxy":{"url":"https://syncv3-matrix-proxy.aosus.org"}}` | ||
# redirect old links | ||
redir /t/* https://discourse.aosus.org{uri} permanent | ||
reverse_proxy aosus-wordpress:80 | ||
encode zstd gzip | ||
} |