Archive abandoned project

This commit is contained in:
Benoit 2025-02-15 00:56:26 +09:00
parent bc8862d90b
commit 65be894048
501 changed files with 24305 additions and 0 deletions

View file

@ -0,0 +1,17 @@
#
# Cookbook:: esh_writefreely
# Recipe:: default
#
# Copyright:: 2022, https://easyself.host
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View file

@ -0,0 +1,65 @@
#
# Cookbook:: esh_writefreely
# Recipe:: install
#
# Copyright:: 2022, https://easyself.host
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version = node['esh']['writefreely']['version']
url = node['esh']['writefreely']['url']
group 'writefreely' do
system true
action :create
end
user 'writefreely' do
gid 'writefreely'
home '/home/writefreely'
manage_home true
shell '/usr/sbin/nologin'
system true
action :create
end
remote_file "#{Chef::Config['file_cache_path']}/writefreely_#{version}_linux_amd64.tar.gz" do
source url
action :create_if_missing
end
archive_file "#{Chef::Config['file_cache_path']}/writefreely_#{version}_linux_amd64.tar.gz" do
destination '/home/'
owner 'writefreely'
group 'writefreely'
mode '0755'
overwrite true
not_if do
`/home/writefreely/writefreely --version | awk '{print $2}'`.strip == version
end
end
template '/home/writefreely/config.ini' do
owner 'writefreely'
group 'writefreely'
mode '0600'
variables database_password: node['esh']['writefreely']['mariadb']['password'],
site_name: node['esh']['writefreely']['app']['site_name'],
host: node['esh']['writefreely']['app']['host'],
single_user: node['esh']['writefreely']['app']['single_user']
action :create
end
esh_nginx_basic_proxy node['esh']['writefreely']['nginx']['ip_addr'] do
port node['esh']['writefreely']['nginx']['port']
end

View file

@ -0,0 +1,36 @@
#
# Cookbook:: esh_writefreely
# Recipe:: mariadb
#
# Copyright:: 2022, https://easyself.host
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apt_package 'mariadb-server'
mariadb_server_install 'MariaDB Server install' do
version '10.5'
setup_repo false
end
mariadb_user 'writefreely' do
password node['esh']['writefreely']['mariadb']['password']
database_name 'writefreely'
action [:create, :grant]
end
mariadb_database 'writefreely' do
encoding 'latin1'
collation 'latin1_swedish_ci'
action :create
end

View file

@ -0,0 +1,38 @@
#
# Cookbook:: esh_writefreely
# Recipe:: service
#
# Copyright:: 2022, https://easyself.host
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
systemd_unit 'writefreely.service' do
content <<~EOU
[Unit]
Description=WriteFreely Instance
After=syslog.target network.target mariadb.service
[Service]
Type=simple
User=writefreely
Group=writefreely
StandardOutput=syslog
StandardError=syslog
WorkingDirectory=/home/writefreely
ExecStart=/home/writefreely/writefreely
Restart=always
[Install]
WantedBy=multi-user.target
EOU
verify false
action [:create, :enable, :start]
end