Compare commits

...

3 Commits

Author SHA1 Message Date
Vivian Lim 9b68313f22 Add cloudcmd + supysonic 2019-12-30 18:08:56 -08:00
Vivian Lim 0512f46754 ampache config
apache2 config with url rewrites
etc :)
2019-12-01 02:46:36 -08:00
Vivian Lim 49fbbc9aea reconfigure things for the purpose of using beets 2019-11-30 23:45:41 -08:00
10 changed files with 2667 additions and 29 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
beets/musiclibrary.db
beets/state.pickle
supysonic_pg

View File

@ -22,7 +22,7 @@ RUN pacman -Syu --noconfirm \
# delete user's password so sudo won't prompt for it
&& passwd -d vivlim \
# basic tools
&& pacman -S vim git zsh base-devel man-db tmux vi --noconfirm \
&& pacman -S vim git zsh base-devel man-db tmux vi base iputils inotify-tools python-pipenv youtube-dl ffmpeg npm beets --noconfirm \
# install an aur helper
&& cd /tmp \
&& git clone https://aur.archlinux.org/yay.git \
@ -34,6 +34,11 @@ RUN pacman -Syu --noconfirm \
# clean cache
&& pacman -Scc --noconfirm
RUN npm install -g cloudcmd
# installing gritty requires root
RUN npm install -g gritty --unsafe
# oh-my-zsh
RUN su vivlim -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh) --unattended" \
&& chsh -s /usr/bin/zsh vivlim
@ -44,14 +49,6 @@ RUN su vivlim -c "yay -S --noconfirm --cleanafter vcsh myrepos"
# remove .zshrc because the config will overwrite it.
RUN rm /home/vivlim/.zshrc
# Install languages: python, js, rust, elixir
RUN pacman --noconfirm -Sy npm python-pipenv elixir \
&& pacman -Scc --noconfirm
# patch on some more packages I forgot to add before (if rebuilding, merge up!)
RUN pacman --noconfirm -Sy base iputils inotify-tools \
&& pacman -Scc --noconfirm
COPY launch.sh /launch.sh
COPY user_launch.sh /user_launch.sh

227
ampache_apache2.conf Normal file
View File

@ -0,0 +1,227 @@
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default
#
# The directory where shm and other runtime files will be stored.
#
DefaultRuntimeDir ${APACHE_RUN_DIR}
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2
beets/config.yaml Normal file
View File

@ -0,0 +1,2 @@
directory: ~/music
library: ~/.config/beets/musiclibrary.db

View File

@ -1,30 +1,92 @@
version: '3'
version: '3.2'
services:
arch:
build: .
image: viviridian/archdev
container_name: arch
hostname: arch_container
image: viviridian/archbeets
container_name: archbeets
hostname: arch_beets
volumes:
#- ./launch.sh:/launch.sh:ro
#- ./user_launch.sh:/user_launch.sh:ro
- /home/vivlim/.ssh:/home/vivlim/.ssh:ro
- /home/vivlim:/home/vivlim/external
- /home/vivlim:/home/vivlim/external:ro
- /mnt/big:/home/vivlim/big:ro
- /mnt/big/vivlim/beets-library:/home/vivlim/music
- ./beets:/home/vivlim/.config/beets
- home:/home/vivlim
- ssh_server_keys:/etc/ssh/keys
-
type: bind
source: "/net/192.168.1.107/depths"
target: "/home/vivlim/depths"
read_only: true
bind:
propagation: rshared
restart: unless-stopped
ports:
- "7722:22"
postgres_db:
image: postgres
restart: unless-stopped
environment:
POSTGRES_PASSWORD: secret
PGDATA: /pgdata
- "8322:22"
networks:
- frontend
ampache:
image: jgoerzen/ampache-mysql
container_name: ampache
tty: true
networks:
- frontend
tmpfs:
- /run:size=100M
- /run/lock:size=100M
stop_signal: SIGRTMIN+3
volumes:
- ./data/postgres:/pgdata
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /mnt/big/vivlim/beets-library:/music:ro
- /mnt/big/vivlim/playlists:/playlists:rw
- ./ampache_config:/var/www/html/ampache/config:rw
- ./ampache_apache2.conf:/etc/apache2/apache2.conf:ro
- ampache_mysql:/var/lib/mysql:rw
restart: unless-stopped
ports:
- "8932:80"
environment:
- DEBBASE_NO_STARTUP_APT=yes
supysonic:
image: 'speranza/supysonic-pg'
container_name: 'supysonic'
restart: 'unless-stopped'
networks:
- frontend
- backend
environment:
- PUID=1000
- PGID=1000
volumes:
- './supysonic.conf:/etc/supysonic'
- '/mnt/big/vivlim/beets-library:/media'
ports:
- 8000:8000
postgres:
image: postgres:10.5
container_name: supysonic_postgres
hostname: supysonic_postgres
restart: always
networks:
- backend
volumes:
- ./supysonic_pg/data:/var/lib/postgresql/data
- ./supysonic_pg/postgres.conf:/etc/postgres.conf
- ./supysonic_pg/pg_hba.conf:/etc/pg_hba.conf
command: postgres -c config_file=/etc/postgres.conf
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
ssh_server_keys:
home:
ampache_mysql:
networks:
frontend:
external:
name: ingress_frontend
backend:

2
scan.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
docker-compose exec supysonic supysonic-cli folder scan

17
supysonic.conf Normal file
View File

@ -0,0 +1,17 @@
[base]
; A database URI. See the 'schema' folder for schema creation scripts
database_uri = postgres://postgres:postgres@supysonic_postgres/supysonic
[daemon]
; Socket file the daemon will listen on for incoming management commands
; Default: /tmp/supysonic/supysonic.sock
socket = /tmp/supysonic.sock
; Defines if the file watcher should be started. Default: yes
run_watcher = yes
; Delay before triggering scanning operation after a change have been detected
; This prevents running too many scans when multiple changes are detected for a
; single file over a short time span. Default: 5
wait_delay = 5

View File

@ -11,12 +11,7 @@ tmux new-window -d -n vimconfig -t 9 bash
tmux send-keys -t 9 "cd /home/vivlim/.vim \
&& git submodule init \
&& git submodule update \
&& vim -E -c 'source ~/.vimrc' -c PluginInstall -c qall \
&& curl https://sh.rustup.rs | bash -s -- -y \
&& source ~/.cargo/env \
&& rustup default stable \
&& rustup component add rls rust-analysis rust-src \
&& rustup default nightly" C-m
&& vim -E -c 'source ~/.vimrc' -c PluginInstall -c qall" C-m
tmux new-window -t 1 zsh
tmux kill-window -t 0
@ -27,3 +22,6 @@ if [ $? == 0 ]; then
echo "No password is set. You will be prompted for one when you connect."
tmux send-keys -t 1 "passwd vivlim" C-m
fi
# start cloudcmd
cloudcmd --terminal --terminal-path `gritty --path` &