2018-01-20 23:48:31 +00:00
# MediaGoblin
2018-02-11 00:54:26 +00:00
A basic container for a private MediaGoblin media server (https://mediagoblin.org/), including Nginx and uWSGI. Assumes a separate PostgreSQL database for persistence, and an email host for sending email notifications.
2018-01-20 23:48:31 +00:00
2022-08-01 19:06:17 +00:00
Hosted at https://projects.torsion.org/witten/mediagoblin-docker
2018-01-20 23:48:31 +00:00
## Environment variables
2018-01-20 23:50:08 +00:00
* `NOTIFICATION_EMAIL` : From address for MediaGoblin notification emails.
2018-02-11 00:54:26 +00:00
* `EMAIL_HOSTNAME` : Hostname used to send outgoing notification emails.
* `EMAIL_PORT` : Port number used to send outgoing notification emails.
* `EMAIL_USERNAME` : Username used to connect to outgoing email host.
* `EMAIL_PASSWORD` : Password used to connect to outgoing email host.
* `EMAIL_TLS_SSL` : "true" or "false" for using TLS/SSL encryption for sending emails.
* `EMAIL_STARTTLS` : "true" or "false" for using STARTTLS encryption for sending emails.
2018-01-20 23:50:08 +00:00
* `DATABASE_URL` : Connection string for database to use for persistence, including credentials. See example below.
2018-01-20 23:48:31 +00:00
## Volumes
2018-01-20 23:50:08 +00:00
* `/app/user_dev` : Location to store user media uploads.
2018-01-20 23:48:31 +00:00
## Ports
2018-01-20 23:50:08 +00:00
* `80` : Only listens on port 80 for HTTP. Intended to be used in conjunction with an external reverse proxy like https://hub.docker.com/r/jwilder/nginx-proxy/ to provide HTTPS or anything else that's needed.
2018-01-20 23:48:31 +00:00
## Example
```console
2019-06-04 04:59:48 +00:00
$ sudo docker run --detach --name=mediagoblin \
2018-01-20 23:48:31 +00:00
--env NOTIFICATION_EMAIL=media@example.org \
2018-02-11 00:54:26 +00:00
--env EMAIL_HOSTNAME=mail.example.org \
--env EMAIL_PORT=587 \
--env EMAIL_USERNAME=bob@example.org \
--env EMAIL_PASSWORD=pass \
--env EMAIL_TLS_SSL=false \
--env EMAIL_STARTTLS=true \
2018-01-20 23:48:31 +00:00
--env DATABASE_URL=postgresql://mediagoblin:password@database.example.org/mediagoblin \
--volume /var/lib/mediagoblin/user_dev:/app/user_dev \
--publish 80:80 \
2022-08-01 19:06:17 +00:00
projects.torsion.org/witten/mediagoblin-docker
2018-01-20 23:48:31 +00:00
```
2019-06-04 04:59:48 +00:00
## User management
Since this image is for running a private MediaGoblin server, user
self-registration is disabled. So, to add a user, first exec into the running
Docker image:
```console
$ sudo docker exec -it mediagoblin bash
```
Where `mediagoblin` is the name of your running Docker container. If you don’ t
know the name to use, try looking in `docker ps` output.
Then, add a user (follow the prompts):
```console
# su - mediagoblin
$ gmg --conf_file /app/mediagoblin_local.ini adduser
```
Finally, if you want to make the new user into an admin user:
```console
$ gmg --conf_file /app/mediagoblin_local.ini makeadmin username
```
Where `username` corresponds to the user you added above.
2023-04-11 05:36:50 +00:00
## Local development
To build the image locally, run:
```console
scripts/build
```
And then to run the image:
```console
scripts/dev
```
Connect to http://localhost:8080 to view the running instance in your browser.