SlideShare una empresa de Scribd logo
1 de 36
©SIProp Project, 2006-2008 1
如何在Ubuntu16.04設置自己的mastodon
Noritsuna Imamura
noritsuna@mstdn.noritsuna.jp
©SIProp Project, 2006-2017 2
Mastodon是什麼?
現在最有名的微博客系統
https://github.com/tootsuite/mastodon
特色
自由軟件!(非常重要)
分散系統(一樣的P2P)
全球的情況
日本
FB跟Twitter已經死了
法國
FB跟Twitter已經死了
意大利
FB跟Twitter已經死了
現在全球大家用Mastodon!!!
©SIProp Project, 2006-2017 3
日本的情況
三-五天(4月13-17號)六萬多用戶!!!
Mstdn.jp : 七萬用戶
Pawoo.net(Pixiv) : 七萬用戶
friends.nico(niconico) : 八千用戶
©SIProp Project, 2006-2017 4
如何在Ubuntu設置自己的mastodon
©SIProp Project, 2006-2017 5
必需品
服務電腦
Mail服務器
DNS服務器
Web服務器
全球IP
網域名稱(FQDN)
我的推薦
在AWS設置Ubuntu
選擇AMI Image(Ubuntu 16.04)
https://cloud-images.ubuntu.com/locator/ec2/
©SIProp Project, 2006-2017 6
準備你的domain
例子
服務電腦
AWS(Ubuntu 16.04)
全球IP
75.101.152.114
網域名稱(FQDN)
mstdn.noritsuna.jp
©SIProp Project, 2006-2017 7
案裝docker
1. $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys
58118E89F3A912897C070ADBF76221572C52609D
2. $ sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
3. $ sudo apt-get update
4. $ sudo apt-get install -y docker-engine
5. $ sudo systemctl status docker
6. $ curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-
`uname -s`-`uname -m` > docker-compose
7. $ chmod +x docker-compose
8. $ sudo mv docker-compose /usr/local/bin/
©SIProp Project, 2006-2017 8
案裝mastodon: mastodon設定文件 1/3
1. $ git clone https://github.com/tootsuite/mastodon.git
2. $ git update-index --skip-worktree docker-compose.yml
編輯設定文件:docker-compose.yml
持續化
### Uncomment to enable DB persistance
volumes:
- ./postgres:/var/lib/postgresql/data
### Uncomment to enable REDIS persistance
volumes:
- ./redis:/data
©SIProp Project, 2006-2017 9
案裝mastodon: mastodon設定文件 2/3
1. cp .env.production.sample .env.production
編輯設定文件:.evn.production
基本
LOCAL_DOMAIN=mstdn.noritsuna.jp
LOCAL_HTTPS=true
DB
DB_USER=mastodon
DB_NAME=mastodon
DB_PASS=xxxx
暗號
PAPERCLIP_SECRET=[第一次的文字列]
SECRET_KEY_BASE=[第二次的文字列]
OTP_SECRET=[第三次的文字列]
1. sudo docker-compose run --rm web rake secret
©SIProp Project, 2006-2017 10
案裝mastodon: mastodon設定文件 3/3
1. cp .env.production.sample .env.production
編輯設定文件
Mail
SMTP_SERVER=75.101.152.114
SMTP_PORT=25
SMTP_FROM_ADDRESS=noritsuna@siprop.org
©SIProp Project, 2006-2017 11
案裝mastodon: DB
1. sudo docker-compose build
2. sudo docker exec -it mastodon_db_1 /bin/bash
3. su - postgres
4. createuser -P mastodon
5. createdb mastodon -O mastodon
6. exit
7. exit
8. sudo docker-compose run --rm web rails db:migrate
9. sudo docker-compose run --rm web rails assets:precompile
©SIProp Project, 2006-2017 12
開始mastodon
Run
1. sudo docker-compose up -d
Stop
1. sudo docker stop $(sudo docker ps -a -q)
Update
1. sudo docker-compose stop
2. git pull
3. sudo docker-compose build
4. sudo docker-compose up -d
5. sudo docker-compose run --rm web rails db:migrate
6. sudo docker-compose run --rm web rails assets:precompile
7. sudo docker stop $(sudo docker ps -a -q) && sudo docker-compose up -d
©SIProp Project, 2006-2017 13
如果你想自己用mastodon的時候:
註冊你的用戶
http://mstdn.noritsuna.jp/about
編輯設定文件
單用戶服務模式
SINGLE_USER_MODE=true
案裝mastodon: 單用戶服務模式
1. $ sudo docker-compose run --rm web rails mastodon:confirm_email
USER_EMAIL=noritsuna@siprop.org
2. $ sudo docker-compose run --rm web rails mastodon:make_admin USERNAME=noritsuna
©SIProp Project, 2006-2017 14
案裝mastodon: SSL證書
1. $ sudo apt-get install letsencrypt
2. $ sudo letsencrypt certonly --standalone -d mstdn.noritsuna.jp -m noritsuna@siprop.org
3. $ sudo crontab -u root -e
4. 00 05 01 * * /usr/bin/letsencrypt certonly --webroot -w /data/www -d mstdn.noritsuna.jp --
renew
©SIProp Project, 2006-2017 15
案裝mastodon: Nginx設定文件 1/4
1. map $http_upgrade $connection_upgrade {
2. default upgrade;
3. '' close;
4. }
5. server {
6. listen 80;
7. listen [::]:80;
8. server_name mstdn.noritsuna.jp;
9. return 301 https://$host$request_uri;
10. }
11. server {
12. listen 443 ssl;
13. listen [::]:443 ssl;
14. server_name mastdn.noritsuna.jp;
15. ssl_protocols TLSv1.2;
16. ssl_ciphers EECDH+AESGCM:EECDH+AES;
17. ssl_ecdh_curve prime256v1;
©SIProp Project, 2006-2017 16
案裝mastodon: Nginx設定文件 2/4
1. ssl_prefer_server_ciphers on;
2. ssl_session_cache shared:SSL:10m;
3. ssl_certificate /etc/letsencrypt/live/mstdn.noritsuna.jp/fullchain.pem;
4. ssl_certificate_key /etc/letsencrypt/live/mstdn.noritsuna.jp/privkey.pem;
5. keepalive_timeout 70;
6. sendfile on;
7. client_max_body_size 0;
8. root /dummy/public;
9. gzip on;
10. gzip_disable "msie6";
11. gzip_vary on;
12. gzip_proxied any;
13. gzip_comp_level 6;
14. gzip_buffers 16 8k;
15. gzip_http_version 1.1;
16. gzip_types text/plain text/css application/json application/javascript text/xml
application/xml application/xml+rss text/javascript;
©SIProp Project, 2006-2017 17
案裝mastodon: Nginx設定文件 3/4
1. add_header Strict-Transport-Security "max-age=31536000";
2. location / {
3. try_files $uri @proxy;
4. }
5. location @proxy {
6. proxy_set_header Host $host;
7. proxy_set_header X-Real-IP $remote_addr;
8. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9. proxy_set_header X-Forwarded-Proto https;
10. proxy_set_header Proxy "";
11. proxy_pass_header Server;
12. proxy_pass http://127.0.0.1:3000;
13. proxy_buffering off;
14. proxy_redirect off;
15. proxy_http_version 1.1;
16. proxy_set_header Upgrade $http_upgrade;
17. proxy_set_header Connection $connection_upgrade;
18. tcp_nodelay on;
©SIProp Project, 2006-2017 18
案裝mastodon: Nginx設定文件 4/4
1. tcp_nodelay on;
2. }
3. location /api/v1/streaming {
4. proxy_set_header Host $host;
5. proxy_set_header X-Real-IP $remote_addr;
6. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
7. proxy_set_header X-Forwarded-Proto https;
8. proxy_set_header Proxy "";
9. proxy_pass http://localhost:4000;
10. proxy_buffering off;
11. proxy_redirect off;
12. proxy_http_version 1.1;
13. proxy_set_header Upgrade $http_upgrade;
14. proxy_set_header Connection $connection_upgrade;
15. tcp_nodelay on;
16. }
17. error_page 500 501 502 503 504 /500.html;
18. }
©SIProp Project, 2006-2017 19
完成了!!!開始玩mastodon!!!
©SIProp Project, 2006-2017 20
為“沒有AWS”的朋友們
©SIProp Project, 2006-2017 21
如何用他人的mastodon服務
©SIProp Project, 2006-2017 22
例子: friends.nico的mastodon服務
NICONICO動畫服務的mastodon。
https://friends.nico/about
©SIProp Project, 2006-2017 23
註冊用戶
©SIProp Project, 2006-2017 24
確認郵件
©SIProp Project, 2006-2017 25
開始屏幕
©SIProp Project, 2006-2017 26
設定
©SIProp Project, 2006-2017 27
設定:語言
©SIProp Project, 2006-2017 28
但是‧‧‧
©SIProp Project, 2006-2017 29
查詢其他用戶
用戶名@服務的網域名稱
我自己的mastodon服務用戶
noritsuna@mstdn.noritsuna.jp
NICONICO的服務用戶
noritsuna@friends.nico
©SIProp Project, 2006-2017 30
Follow其他用戶
©SIProp Project, 2006-2017 31
timeline的種類
Federated timeline(最多)
遠程服務電腦的timeline
Local timeline (中多)
在同一服務電腦的timeline
Home
你Followed用戶的timeline
©SIProp Project, 2006-2017 32
Federated timeline
©SIProp Project, 2006-2017 33
Local timeline
©SIProp Project, 2006-2017 34
Home
©SIProp Project, 2006-2017 35
為“宅男”的朋友們
©SIProp Project, 2006-2017 36
Pawoo.net的mastodon服務
Pixiv(圖片投稿網站)服務的mastodon。
https://pawoo.net/about

