first commit

This commit is contained in:
www-data 2024-10-02 08:29:21 -03:00
commit 179a7c0bb7
7 changed files with 110 additions and 0 deletions

2
.bundle/config Executable file
View File

@ -0,0 +1,2 @@
---
BUNDLE_PATH: "vendor/bundle"

5
.gitignore vendored Executable file
View File

@ -0,0 +1,5 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor

25
404.html Executable file
View File

@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>

8
Gemfile Executable file
View File

@ -0,0 +1,8 @@
source "https://rubygems.org"
gem "jekyll"
# gem "alice", git: "https://git.alice.ufsj.edu.br/Alice/AliceTheme"
gem "alice", path: "../AliceTheme"
# group :jekyll_plugins do
# end

12
_config.yml Executable file
View File

@ -0,0 +1,12 @@
title: Public HTML
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "/s/public_html" # the subpath of your site, e.g. /blog
url: "https://alice.ufsj.edu.br" # the base hostname & protocol for your site, e.g. http://example.com
header_pages:
- pages/index.php
theme: alice

23
makefile Normal file
View File

@ -0,0 +1,23 @@
JEKYLL_CMD = bundle exec jekyll
DEST_PATH = /var/www/html/alice_sites/public_html
DEST_DIR_FLAGS = --destination=${DEST_PATH}
BUILD_FLAGS = --trace
SERVE_FLAGS = -H 0.0.0.0 -P 33002
all:
sg www-data -c "${JEKYLL_CMD} build ${BUILD_FLAGS} ${DEST_DIR_FLAGS}"
deploy:
${JEKYLL_CMD} build ${BUILD_FLAGS} ${DEST_DIR_FLAGS}
# Executa o build toda vez que muda um arquivo
# Rodando como serviço do systemd em /etc/systemd/system/alice-build-watch.service
# examplo: sg www-data -c 'make watch'
watch:
${JEKYLL_CMD} build ${BUILD_FLAGS} ${DEST_DIR_FLAGS} -w
serve:
${JEKYLL_CMD} serve ${SERVE_FLAGS}

35
pages/index.php Normal file
View File

@ -0,0 +1,35 @@
<?php
// Defina o caminho para o diretório base
$baseDir = '/nethome';
// Abra o diretório base
if ($handle = opendir($baseDir)) {
echo "<h1>Lista de Usuários</h1>";
echo "<ul>";
// Itera sobre os itens no diretório
while (false !== ($entry = readdir($handle))) {
// Ignora "." e ".."
if ($entry != "." && $entry != "..") {
// Verifica se o item é um diretório
if (is_dir($baseDir . '/' . $entry)) {
// Cria o link para o public_html do usuário
$userPublicHtml = "/~$entry";
echo "<li><a href='$userPublicHtml'>$entry</a></li>";
}
}
}
echo "</ul>";
// Fecha o diretório
closedir($handle);
} else {
echo "<p>Não foi possível acessar o diretório.</p>";
}
?>