-
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.
- Loading branch information
1 parent
1531f0e
commit 355b904
Showing
5 changed files
with
114 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,14 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:base", | ||
"schedule:weekends" | ||
], | ||
"prHourlyLimit": 8, | ||
"packageRules": [ | ||
{ | ||
"paths": ["**"], | ||
"groupName": "backend" | ||
} | ||
] | ||
} |
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,38 @@ | ||
name: Deploy | ||
|
||
on: push | ||
|
||
jobs: | ||
|
||
build-and-deploy: | ||
name: build and deploy (main) | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Login to Docker registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: postmodern.alexdaniel.org | ||
username: 'librervac' | ||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: postmodern.alexdaniel.org/librervac-backend:${{ github.sha }} ${{ github.ref == 'refs/heads/main' && ', postmodern.alexdaniel.org/librervac-backend:latest' || '' }} | ||
- name: Set SSH key | ||
if: github.ref == 'refs/heads/main' | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_KEY }} | ||
- name: Auth | ||
if: github.ref == 'refs/heads/main' | ||
run: ssh-keyscan -H postmodern.alexdaniel.org >> ~/.ssh/known_hosts | ||
- name: Deploy | ||
if: github.ref == 'refs/heads/main' | ||
run: docker stack deploy --with-registry-auth -c compose.yaml librervac-backend | ||
env: | ||
DOCKER_HOST: ssh://[email protected] |
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,14 @@ | ||
FROM httpd:2.4.58 | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y libcgi-pm-perl libcapture-tiny-perl libdatetime-perl libcapture-tiny-perl libgeo-ip-perl | ||
|
||
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf-extra | ||
RUN cat /usr/local/apache2/conf/httpd.conf-extra >> /usr/local/apache2/conf/httpd.conf | ||
|
||
COPY ./htdocs/ /usr/local/apache2/htdocs/ | ||
COPY ./cgi-bin/ /usr/local/apache2/cgi-bin/ | ||
COPY ./config/ /usr/local/apache2/config/ | ||
|
||
# Set permissions to www-data, there's seems to be no other way to do that | ||
RUN sed -i 's/^exec /chown -R www-data:www-data \/srv\/data\n\nexec /' /usr/local/bin/httpd-foreground |
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 @@ | ||
version: "3.7" | ||
|
||
services: | ||
backend: | ||
image: postmodern.alexdaniel.org/librervac-backend:latest | ||
build: | ||
context: . | ||
volumes: | ||
- /home/librervac/data/librervac/data:/srv/data | ||
- /home/librervac/data/librervac/logs:/srv/logs | ||
networks: | ||
- caddy | ||
deploy: | ||
replicas: 1 | ||
update_config: | ||
parallelism: 1 | ||
delay: 30s | ||
order: start-first | ||
|
||
labels: | ||
caddy: librervac.org, www.librervac.org | ||
caddy.tls: [email protected] | ||
caddy.reverse_proxy: "{{upstreams 80}}" | ||
|
||
networks: | ||
caddy: | ||
external: true |
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,21 @@ | ||
LoadModule cgid_module modules/mod_cgid.so | ||
LoadModule rewrite_module modules/mod_rewrite.so | ||
|
||
ServerAdmin [email protected] | ||
DocumentRoot /usr/local/apache2/htdocs/ | ||
|
||
SetEnv WikiConfigFile /usr/local/apache2/config/config | ||
SetEnv WikiModuleDir /usr/local/apache2/config/modules | ||
SetEnv WikiDataDir /srv/data | ||
|
||
<Directory /> | ||
Options -ExecCGI -FollowSymLinks -Indexes -Includes | ||
AllowOverride None | ||
</Directory> | ||
|
||
<Directory /usr/local/apache2/htdocs/> | ||
AllowOverride All | ||
</Directory> | ||
|
||
ErrorLog /srv/logs/error.log | ||
CustomLog /srv/logs/access.log combined |