Skip to content

Commit 696f4e8

Browse files
committed
configure atproto passwords in infra
1 parent a9ddea0 commit 696f4e8

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

backend/twitterbot/models/tweeted.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ def bluesky_url(self):
6969
r"at://(?P<authority>.+)/(?P<collection>.+)/(?P<key>.+)",
7070
self.atproto_uri,
7171
)
72-
if not match:
73-
return None
74-
if match.group("collection") != "app.bsky.feed.post":
72+
if not match or match.group("collection") != "app.bsky.feed.post":
7573
return None
7674
return f"https://bsky.app/profile/{match.group('authority')}/post/{match.group('key')}"
7775

infra/ansible/roles/django/templates/settings.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@ TWITTERBOT_CREDENTIALS:
6969
"CONSUMER_SECRET": "{{consumer_secret_twitterbot_fr}}",
7070
"ACCESS_TOKEN": "{{access_token_twitterbot_fr}}",
7171
"ACCESS_TOKEN_SECRET": "{{access_token_secret_twitterbot_fr}}",
72+
"ATPROTO_HANDLE": "tournesolbotfr.tournesol.app",
73+
"ATPROTO_PASSWORD": "{{atproto_password_tournesolbot_fr}}",
7274
}
7375
"@TournesolBot": {
7476
"LANGUAGE": "en",
7577
"CONSUMER_KEY": "{{consumer_key_twitterbot_en}}",
7678
"CONSUMER_SECRET": "{{consumer_secret_twitterbot_en}}",
7779
"ACCESS_TOKEN": "{{access_token_twitterbot_en}}",
7880
"ACCESS_TOKEN_SECRET": "{{access_token_secret_twitterbot_en}}",
81+
"ATPROTO_HANDLE": "tournesolbot.tournesol.app",
82+
"ATPROTO_PASSWORD": "{{atproto_password_tournesolbot_en}}",
7983
}
8084

8185
DISCORD_CHANNEL_WEBHOOKS: {

infra/ansible/scripts/deploy-without-secrets.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ ansible-playbook -i inventory.yml -l "$ANSIBLE_HOST" "$SETUP_FILE" \
5757
-e "discord_infra_alert_private_webhook=${DISCORD_INFRA_ALERT_PRIVATE_WEBHOOK:-""}" \
5858
-e "discord_twitter_webhook=${DISCORD_TWITTER_WEBHOOK:-""}" \
5959
-e "plausible_analytics_secret_key=$PLAUSIBLE_ANALYTICS_SECRET_KEY" \
60+
-e "atproto_password_tournesolbot_fr=$ATPROTO_PASSWORD_BOT_FR" \
61+
-e "atproto_password_tournesolbot_en=$ATPROTO_PASSWORD_BOT_EN" \

infra/ansible/scripts/forget-secrets.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ unset DISCORD_INFRA_ALERT_WEBHOOK
3030
unset DISCORD_INFRA_ALERT_PRIVATE_WEBHOOK
3131
unset DISCORD_TWITTER_WEBHOOK
3232
unset PLAUSIBLE_ANALYTICS_SECRET_KEY
33+
unset ATPROTO_PASSWORD_BOT_FR
34+
unset ATPROTO_PASSWORD_BOT_EN

infra/ansible/scripts/get-vm-secrets.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,9 @@ export DISCORD_TWITTER_WEBHOOK
9999

100100
PLAUSIBLE_ANALYTICS_SECRET_KEY="$(ssh "$VM_USER@$VM_ADDR" -- sudo cat /root/plausible_analytics_secret_key)"
101101
export PLAUSIBLE_ANALYTICS_SECRET_KEY
102+
103+
ATPROTO_PASSWORD_BOT_FR=$(get_settings_value .TWITTERBOT_CREDENTIALS.\"@TournesolBotFR\".ATPROTO_PASSWORD)
104+
export ATPROTO_PASSWORD_BOT_FR
105+
106+
ATPROTO_PASSWORD_BOT_EN=$(get_settings_value .TWITTERBOT_CREDENTIALS.\"@TournesolBot\".ATPROTO_PASSWORD)
107+
export ATPROTO_PASSWORD_BOT_EN

0 commit comments

Comments
 (0)