Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilledheart committed Jul 9, 2014
1 parent fff0325 commit 7ad469f
Show file tree
Hide file tree
Showing 47 changed files with 149 additions and 188 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Seafile
#Introduction

Seafile is an open source cloud storage system with advanced
support for file syncing, privacy protection and teamwork.
Expand Down
3 changes: 1 addition & 2 deletions build_seafile/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## How to Build Seafile
# How to Build Seafile

You can build Seafile from our source code package or from the Github repo directly.

Expand Down
3 changes: 1 addition & 2 deletions build_seafile/linux.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Linux
# Linux

#### Preparation

Expand Down
3 changes: 1 addition & 2 deletions build_seafile/osx.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#Seafile
## Mac OS X
# Mac OS X

Setup development environment
-----------------------------
Expand Down
3 changes: 1 addition & 2 deletions build_seafile/server.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Server
# Server

## Preparation

Expand Down
3 changes: 1 addition & 2 deletions build_seafile/windows.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Seafile
## Windows
# Windows
3 changes: 1 addition & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Changelog
# Changelog

####v3.0.4 Server

Expand Down
3 changes: 1 addition & 2 deletions client/client.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Client
# Client
This manual explains how to setup and run Seafile client from a pre-built package.

## Components
Expand Down
3 changes: 1 addition & 2 deletions client/seafile_cli.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Seafile CLI
# Seafile CLI

init
----
Expand Down
3 changes: 1 addition & 2 deletions contribution.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Contribution
# Contribution

## Licensing
Seafile and its desktop and mobile clients are published under the GPLv3.
Expand Down
2 changes: 1 addition & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Deploying Seafile
# Deploying and Upgrading Seafile

Here we describe how to deploy Seafile from prebuild binary packages.

Expand Down
3 changes: 1 addition & 2 deletions deploy/add_memcached.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seahub
## Use memcache
# Add memcached

Seahub caches items(avatars, profiles, etc) on file system by default(/tmp/seahub_cache/). You can replace with Memcached.
After install **python-memcache**, add the following lines to **seahub_settings.py**.
Expand Down
3 changes: 1 addition & 2 deletions deploy/common_problems_for_setting_up_server.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Common Problems for Setting up Server
# Common Problems for Setting up Server

#### Failed to upload/download file online

Expand Down
3 changes: 1 addition & 2 deletions deploy/components.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Components Overview
# Components Overview

## Server

Expand Down
3 changes: 1 addition & 2 deletions deploy/customize_email_notifications.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Customize Email Notifications
# Customize Email Notifications

**Note:** Subject line may vary between different releases, this is based on Release 2.0.1. Restart Seahub so that your changes take effect.

Expand Down
14 changes: 8 additions & 6 deletions deploy/deploy_Seafile_behind_NAT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Deploy Seafile behind NAT

A lot of people want to deploy a seafile server in their LAN, and access it from the WAN.

To achieve this, you need:
Expand All @@ -16,7 +18,7 @@ To achieve this, you need:

## Setup the server

First, you should follow the guide on [Download and Setup Seafile Server](using_sqlite.md) to setup your Seafile server.
First, you should follow the guide on [Download and Setup Seafile Server](using_sqlite.md) to setup your Seafile server.

Before you continue, make sure:

Expand All @@ -27,15 +29,15 @@ Before you continue, make sure:

### Ensure Your Router Supports Port Forwarding

First, ensure your router supports port forwarding.
First, ensure your router supports port forwarding.

- Login to the web adminstration page of your router. If you don't know how to do this, you should find the instructions on the manual of the router. If you have no maunal, just google **"XXX router administration page"** where `XXX` is your router's brand.

- Navigate around in the adminstration page, and check if there is a tag which contains a word such as "forward", "advanced". If your router supports it, chances are that you can find the port forwarding related settings there.
- Navigate around in the adminstration page, and check if there is a tag which contains a word such as "forward", "advanced". If your router supports it, chances are that you can find the port forwarding related settings there.

### Setup Port Forwarding Rules

Seafile server is composed of several components. You need to configure port forward for all the components listed below.
Seafile server is composed of several components. You need to configure port forward for all the components listed below.

