Compare commits

...
Sign in to create a new pull request.

6 commits

4 changed files with 41 additions and 10 deletions

View file

@ -74,16 +74,14 @@ If you have access to a server that supports one of the sources below, I recomme
- Install with [nvm](https://github.com/nvm-sh/nvm)
- 🐘 At least [PostgreSQL](https://www.postgresql.org/) v12
- 🍱 At least [Redis](https://redis.io/) v6 (v7 recommend)
- Web Proxy (one of the following)
- 🍀 Nginx (recommended)
- 🪶 Apache
### 😗 Optional dependencies
- [FFmpeg](https://ffmpeg.org/) for video transcoding
- [ElasticSearch](https://www.elastic.co/elasticsearch/) for full-text search
- OpenSearch/Sonic are not supported as of right now
- Management (choose one of the following)
- 🛰️ [pm2](https://pm2.io/)
- 🐳 [Docker](https://docker.com)
- Service manager (systemd, openrc, etc)
### 🏗️ Build dependencies
@ -138,13 +136,22 @@ psql postgres -c "create database calckey with encoding = 'UTF8';"
For migrating from Misskey v13, Misskey v12, and Foundkey, read [this document](https://codeberg.org/calckey/calckey/src/branch/develop/docs/migrate.md).
## 🍀 NGINX
## 🌐 Web proxy
### 🍀 Nginx (recommended)
- Run `sudo cp ./calckey.nginx.conf /etc/nginx/sites-available/ && cd /etc/nginx/sites-available/`
- Edit `calckey.nginx.conf` to reflect your instance properly
- Run `sudo cp ./calckey.nginx.conf ../sites-enabled/`
- Run `sudo ln -s ./calckey.nginx.conf ../sites-enabled/calckey.nginx.conf`
- Run `sudo nginx -t` to validate that the config is valid, then restart the NGINX service.
### 🪶 Apache
- Run `sudo cp ./calckey.apache.conf /etc/apache2/sites-available/ && cd /etc/apache2/sites-available/`
- Edit `calckey.apache.conf` to reflect your instance properly
- Run `sudo a2ensite calckey.apache` to enable the site
- Run `sudo service apache2 restart` to reload apache2 configuration
</details>
## 🚀 Build and launch!

13
calckey.apache.conf Normal file
View file

@ -0,0 +1,13 @@
# Replace example.tld with your domain
<VirtualHost *:80>
ServerName example.tld
# For WebSocket
ProxyPass "/streaming" "ws://127.0.0.1:3000/streaming/"
# Proxy to Node
ProxyPass "/" "http://127.0.0.1:3000/"
ProxyPassReverse "/" "http://127.0.0.1:3000/"
ProxyPreserveHost On
# For files proxy
AllowEncodedSlashes On
</VirtualHost>

View file

@ -146,6 +146,12 @@ export const NoteRepository = db.getRepository(Note).extend({
}
}
if (note.visibility === "home" || note.visibility === "public") {
if (meId == null) {
return !note.localOnly
}
}
return true;
},

View file

@ -11,8 +11,13 @@ export function generateVisibilityQuery(
if (me == null) {
q.andWhere(
new Brackets((qb) => {
qb.where(`note.visibility = 'public'`).orWhere(
`note.visibility = 'home'`,
qb.where(`note.localOnly = 'false'`)
.andWhere(
new Brackets((qb) => {
qb.where(`note.visibility = 'home'`).orWhere(
`note.visibility = 'public'`
)
})
);
}),
);