social-app を更新
@ -150,8 +150,8 @@ function at-repos-social-app-write() {
|
|||||||
f=$dt/lib/strings/url-helpers.ts
|
f=$dt/lib/strings/url-helpers.ts
|
||||||
sed -i 's#`https://go\.syu\.is/redirect\?u=\${encodeURIComponent(url)}`#url#g' $f
|
sed -i 's#`https://go\.syu\.is/redirect\?u=\${encodeURIComponent(url)}`#url#g' $f
|
||||||
|
|
||||||
f=$dt/state/geolocation.tsx
|
#f=$dt/state/geolocation.tsx
|
||||||
sed -i 's#https://syu\.is/ipcc#https://bsky\.app/ipcc#g' $f
|
#sed -i 's#https://syu\.is/ipcc#https://bsky\.app/ipcc#g' $f
|
||||||
|
|
||||||
f=$dt/view/icons/Logotype.tsx
|
f=$dt/view/icons/Logotype.tsx
|
||||||
o=$d/icons/Logotype.tsx
|
o=$d/icons/Logotype.tsx
|
||||||
@ -165,3 +165,52 @@ function at-repos-social-app-write() {
|
|||||||
grep -R $did_admin .|cut -d : -f 1|sort -u|xargs sed -i "s/${did_admin}/${did}/g"
|
grep -R $did_admin .|cut -d : -f 1|sort -u|xargs sed -i "s/${did_admin}/${did}/g"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## ipcc
|
||||||
|
|
||||||
|
自前のサービスにするか、あるいは、dockerで建てるかです。
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Cloudflare Workerのコード
|
||||||
|
export default {
|
||||||
|
async fetch(request) {
|
||||||
|
// IPアドレスから国を取得
|
||||||
|
const country = request.cf?.country || 'JP';
|
||||||
|
|
||||||
|
return new Response(JSON.stringify({ countryCode: country }), {
|
||||||
|
status: 200,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Access-Control-Allow-Origin': '*', // CORSを許可!
|
||||||
|
'Access-Control-Allow-Methods': 'GET',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
dokcerの方法は以下。
|
||||||
|
|
||||||
|
> ./configs/ipcc/default.conf
|
||||||
|
|
||||||
|
```js
|
||||||
|
server {
|
||||||
|
location / {
|
||||||
|
add_header Content-Type application/json;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
return 200 '{"countryCode":"JP"}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> compose.yml
|
||||||
|
|
||||||
|
```yml
|
||||||
|
ipcc:
|
||||||
|
image: nginx:alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./configs/ipcc/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
ports:
|
||||||
|
- "8099:80"
|
||||||
|
```
|
Reference in New Issue
Block a user