<table>
<tr>
Expand Down Expand Up @@ -82,9 +84,9 @@ If your port forwarding is not working, the reasons may be:
- Your router may need a restart
- You network may be down
### Set SERVICE_URL
### Set SERVICE_URL
"SERVICE_URL" in `ccnet.conf` is used to generate the download/upload link for files when you browse files online. Set it using your WAN IP.
"SERVICE_URL" in `ccnet.conf` is used to generate the download/upload link for files when you browse files online. Set it using your WAN IP.
```
SERVICE_URL = http://<Your WAN IP>:8000
Expand Down
7 changes: 4 additions & 3 deletions deploy/deploy_Seahub_at_Non-root_domain.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
This documentation will talk about how to deploy Seafile Web using Apache/Nginx at Non-root directory of the website(e.g., www.example.com/seafile/).
# Deploy Seahub at Non-root domain
This documentation will talk about how to deploy Seafile Web using Apache/Nginx at Non-root directory of the website(e.g., www.example.com/seafile/).

**Note:** We assume you have read [[Deploy Seafile with nginx]] or [[Deploy Seafile with apache]].

Expand Down Expand Up @@ -40,7 +41,7 @@ server {
# fastcgi_param HTTPS on; # enable this line only if https is used
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;
}
}

location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
Expand All @@ -55,7 +56,7 @@ server {
}
</pre>

You need also to modify `SERVICE_URL` and `HTTP_SERVER_ROOT` (see below).
You need also to modify `SERVICE_URL` and `HTTP_SERVER_ROOT` (see below).

## Deploy with Apache

Expand Down
3 changes: 1 addition & 2 deletions deploy/deploy_with_apache.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Deploy with Apache
# Config Seahub with Apache

## Prepare

Expand Down
3 changes: 1 addition & 2 deletions deploy/deploy_with_nginx.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Deploy with nginx
# Config Seahub with Nginx

## Prepare

Expand Down
3 changes: 1 addition & 2 deletions deploy/deploy_with_windows.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Deploy with Windows
# Deploy with Windows

## Download/Uncompress
###Install Python 2.7
Expand Down
11 changes: 5 additions & 6 deletions deploy/https_with_apache.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Enabling Https with Apache
# Enabling Https with Apache

## Generate SSL digital certificate with OpenSSL

Expand Down Expand Up @@ -32,7 +31,7 @@ Then modify your Apache configuration file. Here is a sample:
DocumentRoot /var/www
Alias /media /home/user/haiwen/seafile-server-latest/seahub/media

SSLEngine On
SSLEngine On
SSLCertificateFile /path/to/cacert.pem
SSLCertificateKeyFile /path/to/privkey.pem

Expand Down Expand Up @@ -81,7 +80,7 @@ HTTP_SERVER_ROOT = 'https://www.myseafile.com/seafhttp'

The picture at the end of [this document](components.md) may help you understand seafile server better

There are two components in Seafile server, Seahub and HttpServer. HttpServer only servers for raw file uploading/downloading, it listens on 8082. Seahub, that serving all the other pages, is still listen on 8000. But under https, Seahub should listen as in fastcgi mode on 8000 (run as ./seahub.sh start-fastcgi). And as in fastcgi mode, when you visit http://domain:8000 directly, it should return an error page.
There are two components in Seafile server, Seahub and HttpServer. HttpServer only servers for raw file uploading/downloading, it listens on 8082. Seahub, that serving all the other pages, is still listen on 8000. But under https, Seahub should listen as in fastcgi mode on 8000 (run as ./seahub.sh start-fastcgi). And as in fastcgi mode, when you visit http://domain:8000 directly, it should return an error page.

When a user visit https://domain.com/home/my/, Apache receives this request and sends it to Seahub via fastcgi. This is controlled by the following config items:

Expand All @@ -93,11 +92,11 @@ When a user visit https://domain.com/home/my/, Apache receives this request and
RewriteRule ^/(seahub.*)$ /seahub.fcgi/$1 [QSA,L,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

and

FastCGIExternalServer /var/www/seahub.fcgi -host 127.0.0.1:8000


When a user click a file download link in Seahub, Seahub reads the value of HTTP_SERVER_ROOT and redirects the user to address `https://domain.com/seafhttp/xxxxx/`. `https://domain.com/seafhttp` is the value of HTTP_SERVER_ROOT. Here, the `HTTP_SERVER` means the HttpServer component of Seafile, which only serves for raw file downloading/uploading.
When a user click a file download link in Seahub, Seahub reads the value of HTTP_SERVER_ROOT and redirects the user to address `https://domain.com/seafhttp/xxxxx/`. `https://domain.com/seafhttp` is the value of HTTP_SERVER_ROOT. Here, the `HTTP_SERVER` means the HttpServer component of Seafile, which only serves for raw file downloading/uploading.

When Apache receives the request at 'https://domain.com/seafhttp/xxxxx/', it proxies the request to HttpServer, which is listening at 127.0.0.1:8082. This is controlled by the following config items:

Expand Down
15 changes: 7 additions & 8 deletions deploy/https_with_nginx.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Enabling Https with Nginx
# Enabling Https with Nginx

Here we use self-signed SSL digital certificate for free. If you use a paid ssl certificate from some authority, just skip the first step.

