Skip to content

Commit 26e01e1

Browse files
committed
Dealing with the following changes:
* mastodon/mastodon#14919 * mastodon/mastodon#12822
1 parent bfaa71a commit 26e01e1

2 files changed

Lines changed: 43 additions & 24 deletions

File tree

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ LABEL org.label-schema.vcs-ref=$VCS_REF \
77
org.label-schema.vcs-url="https://github.com/frost-tb-voo/mastodon-http-local"
88

99
RUN sed -i -e "s|force_ssl|# force_ssl|g" /opt/mastodon/app/controllers/application_controller.rb
10+
RUN sed -i -e "s|Rails.env.production?|false|g" /opt/mastodon/app/controllers/application_controller.rb
11+
RUN cat /opt/mastodon/app/controllers/application_controller.rb
1012

1113
RUN sed -i -e 's|"https://#{record.domain}"|"http://#{record.domain}"|g' /opt/mastodon/app/helpers/admin/action_logs_helper.rb
1214
RUN sed -i -e "s|https://#{attributes['domain']}|http://#{attributes['domain']}|g" /opt/mastodon/app/helpers/admin/action_logs_helper.rb
15+
RUN cat /opt/mastodon/app/helpers/admin/action_logs_helper.rb
1316

14-
RUN sed -i -e "s|https =|https = false # https =|g" /opt/mastodon/config/initializers/1_hosts.rb
15-
RUN sed -i -e "s|http#{Rails.configuration.x.use_https ? 's' : ''}|http|g" /opt/mastodon/config/initializers/content_security_policy.rb
17+
RUN sed -i -e 's|https://#{@domain}|http://#{@domain}|g' /opt/mastodon/app/lib/webfinger.rb
18+
RUN cat /opt/mastodon/app/lib/webfinger.rb
1619

1720
RUN sed -i -e "s|https://#{domain}|http://#{domain}|g" /opt/mastodon/lib/mastodon/domains_cli.rb
21+
RUN cat /opt/mastodon/lib/mastodon/domains_cli.rb
1822

19-
RUN sed -i -e "s|'https'|'http'|g" /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/goldfinger-2.1.1/lib/goldfinger/client.rb
23+
RUN sed -i -e "s|https =|https = false # https =|g" /opt/mastodon/config/initializers/1_hosts.rb
24+
RUN cat /opt/mastodon/config/initializers/1_hosts.rb
2025

21-
RUN sed -i -e "s|Rails.env.production?|false|g" /opt/mastodon/app/controllers/application_controller.rb
26+
RUN sed -i -e "s|http#{Rails.configuration.x.use_https ? 's' : ''}|http|g" /opt/mastodon/config/initializers/content_security_policy.rb
27+
RUN cat /opt/mastodon/config/initializers/content_security_policy.rb
2228

2329
RUN sed -i -e 's/Rails.env.production? || /false \&\& /g' /opt/mastodon/config/initializers/devise.rb
2430
RUN sed -i -e 's/Rails.env.production? || /false \&\& /g' /opt/mastodon/config/initializers/session_store.rb

script/grepRb.sh

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,43 @@ M_HOME=/opt/mastodon
66
APP=${M_HOME}/app
77
CONFIG=${M_HOME}/config
88
LIB=${M_HOME}/lib
9-
GFINGER=${M_HOME}/vendor/bundle/ruby/2.6.0/gems/goldfinger-2.1.1
10-
OSTATUS=${M_HOME}/vendor/bundle/ruby/2.6.0/gems/ostatus2-2.0.3
11-
12-
mkdir -p temp
13-
# echo "find ${M_HOME} -type f -name "*.rb" -print | xargs grep -rn 'https'" >> temp/find.sh
14-
# echo "find ${APP} -type f -name "*.rb" -print | xargs grep -rn 'https'" >> temp/find.sh
15-
# echo "find ${CONFIG} -type f -name "*.rb" -print | xargs grep -rn 'https'" >> temp/find.sh
16-
# echo "find ${LIB} -type f -name "*.rb" -print | xargs grep -rn 'https'" >> temp/find.sh
17-
echo "find ${APP} -type f -print | xargs grep -rn 'https'" >> temp/find.sh
18-
echo "find ${CONFIG} -type f -print | xargs grep -rn 'https'" >> temp/find.sh
19-
echo "find ${LIB} -type f -print | xargs grep -rn 'https'" >> temp/find.sh
20-
21-
echo "find ${GFINGER} -type f -name "*.rb" -print | xargs grep -rn 'https'" >> temp/find.sh
22-
echo "find ${OSTATUS} -type f -name "*.rb" -print | xargs grep -rn 'https'" >> temp/find.sh
23-
24-
echo "find ${APP} -type f -name "*.rb" -print | xargs grep -rn 'LOCAL_HTTPS'" >> temp/find.sh
25-
echo "find ${CONFIG} -type f -name "*.rb" -print | xargs grep -rn 'LOCAL_HTTPS'" >> temp/find.sh
26-
echo "find ${LIB} -type f -name "*.rb" -print | xargs grep -rn 'LOCAL_HTTPS'" >> temp/find.sh
9+
# GFINGER=${M_HOME}/vendor/bundle/ruby/2.6.0/gems/goldfinger-2.1.1
10+
# OSTATUS=${M_HOME}/vendor/bundle/ruby/2.6.0/gems/ostatus2-2.0.3
11+
12+
# echo "ls ${M_HOME}/vendor/bundle/ruby/2.6.0/gems/" >> temp/find.sh
13+
14+
mkdir -p tmp
15+
echo "rm -f /tmp/log" >> tmp/find.sh
16+
echo "echo 'GREP for https +*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+'" >> tmp/find.sh
17+
echo "find ${M_HOME} \
18+
-type d -name 'vendor' -prune -or \
19+
-type d -name 'spec' -prune -or \
20+
-type f -name '*.rb' -print \
21+
| xargs grep 'https' >> /tmp/log" >> tmp/find.sh
22+
echo "cat /tmp/log | \
23+
grep -v 'http https' | \
24+
grep -v 'https?' | \
25+
grep -v \"'http://', 'https://'\" | \
26+
grep -v -P 'https://[a-z]+.*'" >> tmp/find.sh
27+
28+
echo "rm -f /tmp/log" >> tmp/find.sh
29+
echo "echo 'GREP for LOCAL_HTTPS +*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+'" >> tmp/find.sh
30+
echo "find ${M_HOME} \
31+
-type d -name 'vendor' -prune -or \
32+
-type d -name 'spec' -prune -or \
33+
-type f -name '*.rb' -print \
34+
| xargs grep 'LOCAL_HTTPS' >> /tmp/log" >> tmp/find.sh
35+
echo "cat /tmp/log | \
36+
grep -v 'http https' | \
37+
grep -v 'https?' | \
38+
grep -v \"'http://', 'https://'\" | \
39+
grep -v -P 'https://[a-z]+.*'" >> tmp/find.sh
2740

2841
docker pull tootsuite/mastodon
2942
docker run --rm -it \
30-
-v `pwd`/temp:/temp:rw \
43+
-v `pwd`/tmp:/temp:rw \
3144
tootsuite/mastodon \
3245
bash /temp/find.sh
3346

34-
rm -r temp
47+
rm -r tmp
3548

0 commit comments

Comments
 (0)