Branch: refs/heads/master
Author: Nick Treleaven <n(a)trelsoft.com>
Committer: Nick Treleaven <n(a)trelsoft.com>
Date: Mon, 22 Jul 2019 11:49:04 UTC
Commit: d11cbff9ba3c3d13143e7eb39b209f2e990f32ac
https://github.com/geany/geany/commit/d11cbff9ba3c3d13143e7eb39b209f2e990f3…
Log Message:
-----------
Show Various pref group prefixes
E.g. *editor.use_gtk_word_boundaries*.
stash_tree_setup() now puts a prefix before the key name.
stash_group_set_various() can set a prefix otherwise group->name is
used. This is useful as Geany prefs all use PACKAGE for the group name
apart from "build-menu". This allows us to regroup various prefs
without breaking user config.
Put `allow_always_save` in `files` group rather than `interface`.
Put `extract_filetype_regex` in `files` group.
Modified Paths:
--------------
doc/geany.txt
src/keyfile.c
src/keyfile.h
src/stash.c
src/stash.h
src/ui_utils.c
Modified: doc/geany.txt
35 lines changed, 17 insertions(+), 18 deletions(-)
===================================================================
@@ -2539,7 +2539,7 @@ documents before restart.
================================ =========================================== ========== ===========
Key Description Default Applies
================================ =========================================== ========== ===========
-**Editor related**
+**``editor`` group**
use_gtk_word_boundaries Whether to look for the end of a word true to new
when using word-boundary related documents
Scintilla commands (see `Scintilla
@@ -2560,17 +2560,10 @@ indent_hard_tab_width The size of a tab character. Don't change 8
editor_ime_interaction Input method editor (IME)'s candidate 0 to new
window behaviour. May be 0 (windowed) or documents
1 (inline)
-**Interface related**
+**``interface`` group**
show_symbol_list_expanders Whether to show or hide the small true to new
expander icons on the symbol list documents
treeview.
-allow_always_save Whether files can be saved always, even false immediately
- if they don't have any changes.
- By default, the Save button and menu
- item are disabled when a file is
- unchanged. When setting this option to
- true, the Save button and menu item are
- always active and files can be saved.
compiler_tab_autoscroll Whether to automatically scroll to the true immediately
last line of the output in the Compiler
tab.
@@ -2586,7 +2579,7 @@ msgwin_messages_visible Whether to show the Messages tab in the t
Messages Window
msgwin_scribble_visible Whether to show the Scribble tab in the true immediately
Messages Window
-**VTE related**
+**``terminal`` group**
send_selection_unsafe By default, Geany strips any trailing false immediately
newline characters from the current
selection before sending it to the terminal
@@ -2604,7 +2597,14 @@ send_cmd_prefix String with which prefix the commands sent E
setting this to a space. Note that leading
spaces must be escaped using `\s` in the
configuration file.
-**File related**
+**``files`` group**
+allow_always_save Whether files can be saved always, even false immediately
+ if they don't have any changes.
+ By default, the Save button and menu
+ item are disabled when a file is
+ unchanged. When setting this option to
+ true, the Save button and menu item are
+ always active and files can be saved.
use_atomic_file_saving Defines the mode how Geany saves files to false immediately
disk. If disabled, Geany directly writes
the content of the document to disk. This
@@ -2636,17 +2636,16 @@ reload_clean_doc_on_file_change Whether to automatically reload documents f
on disk.
If unsaved changes exist then the user is
prompted to reload manually.
-**Filetype related**
-extract_filetype_regex Regex to extract filetype name from file See below. immediately
+extract_filetype_regex Regex to extract filetype name from file See link immediately
via capture group one.
-**Search related**
+ See `ft_regex`_ for default.
+**``search`` group**
find_selection_type See `Find selection`_. 0 immediately
-**Replace related**
replace_and_find_by_default Set ``Replace & Find`` button as default so true immediately
it will be activated when the Enter key is
pressed while one of the text fields has
focus.
-**Build Menu related**
+**``build`` group**
number_ft_menu_items The maximum number of menu items in the 2 on restart
filetype section of the Build menu.
number_non_ft_menu_items The maximum number of menu items in the 3 on restart
@@ -2655,8 +2654,6 @@ number_exec_menu_items The maximum number of menu items in the 2
execute section of the Build menu.
================================ =========================================== ========== ===========
-The extract_filetype_regex has the default value GEANY_DEFAULT_FILETYPE_REGEX.
-
Statusbar Templates
```````````````````
@@ -5469,6 +5466,8 @@ GEANY_DEFAULT_FILETYPE_REGEX The default regex to extract filetypes from Se
files.
============================== ============================================ ==================
+.. _ft_regex:
+
The GEANY_DEFAULT_FILETYPE_REGEX default value is -\\*-\\s*([^\\s]+)\\s*-\\*- which finds Emacs filetypes.
The GEANY_DEFAULT_TOOLS_TERMINAL default value on Windows is::
Modified: src/keyfile.c
39 lines changed, 26 insertions(+), 13 deletions(-)
===================================================================
@@ -132,11 +132,13 @@ void configuration_add_pref_group(struct StashGroup *group, gboolean for_prefs_d
}
-/* The group will be free'd on quitting. */
-void configuration_add_various_pref_group(struct StashGroup *group)
+/* The group will be free'd on quitting.
+ * prefix can be NULL to use group name */
+void configuration_add_various_pref_group(struct StashGroup *group,
+ const gchar *prefix)
{
configuration_add_pref_group(group, TRUE);
- stash_group_set_various(group, TRUE);
+ stash_group_set_various(group, TRUE, prefix);
}
@@ -225,7 +227,7 @@ static void init_pref_groups(void)
/* various geany prefs */
group = stash_group_new(PACKAGE);
- configuration_add_various_pref_group(group);
+ configuration_add_various_pref_group(group, "editor");
stash_group_add_boolean(group, &editor_prefs.show_scrollbars,
"show_editor_scrollbars", TRUE);
@@ -235,6 +237,15 @@ static void init_pref_groups(void)
"use_gtk_word_boundaries", TRUE);
stash_group_add_boolean(group, &editor_prefs.complete_snippets_whilst_editing,
"complete_snippets_whilst_editing", FALSE);
+ /* for backwards-compatibility */
+ stash_group_add_integer(group, &editor_prefs.indentation->hard_tab_width,
+ "indent_hard_tab_width", 8);
+ stash_group_add_integer(group, &editor_prefs.ime_interaction,
+ "editor_ime_interaction", SC_IME_WINDOWED);
+
+ group = stash_group_new(PACKAGE);
+ configuration_add_various_pref_group(group, "files");
+
stash_group_add_boolean(group, &file_prefs.use_safe_file_saving,
atomic_file_saving_key, FALSE);
stash_group_add_boolean(group, &file_prefs.gio_unsafe_save_backup,
@@ -247,23 +258,25 @@ static void init_pref_groups(void)
"show_keep_edit_history_on_reload_msg", TRUE);
stash_group_add_boolean(group, &file_prefs.reload_clean_doc_on_file_change,
"reload_clean_doc_on_file_change", FALSE);
- /* for backwards-compatibility */
- stash_group_add_integer(group, &editor_prefs.indentation->hard_tab_width,
- "indent_hard_tab_width", 8);
- stash_group_add_integer(group, (gint*)&search_prefs.find_selection_type,
- "find_selection_type", GEANY_FIND_SEL_CURRENT_WORD);
stash_group_add_string(group, &file_prefs.extract_filetype_regex,
"extract_filetype_regex", GEANY_DEFAULT_FILETYPE_REGEX);
+ stash_group_add_boolean(group, &ui_prefs.allow_always_save,
+ "allow_always_save", FALSE);
+
+ group = stash_group_new(PACKAGE);
+ configuration_add_various_pref_group(group, "search");
+
+ stash_group_add_integer(group, (gint*)&search_prefs.find_selection_type,
+ "find_selection_type", GEANY_FIND_SEL_CURRENT_WORD);
stash_group_add_boolean(group, &search_prefs.replace_and_find_by_default,
"replace_and_find_by_default", TRUE);
- stash_group_add_integer(group, &editor_prefs.ime_interaction,
- "editor_ime_interaction", SC_IME_WINDOWED);
/* Note: Interface-related various prefs are in ui_init_prefs() */
/* various build-menu prefs */
+ // Warning: don't move PACKAGE group name items here
group = stash_group_new("build-menu");
- configuration_add_various_pref_group(group);
+ configuration_add_various_pref_group(group, "build");
stash_group_add_integer(group, &build_menu_prefs.number_ft_menu_items,
"number_ft_menu_items", 0);
@@ -903,7 +916,7 @@ static void load_dialog_prefs(GKeyFile *config)
* this can't be done in init_pref_groups() because we need to know the value of
* vte_info.load_vte, and `vc` to be initialized */
group = stash_group_new("VTE");
- configuration_add_various_pref_group(group);
+ configuration_add_various_pref_group(group, "terminal");
stash_group_add_string(group, &vc->send_cmd_prefix, "send_cmd_prefix", "");
stash_group_add_boolean(group, &vc->send_selection_unsafe, "send_selection_unsafe", FALSE);
Modified: src/keyfile.h
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -37,7 +37,8 @@ struct StashGroup;
void configuration_add_pref_group(struct StashGroup *group, gboolean for_prefs_dialog);
-void configuration_add_various_pref_group(struct StashGroup *group);
+void configuration_add_various_pref_group(struct StashGroup *group,
+ const gchar *prefix);
void configuration_save(void);
Modified: src/stash.c
14 lines changed, 11 insertions(+), 3 deletions(-)
===================================================================
@@ -126,6 +126,7 @@ struct StashGroup
const gchar *name; /* group name to use in the keyfile */
GPtrArray *entries; /* array of (StashPref*) */
gboolean various; /* mark group for display/edit in stash treeview */
+ const gchar *prefix; /* text to display for Various UI instead of name */
gboolean use_defaults; /* use default values if there's no keyfile entry */
};
@@ -427,10 +428,13 @@ G_DEFINE_BOXED_TYPE(StashGroup, stash_group, stash_group_dup, stash_group_free);
/* Used for selecting groups passed to stash_tree_setup().
- * @c FALSE by default. */
-void stash_group_set_various(StashGroup *group, gboolean various)
+ * @param various @c FALSE by default.
+ * @param prefix @nullable Group prefix or @c NULL to use @c group->name. */
+void stash_group_set_various(StashGroup *group, gboolean various,
+ const gchar *prefix)
{
group->various = various;
+ group->prefix = prefix;
}
@@ -1114,15 +1118,19 @@ static void stash_tree_append_pref(StashGroup *group, StashPref *entry, GtkListS
{
GtkTreeIter iter;
StashTreeValue *value;
+ gchar *text = NULL;
value = g_new0(StashTreeValue, 1);
value->group_name = group->name;
value->pref = entry;
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter, STASH_TREE_NAME, entry->key_name,
+ text = g_strconcat(group->prefix ? group->prefix : group->name,
+ ".", entry->key_name, NULL);
+ gtk_list_store_set(store, &iter, STASH_TREE_NAME, text,
STASH_TREE_VALUE, value, -1);
+ g_free(text);
}
Modified: src/stash.h
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -93,7 +93,8 @@ void stash_group_free_settings(StashGroup *group);
#ifdef GEANY_PRIVATE
-void stash_group_set_various(StashGroup *group, gboolean write_once);
+void stash_group_set_various(StashGroup *group, gboolean various,
+ const gchar *prefix);
void stash_group_set_use_defaults(StashGroup *group, gboolean use_defaults);
Modified: src/ui_utils.c
4 lines changed, 1 insertions(+), 3 deletions(-)
===================================================================
@@ -2334,14 +2334,12 @@ void ui_init_prefs(void)
StashGroup *group = stash_group_new(PACKAGE);
/* various prefs */
- configuration_add_various_pref_group(group);
+ configuration_add_various_pref_group(group, "interface");
stash_group_add_boolean(group, &interface_prefs.show_symbol_list_expanders,
"show_symbol_list_expanders", TRUE);
stash_group_add_boolean(group, &interface_prefs.compiler_tab_autoscroll,
"compiler_tab_autoscroll", TRUE);
- stash_group_add_boolean(group, &ui_prefs.allow_always_save,
- "allow_always_save", FALSE);
stash_group_add_string(group, &ui_prefs.statusbar_template,
"statusbar_template", _(DEFAULT_STATUSBAR_TEMPLATE));
stash_group_add_boolean(group, &ui_prefs.new_document_after_close,
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Andy Alt <andy5995(a)users.noreply.github.com>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Fri, 19 Jul 2019 08:40:46 UTC
Commit: 386d418c332c7466da81ec13e9eb1afdb19284cd
https://github.com/geany/geany/commit/386d418c332c7466da81ec13e9eb1afdb1928…
Log Message:
-----------
Fix configure to show "default=auto" for --enable-api-docs (#2190)
This fixes the discrepancy where configure --help shows "default=no"
but the api-docs are built anyway (only if dependencies are found).
The actual default is auto which is intended.
Fixes #2189
Modified Paths:
--------------
m4/geany-doxygen.m4
Modified: m4/geany-doxygen.m4
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -5,7 +5,7 @@ AC_DEFUN([GEANY_CHECK_DOXYGEN],
[
AC_ARG_ENABLE([api-docs],
[AS_HELP_STRING([--enable-api-docs],
- [generate API documentation using Doxygen [default=no]])],
+ [generate API documentation using Doxygen [default=auto]])],
[geany_with_doxygen="$enableval"],
[geany_with_doxygen="auto"])
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sun, 14 Jul 2019 22:19:19 UTC
Commit: 1e16f26d23ca3a5599a62ebd2f3d1a99f7980b65
https://github.com/geany/www.geany.org/commit/1e16f26d23ca3a5599a62ebd2f3d1…
Log Message:
-----------
Add Dockerfile and documentation for local development
Alternatively to setting up a virtualenv and a local database, we
provide a Dockerfile to create a container image to be ran locally
for easier setup.
Quick usage: make docker-build && make docker-run
Modified Paths:
--------------
.dockerignore
.gitignore
Makefile
README.dev.md
docker/Dockerfile
docker/entrypoint.sh
docker/irc_userlist
docker/local_settings.docker.py
geany/settings.py
tox.ini
Modified: .dockerignore
43 lines changed, 43 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,43 @@
+**/*.pyc
+**/__pycache__
+*.egg
+*.egg-info
+*.pyc
+*.pyd
+*.pyo
+*.swp
+.Python
+.cache
+.coverage
+.coverage
+.coverage.*
+.dockerignore
+.eggs
+.git
+.gitignore
+.tox
+.venv
+build
+dist
+docker/data
+docs/_build
+env
+venv
+
+
+# MacOS / Windows stuff
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+.DS_Store
+.AppleDouble
+.LSOverride
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
Modified: .gitignore
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -4,3 +4,4 @@
local_settings.py
venv
geany/media
+docker/data
Modified: Makefile
38 lines changed, 38 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+#
+# LICENCE: This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+docker-run:
+ docker run \
+ --rm \
+ --interactive=true \
+ --tty=true \
+ --user "$$(id --user):$$(id --group)" \
+ --mount "type=bind,src=$$(pwd),dst=/app" \
+ --publish 8000:8000 \
+ --name geany_dev \
+ geany_dev:latest
+
+
+docker-build:
+ docker build \
+ --file docker/Dockerfile \
+ --tag geany_dev \
+ .
+
+
+docker-clean:
+ rm -rf docker/data
Modified: README.dev.md
87 lines changed, 70 insertions(+), 17 deletions(-)
===================================================================
@@ -15,8 +15,18 @@ extra packages installed on your system.
The code requires Python 3.5 or higher.
-Prepare your system
--------------------
+Get the code
+------------
+
+Perform a usual clone of the www.geany.org repository from Github:
+
+ git clone git://github.com/geany/www.geany.org
+
+
+Local setup using virtualenv
+----------------------------
+
+### Prepare your system
To ease package handling and to get a clean environment, we use
virtualenv. Into the virtualenv we will install Django, Mezzanine and a couple of
@@ -31,16 +41,7 @@ packages:
apt-get install python3-venv python3-pip python3-dev build-essential libmysqlclient-dev libmemcached-dev
-Get the code
-------------
-
-Perform a usual clone of the www.geany.org repository from Github:
-
- git clone git://github.com/geany/www.geany.org
-
-
-Setting up a virtualenv
------------------------
+### Setting up a virtualenv
Change into the freshly cloned repository directory and execute the following commands
to create a new virtualenv and install required Python packages:
@@ -55,8 +56,7 @@ This will setup a new virtualenv, upgrade the Python package manager
pip and install required packages for the website.
-Create a local config
----------------------
+### Create a local config
Use a text editor of choice (we all know what this would be...) and create a new file
*local_settings.py* in *www.geany.org/geany/* (next to the existing *settings.py*).
@@ -132,8 +132,7 @@ The database dump contains a default admin user:
password: change-me
-Start the development server
-----------------------------
+### Start the development server
After you set up everything as described above, you are ready
to start the development server to actually do something:
@@ -152,8 +151,62 @@ to reload the changed file(s). This is very helpful.
To stop the server, simply interrupt it with *Ctrl-C*.
+Local setup using Docker
+------------------------
+
+Alternatively, a Dockerfile is provided to build a Docker image
+and to run the website in a Docker container.
+This is the easiest way to get a local environment running.
+
+### Local config
+
+When using the Docker image, a prepared local settings file is
+used with already adjusted settings for running in a Docker container.
+This file is located at `docker/local_settings.docker.py`.
+
+
+### Build container image
+
+First, you need to build the image:
+
+ make docker-build
+
+This will take some time but is only necessary once.
+
+Note: before building the image, carefully review the Dockerfile
+and especially make sure you use a base image you can trust.
+
+
+### Start the container
+
+After the image is built, you can start the container:
+
+ make docker-run
+
+On the first run, the database is setup, screenshots are downloaded to be
+locally available as well as a few more preparations.
+
+Once running, you can open the resulting site in your browser by pointing it
+to http://localhost:8000.
+
+Basically now you are done and you can start improving the website.
+A little detail you might notice: once you change any .py file
+which is knwon by Django, the development server will restart automatically
+to reload the changed file(s). This is very helpful.
+
+To stop the container, simply interrupt it with *Ctrl-C*.
+
+### Cleanup
+
+All files created on first container startup are stored in `docker/data`.
+To start from scratch (e.g. with a fresh database, no uploads, etc.), simply
+delete this directory or run:
+
+ make docker-clean
+
+
Management Commands
------------------------
+-------------------
In addition to the usual Django management commands (for a
list run `python manage.py`), the Geany apps provide a few more.
Modified: docker/Dockerfile
101 lines changed, 101 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,101 @@
+# LICENCE: This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+# Docker container to run the Geany website locally for development.
+# This is not intended for production!!
+# Before using this image, please get yourself familiar with Docker and
+# carefully review this Dockerfile before using it!
+#
+# Build image:
+# docker build -f docker/Dockerfile -t geany_dev .
+# Run container:
+# docker run --rm -it --user "$(id --user):$(id --group)" --mount "type=bind,src=$(pwd),dst=/app" -p 8000:8000 --name geany_dev geany_dev:latest
+
+# Intermediate build container
+FROM debian:stretch-slim AS builder
+
+ENV LANG=C.UTF-8 \
+ DEBIAN_FRONTEND=noninteractive \
+ # Extra python env
+ PYTHONDONTWRITEBYTECODE=1 \
+ PYTHONUNBUFFERED=1 \
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
+ PIP_FORMAT="columns" \
+ PIP_NO_BINARY=":all:" \
+ PIP_CACHE_DIR="/tmp/pip" \
+ PIP_TIMEOUT=60
+
+RUN apt-get update && \
+ apt-get install --assume-yes --no-install-recommends \
+ python3 \
+ build-essential \
+ git \
+ python3-pip \
+ python3-wheel \
+ python3-venv \
+ python3-dev \
+ default-libmysqlclient-dev \
+ libffi-dev \
+ libjpeg-dev \
+ libmemcached-dev \
+ zlib1g-dev \
+ libssl-dev && \
+ mkdir -p /app /data /venv && \
+ chown -R nobody:nogroup /app /data /venv
+
+WORKDIR /app
+USER nobody:nogroup
+COPY requirements.txt /data/
+# Install Python deps
+RUN python3 -m venv --copies /venv && \
+ /venv/bin/pip install -U pip setuptools && \
+ /venv/bin/pip install -r /data/requirements.txt
+
+
+# App container
+FROM debian:stretch-slim AS app
+
+ENV LANG=C.UTF-8 \
+ DEBIAN_FRONTEND=noninteractive \
+ # Extra python env
+ PYTHONDONTWRITEBYTECODE=1 \
+ PYTHONUNBUFFERED=1 \
+ # Path to local settings
+ LOCAL_SETTINGS_PY=/app/docker/local_settings.docker.py
+
+# do all of this in one RUN to limit final image size
+RUN apt-get update && \
+ apt-get install --assume-yes --no-install-recommends \
+ ca-certificates \
+ intltool \
+ libjpeg62-turbo \
+ libmariadbclient18 \
+ libmemcached11 \
+ libssl1.1 \
+ python3 \
+ sqlite3 \
+ wget \
+ zlib1g && \
+ rm -rf /var/lib/apt/lists/*
+
+WORKDIR /app
+USER nobody:nogroup
+
+# copy in Python environment
+COPY --from=builder /venv /venv
+# copy helpers and configs
+COPY ./docker/entrypoint.sh ./docker/irc_userlist /data/
+
+EXPOSE 8000
+CMD ["/bin/bash", "/data/entrypoint.sh"]
Modified: docker/entrypoint.sh
70 lines changed, 70 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# LICENCE: This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+set -e
+
+mkdir -p /app/docker/data
+
+# setup database if it does not exist
+if [ ! -f "/app/docker/data/geany_dev.db" ]; then
+ echo "==== Setup database ===="
+ /venv/bin/python manage.py reset_db --noinput
+ /venv/bin/python manage.py migrate --run-syncdb --noinput
+ echo 'DELETE FROM auth_permission;
+ DELETE FROM django_content_type;
+ DELETE FROM django_site;' | /venv/bin/python manage.py dbshell
+ /venv/bin/python manage.py loaddata database.json
+fi
+if [ ! -f "/app/docker/data/geany_dev_nightlybuilds.db" ]; then
+ /venv/bin/python manage.py migrate --database nightlybuilds --run-syncdb --noinput
+ /venv/bin/python manage.py loaddata --database nightlybuilds database_nightlybuilds.json
+fi
+
+# screenshots
+echo "==== Download screenshots ===="
+SCREENSHOTS="$(sqlite3 docker/data/geany_dev.db 'select file from galleries_galleryimage;')"
+# add homepage screenshots
+SCREENSHOTS="${SCREENSHOTS}
+uploads/screenshots/homepage/geany_dark_2019-05-20.png
+uploads/screenshots/homepage/geany_light_php-2019-06-15.png
+uploads/screenshots/homepage/geany_windows_classic-2019-06-09.png
+"
+pushd /app/docker/data
+for screenshot in ${SCREENSHOTS}; do
+ if [ ! -f "/app/docker/data/${screenshot}" ]; then
+ mkdir -p $(dirname "/app/docker/data/${screenshot}")
+ wget \
+ --no-verbose \
+ --output-document="/app/docker/data/${screenshot}" \
+ "https://www.geany.org/media/${screenshot}"
+ fi
+done
+popd
+
+# generate i18n stats if not already available
+if [ ! -d "/app/docker/data/i18n" ]; then
+ echo "==== Update I18N statistics ===="
+ wget --no-verbose https://download.geany.org/geany_git.tar.gz -O /tmp/geany_git.tar.gz
+ /venv/bin/python manage.py generate_i18n_statistics
+ rm -f /tmp/geany_git.tar.gz
+fi
+
+# sync page contents from GIT back to the database
+echo "==== Sync page contents ===="
+/venv/bin/python /app/manage.py sync_pages
+
+# start the server
+/venv/bin/python /app/manage.py runserver 0.0.0.0:8000
Modified: docker/irc_userlist
5 lines changed, 5 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,5 @@
+dummy-user-1
+dummy-user-2
+dummy-user-3
+dummy-user-4
+dummy-user-5
Modified: docker/local_settings.docker.py
124 lines changed, 124 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,124 @@
+# coding.: utf-8
+
+# This file is exec'd from settings.py, so it has access to and can modify all
+# the variables in settings.py.
+
+# If this file is changed in development, the development server will have to
+# be manually restarted because changes will not be noticed immediately.
+
+
+DEBUG = True
+
+
+INTERNAL_IPS = ("127.0.0.1",)
+ALLOWED_HOSTS = ('127.0.0.1', 'localhost')
+
+STATIC_ROOT = '/app/static'
+MEDIA_ROOT = '/app/docker/data'
+
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': os.path.join(MEDIA_ROOT, 'geany_dev.db'),
+ },
+ 'nightlybuilds': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': os.path.join(MEDIA_ROOT, 'geany_dev_nightlybuilds.db')
+ }
+}
+
+SECRET_KEY = "f94b410d-0401-4f25-a69e-d5cbbf7717f3-1af070a9-ebef-4efe-a779-a9706bbdfd4a"
+NEVERCACHE_KEY = "c8eb09b7-bd7e-4375-8293-6ffe53bf92e1-884d109e-6da4-4b99-bc56-075d8a498d4c"
+
+CSRF_COOKIE_HTTPONLY = True
+CSRF_COOKIE_SECURE = False
+SSL_FORCE_URL_PREFIXES = ()
+SESSION_COOKIE_SECURE = False
+USE_X_FORWARDED_HOST = False
+
+CACHES = {
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
+ }
+}
+
+FORCE_SCRIPT_NAME = ''
+SERVER_EMAIL = 'root@localhost'
+DEFAULT_FROM_EMAIL = 'root@localhost'
+
+NIGHTLYBUILDS_BASE_DIR = os.path.join(MEDIA_ROOT, 'nightly_mirror')
+IRC_USER_LIST_FILE = '/data/irc_userlist'
+
+STATIC_DOCS_GEANY_SOURCE_TARBALL = '/tmp/geany_git.tar.gz'
+STATIC_DOCS_GEANY_DESTINATION_DIR = os.path.join(MEDIA_ROOT, 'i18n')
+STATIC_DOCS_GEANY_DESTINATION_URL = os.path.join(MEDIA_URL, 'i18n')
+STATIC_DOCS_GEANY_I18N_STATISTICS_FILENAME = 'i18n_statistics.json'
+
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': True,
+ 'formatters': {
+ 'verbose': {
+ 'format': '%(asctime)s %(name)s %(process)d %(threadName)s %(levelname)s %(message)s'
+ },
+ },
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ },
+ },
+ 'handlers': {
+ 'console':{
+ 'level':'DEBUG',
+ 'class':'logging.StreamHandler',
+ 'formatter': 'verbose'
+ },
+ },
+ 'loggers': {
+ '': {
+ 'handlers':['console'],
+ 'level':'DEBUG',
+ 'propagate': False,
+ },
+ 'root': {
+ 'handlers':['console'],
+ 'level':'DEBUG',
+ 'propagate': False,
+ },
+ 'py.warnings': {
+ 'handlers':['console'],
+ 'propagate': True,
+ 'level':'DEBUG',
+ },
+ 'django': {
+ 'handlers':['console'],
+ 'propagate': True,
+ 'level':'DEBUG',
+ },
+ 'django.db': {
+ 'handlers':['console'],
+ 'level': 'INFO',
+ 'propagate': True,
+ },
+ 'django.template': {
+ 'handlers':['console'],
+ 'level': 'INFO',
+ 'propagate': True,
+ },
+ 'django.utils.autoreload': {
+ 'handlers': [],
+ 'level': 'INFO',
+ 'propagate': True,
+ },
+ 'MARKDOWN': {
+ 'level': 'INFO',
+ 'propagate': True,
+ },
+ 'PIL': {
+ 'handlers': [],
+ 'level': 'INFO',
+ 'propagate': True,
+ },
+ }
+}
Modified: geany/settings.py
4 lines changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -594,7 +594,9 @@
# Instead of doing "from .local_settings import *", we use exec so that
# local_settings has full access to everything defined in this module.
-filename = os.path.join(PROJECT_APP_PATH, 'local_settings.py') # pylint: disable=invalid-name
+# pylint: disable=invalid-name
+local_settings_file_name = os.environ.get('LOCAL_SETTINGS_PY', 'local_settings.py')
+filename = os.path.join(PROJECT_APP_PATH, local_settings_file_name) # pylint: disable=invalid-name
if os.path.exists(filename):
import sys
from importlib.util import module_from_spec, spec_from_file_location
Modified: tox.ini
8 lines changed, 4 insertions(+), 4 deletions(-)
===================================================================
@@ -32,7 +32,7 @@ commands =
{envbindir}/pylint --rcfile=tox.ini {[tox]geany_modules}
[flake8]
-exclude = build,.git,docs,migrations,local_settings.py
+exclude = build,.git,docs,migrations,local_settings.py,local_settings.docker.py
ignore = E127,E128,
max-line-length = 100
@@ -46,12 +46,12 @@ sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
lines_after_imports = 2
from_first = true
include_trailing_comma = true
-skip = local_settings.py
+skip = local_settings.py,local_settings.docker.py
-# the following secions are for pylint
+# the following sections are for pylint
[MASTER]
ignore=.git
-ignore-patterns=local_settings.py
+ignore-patterns=local_settings.py,local_settings.docker.py
persistent=no
load-plugins=pylint_django
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).