Skip to content

Commit bd8b1ae

Browse files
committed
Initial tools and readme
1 parent 4690840 commit bd8b1ae

16 files changed

+402
-90
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: pimp-my-shell
2+
repository: .
3+
version: ""
4+
install_date: "2024-03-25T12:13:21-03:00"
5+
project_files:
6+
- web-build/Dockerfile.pimp-my-shell
7+
- homeadditions/.bashrc.d/pimp-my-shell
8+
- config.pimp-my-shell.yaml
9+
global_files: []
10+
removal_actions: []
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: readme
2+
repository: https://github.com/hanoii/ddev-readme/tarball/main
3+
version: ""
4+
install_date: "2024-03-25T12:33:22-03:00"
5+
project_files:
6+
- web-build/Dockerfile.readme
7+
- readme/watch.js
8+
- readme/.prettierrc
9+
- readme/.ahoy.readme.yml
10+
- web-build/Dockerfile.readme
11+
- config.readme.yaml
12+
global_files: []
13+
removal_actions: []

.ddev/config.pimp-my-shell.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#ddev-generated
2+
webimage_extra_packages: [boxes, bsdmainutils, build-essential, kitty-terminfo, libarchive-tools, lua5.4, pv]

.ddev/config.readme.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#ddev-generated
2+
hooks:
3+
post-start:
4+
- exec: nohup bash -c 'if [ -z "${DDEV_README_WATCH_DISABLED-}" ]; then { ahoy -f /var/www/html/.ddev/readme/.ahoy.readme.yml watch & } ; fi' > /dev/null 2>&1

.ddev/config.yaml

