Skip to content

Commit

Permalink
Add SFTPGo container (for webdav mostly) + add forgotten things
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayurifag committed Apr 21, 2024
1 parent a2658e3 commit 0b67882
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ Host mayurifag-prod
| Netdata | <http://netdata.mayurifag.local> | 19999 |
| Owncloud Infinite Scale | <http://ocis.mayurifag.local> | 9200 |
| Portainer | <http://portainer.mayurifag.local> | 9000 |
| SFTPGo | <https://sftp.mayurifag.local> | 8080 |
| Shadowsocks-rust | <https://ss.mayurifag.local/xray> (uses TLS) | 1080 |
| Syncthing [WebUI] | <https://st.mayurifag.local> | 8384 |
| Wallabag | <http://wallabag.mayurifag.local> | 80 |
| Watchtower | - | - |
| Webdav [SFTPGo] | <http://webdav.mayurifag.ru> | 10080 |
| Wireguard-Easy | <http://wg.mayurifag.local> | 58172 |
| Whattocommit | <http://commit.mayurifag.local> | 8080 |

Expand Down
4 changes: 4 additions & 0 deletions roles/cheatsheet/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
Make user and add default docker entrypoint.
### SFTPGo
Set {{ admin_username }} user with password, add directory.
### Files (Filebrowser/OCIS)
You have to sync files now via app. Setup iOS/Android/Mac/Win(?)
Expand Down
2 changes: 2 additions & 0 deletions roles/filebrowser/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ filebrowser_version: "v2.28.0-s6"

filebrowser_subdomain: "fb"
syncthing_subdomain: "st"

Check failure on line 12 in roles/filebrowser/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

var-naming[no-role-prefix]

Variables names from within roles should use filebrowser_ as a prefix. (vars: syncthing_subdomain)
sftpgo_subdomain: "sftp"

Check failure on line 13 in roles/filebrowser/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

var-naming[no-role-prefix]

Variables names from within roles should use filebrowser_ as a prefix. (vars: sftpgo_subdomain)
webdav_subdomain: "webdav"

Check failure on line 14 in roles/filebrowser/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

var-naming[no-role-prefix]

Variables names from within roles should use filebrowser_ as a prefix. (vars: webdav_subdomain)

filebroswer_uid: "{{ admin_uid }}"

Check failure on line 16 in roles/filebrowser/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

var-naming[no-role-prefix]

Variables names from within roles should use filebrowser_ as a prefix. (vars: filebroswer_uid)
filebroswer_gid: "{{ admin_gid }}"
32 changes: 31 additions & 1 deletion roles/filebrowser/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- "{{ filebrowser_files_directory }}"
- "{{ filebrowser_data_directory }}/config"
- "{{ filebrowser_data_directory }}/syncthing_config"
- "{{ filebrowser_data_directory }}/sftpgo_config"

- name: Touch Filebrowser database file
file:
Expand Down Expand Up @@ -64,7 +65,7 @@
- name: Syncthing Docker Container
docker_container:
name: syncthing
image: "linuxserver/syncthing"
image: linuxserver/syncthing:1.27.6
pull: true
recreate: yes
volumes:
Expand All @@ -83,3 +84,32 @@
traefik.http.routers.syncthing.rule: "Host(`{{ syncthing_subdomain }}.{{ server_hostname }}`)"
traefik.http.services.syncthing.loadbalancer.server.port: "8384"
traefik.http.routers.syncthing.middlewares: "my-headers@file"

- name: SFTPGo Docker Container
docker_container:
name: sftpgo
image: drakkan/sftpgo:v2.5.6
pull: true
recreate: yes
user: "{{ filebroswer_uid }}:{{ filebroswer_gid }}"
volumes:
- "{{ filebrowser_data_directory }}/sftpgo_config:/var/lib/sftpgo"
- "{{ filebrowser_files_directory }}:/srv/sftpgo/data/{{ admin_username }}/"
env:
TZ: "{{ server_timezone }}"
SFTPGO_WEBDAVD__BINDINGS__0__PORT: "10080"
ports:
- "2022:2022"
# - "10080:10080"
restart_policy: unless-stopped
labels:
traefik.enable: "{{ filebrowser_available_externally }}"
### Web UI ###
traefik.http.routers.sftpgo.rule: "Host(`{{ sftpgo_subdomain }}.{{ server_hostname }}`)"
traefik.http.services.sftpgo.loadbalancer.server.port: "8080"
traefik.http.routers.sftpgo.service: "sftpgo"
traefik.http.routers.sftpgo.middlewares: "my-headers@file"
### WebDAV ###
traefik.http.routers.webdav.rule: Host(`{{ webdav_subdomain }}.{{ server_hostname }}`)
traefik.http.services.webdav.loadbalancer.server.port: "10080"
traefik.http.routers.webdav.service: "webdav"

0 comments on commit 0b67882

Please sign in to comment.