Más contenido relacionado

La actualidad más candente

Onos sdn ip 建置之路 20160522
Onos sdn ip 建置之路 20160522Onos sdn ip 建置之路 20160522
Onos sdn ip 建置之路 20160522Fei Ji Siao
 
Google IoT Core 初體驗
Google IoT Core 初體驗Google IoT Core 初體驗
Google IoT Core 初體驗Simon Su
 
LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)Bear Wang
 
SDN ryu 專題安裝
SDN ryu 專題安裝SDN ryu 專題安裝
SDN ryu 專題安裝承樺 董
 
LinkIt Smart 7688程式開發
LinkIt Smart 7688程式開發LinkIt Smart 7688程式開發
LinkIt Smart 7688程式開發Wei-Tsung Su
 
BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置艾鍗科技
 
第9讲 Eigrp
第9讲 Eigrp第9讲 Eigrp
第9讲 EigrpF.l. Yu
 
Raspberry Pi 溫濕度發報機
Raspberry Pi 溫濕度發報機Raspberry Pi 溫濕度發報機
Raspberry Pi 溫濕度發報機艾鍗科技
 
How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015Macpaul Lin
 
PUN v2 開發經驗分享
PUN v2 開發經驗分享PUN v2 開發經驗分享
PUN v2 開發經驗分享Photon Taiwan
 
OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)Macpaul Lin
 
用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人艾鍗科技
 
如何使用Console連接眾至UTM設備
如何使用Console連接眾至UTM設備如何使用Console連接眾至UTM設備
如何使用Console連接眾至UTM設備sharetech
 
Ryu SDN-IP
Ryu SDN-IPRyu SDN-IP
Ryu SDN-IPYi Tseng
 
Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9Bear Wang
 

La actualidad más candente (17)

Onos sdn ip 建置之路 20160522
Onos sdn ip 建置之路 20160522Onos sdn ip 建置之路 20160522
Onos sdn ip 建置之路 20160522
 
Google IoT Core 初體驗
Google IoT Core 初體驗Google IoT Core 初體驗
Google IoT Core 初體驗
 
LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)
 
SDN ryu 專題安裝
SDN ryu 專題安裝SDN ryu 專題安裝
SDN ryu 專題安裝
 
How to Make a Scanning Drone in Chinese
How to Make a Scanning Drone in ChineseHow to Make a Scanning Drone in Chinese
How to Make a Scanning Drone in Chinese
 
Git安裝
Git安裝Git安裝
Git安裝
 
LinkIt Smart 7688程式開發
LinkIt Smart 7688程式開發LinkIt Smart 7688程式開發
LinkIt Smart 7688程式開發
 
BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置
 
第9讲 Eigrp
第9讲 Eigrp第9讲 Eigrp
第9讲 Eigrp
 
Raspberry Pi 溫濕度發報機
Raspberry Pi 溫濕度發報機Raspberry Pi 溫濕度發報機
Raspberry Pi 溫濕度發報機
 
How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015
 
PUN v2 開發經驗分享
PUN v2 開發經驗分享PUN v2 開發經驗分享
PUN v2 開發經驗分享
 
OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)
 
用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人
 
如何使用Console連接眾至UTM設備
如何使用Console連接眾至UTM設備如何使用Console連接眾至UTM設備
如何使用Console連接眾至UTM設備
 
Ryu SDN-IP
Ryu SDN-IPRyu SDN-IP
Ryu SDN-IP
 
Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9
 

Destacado (8)

5000円で誰でも作れる新世代衛星地上局
5000円で誰でも作れる新世代衛星地上局5000円で誰でも作れる新世代衛星地上局
5000円で誰でも作れる新世代衛星地上局
 
All list of the measuring machines for microwave
All list of the measuring machines for microwaveAll list of the measuring machines for microwave
All list of the measuring machines for microwave
 
衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記
 
How to Build & Use OpenCL on Android Studio
How to Build & Use OpenCL on Android StudioHow to Build & Use OpenCL on Android Studio
How to Build & Use OpenCL on Android Studio
 
Radiation Test -Raspberry PI Zero-
Radiation Test -Raspberry PI Zero-Radiation Test -Raspberry PI Zero-
Radiation Test -Raspberry PI Zero-
 
Protocol of the DNA Extraction in Kitchen
Protocol of the DNA Extraction in KitchenProtocol of the DNA Extraction in Kitchen
Protocol of the DNA Extraction in Kitchen
 
將DNA在廚房抽出的程序
將DNA在廚房抽出的程序將DNA在廚房抽出的程序
將DNA在廚房抽出的程序
 
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
 

Similar a How to setup mastodon in chinese

Openshift by mtchang
Openshift by mtchangOpenshift by mtchang
Openshift by mtchangChang Mt
 
Ruby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuRuby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuMarsZ Chen
 
Nginx+常见应用技术指南
Nginx+常见应用技术指南Nginx+常见应用技术指南
Nginx+常见应用技术指南andy54321
 
Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档xuebao_zx
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)Wei Sun
 
KSDG Python and MongoDB for web
KSDG Python and MongoDB for webKSDG Python and MongoDB for web
KSDG Python and MongoDB for webToomore
 
Hongxing
HongxingHongxing
Hongxingncmooc
 
2019 COSCUP 用ETLKettle打造程序流水線
2019 COSCUP 用ETLKettle打造程序流水線2019 COSCUP 用ETLKettle打造程序流水線
2019 COSCUP 用ETLKettle打造程序流水線Freddy Fan
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on praticeKenny (netman)
 
