Commit 99ee56d2ebaee27d5c58c90af66228268db294be

Authored by Kload
1 parent 353bbee124
Exists in master

Add sample config

Showing 2 changed files with 245 additions and 1 deletions Inline Diff

1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Retrieve arguments 3 # Retrieve arguments
4 domain=$1 4 domain=$1
5 path=$2 5 path=$2
6 admin_passwd=$3 6 admin_passwd=$3
7 7
8 # Check domain/path availability 8 # Check domain/path availability
9 sudo yunohost app checkurl $domain$path -a owncloud 9 sudo yunohost app checkurl $domain$path -a owncloud
10 if [[ ! $? -eq 0 ]]; then 10 if [[ ! $? -eq 0 ]]; then
11 exit 1 11 exit 1
12 fi 12 fi
13 13
14 # Generate random password 14 # Generate random password
15 db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p') 15 db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p')
16 16
17 # Use 'owncloud' as database name and user 17 # Use 'owncloud' as database name and user
18 db_user=owncloud 18 db_user=owncloud
19 19
20 # Initialize database and store mysql password for upgrade 20 # Initialize database and store mysql password for upgrade
21 sudo yunohost app initdb $db_user -p $db_pwd 21 sudo yunohost app initdb $db_user -p $db_pwd
22 sudo yunohost app setting owncloud mysqlpwd -v $db_pwd 22 sudo yunohost app setting owncloud mysqlpwd -v $db_pwd
23 23
24 # Create owncloud user 24 # Create owncloud user
25 sudo useradd -d /var/www/owncloud owncloud 25 sudo useradd -d /var/www/owncloud owncloud
26 26
27 # Copy files to the right place 27 # Copy files to the right place
28 final_path=/var/www/owncloud 28 final_path=/var/www/owncloud
29 sudo mkdir -p $final_path 29 sudo mkdir -p $final_path
30 sudo cp -a ../sources/* $final_path 30 sudo cp -a ../sources/* $final_path
31 sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/owncloud.conf 31 sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/owncloud.conf
32 sudo cp ../conf/php-fpm.conf /etc/php5/fpm/pool.d/owncloud.conf 32 sudo cp ../conf/php-fpm.conf /etc/php5/fpm/pool.d/owncloud.conf
33 33
34 # Change variables in Owncloud configuration 34 # Change variables in Owncloud configuration
35 sudo sed -i "s@PATHTOCHANGE@$path@g" /etc/nginx/conf.d/$domain.d/owncloud.conf 35 sudo sed -i "s@PATHTOCHANGE@$path@g" /etc/nginx/conf.d/$domain.d/owncloud.conf
36 sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" /etc/nginx/conf.d/$domain.d/owncloud.conf 36 sudo sed -i "s@ALIASTOCHANGE@$final_path/@g" /etc/nginx/conf.d/$domain.d/owncloud.conf
37 sudo sed -i "s@NAMETOCHANGE@owncloud@g" /etc/nginx/conf.d/$domain.d/owncloud.conf 37 sudo sed -i "s@NAMETOCHANGE@owncloud@g" /etc/nginx/conf.d/$domain.d/owncloud.conf
38 sudo sed -i "s@NAMETOCHANGE@owncloud@g" /etc/php5/fpm/pool.d/owncloud.conf 38 sudo sed -i "s@NAMETOCHANGE@owncloud@g" /etc/php5/fpm/pool.d/owncloud.conf
39 39
40 # Set permissions to owncloud directory and /home directories 40 # Set permissions to owncloud directory and /home directories
41 sudo chown -R owncloud: $final_path 41 sudo chown -hR owncloud: $final_path
42 for i in $(ls /home) 42 for i in $(ls /home)
43 do 43 do
44 if [[ ! $i == yunohost.* ]]; 44 if [[ ! $i == yunohost.* ]];
45 then 45 then
46 sudo setfacl -m g:owncloud:rwx /home/$i 46 sudo setfacl -m g:owncloud:rwx /home/$i
47 fi 47 fi
48 done 48 done
49 49
50 # Reload Nginx and regenerate SSOwat conf 50 # Reload Nginx and regenerate SSOwat conf
51 sudo service php5-fpm restart 51 sudo service php5-fpm restart
52 sudo service nginx reload 52 sudo service nginx reload
53 sudo yunohost app setting owncloud skipped_uris -v "/" 53 sudo yunohost app setting owncloud skipped_uris -v "/"
54 sudo yunohost app ssowatconf 54 sudo yunohost app ssowatconf
55 55
56 # Owncloud installation via curl 56 # Owncloud installation via curl
57 echo "127.0.0.1 $domain #yunoowncloud" | sudo tee -a /etc/hosts 57 echo "127.0.0.1 $domain #yunoowncloud" | sudo tee -a /etc/hosts
58 curl -kL -X POST https://$domain$path/index.php --data "install=true&adminlogin=admin&adminpass=$admin_passwd&directory=/var/www/owncloud/data&dbtype=mysql&dbuser=$db_user&dbpass=$db_pwd&dbname=$db_user&dbhost=localhost" 58 curl -kL -X POST https://$domain$path/index.php --data "install=true&adminlogin=admin&adminpass=$admin_passwd&directory=/var/www/owncloud/data&dbtype=mysql&dbuser=$db_user&dbpass=$db_pwd&dbname=$db_user&dbhost=localhost"
59 59
60 # Check if the Mysql database is initialized & running 60 # Check if the Mysql database is initialized & running
61 sleep 5 61 sleep 5
62 mysql -u $db_user -p$db_pwd $db_user -e "select * from oc_appconfig;" > /dev/null 2>&1 62 mysql -u $db_user -p$db_pwd $db_user -e "select * from oc_appconfig;" > /dev/null 2>&1
63 result=$? 63 result=$?
64 loop_number=1 64 loop_number=1
65 while [ $result != 0 ] && [ $loop_number -lt 5 ]; 65 while [ $result != 0 ] && [ $loop_number -lt 5 ];
66 do 66 do
67 sleep 5 67 sleep 5
68 mysql -u $db_user -p$db_pwd $db_user -e "select * from oc_appconfig;" > /dev/null 2>&1 68 mysql -u $db_user -p$db_pwd $db_user -e "select * from oc_appconfig;" > /dev/null 2>&1
69 let result=$? 69 let result=$?
70 let loop_number++ 70 let loop_number++
71 done 71 done
72 72
73 sudo yunohost app setting owncloud skipped_uris -v "/public.php" 73 sudo yunohost app setting owncloud skipped_uris -v "/public.php"
74 sudo yunohost app ssowatconf 74 sudo yunohost app ssowatconf
75 mysql -u $db_user -p$db_pwd $db_user < ../conf/ldap_config.sql 75 mysql -u $db_user -p$db_pwd $db_user < ../conf/ldap_config.sql
76 76
77 # Remove temporary entry in /etc/hosts 77 # Remove temporary entry in /etc/hosts
78 sudo sed -i '/yunoowncloud/d' /etc/hosts 78 sudo sed -i '/yunoowncloud/d' /etc/hosts
79 79
sources/config/config.sample.php
File was created 1 <?php
2
3 /* Only enable this for local development and not in productive environments */
4 /* This will disable the minifier and outputs some additional debug informations */
5 define("DEBUG", true);
6
7 $CONFIG = array(
8 /* Flag to indicate ownCloud is successfully installed (true = installed) */
9 "installed" => false,
10
11 /* Type of database, can be sqlite, mysql or pgsql */
12 "dbtype" => "sqlite",
13
14 /* Name of the ownCloud database */
15 "dbname" => "owncloud",
16
17 /* User to access the ownCloud database */
18 "dbuser" => "",
19
20 /* Password to access the ownCloud database */
21 "dbpassword" => "",
22
23 /* Host running the ownCloud database */
24 "dbhost" => "",
25
26 /* Prefix for the ownCloud tables in the database */
27 "dbtableprefix" => "",
28
29 /* Define the salt used to hash the user passwords. All your user passwords are lost if you lose this string. */
30 "passwordsalt" => "",
31
32 /* Force use of HTTPS connection (true = use HTTPS) */
33 "forcessl" => false,
34
35 /* Blacklist a specific file and disallow the upload of files with this name - WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING. */
36 "blacklisted_files" => array('.htaccess'),
37
38 /* The automatic hostname detection of ownCloud can fail in certain reverse proxy situations. This option allows to manually override the automatic detection. You can also add a port. For example "www.example.com:88" */
39 "overwritehost" => "",
40
41 /* The automatic protocol detection of ownCloud can fail in certain reverse proxy situations. This option allows to manually override the protocol detection. For example "https" */
42 "overwriteprotocol" => "",
43
44 /* The automatic webroot detection of ownCloud can fail in certain reverse proxy situations. This option allows to manually override the automatic detection. For example "/domain.tld/ownCloud" */
45 "overwritewebroot" => "",
46
47 /* The automatic detection of ownCloud can fail in certain reverse proxy situations. This option allows to define a manually override condition as regular expression for the remote ip address. For example "^10\.0\.0\.[1-3]$" */
48 "overwritecondaddr" => "",
49
50 /* A proxy to use to connect to the internet. For example "myproxy.org:88" */
51 "proxy" => "",
52
53 /* The optional authentication for the proxy to use to connect to the internet. The format is: [username]:[password] */
54 "proxyuserpwd" => "",
55
56 /* Theme to use for ownCloud */
57 "theme" => "",
58
59 /* Optional ownCloud default language - overrides automatic language detection on public pages like login or shared items. This has no effect on the user's language preference configured under "personal -> language" once they have logged in */
60 "default_language" => "en",
61
62 /* Path to the parent directory of the 3rdparty directory */
63 "3rdpartyroot" => "",
64
65 /* URL to the parent directory of the 3rdparty directory, as seen by the browser */
66 "3rdpartyurl" => "",
67
68 /* Default app to load on login */
69 "defaultapp" => "files",
70
71 /* Enable the help menu item in the settings */
72 "knowledgebaseenabled" => true,
73
74 /* Enable installing apps from the appstore */
75 "appstoreenabled" => true,
76
77 /* URL of the appstore to use, server should understand OCS */
78 "appstoreurl" => "http://api.apps.owncloud.com/v1",
79
80 /* Domain name used by ownCloud for the sender mail address, e.g. no-reply@example.com */
81 "mail_domain" => "example.com",
82
83 /* Enable SMTP class debugging */
84 "mail_smtpdebug" => false,
85
86 /* Mode to use for sending mail, can be sendmail, smtp, qmail or php, see PHPMailer docs */
87 "mail_smtpmode" => "sendmail",
88
89 /* Host to use for sending mail, depends on mail_smtpmode if this is used */
90 "mail_smtphost" => "127.0.0.1",
91
92 /* Port to use for sending mail, depends on mail_smtpmode if this is used */
93 "mail_smtpport" => 25,
94
95 /* SMTP server timeout in seconds for sending mail, depends on mail_smtpmode if this is used */
96 "mail_smtptimeout" => 10,
97
98 /* SMTP connection prefix or sending mail, depends on mail_smtpmode if this is used.
99 Can be '', ssl or tls */
100 "mail_smtpsecure" => "",
101
102 /* authentication needed to send mail, depends on mail_smtpmode if this is used
103 * (false = disable authentication)
104 */
105 "mail_smtpauth" => false,
106
107 /* authentication type needed to send mail, depends on mail_smtpmode if this is used
108 * Can be LOGIN (default), PLAIN or NTLM */
109 "mail_smtpauthtype" => "LOGIN",
110
111 /* Username to use for sendmail mail, depends on mail_smtpauth if this is used */
112 "mail_smtpname" => "",
113
114 /* Password to use for sendmail mail, depends on mail_smtpauth if this is used */
115 "mail_smtppassword" => "",
116
117 /* How long should ownCloud keep deleted files in the trash bin, default value: 30 days */
118 'trashbin_retention_obligation' => 30,
119
120 /* Disable/Enable auto expire for the trash bin, by default auto expire is enabled */
121 'trashbin_auto_expire' => true,
122
123 /* allow user to change his display name, if it is supported by the back-end */
124 'allow_user_to_change_display_name' => true,
125
126 /* Check 3rdparty apps for malicious code fragments */
127 "appcodechecker" => "",
128
129 /* Check if ownCloud is up to date */
130 "updatechecker" => true,
131
132 /* Are we connected to the internet or are we running in a closed network? */
133 "has_internet_connection" => true,
134
135 /* Check if the ownCloud WebDAV server is working correctly. Can be disabled if not needed in special situations*/
136 "check_for_working_webdav" => true,
137
138 /* Check if .htaccess protection of data is working correctly. Can be disabled if not needed in special situations*/
139 "check_for_working_htaccess" => true,
140
141 /* Place to log to, can be owncloud and syslog (owncloud is log menu item in admin menu) */
142 "log_type" => "owncloud",
143
144 /* File for the owncloud logger to log to, (default is ownloud.log in the data dir) */
145 "logfile" => "",
146
147 /* Loglevel to start logging at. 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (default is WARN) */
148 "loglevel" => "",
149
150 /* date format to be used while writing to the owncloud logfile */
151 'logdateformat' => 'F d, Y H:i:s',
152
153 /* timezone used while writing to the owncloud logfile (default: UTC) */
154 'logtimezone' => 'Europe/Berlin',
155
156 /* Append all database queries and parameters to the log file.
157 (watch out, this option can increase the size of your log file)*/
158 "log_query" => false,
159
160 /* Enable or disable the logging of IP addresses in case of webform auth failures */
161 "log_authfailip" => false,
162
163 /*
164 * Configure the size in bytes log rotation should happen, 0 or false disables the rotation.
165 * This rotates the current owncloud logfile to a new name, this way the total log usage
166 * will stay limited and older entries are available for a while longer. The
167 * total disk usage is twice the configured size.
168 * WARNING: When you use this, the log entries will eventually be lost.
169 */
170 'log_rotate_size' => false, // 104857600, // 100 MiB
171
172 /* Lifetime of the remember login cookie, default is 15 days */
173 "remember_login_cookie_lifetime" => 60*60*24*15,
174
175 /* Life time of a session after inactivity */
176 "session_lifetime" => 60 * 60 * 24,
177
178 /* Custom CSP policy, changing this will overwrite the standard policy */
179 "custom_csp_policy" => "default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *",
180
181 /* Enable/disable X-Frame-Restriction */
182 /* HIGH SECURITY RISK IF DISABLED*/
183 "xframe_restriction" => true,
184
185 /* The directory where the user data is stored, default to data in the owncloud
186 * directory. The sqlite database is also stored here, when sqlite is used.
187 */
188 // "datadirectory" => "",
189
190 /* Enable maintenance mode to disable ownCloud
191 If you want to prevent users to login to ownCloud before you start doing some maintenance work,
192 you need to set the value of the maintenance parameter to true.
193 Please keep in mind that users who are already logged-in are kicked out of ownCloud instantly.
194 */
195 "maintenance" => false,
196
197 "apps_paths" => array(
198
199 /* Set an array of path for your apps directories
200 key 'path' is for the fs path and the key 'url' is for the http path to your
201 applications paths. 'writable' indicates whether the user can install apps in this folder.
202 You must have at least 1 app folder writable or you must set the parameter 'appstoreenabled' to false
203 */
204 array(
205 'path'=> '/var/www/owncloud/apps',
206 'url' => '/apps',
207 'writable' => true,
208 ),
209 ),
210 'user_backends'=>array(
211 array(
212 'class'=>'OC_User_IMAP',
213 'arguments'=>array('{imap.gmail.com:993/imap/ssl}INBOX')
214 )
215 ),
216 //links to custom clients
217 'customclient_desktop' => '', //http://owncloud.org/sync-clients/
218 'customclient_android' => '', //https://play.google.com/store/apps/details?id=com.owncloud.android
219 'customclient_ios' => '', //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8
220
221 // PREVIEW
222 'enable_previews' => true,
223 /* the max width of a generated preview, if value is null, there is no limit */
224 'preview_max_x' => null,
225 /* the max height of a generated preview, if value is null, there is no limit */
226 'preview_max_y' => null,
227 /* the max factor to scale a preview, default is set to 10 */
228 'preview_max_scale_factor' => 10,
229 /* custom path for libreoffice / openoffice binary */
230 'preview_libreoffice_path' => '/usr/bin/libreoffice',
231 /* cl parameters for libreoffice / openoffice */
232 'preview_office_cl_parameters' => '',
233
234 /* whether avatars should be enabled */
235 'enable_avatars' => true,
236
237 // Extra SSL options to be used for configuration
238 'openssl' => array(
239 //'config' => '/absolute/location/of/openssl.cnf',
240 ),
241
242 /* whether usage of the instance should be restricted to admin users only */
243 'singleuser' => false,
244 );
245