-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
132 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
|
||
require 'bundler/setup' # Set up gems listed in the Gemfile. | ||
require 'bootsnap/setup' # Speed up boot time by caching expensive operations. | ||
|
||
# Broken in docker image, need set it false | ||
# Ref: https://github.com/Shopify/bootsnap/issues/262 | ||
if ENV.fetch('ENABLE_BOOTSNAP', 'true') == 'true' | ||
require 'bootsnap/setup' # Speed up boot time by caching expensive operations. | ||
end |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
PUID=${PUID:-911} | ||
PGID=${PGID:-911} | ||
|
||
groupmod -o -g "$PGID" zealot | ||
usermod -o -u "$PUID" zealot | ||
|
||
echo " | ||
------------------------------------- | ||
GID/UID | ||
------------------------------------- | ||
User uid: $(id -u zealot) | ||
User gid: $(id -g zealot) | ||
------------------------------------- | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
TZ=${TZ:-"Asia/Shanghai"} | ||
|
||
if [[ -f "/usr/share/zoneinfo/$TZ" ]]; then | ||
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime | ||
echo "$TZ" > /etc/timezone | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
touch /var/log/clean_tmp_cron.log | ||
crontab /etc/crontabs/clean_tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/with-contenv bash | ||
|
||
if [[ ! -f /mnt/config/etc/logrotate.conf ]]; then | ||
if [[ ! -d /mnt/config/etc ]]; then | ||
s6-setuidgid guardian mkdir -p /mnt/config/etc | ||
fi | ||
|
||
s6-setuidgid guardian cp /etc/logrotate.conf /mnt/config/etc/logrotate.conf | ||
fi | ||
|
||
if [[ ! -d /mnt/config/etc/logrotate.d ]]; then | ||
s6-setuidgid guardian mkdir -p /mnt/config/etc/logrotate.d | ||
s6-setuidgid guardian cp -n /etc/logrotate.d/* /mnt/config/etc/logrotate.d/ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
cd /app | ||
|
||
# Clear pid if unexpected exception exit | ||
s6-setuidgid zealot rm -f tmp/pids/.pid | ||
s6-setuidgid zealot mkdir -p tmp/pids tmp/cache tmp/uploads tmp/sockets log | ||
|
||
# Updating assets | ||
if [ -d "new_public" ]; then | ||
echo "Zealot updating public ..." | ||
for x in public/*; do | ||
if [ -z $(echo "$x" | grep uploads) ]; then | ||
s6-setuidgid zealot rm -rf "$x" | ||
fi | ||
done | ||
|
||
for x in new_public/*; do | ||
if [ -z $(echo "$x" | grep uploads) ]; then | ||
s6-setuidgid zealot mv "$x" "public" | ||
fi | ||
done | ||
|
||
s6-setuidgid zealot rm -rf new_public | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
cd /app && ./bin/rails zealot:upgrade | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 */5 * * * /bin/sh -l -c 'find /tmp -type f -mmin +300 -exec rm -f {} \;' >> /var/log/clean_tmp_cron.log 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/crontabs/clean_tmp false root:root 0644 0755 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/app true zealot,911:911 0644 0755 | ||
/app/bin true zealot,911:911 0755 0755 | ||
/app/vendor true zealot,911:911 0755 0755 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
weekly | ||
rotate 4 | ||
|
||
create | ||
dateext | ||
compress | ||
|
||
notifempty | ||
nomail | ||
noolddir | ||
|
||
tabooext + .apk-new | ||
|
||
include /etc/logrotate.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/var/log/clean_tmp_cron.log { | ||
missingok | ||
notifempty | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/app/log/sidekiq.log { | ||
missingok | ||
notifempty | ||
monthly | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/app/log/zealot.log { | ||
missingok | ||
notifempty | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/execlineb -P | ||
|
||
/usr/sbin/crond -fS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
echo "Starting Zealot Worker" | ||
cd /app | ||
bundle exec sidekiq -C config/sidekiq.yml | tee /app/log/sidekiq.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/with-contenv sh | ||
|
||
echo "Starting Zealot" | ||
cd /app | ||
bundle exec puma -C config/puma.rb | tee /app/log/zealot.log |