fix some doc issues, add run_mastodon_for_tests.sh

master
halcy 2025-08-26 19:51:29 +03:00
rodzic 6ee81693c9
commit 48ad964057
3 zmienionych plików z 34 dodań i 4 usunięć

Wyświetl plik

@ -18,9 +18,8 @@ All of these help immensely, even if it's just "hey, I don't really get why X is
have are, so while I'm not going to implement every suggestion and do have some ideas of what does and does not make a good library, your feedback is, in fact, extremely valuable
and welcome.
If you're looking for some "starter issues" to address: Currently, we don't have support for much of any of the new 4.0.0 API endpoints implemented. Pick one and have a go,
especially from the admin API. Tests are somewhat annoying to set up, as they need to run against a live mastodon instance - great if you can write them, but feel free to
skip out on them, too, or just write them "in the dry" without actually running them and leaving that for someone else.
If you're looking for some "starter issues" to address, have a look at CONTRIBUTING.md or TODO.md in the repository ( https://github.com/halcy/Mastodon.py ) and see if anything
seems like you'd want to give it a try.
Tests
-----

Wyświetl plik

@ -39,7 +39,7 @@ Then, log in. This can be done every time your application starts, or you can us
Note that previous versions of Mastodon allowed logging in with username and
password - unfortunately, due to security concerns, Mastodon has started
requiring OAuth starting with version 4.4.0. If you're building a bot, you
may with to instead just generate a token in the UI (On Mastodon:
may wish to instead just generate a token in the UI (On Mastodon:
your-server.com/settings/applications) and use it directly
To post, create an actual API instance:

Wyświetl plik

@ -0,0 +1,31 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 /path/to/mastodon/"
exit 1
fi
TOOTCTL_DIR="$1"
SETUP_DIR="$(pwd)"
# Start services
sudo /etc/init.d/redis-server start && sleep 3
sudo /etc/init.d/postgresql start && sleep 3
sudo redis-cli flushall && sleep 3 && \
sudo /etc/init.d/redis-server restart
# Change to tootctl dir
cd "$TOOTCTL_DIR" || { echo "Directory $TOOTCTL_DIR not found"; exit 1; }
# Database setup & accounts
RAILS_ENV=development rails db:setup && \
RAILS_ENV=development bin/tootctl accounts create admin2 --email zerocool@example.com --confirmed --approve --role Owner && \
RAILS_ENV=development bin/tootctl accounts create mastodonpy_test --email mastodonpy_test@localhost --approve --confirmed && \
RAILS_ENV=development bin/tootctl accounts create mastodonpy_test_2 --email mastodonpy_test_2@localhost --approve --confirmed && \
RAILS_ENV=development bin/tootctl settings registrations open
# Run setup.sql from original dir
psql -d mastodon_development < "$SETUP_DIR/setup.sql" && sleep 4
# Launch services
RAILS_ENV=development LAUNCHY_DRY_RUN=true DB_PASS="1234" foreman start