noplanman.lstu

Lstu (そのURLを短縮しよう)のためのAnsibleロール

ビルドステータス Ansibleロール


:rocket: 開発は**git.feneas.org**に移動しました。

(GitHubのリポジトリはミラーのみですので、貢献するにはFeneasでフォークしてください。登録は不要で、GitHubアカウントでサインインするだけです。)


このロールは、Debian/UbuntuサーバーにLstuをインストールし、設定します。 Lstuについて、Luc Didryが作成したものです。

このロールは、サーバーの起動時に自動的に開始されるサービスをインストールします。 使用されているサービスマネージャも自動的に判断します。

要件

このロールを使用しても、逆プロキシとしてNginxやApacheはインストールされませんので、自分で設定する必要があります! 例の設定を確認してください。

ロール変数

Lstuを実行するために使用するユーザー/グループを設定します。ウェブサーバーのユーザー/グループを使用するのが理にかなっています。

lstu_user: www-data
lstu_group: www-data

Lstuを最新の状態に保つべきかどうかを設定します。(デフォルト:いいえ)

lstu_keep_updated: no

管理者パスワードをハッシュ化された形式で保存するかどうか (lstu_adminpwdは常に平文のパスワードでなければなりません!)

lstu_hash_adminpwd: yes

必須の値と多くのオプション値があります。すべての可能な変数はdefaults/main.ymlで確認できます。

# 必須!
lstu_working_dir: "/var/www/example.com"
lstu_listen: "http://127.0.0.1:8080"    # 複数のアドレスの場合は配列で指定できます。
lstu_contact: "[email protected]"
lstu_secrets: ["array", "of", "random", "secrets"]

# オプション
lstu_proxy: no
lstu_adminpwd: "sup3r-secr3t"
lstu_theme: "default"
lstu_page_offset: 10
lstu_url_length: 8
lstu_provis_step: 5
lstu_provisioning: 100
lstu_prefix: "/"
lstu_allowed_domains: []
lstu_fixed_domain: "example.org"
lstu_db_type: "sqlite"
lstu_db_path: "lstu.db"
lstu_pgdb:
    database: "lstu"
    host: "localhost"
    port: 5432
    user: "DBUSER"
    pwd: "DBPASSWORD"
    max_connections: 1
lstu_mysqldb:
    database: "lstu"
    host: "localhost"
    port: 3306
    user: "DBUSER"
    pwd: "DBPASSWORD"
    max_connections: 5
lstu_ban_min_strike: 3
lstu_ban_blacklist: []
lstu_ban_whitelist: []
lstu_piwik:
    url: "http://piwik.example.com"
    idsite: "1"
minion:
    enabled: no,
    db_path: "minion.db"
    pgdb:
        database: "lstu_minion"
        host: "localhost"
        port: 5432
        user: "DBUSER"
        pwd: "DBPASSWORD"
    mysqldb:
        database: "lstu_minion"
        host: "localhost"
        port: 3306
        user: "DBUSER"
        pwd: "DBPASSWORD"
lstu_ldap:
    uri: "ldaps://ldap.example.org"
    user_tree: "ou=users,dc=example,dc=org"
    bind_dn: "uid=ldap_user,ou=users,dc=example,dc=org"
    bind_pwd: "secr3t"
    user_attr: "uid"
    user_filter: "(!(uid=ldap_user))"
lstu_htpasswd: "lstu.passwd"
lstu_session_duration: 3600
lstu_max_redir: 2
lstu_spam_blacklist_regex: "foo|bar"
lstu_spam_path_blacklist_regex: "foo|bar"
lstu_spam_whitelist_regex: "foo|bar"
lstu_skip_spamhaus: no
lstu_safebrowsing_api_key: ""
lstu_memcached_servers: []
lstu_csp: "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; form-action 'self'; base-uri 'self'"
lstu_x_frame_options: "DENY"
lstu_x_content_type_options: "nosniff"
lstu_x_xss_protection: "1; mode=block"
lstu_log_creator_ip: no

ロールタグ

設定の各部分にタグがあります。

lstu:install
lstu:site
lstu:service

依存関係

なし。

例のプレイブック

# playbook.yml
---
- hosts: servers
  become: yes
  vars_files:
    - vars/main.yml
  roles:
    - { role: noplanman.lstu }
# vars/main.yml
---
lstu_working_dir: "/var/www/lstu.example.com"
lstu_listen: "http://127.0.0.1:8080"
lstu_contact: "[email protected]"
lstu_secrets: ["Weiboe3a","Ahsahm0O","biPhah2u","Ki2teeph","Choihah4","ka7Oifia","aeT7eeb9","oYah4it7"]
lstu_adminpwd: "kohdah6DJieSh1CaTe1uWohKax9ahxeG"

テスト

Dockerを使用して、異なるオペレーティングシステムでロールのテストを行います。

testsフォルダを確認してください。

ライセンス

MIT

プロジェクトについて

Install and run Lstu on a Debian-like system.

インストール
ansible-galaxy install noplanman.lstu
ライセンス
mit
ダウンロード
80
所有者
Passionate open sourcerer and sharer 😇 Find me coding at @php-telegram-bot and a plethora of other little projects that I care about.