Expand All @@ -23,7 +22,7 @@ Assume you have configured nginx as
```nginx
server {
listen 80;
server_name www.yourdoamin.com;
server_name www.yourdoamin.com;
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
}
Expand All @@ -32,7 +31,7 @@ Assume you have configured nginx as
ssl on;
ssl_certificate /etc/ssl/cacert.pem; # path to your cacert.pem
ssl_certificate_key /etc/ssl/privkey.pem; # path to your privkey.pem
server_name www.yourdoamin.com;
server_name www.yourdoamin.com;
# ......
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
Expand All @@ -55,12 +54,12 @@ Here is the sample configuration file:
ssl on;
ssl_certificate /etc/ssl/cacert.pem; # path to your cacert.pem
ssl_certificate_key /etc/ssl/privkey.pem; # path to your privkey.pem
server_name www.yourdoamin.com;
server_name www.yourdoamin.com;
location / {
fastcgi_pass 127.0.0.1:8000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
Expand All @@ -71,10 +70,10 @@ Here is the sample configuration file:
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
access_log /var/log/nginx/seahub.access.log;
error_log /var/log/nginx/seahub.error.log;
}
}
location /seafhttp {
rewrite ^/seafhttp(.*)$ $1 break;
proxy_pass http://127.0.0.1:8082;
Expand Down
3 changes: 1 addition & 2 deletions deploy/install_seafile_server_as_a_windows_service.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Install Seafile Server as a Windows Service
# Install Seafile Server as a Windows Service

###Why you may want to install Seafile Server as a Windows service

Expand Down
3 changes: 1 addition & 2 deletions deploy/migrate_from_sqlite_to_mysql.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Migrate From SQLite to MySQL
# Migrate From SQLite to MySQL

First make sure the python module for MySQL is installed. On Ubuntu, use `apt-get install python-mysqldb` to install it.

Expand Down
3 changes: 1 addition & 2 deletions deploy/ports_used_by_seafile_windows_server.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Ports used by Seafile Windows Server
# Ports used by Seafile Windows Server

Seafile server has several components, so several TCP ports are used.
##The two configuration files
Expand Down
3 changes: 1 addition & 2 deletions deploy/seahub_customization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Seahub customization
# Seahub customization
## Customize Seahub Logo and Css

Assume that you are using version 2.1.0. Create a folder `custom` under `seafile-server-2.1.0/seahub/media`. Put all the customization files here. The upgrade script will copy the folder to `seafile-server-2.1.1/seahub/media` when you upgrade to version 2.1.1.
Expand Down
3 changes: 1 addition & 2 deletions deploy/server_configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Server Configuration
# Server Configuration

This manual explains how to change various config options for Seafile server. We
assume that you've [Download-and-setup-seafile-server](using_sqlite.md).
Expand Down
4 changes: 3 additions & 1 deletion deploy/start_Seafile_at_system_bootup.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Start Seafile at System Bootup

For Ubuntu
----------

Expand Down Expand Up @@ -419,7 +421,7 @@ Create systemd service files, change **${seafile\_dir}** to your
[Unit]
Description=Seafile
# add mysql.service or postgresql.service depending on your database to the line below
After=network.target
After=network.target

[Service]
Type=oneshot
Expand Down
3 changes: 1 addition & 2 deletions deploy/using_firewall.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Firewall/NAT settings
# Firewall/NAT settings

A lot of people want to deploy a seafile server in their LAN, and access it from the WAN.

Expand Down
3 changes: 1 addition & 2 deletions deploy/using_ldap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Using LDAP
# Configure Seafile to use LDAP
The current code of seahub assumes that user name to be email address, so it's not possible to log in with UNIX user names or Windows Domain user names now. The support may be added later.

Seafile will find a user both from database and LDAP. LDAP will be tried first. Note that the Seafile admin account created during setup is always stored in sqlite/mysql database.
Expand Down
3 changes: 1 addition & 2 deletions deploy/using_logrotate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Set up logrotate for server
# Set up logrotate for server

## How it works

Expand Down
5 changes: 2 additions & 3 deletions deploy/using_mysql.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Using MySQL
# Deploying Seafile with MySQL

This manual explains how to setup and run seafile server from a pre-built package with MySQL.

Expand Down Expand Up @@ -151,7 +150,7 @@ Please choose a way to initialize seafile databases:
```


Which one to choose depends on if you have the root password.
Which one to choose depends on if you have the root password.

* If you choose "1", you need to provide the root password. The script would create the databases and a new user to access the databases
* If you choose "2", the ccnet/seafile/seahub databases must have already been created, either by you, or someone else.
Expand Down
3 changes: 1 addition & 2 deletions deploy/using_sqlite.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Deploying Seafile with SQLite
# Deploying Seafile with SQLite

## Quickstart

Expand Down
4 changes: 1 addition & 3 deletions develop/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# Seafile

## Develop Documents
# Develop Documents

3 changes: 1 addition & 2 deletions develop/code_standard.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Seafile
## Code Standard
# Code Standard

The source code of seafile is ISO/IEC 9899:1999 (E) (a.k.a. C99) compatible.

Expand Down
Loading

0 comments on commit 7ad469f

Please sign in to comment.