Browse Source

Pleroma logo

Bob Mottram 7 years ago
parent
commit
4ae5bc3346
4 changed files with 138 additions and 15 deletions
  1. 3
    5
      doc/EN/app_pleroma.org
  2. BIN
      img/pleroma-logo.png
  3. 121
    0
      src/freedombone-app-pleroma
  4. 14
    10
      website/EN/app_pleroma.html

+ 3
- 5
doc/EN/app_pleroma.org View File

@@ -10,11 +10,9 @@
10 10
 [[file:images/logo.png]]
11 11
 #+END_CENTER
12 12
 
13
-#+BEGIN_EXPORT html
14
-<center>
15
-<h1>Pleroma</h1>
16
-</center>
17
-#+END_EXPORT
13
+#+BEGIN_CENTER
14
+[[file:images/pleroma-logo.png]]
15
+#+END_CENTER
18 16
 
19 17
 Pleroma is an OStatus-compatible social networking server, compatible with GNU Social, PostActiv and Mastodon. It is high-performance and so is especially well suited for running on low power single board computers without much RAM.
20 18
 

BIN
img/pleroma-logo.png View File


+ 121
- 0
src/freedombone-app-pleroma View File

@@ -62,6 +62,127 @@ pleroma_variables=(ONION_ONLY
62 62
                    MY_EMAIL_ADDRESS
63 63
                    MY_USERNAME)
64 64
 
