Go to file
Wamm K. D 7d9de8aa9e And we're not using this, anymore. 2023-08-12 19:11:12 -05:00
assets As soon as I hardcoded that, I smelt something funky… 2023-08-04 21:22:46 -05:00
config Let's make this controllable by anyone running this; defaults to ~true~. 2023-07-07 00:16:49 -05:00
lib And we're not using this, anymore. 2023-08-12 19:11:12 -05:00
priv I was hanging back on creating these as I wanted to avoid introducing 2023-07-18 20:45:46 -05:00
rel/overlays/bin Fly.io generated a =Dockerfile= for me, based off of ~mix 2022-09-17 04:31:38 -05:00
test And, also, test generating =Activity= ~attrs~. 2023-07-18 00:35:22 -05:00
.dockerignore Fly.io generated a =Dockerfile= for me, based off of ~mix 2022-09-17 04:31:38 -05:00
.formatter.exs And the start of a new Phoenix project. 2020-12-07 00:49:13 -06:00
.gitignore Another new change: truly static files go under `/priv/static/`, now, 2022-07-15 20:03:34 -05:00
CODE_OF_CONDUCT.md This is…wildly subjective and ablist to autistic people, who have 2021-08-21 23:39:46 -05:00
Dockerfile Fly.io generated a =Dockerfile= for me, based off of ~mix 2022-09-17 04:31:38 -05:00
LICENSE Initial commit 2019-03-29 21:55:35 -05:00
Procfile Adding these to (hopefully) be able to deploy to Heroku. 2020-12-13 20:38:52 -06:00
README.org I figured some stuff out so updating the README. 2023-06-22 01:43:16 -05:00
ROADMAP.org Commit this so we can keep track of it. 2023-07-29 06:38:26 -05:00
compile Speaking of defaults for the buildpacks, let's tweak the default to 2022-07-17 01:27:31 -05:00
elixir_buildpack.config Turns out this version isn't supported, yet, so scale back, slightly. 2022-11-03 21:41:53 -05:00
fly.toml Fly.io generated a =Dockerfile= for me, based off of ~mix 2022-09-17 04:31:38 -05:00
mix.exs Looks like they've updated in the last year; let's use the latest. 2023-06-18 02:20:05 -05:00
mix.lock Looks like they've updated in the last year; let's use the latest. 2023-06-18 02:20:05 -05:00
package-lock.json And, with those changes in place, we can update the package-lock. 2022-07-15 21:41:33 -05:00
phoenix_static_buildpack.config O. K.; so I don't remember if the root of the project had 2020-12-14 10:44:26 -06:00

README.org

Swanye

A tumblelog in the style of Tumblr.

Swanye is still incredibly pre-alpha software; it is highly unrecommended to run Swanye in anything other than a local setup, at this point in time.

Getting started

Swanye relies on a few dependencies:

In order to run Swanye, make sure you have these installed; basic, out-of-the-box configuration should suffice to get Swanye working. Do remember to create a user, in your database, for the username and password defined under config/dev.exs.

With those installed, to start your Phoenix server :

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with npm install inside the assets directory

    • this is primarily to run the SASS monitor when developing which will build the CSS files we need for production
    • JavaScript will be handled by Phoenix's esbuild
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000">localhost:4000 from your browser.

Ready to run in production? Please check Phoenix's deployment guides.

For Guix Users

Because mix will try to build certain dependencies locally, you will need the packages make and gcc-toolchain; you will also need to prefix CC=gcc for mix commands as it will look for cc before gcc, as well.

In order for Elixir to monitor the system as it runs, it will complain about a lack of inotify-tools and the RsaEx dependency will expect for openssl to be executable for it.

For now, running guix shell elixir node mariadb make gcc-toolchain inotify-tools openssl should be sufficient to get you up and running, I think (without polluting your profile with dependencies you probably don't want to keep).

I am hoping to create a Guix file so you can just run guix shell from the root of the project and not worry about the details but haven't found the time, yet.

Production Deployment

Currently, I've been deploying this code via Heroku. I've been using the buildpacks Heroku Buildpack Elixir and Phoenix Static Buildpack.

The relevant files for the first buildpack are Procfile and elixir_buildpack.config. Procfile sets which environment is being used and holds the command to start the project. elixir_buildpack.config's most relevant bits are setting the versions of both Erlang and Elixir.

The relevant files for the second buildpack is compile, overwriting the default compile script of Phoenix Static Buildpack. The main difference from the default script is using mix "assets.deploy" instead of mix "${phoenix_ex}.digest".

The SASS and JavaScript files under assets (in /css and /js, respectively) need to be generated so the processes handled by the files, above, need to be ensured if you try to run this code outside of a Heroku (with the aforementioned buildpacks) environment/situation.

Environment Variables

While MariaDB variables are already hardcoded so that the don't need to be provided to connect to a database when running locally, the variables MAILGUN_API_KEY and MAILGUN_DOMAIN must be provided for E-mail functionality. Currently, Swanye is setup to use Mailgun to send E-mails; obviously, providing greater choice (and, hopefully, more libre options) is a desire, for the future.

DREAM_OBJECTS_ACCESS_KEY_ID and DREAM_OBJECTS_SECRET_ACCESS_KEY can be provided to test image uploading and storage usage; you must have a DreamObjects account for this, however.

Production environment variables in use are:

  • DREAM_OBJECTS_ACCESS_KEY_ID DreamObjects ID, for image storage
  • DREAM_OBJECTS_SECRET_ACCESS_KEY DreamObjects Secret, for image storage
  • MARIADB_USERNAME MariaDB username for database access
  • MARIADB_PASSWORD MariaDB password for database access
  • MARIADB_HOST MariaDB host/domain for database access
  • MARIADB_DATABASE MariaDB database name for database access
  • SECRET_KEY_BASE Used by Phoenix; generate with mix phx.gen.secret
  • MAILGUN_API_KEY Your Mailgun-given API key
  • MAILGUN_DOMAIN The Mailgun domain of your Mailgun account
  • PHX_HOST (for Prod.) The domain of your site
  • PORT (optional) The port you need your application to connect to, if not 4000

Other places to find us

If you want to follow for updates about the development progress, general updates (including my thoughts about new features and how development is going) can be found at our Mastodon account.

If you're interested in helping support me so I can work on Swanye, the project also has a Liberapay.