puyoskey/README.md

275 lines
No EOL
6.4 KiB
Markdown

<div align="center">
<img src="./docs/logo.png" height="150" />
<h2>ぷよすきー</h2>
**🌎 [Puyoskey](https://git.v-sli.me/HidemaruOwO/puyoskey) is federated SNS based on Sharkey 🚀**
</div>
## Usage 💨
<details>
<summary> Install depencies for AlmaLinux 9 Server ⛏️</summary>
install cli depencies
```bash
dnf install -y epel-release
dnf config-manager --set-enabled crb
dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm -y
dnf install --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm -y
dnf update -y
dnf install -y git make automake gcc gcc-c++ kernel-devel kernel-headers ffmpeg vim jemalloc
dnf groupinstall -y "Development Tools"
```
install Node.js and pnpm:
```bash
curl -fsSL https://rpm.nodesource.com/setup_22.x | bash -
dnf install nodejs -y
corepack enable
# To type y
pnpm
```
</details>
- Manual Install
create user for puyoskey:
```bash
useradd -m -D puyoskey
```
switch created user:
```bash
sudo -iu puyoskey
```
clone the puyoskey repository, and copy the example configuration file:
```bash
git clone --recurse-submodules -b master https://git.v-sli.me/HidemaruOwO/puyoskey.git
cd puyoskey
pnpm install --frozen-lockfile
cp .config/example.yml .config/default.yml
```
build puyoskey:
```bash
pnpm run build
```
- setup DB (if postgresql installed):
attach psql:
```bash
sudo -u postgres psql
```
```sql
CREATE DATABASE puyoskey WITH ENCODING = 'UTF8';
CREATE USER puyoskey WITH ENCRYPTED PASSWORD '{YOUR_PASSWORD}';
GRANT ALL PRIVILEGES ON DATABASE puyoskey TO puyoskey;
ALTER DATABASE puyoskey OWNER TO puyoskey;
\q
```
edit configuration file:
```bash
vim .config/default.yml
```
create the schema:
```bash
pnpm run init
```
start puyoskey:
```bash
pnpm start
```
<details>
<summary>Run with systemd (you should change user as root)</summary>
Create a file `/etc/systemd/system/puyoskey.service` containing:
```bash
[Unit]
Description=Puyoskey daemon
[Service]
Type=simple
User=puyoskey
ExecStart=/bin/pnpm start
WorkingDirectory=/home/puyoskey/puyoskey
Environment="NODE_OPTIONS=--max-old-space-size=8192"
Environment="NODE_ENV=production"
Environment="LD_PRELOAD=/usr/lib64/libjemalloc.so.2"
TimeoutSec=60
StandardOutput=journal
StandardError=journal
SyslogIdentifier=puyoskey
Restart=always
[Install]
WantedBy=multi-user.target
```
enable and run daemon service
```bash
systemctl daemon-reload
systemctl enable --now puyoskey.service
```
- do you want periodic restart process?
Create a file `/etc/systemd/system/puyoskey.timer`:
```bash
[Unit]
Description = Puyoskey restart timer
[Timer]
OnCalendar = daily
Unit=puyoskey-restart.service
[Install]
WantedBy = timers.target
```
Create a file `/etc/systemd/system/puyoskey-restart.service`:
```bash
[Unit]
Description=Restart puyoskey service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart puyoskey.service
[Install]
WantedBy=multi-user.target
```
enable timer:
```bash
systemctl enable puyoskey.timer
```
</details>
## Update 💫
```bash
git checkout master
git pull
git submodule update --init
pnpm install --frozen-lockfile
pnpm run build
pnpm run migrate
```
## Something Error 💣
you should rebuild puyoskey
```bash
pnpm run clean-all
pnpm rebuild
```
## Update from Sharkey 🦈
When Sharkey is updated, puyoskey needs to follow suit!
```bash
# If u have not yet added sharkey remote
git remote add base https://activitypub.software/TransFem-org/Sharkey.git
git fetch base
git checkout -b stable base/stable
# switch puyoskey branch
git checkout master
# merge from stable branch
git merge --squash stable
# If u respond to conflicts or u don't got conflicts.
# Commit message is example.
git commit -m ":recycle: Merge updates from upstream as v2024.11.2"
git push origin master
```
---
<details>
<summary>Sharkey Original README</summary>
<div align="center">
<a href="https://joinsharkey.org/">
<img src="https://activitypub.software/TransFem-org/Sharkey/-/raw/develop/packages/frontend/assets/sharkey.svg" alt="Sharkey logo" style="border-radius:50%" width="300"/>
</a>
**🌎 **[Sharkey](https://joinsharkey.org/)** is an open source, decentralized social media platform that's free forever! 🚀**
---
<a href="https://docs.joinsharkey.org/docs/install/fresh/">
<img src="https://custom-icon-badges.herokuapp.com/badge/create_an-instance-FBD53C?logoColor=FBD53C&style=for-the-badge&logo=server&labelColor=363B40" alt="create an instance"/></a>
<a href="./CONTRIBUTING.md">
<img src="https://custom-icon-badges.herokuapp.com/badge/become_a-contributor-A371F7?logoColor=A371F7&style=for-the-badge&logo=git-merge&labelColor=363B40" alt="become a contributor"/></a>
<a href="https://discord.gg/6VgKmEqHNk">
<img src="https://custom-icon-badges.herokuapp.com/badge/join_the-community-5865F2?logoColor=5865F2&style=for-the-badge&logo=discord&labelColor=363B40" alt="join the community"/></a>
<a href="https://opencollective.com/sharkey">
<img src="https://custom-icon-badges.herokuapp.com/badge/donate-81ACF4?logoColor=81ACF4&style=for-the-badge&logo=opencollective&labelColor=363B40" alt="donate"/></a>
---
</div>
<div>
<a href="https://joinsharkey.org/"><img src="https://cdn.shonk.social/files/b671c81c-58cf-4f13-bc96-af0b0c96c667.webp" align="right" height="520px"/></a>
## ✨ Features
- **ActivityPub support**\
Not on Sharkey? No problem! Not only can Sharkey instances talk to each other, but you can make friends with people on other networks like Mastodon and Pixelfed!
- **Federated Backgrounds and Music status**\
You can add a background to your profile as well as a music status via ListenBrainz, show everyone what music you are currently listening to
- **Mastodon API**\
Sharkey implements the Mastodon API unlike normal Misskey
- **UI/UX Improvements**\
Sharkey makes some UI/UX improvements to make it easier to navigate
- **Sign-Up Approval**\
With Sharkey, you can enable sign-ups, subject to manual moderator approval and mandatory user-provided reasons for joining.
- **Rich Web UI**\
Sharkey has a rich and easy to use Web UI!
It is highly customizable, from changing the layout and adding widgets to making custom themes.
Furthermore, plugins can be created using AiScript, an original programming language.
- And much more...
</div>
<div style="clear: both;"></div>
## Documentation
Sharkey Documentation can be found at [Sharkey Documentation](https://docs.joinsharkey.org/docs/install/fresh/)
</details>