+277
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
name: ddev-pimp-my-shell
2+
type: php
3+
docroot: ""
4+
php_version: "8.1"
5+
webserver_type: nginx-fpm
6+
xdebug_enabled: false
7+
additional_hostnames: []
8+
additional_fqdns: []
9+
database:
10+
type: mariadb
11+
version: "10.4"
12+
omit_containers: [db]
13+
use_dns_when_possible: true
14+
composer_version: "2"
15+
web_environment: []
16+
disable_upload_dirs_warning: true
17+
18+
# Key features of DDEV's config.yaml:
19+
20+
# name: <projectname> # Name of the project, automatically provides
21+
# http://projectname.ddev.site and https://projectname.ddev.site
22+
23+
# type: <projecttype> # backdrop, craftcms, django4, drupal6/7/8/9/10, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
24+
# See https://ddev.readthedocs.io/en/latest/users/quickstart/ for more
25+
# information on the different project types
26+
27+
# docroot: <relative_path> # Relative path to the directory containing index.php.
28+
29+
# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"
30+
31+
# You can explicitly specify the webimage but this
32+
# is not recommended, as the images are often closely tied to DDEV's' behavior,
33+
# so this can break upgrades.
34+
35+
# webimage: <docker_image> # nginx/php docker image.
36+
37+
# database:
38+
# type: <dbtype> # mysql, mariadb, postgres
39+
# version: <version> # database version, like "10.4" or "8.0"
40+
# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0
41+
# PostgreSQL versions can be 9-16.
42+
43+
# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
44+
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
45+
46+
# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart"
47+
# Note that for most people the commands
48+
# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better,
49+
# as leaving Xdebug enabled all the time is a big performance hit.
50+
51+
# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart"
52+
# Note that for most people the commands
53+
# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better,
54+
# as leaving Xhprof enabled all the time is a big performance hit.
55+
56+
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
57+
58+
# timezone: Europe/Berlin
59+
# This is the timezone used in the containers and by PHP;
60+
# it can be set to any valid timezone,
61+
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
62+
# For example Europe/Dublin or MST7MDT
63+
64+
# composer_root: <relative_path>
65+
# Relative path to the Composer root directory from the project root. This is
66+
# the directory which contains the composer.json and where all Composer related
67+
# commands are executed.
68+
69+
# composer_version: "2"
70+
# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1
71+
# to use the latest major version available at the time your container is built.
72+
# It is also possible to use each other Composer version channel. This includes:
73+
# - 2.2 (latest Composer LTS version)
74+
# - stable
75+
# - preview
76+
# - snapshot
77+
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
78+
# To reinstall Composer after the image was built, run "ddev debug refresh".
79+
80+
# nodejs_version: "18"
81+
# change from the default system Node.js version to any other version.
82+
# Numeric version numbers can be complete (i.e. 18.15.0) or
83+
# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with
84+
# other named releases.
85+
# see https://www.npmjs.com/package/n#specifying-nodejs-versions
86+
# Note that you can continue using 'ddev nvm' or nvm inside the web container
87+
# to change the project's installed node version if you need to.
88+
89+
# additional_hostnames:
90+
# - somename
91+
# - someothername
92+
# would provide http and https URLs for "somename.ddev.site"
93+
# and "someothername.ddev.site".
94+
95+
# additional_fqdns:
96+
# - example.com
97+
# - sub1.example.com
98+
# would provide http and https URLs for "example.com" and "sub1.example.com"
99+
# Please take care with this because it can cause great confusion.
100+
101+
# upload_dirs: "custom/upload/dir"
102+
#
103+
# upload_dirs:
104+
# - custom/upload/dir
105+
# - ../private
106+
#
107+
# would set the destination paths for ddev import-files to <docroot>/custom/upload/dir
108+
# When Mutagen is enabled this path is bind-mounted so that all the files
109+
# in the upload_dirs don't have to be synced into Mutagen.
110+
111+
# disable_upload_dirs_warning: false
112+
# If true, turns off the normal warning that says
113+
# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set"
114+
115+
# ddev_version_constraint: ""
116+
# Example:
117+
# ddev_version_constraint: ">= 1.22.4"
118+
# This will enforce that the running ddev version is within this constraint.
119+
# See https://github.com/Masterminds/semver#checking-version-constraints for
120+
# supported constraint formats
121+
122+
# working_dir:
123+
# web: /var/www/html
124+
# db: /home
125+
# would set the default working directory for the web and db services.
126+
# These values specify the destination directory for ddev ssh and the
127+
# directory in which commands passed into ddev exec are run.
128+
129+
# omit_containers: [db, ddev-ssh-agent]
130+
# Currently only these containers are supported. Some containers can also be
131+
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
132+
# the "db" container, several standard features of DDEV that access the
133+
# database container will be unusable. In the global configuration it is also
134+
# possible to omit ddev-router, but not here.
135+
136+
# performance_mode: "global"
137+
# DDEV offers performance optimization strategies to improve the filesystem
138+
# performance depending on your host system. Should be configured globally.
139+
#
140+
# If set, will override the global config. Possible values are:
141+
# - "global": uses the value from the global config.
142+
# - "none": disables performance optimization for this project.
143+
# - "mutagen": enables Mutagen for this project.
144+
# - "nfs": enables NFS for this project.
145+
#
146+
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs
147+
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen
148+
149+
# fail_on_hook_fail: False
150+
# Decide whether 'ddev start' should be interrupted by a failing hook
151+
152+
# host_https_port: "59002"
153+
# The host port binding for https can be explicitly specified. It is
154+
# dynamic unless otherwise specified.
155+
# This is not used by most people, most people use the *router* instead
156+
# of the localhost port.
157+
158+
# host_webserver_port: "59001"
159+
# The host port binding for the ddev-webserver can be explicitly specified. It is
160+
# dynamic unless otherwise specified.
161+
# This is not used by most people, most people use the *router* instead
162+
# of the localhost port.
163+
164+
# host_db_port: "59002"
165+
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
166+
# unless explicitly specified.
167+
168+
# mailpit_http_port: "8025"
169+
# mailpit_https_port: "8026"
170+
# The Mailpit ports can be changed from the default 8025 and 8026
171+
172+
# host_mailpit_port: "8025"
173+
# The mailpit port is not normally bound on the host at all, instead being routed
174+
# through ddev-router, but it can be bound directly to localhost if specified here.
175+
176+
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
177+
# Extra Debian packages that are needed in the webimage can be added here
178+
179+
# dbimage_extra_packages: [telnet,netcat]
180+
# Extra Debian packages that are needed in the dbimage can be added here
181+
182+
# use_dns_when_possible: true
183+
# If the host has internet access and the domain configured can
184+
# successfully be looked up, DNS will be used for hostname resolution
185+
# instead of editing /etc/hosts
186+
# Defaults to true
187+
188+
# project_tld: ddev.site
189+
# The top-level domain used for project URLs
190+
# The default "ddev.site" allows DNS lookup via a wildcard
191+
# If you prefer you can change this to "ddev.local" to preserve
192+
# pre-v1.9 behavior.
193+
194+
# ngrok_args: --basic-auth username:pass1234
195+
# Provide extra flags to the "ngrok http" command, see
196+
# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h"
197+
198+
# disable_settings_management: false
199+
# If true, DDEV will not create CMS-specific settings files like
200+
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
201+
# In this case the user must provide all such settings.
202+
203+
# You can inject environment variables into the web container with:
204+
# web_environment:
205+
# - SOMEENV=somevalue
206+
# - SOMEOTHERENV=someothervalue
207+
208+
# no_project_mount: false
209+
# (Experimental) If true, DDEV will not mount the project into the web container;
210+
# the user is responsible for mounting it manually or via a script.
211+
# This is to enable experimentation with alternate file mounting strategies.
212+
# For advanced users only!
213+
214+
# bind_all_interfaces: false
215+
# If true, host ports will be bound on all network interfaces,
216+
# not the localhost interface only. This means that ports
217+
# will be available on the local network if the host firewall
218+
# allows it.
219+
220+
# default_container_timeout: 120
221+
# The default time that DDEV waits for all containers to become ready can be increased from
222+
# the default 120. This helps in importing huge databases, for example.
223+
224+
#web_extra_exposed_ports:
225+
#- name: nodejs
226+
# container_port: 3000
227+
# http_port: 2999
228+
# https_port: 3000
229+
#- name: something
230+
# container_port: 4000
231+
# https_port: 4000
232+
# http_port: 3999
233+
# Allows a set of extra ports to be exposed via ddev-router
234+
# Fill in all three fields even if you don’t intend to use the https_port!
235+
# If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start.
236+
#
237+
# The port behavior on the ddev-webserver must be arranged separately, for example
238+
# using web_extra_daemons.
239+
# For example, with a web app on port 3000 inside the container, this config would
240+
# expose that web app on https://<project>.ddev.site:9999 and http://<project>.ddev.site:9998
241+
# web_extra_exposed_ports:
242+
# - name: myapp
243+
# container_port: 3000
244+
# http_port: 9998
245+
# https_port: 9999
246+
247+
#web_extra_daemons:
248+
#- name: "http-1"
249+
# command: "/var/www/html/node_modules/.bin/http-server -p 3000"
250+
# directory: /var/www/html
251+
#- name: "http-2"
252+
# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000"
253+
# directory: /var/www/html
254+
255+
# override_config: false
256+
# By default, config.*.yaml files are *merged* into the configuration
257+
# But this means that some things can't be overridden
258+
# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge
259+
# and you can't erase existing hooks or all environment variables.
260+
# However, with "override_config: true" in a particular config.*.yaml file,
261+
# 'use_dns_when_possible: false' can override the existing values, and
262+
# hooks:
263+
# post-start: []
264+
# or
265+
# web_environment: []
266+
# or
267+
# additional_hostnames: []
268+
# can have their intended affect. 'override_config' affects only behavior of the
269+
# config.*.yaml file it exists in.
270+
271+
# Many DDEV commands can be extended to run tasks before or after the
272+
# DDEV command is executed, for example "post-start", "post-import-db",
273+
# "pre-composer", "post-composer"
274+
# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more
275+
# information on the commands that can be extended and the tasks you can define
276+
# for them. Example:
277+
#hooks:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ddev-generated
2+
3+
[ -f /opt/.fzf.bash ] && source /opt/.fzf.bash
4+
5+
if ! grep -qxF "source /opt/fzf-git.sh/fzf-git.sh" ~/.bashrc ; then
6+
echo -e "\n# Added by ddev-fzf add-on on $(date -u "+%Y-%m-%d %H:%m") \nsource /opt/fzf-git.sh/fzf-git.sh" >> ~/.bashrc
7+
fi
8+
9+
# z.lua
10+
mkdir -p /mnt/ddev-global-cache/z.lua/${HOSTNAME}
11+
_ZL_DATA=/mnt/ddev-global-cache/z.lua/${HOSTNAME}/.zlua
12+
export _ZL_DATA
13+
if [[ "$BASHOPTS" =~ login_shell ]]; then
14+
eval "$(lua /opt/z.lua/z.lua --init bash enhanced once fzf)"
15+
fi