Using google appengine_1027
Using google appengine_1027Using google appengine_1027
Using google appengine_1027Wei Sun
 
Using google appengine_final
Using google appengine_finalUsing google appengine_final
Using google appengine_finalWei Sun
 
Spark在苏宁云商的实践及经验分享
Spark在苏宁云商的实践及经验分享Spark在苏宁云商的实践及经验分享
Spark在苏宁云商的实践及经验分享alipay
 
再生龍於雲端環境之應用
再生龍於雲端環境之應用再生龍於雲端環境之應用
再生龍於雲端環境之應用Chenkai Sun
 
Docker容器微服務 x WorkShop
Docker容器微服務 x WorkShopDocker容器微服務 x WorkShop
Docker容器微服務 x WorkShopPhilip Zheng
 
Puppet安装总结
Puppet安装总结Puppet安装总结
Puppet安装总结Yiwei Ma
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來Shengyou Fan
 
[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127CAVEDU Education
 
2010 08-14 web-sitei18n
2010 08-14 web-sitei18n2010 08-14 web-sitei18n
2010 08-14 web-sitei18ntsunghaolee
 
Gops2016 云端基于Docker的微服务与持续交付实践
Gops2016 云端基于Docker的微服务与持续交付实践Gops2016 云端基于Docker的微服务与持续交付实践
Gops2016 云端基于Docker的微服务与持续交付实践Li Yi
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Yiwei Ma
 

Similar a How to setup mastodon in chinese (20)

Openshift by mtchang
Openshift by mtchangOpenshift by mtchang
Openshift by mtchang
 
Ruby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for UbuntuRuby on Rails 開發環境建置 for Ubuntu
Ruby on Rails 開發環境建置 for Ubuntu
 
Nginx+常见应用技术指南
Nginx+常见应用技术指南Nginx+常见应用技术指南
Nginx+常见应用技术指南
 
Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)
 
KSDG Python and MongoDB for web
KSDG Python and MongoDB for webKSDG Python and MongoDB for web
KSDG Python and MongoDB for web
 
Hongxing
HongxingHongxing
Hongxing
 
2019 COSCUP 用ETLKettle打造程序流水線
2019 COSCUP 用ETLKettle打造程序流水線2019 COSCUP 用ETLKettle打造程序流水線
2019 COSCUP 用ETLKettle打造程序流水線
 
Linux network monitoring hands-on pratice
Linux network monitoring hands-on praticeLinux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
 
Using google appengine_1027
Using google appengine_1027Using google appengine_1027
Using google appengine_1027
 
Using google appengine_final
Using google appengine_finalUsing google appengine_final
Using google appengine_final
 
Spark在苏宁云商的实践及经验分享
Spark在苏宁云商的实践及经验分享Spark在苏宁云商的实践及经验分享
Spark在苏宁云商的实践及经验分享
 
再生龍於雲端環境之應用
再生龍於雲端環境之應用再生龍於雲端環境之應用
再生龍於雲端環境之應用
 
Docker容器微服務 x WorkShop
Docker容器微服務 x WorkShopDocker容器微服務 x WorkShop
Docker容器微服務 x WorkShop
 
Puppet安装总结
Puppet安装总结Puppet安装总结
Puppet安装总结
 
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
[Modern Web 2016] 讓你的 PHP 開發流程再次潮起來
 
[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127[2]futurewad樹莓派研習會 141127
[2]futurewad樹莓派研習會 141127
 
2010 08-14 web-sitei18n
2010 08-14 web-sitei18n2010 08-14 web-sitei18n
2010 08-14 web-sitei18n
 
Gops2016 云端基于Docker的微服务与持续交付实践
Gops2016 云端基于Docker的微服务与持续交付实践Gops2016 云端基于Docker的微服务与持续交付实践
Gops2016 云端基于Docker的微服务与持续交付实践
 
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
 

Más de Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)

