services : ajout seafile

This commit is contained in:
Gitouche 2021-05-26 22:11:53 +02:00
parent 593563def3
commit 7a0d656a0a
4 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
podman generate systemd --files --name podman-seafile
mkdir -p ~/.config/systemd/user/
cp *.service ~/.config/systemd/user/
systemctl --user enable pod-podman-seafile.service

79
podman-seafile/README.md Normal file
View File

@ -0,0 +1,79 @@
# seafile-compose
Créée le dimanche 17 janvier 2021
Procédures
----------
### Première installation
SELinux pose des soucis lors des premières écritures sur les volumes. Lors de la toute première exécution - initialisation de l'espace, passer en
# AS ROOT
setenforce 0
# AS podman-user
$ podman-compose up -d
$ podman logs -f seafile # wait for init process ending
$ podman pod stop podman-seafile
# AS ROOT
setenforce 1
### Bind sur 0.0.0.0 pour remonter la conf nginx sur l'hôte
cd ~/.local/share/containers/storage/volumes/podman-seafile_seafile-data/_data/seafile/conf/
#### Dans gunicorn.conf.py
bind = "0.0.0.0:8000"
#### Dans seafdav.conf
[WEBDAV]
port = 8080
host = 0.0.0.0
#### Dans seafile.conf
[fileserver]
port = 8082
host = 0.0.0.0
### email
dans [~/.local/share/containers/storage/volumes/podman-seafile_seafile-data/_data/seafile/conf/seahub_settings.py](.local/share/containers/storage/volumes/podman-seafile_seafile-data/_data/seafile/conf/seahub_settings.py) , ajouter :
EMAIL_USE_TLS = False
EMAIL_HOST = 'backdrifts.garbaye.fr'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 25
DEFAULT_FROM_EMAIL = '[noreply@seafile.garbaye.fr](mailto:noreply@seafile.garbaye.fr)'
SERVER_EMAIL = '[noreply@seafile.garbaye.fr](mailto:noreply@seafile.garbaye.fr)'
### soucis d'URL
Changer les URL dans l'interface d'admin!!
Administrateur systeme
SERVICE_URL
### Reconstruire le pod - conserver les données
# AS podman-user
$ cd podman-seafile
$ podman system renumber
$ podman-compose up -d
$ podman logs -f seafile # wait for process ending
### MAJ seafile suite maj image source officiel docker
# as podman-seafile
# <https://hub.docker.com/r/seafileltd/seafile-mc/tags?page=1&ordering=last_updated>
# podman images --digests
podman pull docker.io/seafileltd/seafile-mc:latest
systemctl --user stop pod-podman-seafile.service
podman-compose down
podman-compose up -d
podman logs -f seafile # wait for process ending
# as root
/home/podman-seafile/podman-seafile/update-seahub-media.sh
# as podman-seafile
podman generate systemd --files --name podman-seafile
cp *.service [~/.config/systemd/user/](.config/systemd/user)
podman pod stop podman-seafile
systemctl --user daemon-reload
systemctl --user enable --now pod-podman-seafile.service
podman logs -f seafile # wait for process ending

View File

@ -0,0 +1,45 @@
version: '2.0'
services:
db:
image: mariadb:10.1
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=${GARBAYE_SEAFILE_MYSQL_ROOT_PASSWORD} # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- seafile-mysql:/var/lib/mysql:Z # Requested, specifies the path to MySQL data persistent store.
networks:
- seafile-net
memcached:
image: memcached:1.5.6
container_name: seafile-memcached
command: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-mc:8.0.5
container_name: seafile
ports:
- "127.0.0.1:8000:8000"
- "127.0.0.1:8080:8080"
- "127.0.0.1:8082:8082"
volumes:
- seafile-data:/shared:Z # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=${GARBAYE_SEAFILE_MYSQL_ROOT_PASSWORD} # Requested, the value shuold be root's password of MySQL service.
- TIME_ZONE=Etc/UTC # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=laposte-seafile@garbaye.fr # Specifies Seafile admin user, default is 'me@example.com'.
- SEAFILE_ADMIN_PASSWORD=${GARBAYE_SEAFILE_ADMIN_PASSWORD} # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=seafile.garbaye.fr # Specifies your host name if https is enabled.
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
rm -rf /tmp/seahub
su - podman-seafile -c "podman cp seafile:/opt/seafile/seafile-server-latest/seahub /tmp"
mkdir -p /var/www/seafile/seafile-server-latest/
rm -rf /var/www/seafile/seafile-server-latest/seahub
mv -v /tmp/seahub /var/www/seafile/seafile-server-latest/
rm -rf /var/www/seafile/seahub-data
cp -a ~podman-seafile/.local/share/containers/storage/volumes/seafile-compose_seafile-data/_data/seafile/seahub-data /var/www/seafile/
restorecon -RF /var/www/seafile
chown -R nginx:nginx /var/www/seafile