65
+function pleroma_block_domain_script {
66
+    database_name='pleroma'
67
+    pleroma_domain=$PLEROMA_DOMAIN_NAME
68
+
69
+    echo '#!/bin/bash' > /usr/bin/pleroma-delete-domain
70
+    echo '' >> /usr/bin/pleroma-delete-domain
71
+    echo 'database_name=$1' >> /usr/bin/pleroma-delete-domain
72
+    echo 'remove_domain=$2' >> /usr/bin/pleroma-delete-domain
73
+    echo 'domain_name=$3' >> /usr/bin/pleroma-delete-domain
74
+    echo "POSTGRESQL_PASSWORD=\$(${PROJECT_NAME}-pass -u root -a pleroma)" >> /usr/bin/pleroma-delete-domain
75
+    echo '' >> /usr/bin/pleroma-delete-domain
76
+    echo 'if [ ${#remove_domain} -lt 2 ]; then' >> /usr/bin/pleroma-delete-domain
77
+    echo '    echo $"No domain was specified"' >> /usr/bin/pleroma-delete-domain
78
+    echo '    exit 1' >> /usr/bin/pleroma-delete-domain
79
+    echo 'fi' >> /usr/bin/pleroma-delete-domain
80
+    echo '' >> /usr/bin/pleroma-delete-domain
81
+    echo 'if [[ "$remove_domain" != *"."* ]]; then' >> /usr/bin/pleroma-delete-domain
82
+    echo '    echo $"This doesnt look like a domain"' >> /usr/bin/pleroma-delete-domain
83
+    echo '    exit 2' >> /usr/bin/pleroma-delete-domain
84
+    echo 'fi' >> /usr/bin/pleroma-delete-domain
85
+    echo '' >> /usr/bin/pleroma-delete-domain
86
+    echo 'if [ ${#database_name} -lt 2 ]; then' >> /usr/bin/pleroma-delete-domain
87
+    echo '    echo $"No database was specified"' >> /usr/bin/pleroma-delete-domain
88
+    echo '    exit 3' >> /usr/bin/pleroma-delete-domain
89
+    echo 'fi' >> /usr/bin/pleroma-delete-domain
90
+    echo '' >> /usr/bin/pleroma-delete-domain
91
+    echo "database_query=\"select user_id from profile where profileurl like '%\${remove_domain}%';\"" >> /usr/bin/pleroma-delete-domain
92
+    echo 'declare -a ids=$(mysql -u root --password="$POSTGRESQL_PASSWORD" << EOF' >> /usr/bin/pleroma-delete-domain
93
+    echo 'use $database_name;' >> /usr/bin/pleroma-delete-domain
94
+    echo '$database_query' >> /usr/bin/pleroma-delete-domain
95
+    echo 'EOF' >> /usr/bin/pleroma-delete-domain
96
+    echo ')' >> /usr/bin/pleroma-delete-domain
97
+    echo '' >> /usr/bin/pleroma-delete-domain
98
+    echo 'ctr=0' >> /usr/bin/pleroma-delete-domain
99
+    echo 'for id in $ids' >> /usr/bin/pleroma-delete-domain
100
+    echo 'do' >> /usr/bin/pleroma-delete-domain
101
+    echo '    if [ $ctr -gt 0 ]; then' >> /usr/bin/pleroma-delete-domain
102
+    echo '        #echo "Removing user ID $id on $remove_domain"' >> /usr/bin/pleroma-delete-domain
103
+    echo '' >> /usr/bin/pleroma-delete-domain
104
+    echo "        database_query=\"delete from conversation where uri like '%\${remove_domain}%';\"" >> /usr/bin/pleroma-delete-domain
105
+    echo '        mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain
106
+    echo '' >> /usr/bin/pleroma-delete-domain
107
+    echo '        database_query="delete from reply where profile_id=${id};"' >> /usr/bin/pleroma-delete-domain
108
+    echo '        mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain
109
+    echo '' >> /usr/bin/pleroma-delete-domain
110
+    echo '        database_query="delete from reply where replied_id=${id};"' >> /usr/bin/pleroma-delete-domain
111
+    echo '        mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain
112
+    echo '' >> /usr/bin/pleroma-delete-domain
113
+    echo '        if [ $domain_name ]; then' >> /usr/bin/pleroma-delete-domain
114
+    echo '          database_query="select rendered from notice where profile_id=${id} and rendered like '"'"'%/file/%'"'"';"' >> /usr/bin/pleroma-delete-domain
115
+    echo '          declare -a stored_files=$(mysql -u root --password="$POSTGRESQL_PASSWORD" << EOF' >> /usr/bin/pleroma-delete-domain
116
+    echo 'use $database_name;' >> /usr/bin/pleroma-delete-domain
117
+    echo '$database_query' >> /usr/bin/pleroma-delete-domain
118
+    echo 'EOF' >> /usr/bin/pleroma-delete-domain
119
+    echo ')' >> /usr/bin/pleroma-delete-domain
120
+    echo -n "           files_to_delete=\$(echo \"\$stored_files\" | " >> /usr/bin/pleroma-delete-domain
121
+    echo 'sed -n '"'"'s/.*href="\([^"]*\).*/\1/p'"'"' | awk -F '"'"'file/'"'"' '"'"'{print $2}'"'"')' >> /usr/bin/pleroma-delete-domain
122
+    echo '            filectr=0' >> /usr/bin/pleroma-delete-domain
123
+    echo '            for f in $files_to_delete' >> /usr/bin/pleroma-delete-domain
124
+    echo '            do' >> /usr/bin/pleroma-delete-domain
125
+    echo '                if [ $filectr -gt 0 ]; then' >> /usr/bin/pleroma-delete-domain
126
+    echo '                    if $(ls /var/www/${domain_name}/htdocs/file/*${f}* 1> /dev/null 2>&1); then' >> /usr/bin/pleroma-delete-domain
127
+    echo '                        rm /var/www/${domain_name}/htdocs/file/*${f}*' >> /usr/bin/pleroma-delete-domain
128
+    echo '                    fi' >> /usr/bin/pleroma-delete-domain
129
+    echo '                fi' >> /usr/bin/pleroma-delete-domain
130
+    echo '                filectr=$((filectr + 1))' >> /usr/bin/pleroma-delete-domain
131
+    echo '            done' >> /usr/bin/pleroma-delete-domain
132
+    echo '        fi' >> /usr/bin/pleroma-delete-domain
133
+    echo '' >> /usr/bin/pleroma-delete-domain
134
+    echo '        database_query="delete from notice where profile_id=${id};"' >> /usr/bin/pleroma-delete-domain
135
+    echo '        mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain
136
+    echo '' >> /usr/bin/pleroma-delete-domain
137
+    echo '        database_query="delete from profile where id=${id};"' >> /usr/bin/pleroma-delete-domain
138
+    echo '        mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain
139
+    echo '' >> /usr/bin/pleroma-delete-domain
140
+    echo '        database_query="delete from qvitternotification where to_profile_id=${id} or from_profile_id=${id};"' >> /usr/bin/pleroma-delete-domain
141
+    echo '        mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain
142
+    echo '    fi' >> /usr/bin/pleroma-delete-domain
143
+    echo '    ctr=$((ctr + 1))' >> /usr/bin/pleroma-delete-domain
144
+    echo 'done' >> /usr/bin/pleroma-delete-domain
145
+    chmod +x /usr/bin/pleroma-delete-domain
146
+
147
+    echo '#!/bin/bash' > /usr/bin/${database_name}-firewall
148
+    echo '' >> /usr/bin/${database_name}-firewall
149
+    echo "PROJECT_NAME=$PROJECT_NAME" >> /usr/bin/${database_name}-firewall
150
+
151
+    if [[ $ONION_ONLY == 'no' ]]; then
152
+        echo "PLEROMA_DOMAIN_NAME=$PLEROMA_DOMAIN_NAME" >> /usr/bin/${database_name}-firewall
153
+    else
154
+        echo "PLEROMA_DOMAIN_NAME=$PLEROMA_ONION_HOSTNAME" >> /usr/bin/${database_name}-firewall
155
+    fi
156
+
157
+    echo "database_name=$database_name" >> /usr/bin/${database_name}-firewall
158
+    echo 'FIREWALL_DOMAINS=$HOME/${PROJECT_NAME}-firewall-domains.cfg' >> /usr/bin/${database_name}-firewall
159
+    echo '' >> /usr/bin/${database_name}-firewall
160
+    echo 'while read block; do' >> /usr/bin/${database_name}-firewall
161
+    echo '    if [[ "$block" != *"@"* ]]; then' >> /usr/bin/${database_name}-firewall
162
+    echo '        /usr/bin/pleroma-delete-domain "$database_name" "$block" "$PLEROMA_DOMAIN_NAME"' >> /usr/bin/${database_name}-firewall
163
+    echo '    else' >> /usr/bin/${database_name}-firewall
164
+    echo '        /usr/bin/pleroma-delete-user "$database_name" "$block" "$PLEROMA_DOMAIN_NAME"' >> /usr/bin/${database_name}-firewall
165
+    echo '    fi' >> /usr/bin/${database_name}-firewall
166
+    echo 'done <$FIREWALL_DOMAINS' >> /usr/bin/${database_name}-firewall
167
+    echo '' >> /usr/bin/${database_name}-firewall
168
+    echo '# remove any metadata from images uploaded in the last 2 minutes' >> /usr/bin/${database_name}-firewall
169
+    echo 'if [ -d /var/www/$PLEROMA_DOMAIN_NAME/htdocs ]; then' >> /usr/bin/${database_name}-firewall
170
+    echo '    cd /var/www/$PLEROMA_DOMAIN_NAME/htdocs' >> /usr/bin/${database_name}-firewall
171
+    echo '    declare -a recent_image=$(find file ! -name thumb-* -mmin -2 -type f -exec ls -l {} + | awk -F '"'"'file/'"'"' '"'"'{print $2}'"'"')' >> /usr/bin/${database_name}-firewall
172
+    echo '    for f in ${recent_image[@]}' >> /usr/bin/${database_name}-firewall
173
+    echo '    do' >> /usr/bin/${database_name}-firewall
174
+    echo '        if [ ${#f} -gt 1 ]; then' >> /usr/bin/${database_name}-firewall
175
+    echo '            exiftool -q -all= "file/${f}"' >> /usr/bin/${database_name}-firewall
176
+    echo '        fi' >> /usr/bin/${database_name}-firewall
177
+    echo '    done' >> /usr/bin/${database_name}-firewall
178
+    echo 'fi' >> /usr/bin/${database_name}-firewall
179
+    chmod +x /usr/bin/${database_name}-firewall
180
+
181
+    if ! grep -q "${database_name}-firewall" /etc/crontab; then
182
+        echo "*/1            * *   *   *   root /usr/bin/${database_name}-firewall" >> /etc/crontab
183
+    fi
184
+}
185
+
65 186
 function pleroma_recompile {
66 187
     # necessary after parameter changes
67 188
     sudo -u pleroma mix clean

+ 14
- 10
website/EN/app_pleroma.html View File

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2017-11-08 Wed 14:34 -->
6
+<!-- 2017-11-10 Fri 17:42 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title>&lrm;</title>
@@ -244,9 +244,13 @@ for the JavaScript code in this tag.
244 244
 </div>
245 245
 </div>
246 246
 
247
-<center>
248
-<h1>Pleroma</h1>
249
-</center>
247
+<div class="org-center">
248
+
249
+<div class="figure">
250
+<p><img src="images/pleroma-logo.png" alt="pleroma-logo.png" />
251
+</p>
252
+</div>
253
+</div>
250 254
 
251 255
 <p>
252 256
 Pleroma is an OStatus-compatible social networking server, compatible with GNU Social, PostActiv and Mastodon. It is high-performance and so is especially well suited for running on low power single board computers without much RAM.
@@ -260,9 +264,9 @@ Pleroma is an OStatus-compatible social networking server, compatible with GNU S
260 264
 </div>
261 265
 </div>
262 266
 
263
-<div id="outline-container-org7600aa0" class="outline-2">
264
-<h2 id="org7600aa0">Installation</h2>
265
-<div class="outline-text-2" id="text-org7600aa0">
267
+<div id="outline-container-org630bbcf" class="outline-2">
268
+<h2 id="org630bbcf">Installation</h2>
269
+<div class="outline-text-2" id="text-org630bbcf">
266 270
 <p>
267 271
 Log into your system with:
268 272
 </p>
@@ -282,9 +286,9 @@ Select <b>Add/Remove Apps</b> then <b>pleroma</b>. You will then be asked for a
282 286
 </div>
283 287
 </div>
284 288
 
285
-<div id="outline-container-orgf115794" class="outline-2">
286
-<h2 id="orgf115794">Initial setup</h2>
287
-<div class="outline-text-2" id="text-orgf115794">
289
+<div id="outline-container-org703cfb4" class="outline-2">
290
+<h2 id="org703cfb4">Initial setup</h2>
291
+<div class="outline-text-2" id="text-org703cfb4">
288 292
 <p>
289 293
 The first thing you'll need to do is register a new account. You can set your profile details and profile image by selecting the small settings icon to the right of your name.
290 294
 </p>