From bbd2132feede2d8c5e214c4d8a436f5505b9a766 Mon Sep 17 00:00:00 2001 From: Michal Kostewicz Date: Sun, 7 Feb 2021 16:26:58 +0100 Subject: Add script which will use config.txt if exist --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index d507d6c..b11a2cc 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,7 @@ CACHE_VIEWS=false APP_KEY= -DATA_DIR=data +DATA_DIR=database DB_CONNECTION=sqlite DB_HOST=127.0.0.1 -- cgit v1.2.3-54-g00ecf From 0a3ce5a9e37dd917cfabdf97fdc18a41d88c65eb Mon Sep 17 00:00:00 2001 From: Michal Kostewicz Date: Tue, 9 Feb 2021 21:28:23 +0100 Subject: Fix all issues found on CR -> especially update README.md, remove creation of new config.txt, update ignore files. --- .dockerignore | 7 ++++--- .env.example | 2 +- .gitignore | 3 +-- README.md | 4 ++-- docker/.gitignore | 4 ---- docker/README.md | 16 +++++----------- docker/entrypoint.sh | 16 +++++----------- 7 files changed, 18 insertions(+), 34 deletions(-) (limited to '.env.example') diff --git a/.dockerignore b/.dockerignore index 7dad3a9..01c565b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,10 +7,11 @@ .gitattributes .cache -# ignore all markdown files (md) beside all README*.md other than README-secret.md +# ignore all markdown files *.md -!README*.md -README-secret.md + +# Ignore database files +*.sqlite # ignore other directories docker diff --git a/.env.example b/.env.example index b11a2cc..a11ce1f 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,7 @@ CACHE_VIEWS=false APP_KEY= -DATA_DIR=database +DATA_DIR= DB_CONNECTION=sqlite DB_HOST=127.0.0.1 diff --git a/.gitignore b/.gitignore index 0f1f969..267390d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,7 @@ tmp .env # The development sqlite file -database/development.sqlite -database/adonis.sqlite +*.sqlite # Uploaded recipes recipes/ diff --git a/README.md b/README.md index 60de4fc..2e0d9f9 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,11 @@ After setting up the docker container we recommend you to set up an NGINX revers getferdi/ferdi-server ``` - Alternatively, you can also use docker-compose v2 schemas. An example can be found in [./docker/docker-compose.yml](https://github.com/getferdi/server/tree/master/docker/docker-compose.yml) file. + Alternatively, you can also use docker-compose v2 schema. An example can be found [in the docker folder](./docker/docker-compose.yml). 3. Optionally, you can now [set up Nginx as a reverse proxy](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#set-up-nginx-as-a-reverse-proxy-server). -For more information on configuring the Docker image, please read [./docker/README.md](https://github.com/getferdi/server/tree/master/docker/README.md). +For more information on configuring the Docker image, please read [the ferdi docker documentation](./docker/README.md). ### Manual setup 1. Clone this repository diff --git a/docker/.gitignore b/docker/.gitignore index b726524..552cd4a 100644 --- a/docker/.gitignore +++ b/docker/.gitignore @@ -4,10 +4,6 @@ node_modules # Adonis directory for storing tmp files tmp -# The development sqlite file -database/development.sqlite -database/adonis.sqlite - # Uploaded recipes recipes/ diff --git a/docker/README.md b/docker/README.md index 8518e15..1cea8ae 100644 --- a/docker/README.md +++ b/docker/README.md @@ -76,9 +76,11 @@ The server will be launched at [http://localhost:3333/](http://localhost:3333/) ## Configuration -Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `:` respectively. For example, `-p 3333:80` would expose port `80` from inside the container to be accessible from the host's IP on port `3333` outside the container. -After the first run, Ferdi-server's default configuration is saved inside the `config.txt` file inside your persistent data directory (`/config` in the container). -If any environmental parameter is not passed to the container, its value will be taken from the `config.txt` file. You can also edit the `config.txt` file, but it is advisable to send the environment parameters to the container. +Container images are configured using parameters passed at runtime (such as those above). + +**Warning ,using `config.txt` will be deprecated in the future releases.** + +If any of environmental parameters is not passed to the container, its value will be taken from the `/config/config.txt` file. **The previous functionality of saving container parameters in this file is now removed.** | Parameter | Function | | :----: | --- | @@ -213,13 +215,5 @@ docker build \ -t getferdi/ferdi-server:latest . ``` -## Versions - -* **05.02.21:** - Repository moved to ferdi-server repository -* **19.01.21:** - Updated Mail SSL and DB SLL settings -* **20.09.20:** - Updated SMTP Mailer settings for password reset. -* **21.06.20:** - Rebase to Alpine 3.11 and added Mailer settings. -* **25.09.19:** - Initial Release. - ## License Ferdi-server-docker and ferdi-server are licensed under the MIT License. diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 0bbcb9d..eac3fc8 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -14,17 +14,11 @@ Support our Open Collective at: https://opencollective.com/getferdi/ EOL -# if config.txt doesn't exist then create one with default values -if [ ! -f /config/config.txt ]; then - cp /app/.env.example /config/config.txt -fi - -# use config.txt default values as .env file -if [ -f /app/.env ]; then - rm /app/.env - ln -s /config/config.txt /app/.env -elif [ ! -f /app/.env ]; then - ln -s /config/config.txt /app/.env +# use config.txt or .env.example parameter values as default if they are not passed to container +if [ -f /config/config.txt ]; then + cp /config/config.txt /app/.env +else + cp /app/.env.example /app/.env fi # Create APP key if needed -- cgit v1.2.3-54-g00ecf From 0caee16078a24e1af3d655b5cb1c43bbca5d31dd Mon Sep 17 00:00:00 2001 From: thursday Date: Fri, 9 Jul 2021 16:56:48 -0400 Subject: Updated .env.example To match changes to database.js as per the discussion here: https://github.com/getferdi/server/pull/48#discussion_r667150127 --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index a11ce1f..19af6e3 100644 --- a/.env.example +++ b/.env.example @@ -10,14 +10,14 @@ CACHE_VIEWS=false APP_KEY= -DATA_DIR= +DATA_DIR=data DB_CONNECTION=sqlite DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root DB_PASSWORD= -DB_DATABASE=adonis +DB_DATABASE=database DB_SSL=false -- cgit v1.2.3-54-g00ecf From dd54d4c4a21c0076a3cba9c6b265e1f33b6e87cf Mon Sep 17 00:00:00 2001 From: thursday Date: Fri, 9 Jul 2021 17:24:41 -0400 Subject: Update .env.example --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 19af6e3..2c86c60 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ HOST=127.0.0.1 PORT=3333 NODE_ENV=development -APP_NAME=AdonisJs +APP_NAME=Ferdi-server APP_URL=http://${HOST}:${PORT} EXTERNAL_DOMAIN=ferdi.domain.tld -- cgit v1.2.3-54-g00ecf From 2ad00034dbcb6f3f3171c06ce384f466a1c3ac27 Mon Sep 17 00:00:00 2001 From: thursday Date: Mon, 12 Jul 2021 18:55:40 -0400 Subject: Changed default dbname to ferdi in .env.example --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 2c86c60..69d4d3c 100644 --- a/.env.example +++ b/.env.example @@ -17,7 +17,7 @@ DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root DB_PASSWORD= -DB_DATABASE=database +DB_DATABASE=ferdi DB_SSL=false -- cgit v1.2.3-54-g00ecf From e94853d276391497c1c2ebf19e897ff04459ae7c Mon Sep 17 00:00:00 2001 From: thursday Date: Tue, 13 Jul 2021 07:23:42 -0400 Subject: Update .env.example changed data_dir to /data --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 69d4d3c..6b81d1b 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,7 @@ CACHE_VIEWS=false APP_KEY= -DATA_DIR=data +DATA_DIR=/data DB_CONNECTION=sqlite DB_HOST=127.0.0.1 -- cgit v1.2.3-54-g00ecf From 74557d190d6611ebfbb29805a63d1b0128f090da Mon Sep 17 00:00:00 2001 From: thursday Date: Tue, 13 Jul 2021 08:09:45 -0400 Subject: Update .env.example --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 6b81d1b..69d4d3c 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,7 @@ CACHE_VIEWS=false APP_KEY= -DATA_DIR=/data +DATA_DIR=data DB_CONNECTION=sqlite DB_HOST=127.0.0.1 -- cgit v1.2.3-54-g00ecf From cf6cfb9a0c036284325945e1c67b81f1bee1016e Mon Sep 17 00:00:00 2001 From: thursday Date: Wed, 21 Jul 2021 02:36:00 -0400 Subject: Update .env.example Added PUID and PGID values to run as non-root --- .env.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.env.example') diff --git a/.env.example b/.env.example index 69d4d3c..0c470e9 100644 --- a/.env.example +++ b/.env.example @@ -18,9 +18,11 @@ DB_PORT=3306 DB_USER=root DB_PASSWORD= DB_DATABASE=ferdi - DB_SSL=false +PUID=1000 +PGID=1000 + HASH_DRIVER=bcrypt IS_CREATION_ENABLED=true -- cgit v1.2.3-54-g00ecf