.ddev/readme/.ahoy.readme.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#ddev-generated
2+
ahoyapi: v2
3+
commands:
4+
build:
5+
usage: 'Tidy up README.md'
6+
cmd: |
7+
prettier /var/www/html/README.md --write --config=/var/www/html/.ddev/readme/.prettierrc
8+
markdown-toc -i /var/www/html/README.md
9+
10+
watch:
11+
usage: 'Watch README.md for changes'
12+
cmd: |
13+
node /var/www/html/.ddev/readme/watch.js

.ddev/readme/.prettierrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#ddev-generated
2+
proseWrap: "always"

.ddev/readme/watch.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// #ddev-generated
2+
const fs = require('fs');
3+
const { exec } = require("child_process");
4+
5+
const timeout = 2000
6+
7+
function watch() {
8+
console.log("Watching for changes on README.md...")
9+
let watcher = fs.watch('/var/www/html/README.md', (event, filename) => {
10+
exec("ahoy -f /var/www/html/.ddev/readme/.ahoy.readme.yml build", (error, stdout, stderr) => {
11+
console.log(stdout);
12+
})
13+
watcher.close()
14+
setTimeout(() => {
15+
watch();
16+
}, timeout);
17+
})
18+
}
19+
20+
exec("ahoy -f /var/www/html/.ddev/readme/.ahoy.readme.yml build", (error, stdout, stderr) => {
21+
console.log(stdout);
22+
})
23+
setTimeout(() => {
24+
watch();
25+
}, timeout);
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ddev-generated
2+
RUN wget -q https://github.com/ahoy-cli/ahoy/releases/download/v2.1.1/ahoy-bin-linux-`dpkg --print-architecture` -O - > /usr/local/bin/ahoy && chmod +x /usr/local/bin/ahoy
3+
RUN mkdir -p /opt/fzf && cd /opt/fzf && git init && git remote add origin https://github.com/junegunn/fzf.git && git fetch --depth 1 origin db6db49ed642caf9cbe716f80d4fa40052118068 && git checkout FETCH_HEAD && /opt/fzf/install --all && cp /root/.fzf.bash /opt
4+
RUN mkdir -p /opt/fzf-git.sh && cd /opt/fzf-git.sh && git init && git remote add origin https://github.com/junegunn/fzf-git.sh.git && git fetch --depth 1 origin 0f1e52079ffd9741eec723f8fd92aa09f376602f && git checkout FETCH_HEAD
5+
RUN wget -q https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_`dpkg --print-architecture`.deb -O bat.deb && dpkg -i bat.deb && rm bat.deb
6+
RUN mkdir -p /opt/z.lua && wget https://github.com/skywind3000/z.lua/archive/refs/tags/1.8.18.zip -qO- | bsdtar xf - --strip-components=1 -C /opt/z.lua

.ddev/web-build/Dockerfile.readme

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#ddev-generated
2+
RUN npm install -g markdown-toc prettier

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
[![tests](https://github.com/hanoii/ddev-pimp-my-shell/actions/workflows/tests.yml/badge.svg)](https://github.com/hanoii/ddev-pimp-my-shell/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)
1+
[![tests](https://github.com/hanoii/ddev-pimp-my-shell/actions/workflows/tests.yml/badge.svg)](https://github.com/hanoii/ddev-pimp-my-shell/actions/workflows/tests.yml)
2+
![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)
23

34
# ddev-pimp-my-shell <!-- omit in toc -->
45

56
<!-- toc -->
7+
8+
- [What is ddev-pimp-my-shell?](#what-is-ddev-pimp-my-shell)
9+
10+
<!-- tocstop -->
11+
612
<!-- stoptoc -->
713

814
## What is ddev-pimp-my-shell?

config.pimp-my-shell.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#ddev-generated
2+
webimage_extra_packages: [boxes, bsdmainutils, build-essential, kitty-terminfo, libarchive-tools, lua5.4, pv]

0 commit comments

Comments
 (0)