Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
kklein33 committed Apr 12, 2018
1 parent 3d5af2e commit 11ea776
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 767 deletions.
149 changes: 0 additions & 149 deletions README.dev.md

This file was deleted.

73 changes: 34 additions & 39 deletions README.md
Expand Up @@ -13,40 +13,56 @@
Download seafile image, and run the image.

```
docker pull seafileltd/seafile:6.2.1
docker run -d --name seafile-server -v /root/seafile:/shared -p 80:80 seafileltd/seafile:6.2.1
docker run -d --name seafile-server -v /opt/seafile-data:/shared -p 80:80 seafileltd/seafile:6.2.1
```

Now visit `http://hostname` or `https://hostname` to open Seafile Web UI.

If you are not familiar with docker commands, refer to [docker documentation](https://docs.docker.com/engine/reference/commandline/cli/).

### How to use
### More configuration option

#### Password and plan B
#### Custom admin username and password

The default account is `me@example.com` and the password is `asecret`. It will be created when the container is first run.
The default values can also be changed by setting the container's environment variables

e.g.

docker run -d --name seafile-server -e "SEAFILE_ADMIN_EMAIL=me@example.com" -e "SEAFILE_ADMIN_PASSWORD=asecret" -v /opt/seafile-data:/shared -p 80:80 seafileltd/seafile:6.2.1

The default account is `me@example.com` and the password is `asecret`.
You must change the password when you first run the seafile server.
If you forget the admin password, you can add a new admin account and then go to the sysadmin panel to reset user password.

#### Domain

You can create `/shared/bootstrap.conf`, write the following lines.
The default value is `seafile.example.com`, you can set environ to docker container.

e.g.

docker run -d --name seafile-server -e "SEAFILE_SERVER_HOSTNAME=seafile.example.com" -v /opt/seafile-data:/shared -p 80:80 seafileltd/seafile:6.2.1

And then nginx will update up config.

#### Let's encrypt SSL certificate

[server]
server.hostname = seafile.example.com
If you set `SEAFILE_SERVER_LETSENCRYPT` to `true`, the bootstrap script would request a letsencrypt-signed SSL certificate for you.

And then restart service, nginx will update up config.
e.g.

docker run -d --name seafile-server -e "SEAFILE_SERVER_LETSENCRYPT=true" -v /opt/seafile-data:/shared -p 80:80 -p 443:443 seafileltd/seafile:6.2.1

If you want to use your own SSL certificate:
- create a folder 'shared/ssl', and put your certificate and private key under the ssl directory.
- Assume your site name is "seafile.example.com", then your certificate must have the name "seafile.example.com.crt", and the private key must have the name "seafile.example.com.key".

#### Modify configurations

The config files are under `shared/seafile/conf`. You can modify the configurations according to [Seafile manual](https://manual.seafile.com/)

After modification, run the new docker container:
After modification, restart docker container:

```
docker rm seafile-server
docker run -d --name seafile-server -v /root/seafile:/shared -p 80:80 seafileltd/seafile:6.2.1
docker restart seafile-server
```

#### Find logs
Expand All @@ -55,7 +71,6 @@ The seafile logs are under `shared/logs/seafile`.

The system logs are under `shared/logs/var-log`.


#### Add a new Admin

Enter the command below.
Expand All @@ -68,10 +83,6 @@ Enter the username and password according to the prompts.You now have a new admi

### Directory Structure

#### `/samples`

Sample container definitions you may use to bootstrap your environment. You can copy templates from here into the bootstrap directory.

#### `/shared`

Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various logfiles and upload directory outside. This allows you to rebuild containers easily without losing important information.
Expand All @@ -85,29 +96,13 @@ Placeholder spot for shared volumes. You may elect to store certain persistent i
- /shared/bootstrap.conf: This file does not exist by default. You can create it by your self, and write the configuration of files similar to the `samples` folder.


#### `/image`

Dockerfiles for Seafile.

The Docker repository will always contain the latest built version at: https://hub.docker.com/r/seafileltd/seafile/, you should not need to build the base image.

### Container Configuration

#### Let's encrypt SSL certificate

If you set `server.letsencrypt` to `true`, the bootstrap script would request a letsencrypt-signed SSL certificate for you.

```conf
server.letsencrypt = true
```

If you want to use your own SSL certificate:
- create a folder 'shared/ssl', and put your certificate and private key under the ssl directory.
- Assume your site name is "seafile.example.com", then your certificate must have the name "seafile.example.com.crt", and the private key must have the name "seafile.example.com.key".

### Upgrading Seafile Server
If you are one of the users who use the launcher update. You can refer to [upgrade from old format](https://github.com/haiwen/seafile-docker/upgrade_from_old_format.md)

ensure same version of the repo, and run start command

ensure same version of the repo, and run start command`docker run -d --name seafile-server -v /root/seafile:/shared -p 80:80 seafileltd/seafile:6.2.1 `, which would keep your seafile server up to date.
docker run -d --name seafile-server -v ${data_path}:/shared -p 80:80 seafileltd/seafile:6.2.1
which would keep your seafile server up to date.

### Troubleshooting

Expand Down
15 changes: 7 additions & 8 deletions ci/ci.sh
@@ -1,23 +1,22 @@
#!/bin/bash

version=6.2.3
set -e -x


(
cd image
# pip install docker-squash
# make base squash-base server
make base
make server
)

sudo cp samples/server.conf bootstrap/bootstrap.conf

sudo ./launcher -v start && sleep 10
sudo ./launcher stop --skip-prereqs
sudo ./launcher start --docker-args "--memory 1g" && sleep 10
sudo ./launcher restart
sudo ./launcher -v rebuild
sudo ./launcher -v rebuild --docker-args "--memory 1g"
mkdir -p /opt/seafile-docker-data
docker run -d --name seafile-server -v /opt/seafile-docker-data:/shared -p 80:80 -p 443:443 seafileltd/seafile:$version
docker stop seafile-server
docker start seafile-server
docker restart seafile-server

if [[ $TRAVIS_TAG != "" ]]; then
ci/publish-image.sh
Expand Down
2 changes: 1 addition & 1 deletion image/seafile/create_data_links.sh
Expand Up @@ -26,7 +26,7 @@ if [[ ! -e /shared/logs/seafile ]]; then
mkdir -p /shared/logs/seafile
fi
if [[ -e /shared/logs/seafile ]]; then
ln -sf /shared/logs/seafile/ /opt/seafile/logs
rm /opt/seafile/logs && ln -sf /shared/logs/seafile/ /opt/seafile/logs
fi

current_version_dir=/opt/seafile/seafile-server-${SEAFILE_VERSION}
Expand Down

0 comments on commit 11ea776

Please sign in to comment.