Más de Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院) (20)

What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?
 
半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!
 
Introduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPWIntroduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPW
 
Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会
 
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPiPrinciple Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
 
Microwaveguquantum
MicrowaveguquantumMicrowaveguquantum
Microwaveguquantum
 
The easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on WindowsThe easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on Windows
 
GNU Radio Study for Super beginner
GNU Radio Study for Super beginnerGNU Radio Study for Super beginner
GNU Radio Study for Super beginner
 
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
 
Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3
 
Zedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on ZedboardZedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on Zedboard
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 
3D Printed Google Cardboard for workshop
3D Printed Google Cardboard for workshop3D Printed Google Cardboard for workshop
3D Printed Google Cardboard for workshop
 
計算機(物理)
計算機(物理)計算機(物理)
計算機(物理)
 
Resume
ResumeResume
Resume
 
How to Use OpenMP on Native Activity
How to Use OpenMP on Native ActivityHow to Use OpenMP on Native Activity
How to Use OpenMP on Native Activity
 
How to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native ActivityHow to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native Activity
 
How to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCVHow to Make Hand Detector on Native Activity with OpenCV
How to Make Hand Detector on Native Activity with OpenCV
 
How to Make Android Native Application
How to Make Android Native ApplicationHow to Make Android Native Application
How to Make Android Native Application
 
How to Add Original Library to Android NDK
How to Add Original Library to Android NDKHow to Add Original Library to Android NDK
How to Add Original Library to Android NDK
 

