diff --git a/INSTALL.md b/INSTALL.md index f9b5a92f..e569cd4e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -110,12 +110,11 @@ pip install -r requirements.txt DATABASE_URL=postgresql+psycopg2://username:password@localhost/database_name ``` * Also change `SECRET_KEY` to some random sequence of numbers and letters. - * `RECAPTCHA_PUBLIC_KEY` and `RECAPTCHA_PRIVATE_KEY` can be generated at https://www.google.com/recaptcha/admin/create. + ### Extra info - * `SERVER_NAME` should be the domain of the site/instance. Use `127.0.0.1:5000` during development unless using ngrok. - +* `RECAPTCHA_PUBLIC_KEY` and `RECAPTCHA_PRIVATE_KEY` can be generated at https://www.google.com/recaptcha/admin/create (this is optional - omit to allow registration without RECAPCHA). * `CACHE_TYPE` can be `FileSystemCache` or `RedisCache`. `FileSystemCache` is fine during development (set `CACHE_DIR` to `/tmp/piefed` or `/dev/shm/piefed`) while `RedisCache` **should** be used in production. If using `RedisCache`, set `CACHE_REDIS_URL` to `redis://localhost:6379/1` diff --git a/app/main/routes.py b/app/main/routes.py index cc2a69aa..dfaf1317 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -229,6 +229,23 @@ def list_subscribed_communities(): def donate(): return render_template('donate.html') +@bp.route('/about') +def about_page(): + + users = User.query.filter_by(ap_id=None, deleted=False, banned=False).all() + user_amount = len(users) + # Todo, figure out how to filter the user list with the list of user_role user_id == 4 + #admins = users.filter() + # Todo, figure out how to filter the user list with the list of user_role user_id == 4 + #staff = users.filter() + + domains_amount = len(Domain.query.filter_by(banned=False).all()) + community_amount = len(Community.query.all()) + instance = Instance.query.filter_by(id=1).first() + + + return render_template('about.html', user_amount=user_amount, domains_amount=domains_amount, community_amount=community_amount, instance=instance)#, admins=admins) + @bp.route('/privacy') def privacy(): diff --git a/app/templates/about.html b/app/templates/about.html new file mode 100644 index 00000000..e0595232 --- /dev/null +++ b/app/templates/about.html @@ -0,0 +1,24 @@ +{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %} + {% extends 'themes/' + theme() + '/base.html' %} +{% else %} + {% extends "base.html" %} +{% endif %} %} + +{% block app_content %} +
+
+

{{ _('About %(site_name)s', site_name=g.site.name) }}

+ +

{{g.site.name}} is a pyfedi instance created on {{instance.created_at}}. It is home to {{user_amount}} users, {{community_amount}} communities who discussed {{domains_amount}} domains. This instance is administerred and staffed by $PLACEHOLDER_ADMINS and $PLACEHOLDER_STAFF.

+

Contact

+

Placeholder Admin email

+

About Us

+

{{g.site.description | safe}}

+

{{g.site.sidebar}}

+ {% if g.site.legal_information %} +

Legal Information

+

{{g.site.legal_information}}

+

Our Privacy Policy

+ {% endif %} +
+{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index 988a2aae..f12bf97f 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -157,12 +157,14 @@
  • {{ _('Browse by topic') }}
  • {{ _('All communities') }}
  • {% if moderating_communities %} +
  • {% for community_menu_item in moderating_communities %}
  • {{ community_menu_item.title }}
  • {% endfor %} {% endif %} {% if joined_communities %} +
  • {% for community_menu_item in joined_communities %}
  • {{ community_menu_item.title }}
  • diff --git a/docs/ADDING_COMMUNITIES.md b/docs/ADDING_COMMUNITIES.md new file mode 100644 index 00000000..1c74984b --- /dev/null +++ b/docs/ADDING_COMMUNITIES.md @@ -0,0 +1,15 @@ +# Adding communities + +To add a community to your local + +## Notes + +This is only for local communities, not for remote communities. + +## Instructions + +1. Login to your instance as your admin user +2. Click the PieFed logo +3. Click **Explore communities** +4. In the top right hand corner, click the **Create local** button +5. Fill in the details \ No newline at end of file diff --git a/docs/ADDING_USERS.md b/docs/ADDING_USERS.md new file mode 100644 index 00000000..fd433ef8 --- /dev/null +++ b/docs/ADDING_USERS.md @@ -0,0 +1,41 @@ +# Adding users + +There are two ways of adding users to your instance to get the ball rolling. + +## Notes before starting + +Please note that both of these involve **local** users, and not **remote** users. + +## Instructions + +### Allow registration + +To allow registration: + +1. Login to your instance as your admin user +2. Go to **Admin** +3. Click on **Misc settings** +4. Look for **Registration mode**. +5. Either set the choice to **Open** or **Require Application** + +### Registering + +After registration is set to open/require application, the common user flow is to +navigate to your instance and click **Register**. + +### Disabling ReCAPCHA + +If you ensure your `.env` file has empty values for `RECAPTCHA3_PUBLIC_KEY` and +`RECAPTCHA3_PRIVATE_KEY`, then you can bypass the ReCAPCHA step. The only problem is +you will need to ensure the users email address is verified, and this may be a hassle. + +## Admin screen + +1. Login to your instance as your admin user +2. Go to **Admin** +3. Click **Users** +4. Click the **Add local user** button. +5. Fill in the details +6. Ensure you click **Email address is verified**. + +Once you've set all the details and save, the user is now accessible. \ No newline at end of file diff --git a/docs/KEY_TERMS.md b/docs/KEY_TERMS.md new file mode 100644 index 00000000..3986ba2c --- /dev/null +++ b/docs/KEY_TERMS.md @@ -0,0 +1,10 @@ +# Key terms + +* `Instance`: A single PieFed server. if you are developing on your local, it will most +likely be http://127.0.0.1:5000. Otherwise, if you have set up your instance, or for +whichever instance you want to apply (assuming you have the privileges for the +actions detailed) +* `Local`: By making changes on a local instance, any actions done will be done +* on that instance. +* `Remote`: By making changes on a local instance, any actions done will be applied +to an external instance. \ No newline at end of file