You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 19, 2025. It is now read-only.
In order to communicate with the mastodon instance, you'll have to generate an API Token. It is totally free. Reminder: your application name will be publicly visible.
48
-
1. Go to your account's application page: `https://{yourinstance.tld}/settings/applications/new`
49
-
2. Create a new application with the following scopes:
50
-
-`read:accounts`: get your mastodon account username
51
-
-`write:media`: post medias
52
-
-`write:statuses`: post toots
53
-
-`write:accounts`: update your profile
54
-
3. Populate the [Environment](#Environment) section with your `access token`.
55
-
56
-
### Twitter configuration
57
-
The tweets retrieval by itself can be done without Twitter credentials. But keep in mind that twitter currently blocks guests to access users' replies.
58
-
Touitomamout is trying to restore the previous session, so you'll not get spammed by the Twitter security team for each connection.
59
-
60
-
61
-
> **Note**
62
-
>
63
-
> The configuration allows you to sync a first account and authenticate with a secondary account for two reasons:
64
-
> 1. Currently, there is no simple way to authenticate with an account having 2FA enabled, so you may not want to lower your main account security.
65
-
> 2. Because this project is running with a non-official API, you may not want to put your account at risk.
66
-
67
-
68
-
### Environment
69
-
First things first, please copy the [`.env.example`](https://github.com/louisgrasset/touitomamout/blob/main/.env.example) file to `.env`.
70
-
Then, please fill each variable.
71
-
72
-
> **Warning**
73
-
>
74
-
> Do not forget to properly choose the `EXECUTION` variable.
75
-
> Two values are allowed:
76
-
> 1.`manual`: a simple node script execution
77
-
> 2.`pm2`: spawns as a new PM2 process, named with `touitomamout-${instance_id}` pattern.
78
-
79
-
80
-
### Multiple instances
81
-
This project supports a multiple instances mode. To do so, simply provide multiple `.env` files such as `.env.instance1` and `.env.instance2`.
82
-
83
-
`deploy` & `deploy:update` scripts will handle them properly.
84
-
85
-
## Run it
86
-
87
-
### Manually
88
-
You can simply run a `node ./dist/index.js .env` and have a one shot sync of your recent tweets.
89
-
90
-
> **Note**
91
-
>
92
-
> Don't forget to replace `.env` with the right .env filename.
93
-
94
-
95
-
### Cron
96
-
Because automation is cool, feel free to run that script everytime you need to.
97
-
Simply create your cron [here](https://crontab.guru).
98
-
99
-
### PM2 support
100
-
[PM2](https://pm2.keymetrics.io/) is a utility that allows you to monitor and run periodically your node scripts.
101
-
Thus, it can be useful for some users to deploy Touitomamout to a PM2 instance.
102
-
103
-
#### **PM2**: First run
104
-
```bash
105
-
npm run deploy
106
-
```
107
-
108
-
#### **PM2**: Update your instance after a code update
109
-
Your instance will be removed and will be generated again with the latest codebase.
110
-
Your `cache.instance.json` file is kept, so you won't have duplicated toots.
111
-
```bash
112
-
npm ci &&
113
-
npm run build &&
114
-
npm run deploy:update
115
-
```
116
-
117
-
### Docker
118
-
You can alternatively rely on docker and use the `docker-compose.yml` file.
3 types of environment variables are required to run the sync:
15
+
-**Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables)
16
+
-**Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-)
17
+
-**Docker variables**: required for the docker container, get them [here](/docs/resources/environment-variables#configuration-with-docker-)
18
+
19
+
<TipFileGenerator />
20
+
21
+
## Create the touitomamout docker container
22
+
Two ways of creating it: either by using the image or by building it from the source code. The first one is a bit easier, but features will be the same in both cases.
23
+
24
+
---
25
+
📦 Releases are published on the following registries:
3 types of environment variables are required to run the sync:
19
+
-**Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables).
20
+
-**Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-).
21
+
-**PM2 variables**: required for the PM2 instance, get them [here](/docs/resources/environment-variables#configuration-with-pm2-).
22
+
23
+
<TipFileGenerator />
24
+
25
+
Once your env variables are ready, inject them in a .env.{handle_to_sync} file. (e.g: `.env.signalapp`)
26
+
27
+
## Run it!
28
+
29
+
Touitomamout comes with a script that will automatically handle the PM2 instances management for you.
30
+
31
+
Simply run the following command, and all your `.env.{handle_to_sync}` files will be used by PM2 to create a dedicated Touitomamout instance for each.
32
+
33
+
```bash
34
+
npm run pm2
35
+
```
36
+
37
+
:::info I upgraded the project to the latest version, what should I do?
38
+
If you upgrade the project, you will need to update the PM2 instance(s) to use the latest version of the project. But that's as quick as running the following command:
| 📌 `MASTODON_INSTANCE`| ∅ || The mastodon instance the account is registered on. |
31
+
| 📌 `MASTODON_ACCESS_TOKEN`| ∅ || The mastodon access token to authenticated the sync requests. |
| 📌 `BLUESKY_INSTANCE`| ∅ |**Bluesky**::auth | The bluesky instance the account is registered on.<br/>_(eg: `bsky.social`)_|
37
-
| 📌 `BLUESKY_IDENTIFIER`| ∅ |**Bluesky**::auth | The bluesky user identifier.<br/>_(eg: `handle.bsky.social`)_|
38
-
| 📌 `BLUESKY_PASSWORD`| ∅ |**Bluesky**::auth | The bluesky password.<br/>_(Can be a user password or an [app password](https://bsky.app/settings/app-passwords))_|
| 📌 `BLUESKY_INSTANCE`| ∅ || The bluesky instance the account is registered on.<br/>_(eg: `bsky.social`)_|
38
+
| 📌 `BLUESKY_IDENTIFIER`| ∅ || The bluesky user identifier.<br/>_(eg: `handle.bsky.social`)_|
39
+
| 📌 `BLUESKY_PASSWORD`| ∅ || The bluesky password.<br/>_(Can be a user password or an [app password](https://bsky.app/settings/app-passwords))_|
| 📌 `DAEMON`| false || ⚠️ Set it to **false**. Without this, you'll get multiple instances running without end. |
|`DAEMON`| false || Set it to **false** for a one shot sync, to **true** to make it run again |
81
+
|`SYNC_FREQUENCY_MIN`| 30 || At which frequency run the sync. Only apply if you set `DAEMON` to **true**|
0 commit comments