can3p / pcom

Private social network meant to enforce real human connections
Apache License 2.0
0 stars 0 forks source link
social

Pcom - private social network

Private as in the content is not public by default and discovery requires a human touch. Please refer to manifesto for more details.

If you want to follow the development, there is a youtube playlist with demos!

Dev Setup

Run the frontend

cd cmd/web; yarn watch

Run the server

cd cmd/web; make watchexec

psql access

psql -U pcom pcom_dev

schema changes

./sql-migrate new migration_name

Edit the file given by sql-migrate

./sql-migrate up
./generate.sh

Initial Setup

  1. change remote and push to the new repo
  2. change flytoml to point to the new app pcom
  3. create the app on fly flyctl apps create pcom
  4. create db, set 4gb ram fly postgres create -n pcomdb
  5. attach db to the app flyctl postgres attach -a pcom pcomdb
  6. Set secrets:

    flyctl secrets set SESSION_SALT=<random string>
    flyctl secrets set SITE_ROOT=https://pcom.com
    flyctl secrets set MJ_APIKEY_PUBLIC=<public key from mailjet>
    flyctl secrets set MJ_APIKEY_PRIVATE=<private key from mailjet>
    flyctl secrets set USER_MEDIA_ENDPOINT=<endpoint>
    flyctl secrets set USER_MEDIA_BUCKET=<bucket>
    flyctl secrets set USER_MEDIA_KEY=<key>
    flyctl secrets set USER_MEDIA_REGION=<region>
    flyctl secrets set USER_MEDIA_SECRET=<secret>
    flyctl secrets set SENDER_ADDRESS=<address>
    flyctl secrets set ADMIN_ADDRESS=<address>
    flyctl secrets set STATIC_CDN=<address> # in case you want to put static resources behind the cdn
    flyctl secrets set USER_MEDIA_CDN=<address> # in case you want to put user images behind the cdn
    
  7. Before
  8. Do first deploy fly deploy, make sure you can reach the app via .fly.dev
  9. Create a cert for your custom domain fly certs add pcom.com
  10. After it screams at you, add required A and AAAA records
  11. You might need to run fly certs check pcom.com a couple of times, fly certs list should show your domain with the status ready.
  12. You should be able to reach your app via custom domain at this point
  13. Got to mailjet and add new domain
  14. Add sender email address there
  15. Add required txt record to validate domain
  16. Add required txt records to add DKIM and SPF settings
  17. Add postgres db env var to cmd/web/.env via ./env.pl > cmd/web/.env, remove sslmode=disable and replace domain name with localhost
  18. Run the following from the project root to get the database schema in place

Tab 1:

fly proxy 5433:5432 -a pcomdb

Tab 2

./run.sh
./sqlmigrate.sh up

Development

cd cmd/web
yarn
yarn watch # in one tab
make watchexec # in another tab

Operational notes

Credits

The project has been generated by gogo-cli and uses gogo library