Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pleroma and document how #13

Open
rzr opened this issue Feb 29, 2020 · 1 comment
Open

Support pleroma and document how #13

rzr opened this issue Feb 29, 2020 · 1 comment

Comments

@rzr
Copy link
Owner

rzr commented Feb 29, 2020

https://pleroma.social/

@rzr
Copy link
Owner Author

rzr commented Sep 16, 2020

I think pleromaFE miss the feature to generate apps from web ui

For the record random notes:


## Notes:
website='https://pleroma.fr'
client_name="PleromaFE_deadbeef _2020-09-16T17:20:03.475Z"

host=mastodon.social
#host=pleroma.fr
base_url=https://$host

scopes="read write follow push"
scopes="read"

# base_url=https://mastodon.social
curl -X POST -F "client_name=${client_name}" -F 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' -F "scopes=${scopes}" -F "website=${website}" "${base_url}/api/v1/apps" | jq . | tee apps.log.tmp

#| {
#|   "client_id": "X-EpoaVeqTir6aZpX4vrKFb0_D1Wa_pz9J8Kdqee9JI",
#|   "client_secret": "6mIaWfJRe0LMEV--dwT8gUuzIfNqsbE1hsrVmWvBnP0",
#|   "id": "48477",
#|   "name": "Test Application",
#|   "redirect_uri": "urn:ietf:wg:oauth:2.0:oob",
#|   "website": "https://myapp.example",
#|   "vapid_key": "BPUTBNRKx9ygHQx4BLz8FvJDYnRNQjF-STIhBCufONjuhgwIlDjDFfVLlR5-_SSq6yGK4UDujd-_g9ROwcd5VPM"
#| }

client_id=$(jq .client_id < apps.log.tmp)

client_secret=$(jq .client_secret < apps.log.tmp)

vapid_key=$(jq .vapid_key < apps.log.tmp)

curl -X POST \
	-F "client_id=${client_id}" \
	-F "client_secret=${client_secret}" \
	-F 'redirect_uri=urn:ietf:wg:oauth:2.0:oob' \
	-F 'grant_type=client_credentials' \
        ${base_url}/oauth/token | jq . | tee token.log.tmp

#| {
#|   "access_token": "frBfjnQyu1mrzhtcpfefz1n8RHGMwhjEznf44u7Yj_w",
#|   "created_at": 1600276104,
#|   "expires_in": 600,
#|   "refresh_token": "Afb0yyEnmUX0emTSntHBHQqogHQP-eA23EXRSBVhIVM",
#|   "scope": "read write follow push",
#|   "token_type": "Bearer"
#| }

access_token=$(jq .access_token < token.log.tmp)

cat<<EOF> ~/.mastodon-lite.json
{
  "access_token": ${access_token},
  "host": "${host}",
  "port": 443,
  "api": "/api/v1",
  "rejectUnauthorized": false
}
EOF

 cat ~/.mastodon-lite.json


make start runtime=node
# {"error":"Invalid credentials."}
## Notes:
# https://git.pleroma.social/pleroma/harbour-kyclos/-/blob/develop/qml/pages/LoginPage.qml#L127
website='https://pleroma.fr'
client_name="PleromaFE_deadbeef _2020-09-16T17:20:03.475Z"

host=mastodon.social
#host=pleroma.fr
base_url=https://$host

scopes="read write follow push"
scopes="read"

# base_url=https://mastodon.social
curl -X POST -F "client_name=${client_name}" -F 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' -F "scopes=${scopes}" -F "website=${website}" "${base_url}/api/v1/apps" | jq . | tee apps.log.tmp

#| {
#|   "client_id": "X-EpoaVeqTir6aZpX4vrKFb0_D1Wa_pz9J8Kdqee9JI",
#|   "client_secret": "6mIaWfJRe0LMEV--dwT8gUuzIfNqsbE1hsrVmWvBnP0",
#|   "id": "48477",
#|   "name": "Test Application",
#|   "redirect_uri": "urn:ietf:wg:oauth:2.0:oob",
#|   "website": "https://myapp.example",
#|   "vapid_key": "BPUTBNRKx9ygHQx4BLz8FvJDYnRNQjF-STIhBCufONjuhgwIlDjDFfVLlR5-_SSq6yGK4UDujd-_g9ROwcd5VPM"
#| }

client_id=$(jq .client_id < apps.log.tmp)

client_secret=$(jq .client_secret < apps.log.tmp)

vapid_key=$(jq .vapid_key < apps.log.tmp)

curl -X POST \
	-F "client_id=${client_id}" \
	-F "client_secret=${client_secret}" \
	-F 'redirect_uri=urn:ietf:wg:oauth:2.0:oob' \
	-F 'grant_type=client_credentials' \
        ${base_url}/oauth/token | jq . | tee token.log.tmp

#| {
#|   "access_token": "frBfjnQyu1mrzhtcpfefz1n8RHGMwhjEznf44u7Yj_w",
#|   "created_at": 1600276104,
#|   "expires_in": 600,
#|   "refresh_token": "Afb0yyEnmUX0emTSntHBHQqogHQP-eA23EXRSBVhIVM",
#|   "scope": "read write follow push",
#|   "token_type": "Bearer"
#| }

access_token=$(jq .access_token < token.log.tmp)

cat<<EOF> ~/.mastodon-lite.json
{
  "access_token": ${access_token},
  "host": "${host}",
  "port": 443,
  "api": "/api/v1",
  "rejectUnauthorized": false
}
EOF

 cat ~/.mastodon-lite.json


make start runtime=node
# {"error":"Invalid credentials."}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant