-
Notifications
You must be signed in to change notification settings - Fork 2
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
0 parents
commit 4be233b
Showing
20 changed files
with
534 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,4 @@ | ||
.kitchen/ | ||
.venv/ | ||
srv/ | ||
Gemfile.lock |
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,33 @@ | ||
driver: | ||
name: docker | ||
|
||
platforms: | ||
- name: centos-7 | ||
driver_config: | ||
image: corux/centos7-salt | ||
cap_add: | ||
- SYS_ADMIN | ||
run_command: /usr/sbin/init | ||
- name: debian-8 | ||
driver_config: | ||
image: debian:8 | ||
|
||
provisioner: | ||
name: salt_solo | ||
formula: seafile | ||
vendor_path: srv/salt | ||
pillars-from-files: | ||
seafile.sls: pillar.example | ||
pillars: | ||
top.sls: | ||
base: | ||
"*": | ||
- seafile | ||
state_top: | ||
base: | ||
"*": | ||
- seafile.client | ||
- seafile.server | ||
|
||
suites: | ||
- name: default |
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,11 @@ | ||
sudo: required | ||
services: | ||
- docker | ||
|
||
install: | ||
- bundle install | ||
- sudo pip install -r test-requirements.txt | ||
- gitshelf install | ||
|
||
script: | ||
- kitchen test |
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,8 @@ | ||
name: seafile | ||
os: CentOS, Fedora, Debian | ||
os_family: RedHat, Debian | ||
version: 201601 | ||
release: 1 | ||
dependencies: epel | ||
summary: Formula for installing Seafile | ||
description: Formula for installing Seafile Server and Client |
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 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "test-kitchen" | ||
gem "kitchen-docker" | ||
gem "kitchen-salt" |
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,9 @@ | ||
books: | ||
- book: "srv/formulas/nginx" | ||
git: "https://github.com/saltstack-formulas/nginx-formula.git" | ||
- book: "srv/salt/nginx" | ||
link: "../formulas/nginx/nginx" | ||
- book: "srv/formulas/epel" | ||
git: "https://github.com/saltstack-formulas/epel-formula.git" | ||
- book: "srv/salt/epel" | ||
link: "../formulas/epel/epel" |
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 @@ | ||
seafile: | ||
server: | ||
version: 5.0.4 | ||
config: | ||
seahub_fastcgi: False |
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,30 @@ | ||
{% from 'seafile/map.jinja' import client with context %} | ||
{% if grains['os_family'] == 'RedHat' %} | ||
include: | ||
- epel | ||
{% endif %} | ||
{% if client.get('repo') %} | ||
seafile-repo-key: | ||
cmd.run: | ||
- name: rpm --import {{ client.repo_key }} | ||
- unless: rpm -qi gpg-pubkey-{{ client.repo_keyid }} | ||
seafile-repo: | ||
pkgrepo.managed: | ||
- humanname: Seafile Client repository | ||
- baseurl: {{ client.repo }} | ||
- gpgcheck: 1 | ||
- gpgkey: {{ client.repo_key }} | ||
- require: | ||
- cmd: seafile-repo-key | ||
{% endif %} | ||
seafile-client: | ||
pkg.installed: | ||
- name: seafile-client-qt | ||
{% if client.get('url') %} | ||
- sources: | ||
- seafile: {{ client.url }} | ||
{% endif %} |
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,15 @@ | ||
seafile: | ||
server: | ||
version: 5.0.4 | ||
flavour: x86-64 | ||
dir: /opt/seafile | ||
user: seafile | ||
group: seafile | ||
upgrade: minor-upgrade.sh | ||
config: | ||
name: Seafile | ||
domain: seafile.example.com | ||
admin: [email protected] | ||
password: SecretPassword | ||
seahub_fastcgi: true | ||
seahub_port: "8000" |
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,30 @@ | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: seafile | ||
# Required-Start: $local_fs $remote_fs $network | ||
# Required-Stop: $local_fs | ||
# Default-Start: 1 2 3 4 5 | ||
# Default-Stop: | ||
# Short-Description: Starts Seafile | ||
# Description: Starts Seafile | ||
### END INIT INFO | ||
|
||
function status () { | ||
if pgrep -f "seafile-controller" 2>/dev/null 1>&2; then | ||
echo "Seafile is running" | ||
exit 0 | ||
else | ||
echo "Seafile is not running" | ||
exit 1 | ||
fi | ||
} | ||
|
||
case $1 in | ||
"status" ) | ||
status; | ||
;; | ||
* ) | ||
sudo -u {{ config.user }} {{ config.latest }}/seafile.sh $@ | ||
;; | ||
esac |
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,13 @@ | ||
[Unit] | ||
Description=Seafile server | ||
Wants=network-online.target | ||
|
||
[Service] | ||
ExecStart={{ config.latest }}/seafile.sh start | ||
ExecStop={{ config.latest }}/seafile.sh stop | ||
User={{ config.user }} | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,33 @@ | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: seahub | ||
# Required-Start: $local_fs $remote_fs $network seafile | ||
# Required-Stop: $local_fs | ||
# Default-Start: 1 2 3 4 5 | ||
# Default-Stop: | ||
# Short-Description: Starts Seahub | ||
# Description: Starts Seahub | ||
### END INIT INFO | ||
|
||
function status () { | ||
if pgrep -f "manage.py run_gunicorn" 2>/dev/null 1>&2; then | ||
echo "Seahub is running" | ||
exit 0 | ||
else | ||
echo "Seahub is not running" | ||
exit 1 | ||
fi | ||
} | ||
|
||
case $1 in | ||
"status" ) | ||
status; | ||
;; | ||
"start" ) | ||
sudo -u {{ config.user }} {{ config.latest }}/seahub.sh {{ config.seahub_startcmd }} | ||
;; | ||
* ) | ||
sudo -u {{ config.user }} {{ config.latest }}/seahub.sh $@ | ||
;; | ||
esac |
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 @@ | ||
[Unit] | ||
Description=Seafile hub | ||
Wants=network-online.target | ||
After=seafile.service | ||
|
||
[Service] | ||
ExecStart={{ config.latest }}/seahub.sh {{ config.seahub_startcmd }} | ||
ExecStop={{ config.latest }}/seahub.sh stop | ||
User={{ config.user }} | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,30 @@ | ||
{% import_yaml 'seafile/defaults.yaml' as default_settings %} | ||
{% import_yaml 'seafile/os_map.yaml' as os_map %} | ||
{% import_yaml 'seafile/os_family_map.yaml' as os_family_map %} | ||
{% set default_settings = salt['grains.filter_by'](os_family_map, grain='os_family', merge=default_settings) %} | ||
{% set default_settings = salt['grains.filter_by'](os_map, grain='os', merge=default_settings) %} | ||
|
||
{% set seafile = salt['pillar.get']('seafile', default=default_settings.get('seafile'), merge=True) %} | ||
{% set server = seafile.server %} | ||
{% set client = seafile.client %} | ||
|
||
{% if server.flavour == 'x86-64' or server.flavour == 'i386' %} | ||
{% set url = 'https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_' + server.version + '_' + server.flavour + '.tar.gz' %} | ||
{% elif seafile.server.flavour == 'rpi' %} | ||
{% set url = 'https://github.com/haiwen/seafile-rpi/releases/download/v' + server.version + '/seafile-server_stable_' + server.version + '_pi.tar.gz' %} | ||
{% endif %} | ||
|
||
{% if server.config.seahub_fastcgi %} | ||
{% set startcmd = 'start-fastcgi ' + server.config.seahub_port %} | ||
{% else %} | ||
{% set startcmd = 'start ' + server.config.seahub_port %} | ||
{% endif %} | ||
|
||
{% do server.update({ | ||
'url': server.get('url', url), | ||
'pid': server.dir + '/pids/seaf-server.pid', | ||
'source': '/tmp/seafile-server-' + server.version + '.tar.gz', | ||
'current_install': server.dir + '/seafile-server-' + server.version, | ||
'latest': server.dir + '/seafile-server-latest', | ||
'seahub_startcmd': startcmd | ||
}) %} |
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,23 @@ | ||
RedHat: | ||
seafile: | ||
client: | ||
repo_key: https://copr-be.cloud.fedoraproject.org/results/pkerling/seafile/pubkey.gpg | ||
repo_keyid: 3413633f | ||
server: | ||
use_systemd: True | ||
dependencies: | ||
- python-setuptools | ||
- python-ldap | ||
- python-pillow | ||
- sqlite | ||
Debian: | ||
seafile: | ||
client: | ||
url: https://bintray.com/artifact/download/seafile-org/seafile/seafile_5.0.1_amd64.deb | ||
server: | ||
use_systemd: False | ||
dependencies: | ||
- python-setuptools | ||
- python-ldap | ||
- python-imaging | ||
- sqlite3 |
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,8 @@ | ||
CentOS: | ||
seafile: | ||
client: | ||
repo: https://copr-be.cloud.fedoraproject.org/results/pkerling/seafile/epel-$releasever-$basearch/ | ||
Fedora: | ||
seafile: | ||
client: | ||
repo: https://copr-be.cloud.fedoraproject.org/results/pkerling/seafile/fedora-$releasever-$basearch/ |
Oops, something went wrong.