How to setup mastodon in chinese

  • 1. ©SIProp Project, 2006-2008 1 如何在Ubuntu16.04設置自己的mastodon Noritsuna Imamura noritsuna@mstdn.noritsuna.jp
  • 2. ©SIProp Project, 2006-2017 2 Mastodon是什麼? 現在最有名的微博客系統 https://github.com/tootsuite/mastodon 特色 自由軟件!(非常重要) 分散系統(一樣的P2P) 全球的情況 日本 FB跟Twitter已經死了 法國 FB跟Twitter已經死了 意大利 FB跟Twitter已經死了 現在全球大家用Mastodon!!!
  • 3. ©SIProp Project, 2006-2017 3 日本的情況 三-五天(4月13-17號)六萬多用戶!!! Mstdn.jp : 七萬用戶 Pawoo.net(Pixiv) : 七萬用戶 friends.nico(niconico) : 八千用戶
  • 4. ©SIProp Project, 2006-2017 4 如何在Ubuntu設置自己的mastodon
  • 5. ©SIProp Project, 2006-2017 5 必需品 服務電腦 Mail服務器 DNS服務器 Web服務器 全球IP 網域名稱(FQDN) 我的推薦 在AWS設置Ubuntu 選擇AMI Image(Ubuntu 16.04) https://cloud-images.ubuntu.com/locator/ec2/
  • 6. ©SIProp Project, 2006-2017 6 準備你的domain 例子 服務電腦 AWS(Ubuntu 16.04) 全球IP 75.101.152.114 網域名稱(FQDN) mstdn.noritsuna.jp
  • 7. ©SIProp Project, 2006-2017 7 案裝docker 1. $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D 2. $ sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' 3. $ sudo apt-get update 4. $ sudo apt-get install -y docker-engine 5. $ sudo systemctl status docker 6. $ curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose- `uname -s`-`uname -m` > docker-compose 7. $ chmod +x docker-compose 8. $ sudo mv docker-compose /usr/local/bin/
  • 8. ©SIProp Project, 2006-2017 8 案裝mastodon: mastodon設定文件 1/3 1. $ git clone https://github.com/tootsuite/mastodon.git 2. $ git update-index --skip-worktree docker-compose.yml 編輯設定文件:docker-compose.yml 持續化 ### Uncomment to enable DB persistance volumes: - ./postgres:/var/lib/postgresql/data ### Uncomment to enable REDIS persistance volumes: - ./redis:/data
  • 9. ©SIProp Project, 2006-2017 9 案裝mastodon: mastodon設定文件 2/3 1. cp .env.production.sample .env.production 編輯設定文件:.evn.production 基本 LOCAL_DOMAIN=mstdn.noritsuna.jp LOCAL_HTTPS=true DB DB_USER=mastodon DB_NAME=mastodon DB_PASS=xxxx 暗號 PAPERCLIP_SECRET=[第一次的文字列] SECRET_KEY_BASE=[第二次的文字列] OTP_SECRET=[第三次的文字列] 1. sudo docker-compose run --rm web rake secret
  • 10. ©SIProp Project, 2006-2017 10 案裝mastodon: mastodon設定文件 3/3 1. cp .env.production.sample .env.production 編輯設定文件 Mail SMTP_SERVER=75.101.152.114 SMTP_PORT=25 SMTP_FROM_ADDRESS=noritsuna@siprop.org
  • 11. ©SIProp Project, 2006-2017 11 案裝mastodon: DB 1. sudo docker-compose build 2. sudo docker exec -it mastodon_db_1 /bin/bash 3. su - postgres 4. createuser -P mastodon 5. createdb mastodon -O mastodon 6. exit 7. exit 8. sudo docker-compose run --rm web rails db:migrate 9. sudo docker-compose run --rm web rails assets:precompile
  • 12. ©SIProp Project, 2006-2017 12 開始mastodon Run 1. sudo docker-compose up -d Stop 1. sudo docker stop $(sudo docker ps -a -q) Update 1. sudo docker-compose stop 2. git pull 3. sudo docker-compose build 4. sudo docker-compose up -d 5. sudo docker-compose run --rm web rails db:migrate 6. sudo docker-compose run --rm web rails assets:precompile 7. sudo docker stop $(sudo docker ps -a -q) && sudo docker-compose up -d
  • 13. ©SIProp Project, 2006-2017 13 如果你想自己用mastodon的時候: 註冊你的用戶 http://mstdn.noritsuna.jp/about 編輯設定文件 單用戶服務模式 SINGLE_USER_MODE=true 案裝mastodon: 單用戶服務模式 1. $ sudo docker-compose run --rm web rails mastodon:confirm_email USER_EMAIL=noritsuna@siprop.org 2. $ sudo docker-compose run --rm web rails mastodon:make_admin USERNAME=noritsuna
  • 14. ©SIProp Project, 2006-2017 14 案裝mastodon: SSL證書 1. $ sudo apt-get install letsencrypt 2. $ sudo letsencrypt certonly --standalone -d mstdn.noritsuna.jp -m noritsuna@siprop.org 3. $ sudo crontab -u root -e 4. 00 05 01 * * /usr/bin/letsencrypt certonly --webroot -w /data/www -d mstdn.noritsuna.jp -- renew
  • 15. ©SIProp Project, 2006-2017 15 案裝mastodon: Nginx設定文件 1/4 1. map $http_upgrade $connection_upgrade { 2. default upgrade; 3. '' close; 4. } 5. server { 6. listen 80; 7. listen [::]:80; 8. server_name mstdn.noritsuna.jp; 9. return 301 https://$host$request_uri; 10. } 11. server { 12. listen 443 ssl; 13. listen [::]:443 ssl; 14. server_name mastdn.noritsuna.jp; 15. ssl_protocols TLSv1.2; 16. ssl_ciphers EECDH+AESGCM:EECDH+AES; 17. ssl_ecdh_curve prime256v1;
  • 16. ©SIProp Project, 2006-2017 16 案裝mastodon: Nginx設定文件 2/4 1. ssl_prefer_server_ciphers on; 2. ssl_session_cache shared:SSL:10m; 3. ssl_certificate /etc/letsencrypt/live/mstdn.noritsuna.jp/fullchain.pem; 4. ssl_certificate_key /etc/letsencrypt/live/mstdn.noritsuna.jp/privkey.pem; 5. keepalive_timeout 70; 6. sendfile on; 7. client_max_body_size 0; 8. root /dummy/public; 9. gzip on; 10. gzip_disable "msie6"; 11. gzip_vary on; 12. gzip_proxied any; 13. gzip_comp_level 6; 14. gzip_buffers 16 8k; 15. gzip_http_version 1.1; 16. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  • 17. ©SIProp Project, 2006-2017 17 案裝mastodon: Nginx設定文件 3/4 1. add_header Strict-Transport-Security "max-age=31536000"; 2. location / { 3. try_files $uri @proxy; 4. } 5. location @proxy { 6. proxy_set_header Host $host; 7. proxy_set_header X-Real-IP $remote_addr; 8. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 9. proxy_set_header X-Forwarded-Proto https; 10. proxy_set_header Proxy ""; 11. proxy_pass_header Server; 12. proxy_pass http://127.0.0.1:3000; 13. proxy_buffering off; 14. proxy_redirect off; 15. proxy_http_version 1.1; 16. proxy_set_header Upgrade $http_upgrade; 17. proxy_set_header Connection $connection_upgrade; 18. tcp_nodelay on;
  • 18. ©SIProp Project, 2006-2017 18 案裝mastodon: Nginx設定文件 4/4 1. tcp_nodelay on; 2. } 3. location /api/v1/streaming { 4. proxy_set_header Host $host; 5. proxy_set_header X-Real-IP $remote_addr; 6. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 7. proxy_set_header X-Forwarded-Proto https; 8. proxy_set_header Proxy ""; 9. proxy_pass http://localhost:4000; 10. proxy_buffering off; 11. proxy_redirect off; 12. proxy_http_version 1.1; 13. proxy_set_header Upgrade $http_upgrade; 14. proxy_set_header Connection $connection_upgrade; 15. tcp_nodelay on; 16. } 17. error_page 500 501 502 503 504 /500.html; 18. }
  • 19. ©SIProp Project, 2006-2017 19 完成了!!!開始玩mastodon!!!
  • 20. ©SIProp Project, 2006-2017 20 為“沒有AWS”的朋友們
  • 21. ©SIProp Project, 2006-2017 21 如何用他人的mastodon服務
  • 22. ©SIProp Project, 2006-2017 22 例子: friends.nico的mastodon服務 NICONICO動畫服務的mastodon。 https://friends.nico/about
  • 23. ©SIProp Project, 2006-2017 23 註冊用戶
  • 24. ©SIProp Project, 2006-2017 24 確認郵件
  • 25. ©SIProp Project, 2006-2017 25 開始屏幕
  • 27. ©SIProp Project, 2006-2017 27 設定:語言
  • 28. ©SIProp Project, 2006-2017 28 但是‧‧‧
  • 29. ©SIProp Project, 2006-2017 29 查詢其他用戶 用戶名@服務的網域名稱 我自己的mastodon服務用戶 noritsuna@mstdn.noritsuna.jp NICONICO的服務用戶 noritsuna@friends.nico
  • 30. ©SIProp Project, 2006-2017 30 Follow其他用戶
  • 31. ©SIProp Project, 2006-2017 31 timeline的種類 Federated timeline(最多) 遠程服務電腦的timeline Local timeline (中多) 在同一服務電腦的timeline Home 你Followed用戶的timeline
  • 32. ©SIProp Project, 2006-2017 32 Federated timeline
  • 33. ©SIProp Project, 2006-2017 33 Local timeline
  • 35. ©SIProp Project, 2006-2017 35 為“宅男”的朋友們
  • 36. ©SIProp Project, 2006-2017 36 Pawoo.net的mastodon服務 Pixiv(圖片投稿網站)服務的mastodon。 https://pawoo.net/about