Compare commits

..

38 Commits

Author SHA1 Message Date
87a62a57cc chore: publish 1.10.0+1.28.0 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-05-10 14:49:49 -04:00
e62cce703f Merge pull request 'sftp' (#4) from MIR/custom-html:sftp into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
2025-05-10 18:45:20 +00:00
25df83d7f7 Merge branch 'main' into sftp
Some checks failed
continuous-integration/drone/pr Build is failing
2025-05-10 18:41:06 +00:00
0638fd60ce chore: publish 1.9.0+1.28.0 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-04-30 13:36:49 -04:00
3wc
642ba666e6 chore: publish 1.8.1+1.27.4 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-04-10 19:06:52 +01:00
3wc
64dad451a8 chore: publish 1.8.0+1.27.4 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2025-04-10 18:58:48 +01:00
68ccd5aaa0 Merge branch 'main' into sftp
Some checks failed
continuous-integration/drone/pr Build is failing
2025-01-25 23:53:46 +00:00
ba1c22690b switched to key-based auth for SSH, added docs
Some checks failed
continuous-integration/drone/pr Build is failing
2025-01-25 18:51:02 -05:00
29c4030009 Fix owner on /content 2025-01-25 00:13:24 -05:00
8d3acfbd5d add optional feature for sftp webroot access, wip 2025-01-22 21:59:44 -05:00
3caf27beab Merge pull request 'add nginx configuration option for single page apps' (#3) from singlepage into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #3
2025-01-22 20:26:03 +00:00
fb2a287802 add nginx configuration option for single page apps
Some checks failed
continuous-integration/drone/pr Build is failing
2025-01-16 19:50:54 -05:00
c788b36f13 Update .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-08 10:09:12 -08:00
3wc
565230650d chore: publish 1.7.1+1.27.2 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-10-04 13:33:30 -04:00
3wc
18c564a354 chore: publish 1.7.0+1.27.1 release
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-02 13:27:33 -04:00
3wc
4653c0ea66 chore: publish 1.6.0+1.26.0 release
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2024-05-11 12:18:27 -03:00
05ed929274 Update README.md
All checks were successful
continuous-integration/drone/push Build is passing
fixed syntax on cp command
2024-02-14 21:05:08 +00:00
3wc
3d74c22248 chore: publish 1.5.1+1.25.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-11-09 17:35:58 +00:00
3wc
56d7a64a1b chore: publish 1.5.0+1.25.1 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-08 19:33:37 +01:00
d2308332e4 Merge pull request 'add optional redirection + fix 404s' (#2) from redirect into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #2
2023-05-30 13:51:40 +00:00
3wc
697fe25259 chore: publish 1.4.0+1.24.0 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-27 15:44:50 -04:00
3wc
bad32dd353 chore: publish 1.3.2+1.23.3 release
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-28 11:39:16 -04:00
3wc
f25c45c5c6 Change category to "Development"
[ci skip]
2023-03-28 11:37:29 -04:00
6563cfc7e6 add optional redirection
Some checks failed
continuous-integration/drone/pr Build is failing
2023-03-16 11:48:17 +13:00
3wc
bb9945b38d Switch to self-hosted stack-ssh-deploy image [mass update]
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-21 11:49:55 -08:00
3wc
c50f5397bf Update abra syntax in examples (finally) [mass update]
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-19 16:02:27 -08:00
3wc
2a3021744d Further Drone fix
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-19 15:53:48 -08:00
3wc
a68a31b45c chore: publish 1.3.1+1.23.3 release
All checks were successful
continuous-integration/drone/tag Build is passing
2023-01-19 15:52:35 -08:00
3wc
977a81d493 Fix Drone, switch to new catalogue generation..
Some checks failed
continuous-integration/drone/push Build is failing
..and add Drone badge
2023-01-19 15:50:43 -08:00
3wc
ba0f1986a0 Add backupbot backups 2023-01-19 15:49:13 -08:00
3wc
02d0a39db4 chore: publish 1.3.0+1.23.3 release
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-18 13:23:37 -08:00
3wc
c7d557cc6c Remove more VIM swapfiles
Some checks failed
continuous-integration/drone/push Build is failing
2022-10-26 15:09:21 -04:00
3wc
c8ffbe96fe Remove accidental vim swapfile
Some checks failed
continuous-integration/drone/push Build is failing
2022-06-14 10:21:14 +01:00
3wc
29041d2c81 chore: publish 1.2.1+1.21.6 release
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-02 15:32:55 +02:00
3wc
232a953788 chore: publish 1.2.0+1.21.3 release
Some checks failed
continuous-integration/drone/push Build is failing
2022-03-23 12:01:09 +02:00
3wc
2158fa1fc4 Add git-pull functionality 💅 2022-03-23 11:57:26 +02:00
3wc
b8dec9d61a Add optional traefik-forward-auth login 2021-11-23 13:44:16 +02:00
3wc
8550b91477 Mass README update 2021-11-23 13:44:09 +02:00
10 changed files with 163 additions and 17 deletions

View File

@ -3,27 +3,37 @@ kind: pipeline
name: deploy to swarm-test.autonomic.zone name: deploy to swarm-test.autonomic.zone
steps: steps:
- name: deployment - name: deployment
image: decentral1se/stack-ssh-deploy:latest image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings: settings:
host: swarm-test.autonomic.zone host: swarm-test.autonomic.zone
stack: custom_html stack: custom_html
purge: true purge: true
networks:
- proxy
deploy_key: deploy_key:
from_secret: drone_ssh_swarm_test from_secret: drone_ssh_swarm_test
environment: environment:
DOMAIN: custom-html.swarm-test.autonomic.zone DOMAIN: custom-html.swarm-test.autonomic.zone
STACK_NAME: custom_html STACK_NAME: custom_html
LETS_ENCRYPT_ENV: production LETS_ENCRYPT_ENV: production
NGINX_DEFAULT_CONF_VERSION: v1
ENTRYPOINT_CONF_VERSION: v1
trigger: trigger:
branch: branch:
- main - main
--- ---
kind: pipeline kind: pipeline
name: recipe release name: generate recipe catalogue
steps: steps:
- name: release a new version - name: release a new version
image: thecoopcloud/drone-abra:latest image: plugins/downstream
settings: settings:
command: recipe custom-html release server: https://build.coopcloud.tech
deploy_key: token:
from_secret: abra_bot_deploy_key from_secret: drone_abra-bot_token
fork: true
repositories:
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag

View File

@ -9,3 +9,24 @@ COMPOSE_FILE="compose.yml"
# Single Sign On via Traefik "file provider" # Single Sign On via Traefik "file provider"
#COMPOSE_FILE="$COMPOSE_FILE:compose.sso.yml" #COMPOSE_FILE="$COMPOSE_FILE:compose.sso.yml"
# Git-pull regularly
#COMPOSE_FILE="$COMPOSE_FILE:compose.git-pull.yml"
#GIT_REPO_URL="https://git.coopcloud.tech/dalmationer/hexbomb.gay"
#CRON_SCHEDULE="*/1 * * * *"
# Optionally redirect the entire domain or a sub-path:
# path under which you want to redirect all URLs (with trailing slash):
#REDIRECT_FROM_PATH=/
# full URL of target domain (and optionally path) with trailing slash:
#REDIRECT_TO_URL=https://coopcloud.tech/
# temporary or permanent redirect? (uncomment one)
#REDIRECT_TYPE=redirect
#REDIRECT_TYPE=permanent
# Optionally handle all URL requests using a single file (commonly index.html)
#SINGLE_PAGE_SITE_HANDLER=/index.html
# Enable an SSH server to allow SFTP uploads to the web root
#COMPOSE_FILE="$COMPOSE_FILE:compose.sftp.yml"
#PUBLIC_KEY="ssh-ed25519 AAAAC3NzaJ1lZDI1NTE5AAAAIXqf4nxUxuGmLOaxXXXXXXXXoM/GwhcrAgmtbgXToaYmCJ user@host" # Replace with a public key you generate

View File

@ -1,9 +1,11 @@
# Custom HTML # Custom HTML
[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/custom-html/status.svg)](https://build.coopcloud.tech/coop-cloud/custom-html)
Custom HTML website, served using Nginx. Custom HTML website, served using Nginx.
<!-- metadata --> <!-- metadata -->
* **Category**: Apps * **Category**: Development
* **Status**: 2, beta * **Status**: 2, beta
* **Image**: [`nginx`](https://hub.docker.com/_/nginx), 4, upstream * **Image**: [`nginx`](https://hub.docker.com/_/nginx), 4, upstream
* **Healthcheck**: No * **Healthcheck**: No
@ -18,13 +20,28 @@ Custom HTML website, served using Nginx.
1. Set up Docker Swarm and [`abra`] 1. Set up Docker Swarm and [`abra`]
2. Deploy [`coop-cloud/traefik`] 2. Deploy [`coop-cloud/traefik`]
3. `abra app new custom-html` 3. `abra app new custom-html`
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to 4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy` 5. `abra app deploy YOURAPPDOMAIN`
6. Copy your files to the container, using something like 6. Copy your files to the container, using something like
``` ```
abra app YOURAPPDOMAIN cp index.html app:/usr/share/nginx/html abra app cp YOURAPPDOMAIN index.html app:/usr/share/nginx/html
``` ```
## Allowing upload via SSH/SFTP
To allow management of your site's files using scp, rsync or other SSH-based tools:
1. If you don't already have one, generate an SSH keypair using `ssh-keygen`
1. `abra app config YOURAPPDOMAIN`
2. Uncomment these lines and add your public key:
```
#COMPOSE_FILE="$COMPOSE_FILE:compose.sftp.yml"
#PUBLIC_KEY="ssh-ed25519 AAAAC3NzaJ1lZDI1NTE5AAAAIXqf4nxUxuGmLOaxXXXXXXXXoM/GwhcrAgmtbgXToaYmCJ user@host" # Replace with a public key you generate
```
3. `abra app undeploy YOURAPPDOMAIN`
3. `abra app deploy YOURAPPDOMAIN`
4. Test the SSH connection: `ssh -p 2220 sftp@YOURAPPDOMAIN`
5. You can copy local files into the server's web root with a command like: `scp -r -P 2220 * sftp@YOURAPPDOMAIN:/content`
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra [`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik [`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik

View File

@ -1 +1,2 @@
export NGINX_DEFAULT_CONF_VERSION=v1 export NGINX_DEFAULT_CONF_VERSION=v6
export ENTRYPOINT_CONF_VERSION=v3

26
compose.git-pull.yml Normal file
View File

@ -0,0 +1,26 @@
version: "3.8"
services:
git:
environment:
- GIT_REPO_URL
image: alpine/git:v2.47.2
entrypoint: /docker-entrypoint.sh
volumes:
- content:/git
configs:
- source: entrypoint_conf
target: /docker-entrypoint.sh
mode: 0555
deploy:
mode: replicated
replicas: 0
labels:
- "swarm.cronjob.enable=true"
- "swarm.cronjob.schedule=${CRON_SCHEDULE:-*/5 * * * *}"
restart_policy:
condition: none
configs:
entrypoint_conf:
name: ${STACK_NAME}_entrypoint_conf_${ENTRYPOINT_CONF_VERSION}
file: entrypoint.git-pull.sh

41
compose.sftp.yml Normal file
View File

@ -0,0 +1,41 @@
version: "3.8"
services:
ssh:
image: lscr.io/linuxserver/openssh-server:latest
networks:
- proxy
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- USER_NAME=sftp
- PUBLIC_KEY
volumes:
- content:/content:rw
ports:
- 2220:2222
deploy:
restart_policy:
condition: on-failure
# The following is an admittedly hacky way of setting the owner
# of the `content` volume to the unprivileged `sftp` user, so
# that content can be transferred through the unprivileged sshd process
# using `scp` etc.
sshstart:
image: lscr.io/linuxserver/openssh-server:latest
user: root
depends_on:
- ssh
deploy:
restart_policy:
condition: none
volumes:
- content:/content:rw
entrypoint: [ "bash", "-c", "sleep 10 && chown -R 1000:1000 /content"]
volumes:
content:
networks:
proxy:
external: true

View File

@ -3,7 +3,7 @@ version: "3.8"
services: services:
app: app:
image: nginx:1.21.3 image: nginx:1.28.0
networks: networks:
- proxy - proxy
deploy: deploy:
@ -19,9 +19,14 @@ services:
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" - "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=1.1.0+1.21.3" - "coop-cloud.${STACK_NAME}.version=1.10.0+1.28.0"
- "backupbot.backup=true"
- "backupbot.backup.path=/usr/share/nginx/html"
environment: environment:
DEFAULT_CONF_FILE: /etc/nginx/conf.d/default.conf - DEFAULT_CONF_FILE=/etc/nginx/conf.d/default.conf
- REDIRECT_FROM_PATH
- REDIRECT_TO_URL
- REDIRECT_TYPE
volumes: volumes:
- content:/usr/share/nginx/html - content:/usr/share/nginx/html
configs: configs:
@ -40,7 +45,8 @@ volumes:
configs: configs:
nginx_default_conf: nginx_default_conf:
name: ${STACK_NAME}_nginx_default_conf_${NGINX_DEFAULT_CONF_VERSION} name: ${STACK_NAME}_nginx_default_conf_${NGINX_DEFAULT_CONF_VERSION}
file: default.conf file: default.conf.tmpl
template_driver: golang
networks: networks:
proxy: proxy:

View File

@ -10,10 +10,22 @@ server {
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ $uri.html;
{{ if env "REDIRECT_TO_URL" }}
rewrite ^{{ env "REDIRECT_FROM_PATH" }}(.*)$ {{ env "REDIRECT_TO_URL" }}$1 {{ env "REDIRECT_TYPE" }};
{{ end }}
{{ if env "SINGLE_PAGE_SITE_HANDLER" }}
try_files $uri $uri/ {{ env "SINGLE_PAGE_SITE_HANDLER" }} =404;
{{ else }}
try_files $uri $uri/ $uri.html =404;
{{ end }}
} }
#error_page 404 /404.html; error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html # redirect server error pages to the static page /50x.html
# #

11
entrypoint.git-pull.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if [ ! -d /git/.git ]; then
echo "No repo found, emptying /git/ directory"
rm -r /git/*
echo "Cloning $GIT_REPO_URL into /git"
git clone "$GIT_REPO_URL" /git
else
echo "Updating /git"
git pull
fi

1
release/1.10.0+1.28.0 Normal file
View File

@ -0,0 +1 @@
Adds optional sftp support