ソースを参照

Deprecate wemail

Mailpile is good enough
Bob Mottram 8 年 前
コミット
54adb01f5c
共有3 個のファイルを変更した0 個の追加272 個の削除を含む
  1. 0
    8
      src/freedombone-app-dokuwiki
  2. 0
    263
      src/freedombone-app-webmail
  3. 0
    1
      src/freedombone-utils-upgrade

+ 0
- 8
src/freedombone-app-dokuwiki ファイルの表示

@@ -321,14 +321,6 @@ function install_dokuwiki {
321 321
         nginx_disable_sniffing $DOKUWIKI_DOMAIN_NAME
322 322
         echo '    add_header Strict-Transport-Security "max-age=0;";' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
323 323
         echo '' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
324
-        echo '    # webmail' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
325
-        echo '    location /webmail {' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
326
-        function_check nginx_limits
327
-        nginx_limits $DOKUWIKI_DOMAIN_NAME
328
-        echo '        rewrite ^/(.*) /webmail/index.php last;' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
329
-        echo '        rewrite ^/(.*) /webmail/installer/index.php last;' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
330
-        echo '    }' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
331
-        echo '' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
332 324
         echo '    # rewrite to front controller as default rule' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
333 325
         echo '    location / {' >> /etc/nginx/sites-available/$DOKUWIKI_DOMAIN_NAME
334 326
         function_check nginx_limits

+ 0
- 263
src/freedombone-app-webmail ファイルの表示

@@ -1,263 +0,0 @@
1
-#!/bin/bash
2
-#
3
-# .---.                  .              .
4
-# |                      |              |
5
-# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
-# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
-# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
-#
9
-#                    Freedom in the Cloud
10
-#
11
-# Webmail application
12
-#
13
-# License
14
-# =======
15
-#
16
-# Copyright (C) 2014-2016 Bob Mottram <bob@freedombone.net>
17
-#
18
-# This program is free software: you can redistribute it and/or modify
19
-# it under the terms of the GNU Affero General Public License as published by
20
-# the Free Software Foundation, either version 3 of the License, or
21
-# (at your option) any later version.
22
-#
23
-# This program is distributed in the hope that it will be useful,
24
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
25
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
-# GNU Affero General Public License for more details.
27
-#
28
-# You should have received a copy of the GNU Affero General Public License
29
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
-
31
-VARIANTS=''
32
-
33
-IN_DEFAULT_INSTALL=0
34
-
35
-WEBMAIL_REPO="https://github.com/roundcube/roundcubemail"
36
-WEBMAIL_COMMIT='78cf9c2e5cff2d78cd8beb647d60570f195a2a9c'
37
-WEBMAIL_ONION_HOSTNAME=
38
-WEBMAIL_ONION_PORT=8097
39
-WEBMAIL_ADMIN_PASSWORD=
40
-WEB_PATH=/var/www
41
-WEBMAIL_PATH=$WEB_PATH/webmail
42
-
43
-webmail_variables=(WEBMAIL_REPO
44
-                   WEBMAIL_COMMIT
45
-                   MY_USERNAME
46
-                   ONION_ONLY
47
-                   DEFAULT_DOMAIN_NAME)
48
-
49
-function install_interactive_webmail {
50
-    echo -n ''
51
-    APP_INSTALLED=1
52
-}
53
-
54
-function change_password_webmail {
55
-    echo -n ''
56
-}
57
-
58
-function get_mariadb_webmail_admin_password {
59
-    if [ -f /home/$MY_USERNAME/README ]; then
60
-        if grep -q "MariaDB webmail admin password" /home/$MY_USERNAME/README; then
61
-            WEBMAIL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB webmail admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
62
-        fi
63
-    fi
64
-}
65
-
66
-function webmail_create_database {
67
-    function_check get_mariadb_webmail_admin_password
68
-    get_mariadb_webmail_admin_password
69
-    if [ ! $WEBMAIL_ADMIN_PASSWORD ]; then
70
-        if [ -f $IMAGE_PASSWORD_FILE ]; then
71
-            WEBMAIL_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
72
-        else
73
-            WEBMAIL_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
74
-        fi
75
-    fi
76
-    if [ ! $WEBMAIL_ADMIN_PASSWORD ]; then
77
-        return
78
-    fi
79
-    function_check create_database
80
-    create_database webmail "$WEBMAIL_ADMIN_PASSWORD"
81
-}
82
-
83
-function reconfigure_webmail {
84
-    echo -n ''
85
-}
86
-
87
-function upgrade_webmail {
88
-    function_check set_repo_commit
89
-    set_repo_commit $WEBMAIL_PATH "webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO
90
-}
91
-
92
-function backup_local_webmail {
93
-    if ! grep -q "install_webmail" $COMPLETION_FILE; then
94
-        return
95
-    fi
96
-    echo $"Backing up webmail"
97
-
98
-    function_check backup_database_to_usb
99
-    backup_database_to_usb webmail
100
-
101
-    echo $"Backing up webmail complete"
102
-}
103
-
104
-function restore_local_webmail {
105
-    if ! grep -q "install_webmail" $COMPLETION_FILE; then
106
-        return
107
-    fi
108
-    echo $"Restoring webmail"
109
-
110
-    function_check webmail_create_database
111
-    webmail_create_database
112
-
113
-    function_check restore_database
114
-    restore_database webmail
115
-
116
-    echo $"Restore of webmail complete"
117
-}
118
-
119
-function backup_remote_webmail {
120
-    echo -n ''
121
-}
122
-
123
-function restore_remote_webmail {
124
-    echo -n ''
125
-}
126
-
127
-function remove_webmail {
128
-    nginx_dissite webmail
129
-    if [ -f /etc/nginx/sites-available/webmail ]; then
130
-        rm /etc/nginx/sites-available/webmail
131
-    fi
132
-    function_check remove_onion_service
133
-    remove_onion_service webmail ${WEBMAIL_ONION_PORT}
134
-    function_check drop_database
135
-    drop_database webmail
136
-    if [ -d $WEB_PATH/webmail ]; then
137
-        rm -rf $WEB_PATH/webmail
138
-    fi
139
-    sed -i '/Webmail/d' $COMPLETION_FILE
140
-    sed -i '/webmail/d' $COMPLETION_FILE
141
-    sed -i '/Webmail/d' /home/$MY_USERNAME/README
142
-    sed -i '/webmail/d' /home/$MY_USERNAME/README
143
-    remove_completion_param install_webmail
144
-}
145
-
146
-function install_webmail {
147
-    if [ -d /etc/apache2 ]; then
148
-        rm -rf /etc/apache2
149
-        echo $'Removed Apache installation after Dokuwiki install'
150
-    fi
151
-
152
-    function_check install_mariadb
153
-    install_mariadb
154
-
155
-    function_check get_mariadb_password
156
-    get_mariadb_password
157
-
158
-    function_check repair_databases_script
159
-    repair_databases_script
160
-
161
-    apt-get -yq install php5-common php5-cli php5-curl php5-gd php5-mysql php5-mcrypt git
162
-    apt-get -yq install php5-dev imagemagick php5-imagick php5-sqlite php-auth-sasl php-net-smtp php-mime-type
163
-    apt-get -yq install php-mail-mime php-mail-mimedecode php-net-ldap3 php5-pspell
164
-    pear install Net_IDNA2
165
-
166
-    if [ ! -f $WEBMAIL_PATH/index.php ]; then
167
-        cd $WEB_PATH
168
-        git_clone $WEBMAIL_REPO webmail
169
-        cd $WEBMAIL_PATH
170
-        git checkout $WEBMAIL_COMMIT -b $WEBMAIL_COMMIT
171
-        set_completion_param "webmail commit" "$WEBMAIL_COMMIT"
172
-    fi
173
-    if [ ! -f $WEBMAIL_PATH/index.php ]; then
174
-        echo $'Did not clone webmail repo'
175
-        exit 52825
176
-    fi
177
-
178
-    WEBMAIL_ONION_HOSTNAME=$(add_onion_service webmail 80 ${WEBMAIL_ONION_PORT})
179
-
180
-    webmail_create_database
181
-
182
-    mysql -u root --password="$MARIADB_PASSWORD" -D webmail < $WEBMAIL_PATH/SQL/mysql.initial.sql
183
-
184
-    if [ ! -d /var/www/$DEFAULT_DOMAIN_NAME/htdocs ]; then
185
-        mkdir -p /var/www/$DEFAULT_DOMAIN_NAME/htdocs
186
-    fi
187
-    ln -s $WEBMAIL_PATH /var/www/$DEFAULT_DOMAIN_NAME/htdocs/webmail
188
-
189
-    if [ ! -f /var/www/webmail/config/config.inc.php ]; then
190
-        # generate the configuration
191
-        echo '<?php' > /var/www/webmail/config/config.inc.php
192
-        echo "\$config['db_dsnw'] = 'mysql://root:${MARIADB_PASSWORD}@localhost/webmail';" >> /var/www/webmail/config/config.inc.php
193
-        echo "\$config['default_host'] = 'localhost';" >> /var/www/webmail/config/config.inc.php
194
-        echo "\$config['support_url'] = '';" >> /var/www/webmail/config/config.inc.php
195
-        WEBMAIL_DES_KEY="$(create_password 25)"
196
-        echo "\$config['des_key'] = '${WEBMAIL_DES_KEY}';" >> /var/www/webmail/config/config.inc.php
197
-        echo "\$config['product_name'] = '${PROJECT_NAME}';" >> /var/www/webmail/config/config.inc.php
198
-        echo "\$config['plugins'] = array('enigma');" >> /var/www/webmail/config/config.inc.php
199
-        echo "\$config['mime_param_folding'] = 0;" >> /var/www/webmail/config/config.inc.php
200
-        echo "\$config['enable_installer'] = false;" >> /var/www/webmail/config/config.inc.php
201
-    fi
202
-
203
-    chown -R www-data:www-data $WEBMAIL_PATH
204
-
205
-    echo 'server {' > /etc/nginx/sites-available/webmail
206
-    echo "  listen 127.0.0.1:$WEBMAIL_ONION_PORT default_server;" >> /etc/nginx/sites-available/webmail
207
-    echo "  server_name $WEBMAIL_ONION_HOSTNAME;" >> /etc/nginx/sites-available/webmail
208
-    echo "  root ${WEBMAIL_PATH};" >> /etc/nginx/sites-available/webmail
209
-    echo '  index index.php index.html index.htm;' >> /etc/nginx/sites-available/webmail
210
-    echo '  access_log /dev/null;' >> /etc/nginx/sites-available/webmail
211
-    echo '  error_log /dev/null;' >> /etc/nginx/sites-available/webmail
212
-    echo '  location / {' >> /etc/nginx/sites-available/webmail
213
-    echo '    try_files $uri $uri/ /index.php?q=$uri&$args;' >> /etc/nginx/sites-available/webmail
214
-    echo '  }' >> /etc/nginx/sites-available/webmail
215
-    echo '  error_page 404 /404.html;' >> /etc/nginx/sites-available/webmail
216
-    echo '  error_page 500 502 503 504 /50x.html;' >> /etc/nginx/sites-available/webmail
217
-    echo '  location = /50x.html {' >> /etc/nginx/sites-available/webmail
218
-    echo "    root ${WEBMAIL_PATH};" >> /etc/nginx/sites-available/webmail
219
-    echo '  }' >> /etc/nginx/sites-available/webmail
220
-    echo '  location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {' >> /etc/nginx/sites-available/webmail
221
-    echo '    deny all;' >> /etc/nginx/sites-available/webmail
222
-    echo '  }' >> /etc/nginx/sites-available/webmail
223
-    echo '  location ~ ^/(config|temp|logs)/ {' >> /etc/nginx/sites-available/webmail
224
-    echo '    deny all;' >> /etc/nginx/sites-available/webmail
225
-    echo '  }' >> /etc/nginx/sites-available/webmail
226
-    echo '  location ~ /\. {' >> /etc/nginx/sites-available/webmail
227
-    echo '    deny all;' >> /etc/nginx/sites-available/webmail
228
-    echo '    access_log /dev/null;' >> /etc/nginx/sites-available/webmail
229
-    echo '    log_not_found off;' >> /etc/nginx/sites-available/webmail
230
-    echo '  }' >> /etc/nginx/sites-available/webmail
231
-    echo '  location ~ \.php$ {' >> /etc/nginx/sites-available/webmail
232
-    echo '    try_files $uri =404;' >> /etc/nginx/sites-available/webmail
233
-    echo '    fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/webmail
234
-    echo '    fastcgi_index index.php;' >> /etc/nginx/sites-available/webmail
235
-    echo '    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> /etc/nginx/sites-available/webmail
236
-    echo '    include fastcgi_params;' >> /etc/nginx/sites-available/webmail
237
-    echo '  }' >> /etc/nginx/sites-available/webmail
238
-    echo '  add_header X-Frame-Options DENY;' >> /etc/nginx/sites-available/webmail
239
-    echo '  add_header X-Content-Type-Options nosniff;' >> /etc/nginx/sites-available/webmail
240
-    echo '  client_max_body_size 15m;' >> /etc/nginx/sites-available/webmail
241
-    echo '}' >> /etc/nginx/sites-available/webmail
242
-
243
-    nginx_ensite webmail
244
-    systemctl restart php5-fpm
245
-    systemctl restart nginx
246
-
247
-    if ! grep -q "Webmail" /home/$MY_USERNAME/README; then
248
-        echo '' >> /home/$MY_USERNAME/README
249
-        echo '' >> /home/$MY_USERNAME/README
250
-        echo '# Webmail' >> /home/$MY_USERNAME/README
251
-        if [[ $ONION_ONLY == 'no' ]]; then
252
-            echo $"To access webmail open https://$DEFAULT_DOMAIN_NAME/webmail/index.php" >> /home/$MY_USERNAME/README
253
-        else
254
-            echo $"To access webmail open http://$WEBMAIL_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
255
-        fi
256
-        echo $"MariaDB webmail admin password: $WEBMAIL_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
257
-        chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
258
-        chmod 600 /home/$MY_USERNAME/README
259
-    fi
260
-    APP_INSTALLED=1
261
-}
262
-
263
-# NOTE: deliberately no exit 0

+ 0
- 1
src/freedombone-utils-upgrade ファイルの表示

@@ -77,7 +77,6 @@ function upgrade_installation_from_previous_versions {
77 77
     sed -i 's|Gogs|gogs|g' $COMPLETION_FILE
78 78
     sed -i 's|Wiki|dokuwiki|g' $COMPLETION_FILE
79 79
     sed -i 's|RSS|rss|g' $COMPLETION_FILE
80
-    sed -i 's|Webmail|webmail|g' $COMPLETION_FILE
81 80
     sed -i 's|Zeronet|zeronet|g' $COMPLETION_FILE
82 81
 
83 82
     if [ -f /usr/local/bin/zeronetavahi ]; then